mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-24 17:02:18 +00:00
And now the same for generic forms
This commit is contained in:
@@ -70,7 +70,9 @@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% if page_title and not request.is_ajax %}<h2>{{page_title}}</h2>{% endif %}
|
||||
{% if page_title and not request.is_ajax %}
|
||||
<h2>{{page_title}}</h2>
|
||||
{% endif %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
|
||||
78
templates/generic_form.html
Normal file
78
templates/generic_form.html
Normal file
@@ -0,0 +1,78 @@
|
||||
{% extends override|default:"base_rigs.html" %}
|
||||
{% load button from filters %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col">
|
||||
<form action="{{ form.action|default:request.path }}" method="post">{% csrf_token %}
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{% include 'form_errors.html' %}
|
||||
<div class="form-group form-row">
|
||||
<label for="{{ form.name.id_for_label }}"
|
||||
class="col-sm-2 control-label">{{ form.name.label }}</label>
|
||||
<div class="col-sm-10">
|
||||
{% render_field form.name class+="form-control" placeholder=form.name.label %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-row">
|
||||
<label for="{{ form.phone.id_for_label }}"
|
||||
class="col-sm-2 control-label">{{ form.phone.label }}</label>
|
||||
<div class="col-sm-10">
|
||||
{% render_field form.phone class+="form-control" type="tel" placeholder=form.phone.label %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-row">
|
||||
<label for="{{ form.email.id_for_label }}"
|
||||
class="col-sm-2 control-label">{{ form.email.label }}</label>
|
||||
<div class="col-sm-10">
|
||||
{% render_field form.email class+="form-control" type="email" placeholder=form.email.label %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-row">
|
||||
<label for="{{ form.address.id_for_label }}"
|
||||
class="col-sm-2 control-label">{{ form.address.label }}</label>
|
||||
<div class="col-sm-10">
|
||||
{% render_field form.address class+="form-control" placeholder=form.address.label %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group form-row">
|
||||
<label for="{{ form.notes.id_for_label }}"
|
||||
class="col-sm-2 control-label">{{ form.notes.label }}</label>
|
||||
<div class="col-sm-10">
|
||||
{% render_field form.notes class+="form-control" placeholder=form.notes.label %}
|
||||
</div>
|
||||
</div>
|
||||
{% if form.three_phase_available is not None %}
|
||||
<div class="form-group form-row">
|
||||
<div class="col-sm-10 col-sm-offset-2">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
{% render_field form.three_phase_available %} {{ form.three_phase_available.label }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if form.union_account is not None %}
|
||||
<div class="form-group form-row">
|
||||
<div class="col-sm-10 col-sm-offset-2">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
{% render_field form.union_account %} {{ form.union_account.label }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group text-right">
|
||||
{% button 'submit' %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -6,18 +6,7 @@
|
||||
{% load button from filters %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<form class="form-inline justify-content-end">
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}"
|
||||
class="form-control" id="id_search_text"/>
|
||||
<span class="input-group-append">{% button 'search' id="id_search" %}</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'partials/list_search.html' %}
|
||||
<div class="row py-3">
|
||||
<div class="col text-right">
|
||||
{% button 'new' url=create %}
|
||||
|
||||
13
templates/partials/list_search.html
Normal file
13
templates/partials/list_search.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{% load button from filters %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<form class="form-inline justify-content-end">
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}"
|
||||
class="form-control" id="id_search_text"/>
|
||||
<span class="input-group-append">{% button 'search' id="id_search" %}</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user