diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-24 19:33:05 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-24 19:33:05 +0100 |
commit | 3e5ab9d8eed1ed059d294e6be4815011654748bb (patch) | |
tree | c9aa1c11ec71bb5ea447ef48b1f30aa4c63b134e | |
parent | eccfe77a20a9af462ef6a739de19d488ca1e372d (diff) | |
parent | 0e9d38a6ed4dce4c23e6dfc59869d9d652e6dcfa (diff) | |
download | Ishtar-3e5ab9d8eed1ed059d294e6be4815011654748bb.tar.bz2 Ishtar-3e5ab9d8eed1ed059d294e6be4815011654748bb.zip |
Merge branch 'v0.9' into wheezy
-rw-r--r-- | CHANGES.md | 6 | ||||
-rw-r--r-- | archaeological_operations/tests.py | 45 | ||||
-rw-r--r-- | ishtar_common/static/media/style.css | 12 | ||||
-rw-r--r-- | ishtar_common/templates/base.html | 2 | ||||
-rw-r--r-- | ishtar_common/wizards.py | 5 | ||||
-rw-r--r-- | version.py | 2 |
6 files changed, 62 insertions, 10 deletions
diff --git a/CHANGES.md b/CHANGES.md index 466d91d1d..bd20ae584 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ Ishtar changelog ================ +0.99.5 (2017-01-24) +------------------- + +- UI: short menu don't hide the main content +- Wizard: fix parcel reuse in creation + 0.99.4 (2017-01-24) ------------------- diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 33199dd04..9a61d8bbb 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -705,22 +705,59 @@ class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase): form_datas={ 'general-operation_creation': { 'operation_type': 1, # preventive diag - 'year': 2016} + 'year': 2016}, + 'townsgeneral-operation_creation': [], + 'parcelsgeneral-operation_creation': [], }, ignored=('filechoice-operation_creation', - 'preventive-operation_creation', 'towns-operation_creation', - 'parcels-operation_creation', ) + 'parcels-operation_creation', + 'preventive-operation_creation',) + ), + FormData( + "Create another preventive diag with same parcel name", + form_datas={ + 'general-operation_creation': { + 'operation_type': 1, # preventive diag + 'year': 2016}, + 'townsgeneral-operation_creation': [], + 'parcelsgeneral-operation_creation': [], + }, + ignored=('filechoice-operation_creation', + 'towns-operation_creation', + 'parcels-operation_creation', + 'preventive-operation_creation',) ) ] def pre_wizard(self): + if 'townsgeneral-operation_creation' not in \ + self.form_datas[0].form_datas: + return super(OperationWizardCreationTest, self).pre_wizard() + town = self.create_towns()[0] + town_data = {'town': town.pk} + self.form_datas[0].form_datas['townsgeneral-operation_creation'].append( + town_data + ) + self.form_datas[1].form_datas['townsgeneral-operation_creation'].append( + town_data + ) + parcel_data = { + 'town': town.pk, 'year': 2017, 'section': 'S', + 'parcel_number': '42'} + self.form_datas[0].form_datas[ + 'parcelsgeneral-operation_creation'].append(parcel_data) + self.form_datas[1].form_datas[ + 'parcelsgeneral-operation_creation'].append(parcel_data) self.operation_number = models.Operation.objects.count() + self.parcel_number = models.Parcel.objects.count() super(OperationWizardCreationTest, self).pre_wizard() def post_wizard(self): self.assertEqual(models.Operation.objects.count(), - self.operation_number + 1) + self.operation_number + 2) + self.assertEqual(models.Parcel.objects.count(), + self.parcel_number + 2) class OperationWizardDeleteTest(OperationWizardCreationTest): diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index b1939eaf0..6fe6e6532 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -358,7 +358,7 @@ div#header{ position: fixed; top: 0; z-index: 10; - width:100%; + width: 500px; text-align:left; font-size: 0.9em; background-color: #EAEAEA; @@ -488,10 +488,16 @@ div#context_menu fieldset{ -webkit-border-radius: 0; border-radius: 0; position: fixed; - top: 40px; + top: 8px; right: 10px; } +@media screen and (max-width: 680px) { + div#context_menu fieldset{ + display: none; + } +} + div#action_current_items{ display: inline-block; vertical-align: top; @@ -605,7 +611,7 @@ div#welcome{ div#content{ clear:both; - margin-top:205px ; + margin-top:225px ; margin-bottom: 70px; margin-left: 200px; margin-right: 150px; diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index 3136e7249..870409e41 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -56,7 +56,7 @@ <div id="language_form_div"> <form action="/i18n/setlang/" method="post" id='language_form'> {% csrf_token %} - <label for='language_selector'>{% trans "Lang" %}{% trans ":"%} </label> + {% comment %}<label for='language_selector'>{% trans "Lang" %}{% trans ":"%} </label>{% endcomment %} <select name="language" id='language_selector'> <option value="">----------</option> {% for lang in LANGUAGES %} diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 735ad62fd..5105418a5 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -670,7 +670,10 @@ class Wizard(NamedUrlWizardView): model.RELATIVE_MODELS: value[model.RELATIVE_MODELS[ self.get_saved_model()]] = obj - value, created = model.objects.get_or_create(**value) + value, created = model.objects.get_or_create( + **value) + else: + value = model.objects.create(**value) value.save() # force post_save # check that an item is not add multiple times (forged forms) if value not in related_model.all() and\ diff --git a/version.py b/version.py index 2092b9c8f..4cf114c57 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,4 @@ -VERSION = (0, 99, 4) +VERSION = (0, 99, 5) def get_version(): |