Skip to content

Commit

Permalink
- fixed layout of recurring charge form
Browse files Browse the repository at this point in the history
  • Loading branch information
rptmat57 committed Dec 7, 2022
1 parent 8a7efcc commit 8347bb3
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions NEMO/templates/consumables/recurring_charge.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ <h1 class="form-group">{% if form.instance.id %}Modify {{ form.instance.name }}{
</div>
{% endif %}
<div class="form-group">
<label class="control-label col-sm-2" for="recurring_charge_name">Name</label>
<div class="col-sm-4">
<label class="control-label col-sm-2" for="recurring_charge_name"><b>Name</b></label>
<div class="col-sm-6 col-md-4">
<input required class="form-control" id="recurring_charge_name" name="name" type="text" autocomplete="off" value="{{ form.instance.name }}" {% if form.fields.name.disabled %}disabled{% endif %}/>
</div>
{% if form.name.errors %}
<div class="col-sm-6 form-control-static danger-highlight">
<div class="col-sm-4 col-md-6 form-control-static danger-highlight">
{{ form.name.errors|striptags }}
</div>
{% endif %}
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="consumable">Consumable</label>
<label class="control-label col-sm-2" for="consumable"><b>Consumable</b></label>
{% if force_quantity %}
<input name="quantity" type="hidden" value="{{ force_quantity }}" {% if form.fields.quantity.disabled %}disabled{% endif %}/>
{% else %}
<div class="col-sm-1">
<div class="col-sm-2 col-md-1">
<input aria-label="Quantity" id="quantity" name="quantity" type="number" class="form-control" value="{{ form.quantity.value }}" {% if form.fields.quantity.disabled %}disabled{% endif %}/>
</div>
{% endif %}
<div class="col-sm-{% if force_quantity %}4{% else %}3{% endif %}">
<div class="{% if force_quantity %}col-sm-6 col-md-4{% else %}col-sm-4 col-md-3{% endif %}">
<select class="form-control" id="consumable" name="consumable" {% if form.fields.consumable.disabled %}disabled{% endif %}>
{% if not form.consumable.value %}<option value="" disabled selected>Select a consumable</option>{% endif %}
{% regroup consumables by category as consumable_by_category %}
Expand All @@ -49,27 +49,27 @@ <h1 class="form-group">{% if form.instance.id %}Modify {{ form.instance.name }}{
</select>
</div>
{% if form.quantity.errors or form.consumable.errors %}
<div class="col-sm-6 form-control-static danger-highlight">
<div class="col-sm-4 col-md-6 form-control-static danger-highlight">
{{ form.consumable.errors|striptags|default:form.quantity.errors|striptags }}
</div>
{% endif %}
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="customer_search">Customer</label>
<div class="col-sm-4">
<div class="col-sm-6 col-md-4">
<input type="text" class="form-control" id="customer_search" placeholder="Search for a customer">
<input type="button" id="chosen_customer" title="chosen customer" class="btn btn-default" style="display:none" onclick="clear_selected_customer()">
<input type="hidden" id="customer" name="customer">
</div>
{% if form.customer.errors %}
<div class="col-sm-6 form-control-static danger-highlight">
<div class="col-sm-4 col-md-6 form-control-static danger-highlight">
{{ form.customer.errors|striptags }}
</div>
{% endif %}
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="project">Project</label>
<div class="col-sm-4">
<div class="col-sm-6 col-md-4">
<select id="project" name="project" class="form-control" {% if not projects %}disabled{% endif %}>
{% if projects|length == 0 %}
<option></option>
Expand All @@ -84,47 +84,47 @@ <h1 class="form-group">{% if form.instance.id %}Modify {{ form.instance.name }}{
</select>
</div>
{% if form.project.errors %}
<div class="col-sm-6 form-control-static danger-highlight">
<div class="col-sm-4 col-md-6 form-control-static danger-highlight">
{{ form.project.errors|striptags }}
</div>
{% endif %}
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="rec_start">Start charging on</label>
<div class="col-sm-4">
<div class="col-sm-6 col-md-4">
<input type="text" class="form-control" name="rec_start" id="rec_start" value="{{ form.rec_start.value|input_date_format }}" {% if form.fields.rec_start.disabled %}disabled{% endif %}>
</div>
{% if form.rec_start.errors %}
<div class="col-sm-6 form-control-static danger-highlight">
<div class="col-sm-4 col-md-6 form-control-static danger-highlight">
{{ form.rec_start.errors|striptags }}
</div>
{% endif %}
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="rec_interval">And then every</label>
<div class="col-sm-2">
<div class="col-sm-3 col-md-2">
<input id="rec_interval" name="rec_interval" type="number" class="form-control" value="{{ form.rec_interval.value }}" {% if form.fields.rec_interval.disabled %}disabled{% endif %}/>
</div>
<div class="col-sm-2">
<div class="col-sm-3 col-md-2">
<select class="form-control" name="rec_frequency" id="rec_frequency" aria-label="Frequency" {% if form.fields.rec_frequency.disabled %}disabled{% endif %}>
{% for choice in form.fields.rec_frequency.choices %}
<option value="{{ choice.0 }}" {% if choice.0 == form.rec_frequency.value|to_int %}selected{% endif %}>{{ choice.1 }}</option>
{% endfor %}
</select>
</div>
{% if form.rec_interval.errors or form.rec_frequency.errors %}
<div class="col-sm-6 form-control-static danger-highlight">
<div class="col-sm-4 col-md-6 form-control-static danger-highlight">
{{ form.rec_interval.errors|striptags|default:form.rec_frequency.errors|striptags }}
</div>
{% endif %}
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="rec_until">Until</label>
<div class="col-sm-4">
<div class="col-sm-6 col-md-4">
<input type="text" id="rec_until" name="rec_until" class="form-control" placeholder="Choose a date" value="{{ form.rec_until.value|input_date_format }}" {% if form.fields.rec_until.disabled %}disabled{% endif %}>
</div>
{% if form.rec_until.errors %}
<div class="col-sm-6 form-control-static danger-highlight">
<div class="col-sm-4 col-md-6 form-control-static danger-highlight">
{{ form.rec_until.errors|striptags }}
</div>
{% endif %}
Expand All @@ -134,9 +134,9 @@ <h1 class="form-group">{% if form.instance.id %}Modify {{ form.instance.name }}{
<div class="col-sm-2">
<input type="number" id="rec_count" name="rec_count" class="form-control" value="{{ form.rec_count.value }}" {% if form.fields.rec_count.disabled %}disabled{% endif %}>
</div>
<span class="control-label col-sm-2" style="text-align: left">iterations</span>
<span class="control-label col-sm-4 col-md-2" style="text-align: left">iterations</span>
{% if form.rec_count.errors %}
<div class="col-sm-6 form-control-static danger-highlight">
<div class="col-sm-4 col-md-6 form-control-static danger-highlight">
{{ form.rec_count.errors|striptags }}
</div>
{% endif %}
Expand Down

0 comments on commit 8347bb3

Please sign in to comment.