diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-16 12:43:47 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-16 12:43:47 +0100 |
commit | 9417a7f43faa2a3c972b023981f72ee9da142e9e (patch) | |
tree | d9536a4740f32e9d8068634204ca6ed418eb2b37 | |
parent | 1bd9e2f62a05c5c284089b4d48e886de878ee769 (diff) | |
download | Ishtar-9417a7f43faa2a3c972b023981f72ee9da142e9e.tar.bz2 Ishtar-9417a7f43faa2a3c972b023981f72ee9da142e9e.zip |
UI: more explicit layout for search
-rw-r--r-- | archaeological_operations/forms.py | 7 | ||||
-rw-r--r-- | ishtar_common/templates/base.html | 4 | ||||
-rw-r--r-- | ishtar_common/templates/ishtar/wizard/default_wizard.html | 3 | ||||
-rw-r--r-- | ishtar_common/templates/ishtar/wizard/wizard_done.html | 14 |
4 files changed, 21 insertions, 7 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 00b99ea2b..ce87685a2 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -620,6 +620,7 @@ class OperationSelect(TableSelect): class OperationFormSelection(IshtarForm): + SEARCH = True form_label = _(u"Operation search") associated_models = {'pk': models.Operation} currents = {'pk': models.Operation} @@ -782,12 +783,12 @@ class OperationFormGeneral(CustomForm, ManageOldType): max_length=500, widget=OAWidget, required=False) + operation_type = forms.ChoiceField(label=_(u"Operation type"), + choices=[]) common_name = forms.CharField(label=_(u"Generic name"), required=False, max_length=500, widget=forms.Textarea) address = forms.CharField(label=_(u"Address / Locality"), required=False, max_length=500, widget=forms.Textarea) - operation_type = forms.ChoiceField(label=_(u"Operation type"), - choices=[]) year = forms.IntegerField(label=_(u"Year"), initial=lambda: datetime.datetime.now().year, validators=[validators.MinValueValidator(1000), @@ -921,7 +922,7 @@ class OperationFormGeneral(CustomForm, ManageOldType): fields = OrderedDict() ope_code = self.fields.pop('operation_code') for key, value in self.fields.items(): - if key == 'year': + if key == 'old_code': fields['operation_code'] = ope_code fields[key] = value self.fields = fields diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index b1523a2bf..7091fffaf 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -66,14 +66,14 @@ <i class="fa fa-arrow-up" aria-hidden="true"></i> </button> <div class="container"> + {% block top_content %}{% endblock %} <div id="window_wrapper"> <div id="window" role="tablist"></div> </div> {% if warnings %}{% for warning in warnings %} <div class="alert alert-warning alert-dismissible fade show" role="alert"> - {{warning}} - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> + {{warning}}<button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html index 7ba87c44d..1a774ad49 100644 --- a/ishtar_common/templates/ishtar/wizard/default_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html @@ -36,6 +36,9 @@ {% block "footer" %} <div id="footer"> {% block "validation_bar" %} + {% if wizard.form.SEARCH %} + <p class="confirm-message">{% trans "Search and select an item in the table" %}</p> + {% endif %} {% include 'ishtar/wizard/validation_bar.html' %} {% endblock %} {% include 'ishtar/blocks/footer.html' %} diff --git a/ishtar_common/templates/ishtar/wizard/wizard_done.html b/ishtar_common/templates/ishtar/wizard/wizard_done.html index 2823c1bae..5acd6e78e 100644 --- a/ishtar_common/templates/ishtar/wizard/wizard_done.html +++ b/ishtar_common/templates/ishtar/wizard/wizard_done.html @@ -1,14 +1,24 @@ {% extends "base.html" %} {% load i18n %} + +{% block top_content %} +<div class="alert alert-success alert-dismissible fade show" role="alert"> + {%trans "Item successfully saved"%}<button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">×</span> +</button> +</div> +{% endblock %} + {% block content %} -<p>{%trans "Item successfully saved"%}</p> {% if redirect or wizard_done_window %} <script type='text/javascript' language='javascript'> {% if redirect %} window.location.href = "{{redirect}}"; {% endif %} {% if wizard_done_window %} -$(function(){ load_window("{{wizard_done_window}}{{item.pk}}/"); }); +$(function(){ + load_window("{{wizard_done_window}}{{item.pk}}/", "", + function (){}, true); }); {% endif %} </script> {% endif %} |