summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_operations/widgets.py7
-rw-r--r--ishtar_common/templates/ishtar/wizard/default_wizard.html13
-rw-r--r--ishtar_common/templates/ishtar/wizard/parcels_wizard.html27
-rw-r--r--ishtar_common/widgets.py12
4 files changed, 38 insertions, 21 deletions
diff --git a/archaeological_operations/widgets.py b/archaeological_operations/widgets.py
index 3a587e4fd..1d53bb199 100644
--- a/archaeological_operations/widgets.py
+++ b/archaeological_operations/widgets.py
@@ -52,9 +52,10 @@ class ParcelWidget(widgets.MultiWidget):
class SelectParcelWidget(widgets.TextInput):
def render(self, *args, **kwargs):
render = super(SelectParcelWidget, self).render(*args, **kwargs)
- render += u" <button name='formset_add' value='add'>%s</button>" \
- % _(u"Add")
- return mark_safe(render)
+ html = u"""{}
+ <button class='input-group-addon btn btn-success' name='formset_add'
+ value='add'>{}</button>""".format(render, _(u"Add"))
+ return mark_safe(html)
class OAWidget(forms.TextInput):
diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html
index 1a774ad49..6c9193966 100644
--- a/ishtar_common/templates/ishtar/wizard/default_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html
@@ -19,14 +19,17 @@
{% block form_detail %}
{% if wizard.form.forms %}
{{ wizard.form.management_form }}
-<div class='top_button'><input type="submit" id="submit_form" value="{% trans "Validate" %}"/></div>
-<table class='formset'>
- {%if wizard.form.non_form_errors%}<tr class='error'><th colspan='2'>{{wizard.form.non_form_errors}}</th></tr>{%endif%}
+ {% if wizard.form.non_form_errors %}
+ <div class="alert alert-danger" role="alert">
+ {{wizard.form.non_form_errors}}
+ </div>
+ {% endif %}
{% for formsetform in wizard.form.forms %}
{% bs_form formsetform %}
{% endfor %}
- <tr class='modify'><td colspan="2"><button name="formset_modify" value="{{wizard.steps.current}}">{% trans "Add/Modify" %}</button></td></tr></li>
-</table>
+ <button class="btn btn-success" name="formset_modify" value="{{wizard.steps.current}}">
+ {% trans "Add/Modify" %}
+ </button>
{% else %}
{% bs_form wizard.form %}
{% endif %}
diff --git a/ishtar_common/templates/ishtar/wizard/parcels_wizard.html b/ishtar_common/templates/ishtar/wizard/parcels_wizard.html
index 28ec962f4..6a553d3c1 100644
--- a/ishtar_common/templates/ishtar/wizard/parcels_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/parcels_wizard.html
@@ -1,5 +1,5 @@
{% extends "ishtar/wizard/default_wizard.html" %}
-{% load i18n range inline_formset %}
+{% load i18n range inline_formset table_form %}
{% block extra_head %}
{{wizard.form.media}}
{% endblock %}
@@ -9,19 +9,30 @@
{{ wizard.form.media }}
{{ wizard.management_form }}
{{ wizard.form.management_form }}
-{% if automatic_parcel_association %}<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{%trans "Existing parcels from the operation will be automatically added to the archaeological file." %}</label></p>{% endif %}
- {%if wizard.form.non_form_errors%}
-<table class='formset'>
-<tr class='error'><th colspan='2'>{{wizard.form.non_form_errors}}</th></tr>
-</table>{%endif%}
-{{wizard.form.selection_form}}
+ {% if automatic_parcel_association %}
+ <div class="alert alert-danger" role="alert">
+ {%trans "Existing parcels from the operation will be automatically added to the archaeological file." %}
+ </div>
+ {% endif %}
+ {% if wizard.form.non_form_errors %}
+ <div class="alert alert-danger" role="alert">
+ {{wizard.form.non_form_errors}}
+ </div>{%endif%}
+
+ {% bs_form wizard.form.selection_form %}
+
<table class='inline-table' id='parcel-table'>
<tr>{% for field in wizard.form.forms.0 %}<th{% if not forloop.last %} rowspan='2'{% endif %}>{{ field.label_tag }}</th>{% endfor %}</tr>
<tr><td>({% trans "all"%} <input type='checkbox' name='check-all' class='check-all'/>)</td></tr>
{% inline_formset 'Parcels' wizard.form.forms False %}
</table>
{% if add_all %}<p><input type='checkbox' name='add_all_parcels' id='add_all_parcels'> <label for='add_all_parcels'>{% trans "Add all parcels from the archaeological file" %}</label></p>{% endif %}
-<p><button name="formset_modify" value="{{wizard.steps.current}}">{% trans "Add/Modify" %}</button></p>
+
+ <div class="text-center">
+ <button class="btn btn-success" name="formset_modify" value="{{wizard.steps.current}}">
+ {% trans "Add/Modify" %}
+ </button>
+ </div>
<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
{{ previous_fields|safe }}
{% block "footer" %}
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py
index 59a034c00..84a58c98c 100644
--- a/ishtar_common/widgets.py
+++ b/ishtar_common/widgets.py
@@ -251,11 +251,13 @@ class Select2MultipleField(forms.MultipleChoiceField):
class DeleteWidget(forms.CheckboxInput):
def render(self, name, value, attrs=None, renderer=None):
final_attrs = flatatt(
- self.build_attrs(attrs, {"name": name, "value": '1'}))
- output = ['<tr class="delete"><td colspan="2">']
- output.append(u"<button%s>%s</button>" % (final_attrs, _("Delete")))
- output.append('</td></tr>')
- return mark_safe('\n'.join(output))
+ self.build_attrs(
+ attrs, {"name": name, "value": '1',
+ 'class': "btn btn-danger"})
+ )
+ output = u"<button%s>%s</button>" % (final_attrs, _("Delete"))
+
+ return mark_safe(output)
class ImageFileInput(ClearableFileInput):