diff options
-rw-r--r-- | CHANGES.md | 9 | ||||
-rw-r--r-- | Makefile.example | 9 | ||||
-rw-r--r-- | archaeological_context_records/fixtures/initial_data-fr.json | 322 | ||||
-rw-r--r-- | archaeological_context_records/tests.py | 16 | ||||
-rw-r--r-- | archaeological_finds/fixtures/initial_data-fr.json | 65 | ||||
-rw-r--r-- | archaeological_finds/forms.py | 20 | ||||
-rw-r--r-- | archaeological_finds/models_treatments.py | 6 | ||||
-rw-r--r-- | archaeological_operations/fixtures/initial_data-fr.json | 42 | ||||
-rw-r--r-- | archaeological_operations/tests.py | 2 | ||||
-rw-r--r-- | archaeological_operations/wizards.py | 1 | ||||
-rw-r--r-- | archaeological_warehouse/fixtures/initial_data-fr.json | 100 | ||||
-rw-r--r-- | archaeological_warehouse/ishtar_menu.py | 2 | ||||
-rw-r--r-- | ishtar_common/fixtures/initial_data-fr.json | 98 | ||||
-rw-r--r-- | ishtar_common/models.py | 16 | ||||
-rw-r--r-- | ishtar_common/static/media/style.css | 18 | ||||
-rw-r--r-- | ishtar_common/widgets.py | 2 | ||||
-rw-r--r-- | version.py | 2 |
17 files changed, 499 insertions, 231 deletions
diff --git a/CHANGES.md b/CHANGES.md index e5ce0ac3c..c02db8910 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,15 @@ Ishtar changelog ================ +v0.99.18 (2017-04-11) +--------------------- + +### Features ### +- Update fixtures +- CSS: update input width +- Manage hierarchical display with select2 +- Fix hiearchical display of types + v0.99.17 (2017-04-07) --------------------- diff --git a/Makefile.example b/Makefile.example index ac8e54cc5..abbaf9202 100644 --- a/Makefile.example +++ b/Makefile.example @@ -8,8 +8,6 @@ project=example_project # list used apps apps="ishtar_common" "archaeological_operations" "archaeological_context_records" "archaeological_files" "archaeological_finds" "archaeological_warehouse" "archaeological_files_pdl" default_data='fr' -url='ishtar.example.com' -project_name='Test' help: # Actions available: @@ -217,6 +215,8 @@ fixtures_context_records: archaeological_context_records.unit \ archaeological_context_records.datingtype \ archaeological_context_records.relationtype \ + archaeological_context_records.excavationtechnictype \ + archaeological_context_records.documentationtype \ > '../archaeological_context_records/fixtures/initial_data-'$(default_data)'.json' fixtures_finds: @@ -229,12 +229,15 @@ fixtures_finds: archaeological_finds.preservationtype \ archaeological_finds.objecttype \ archaeological_finds.integritytype \ + archaeological_finds.batchtype \ + archaeological_finds.treatmentfiletype \ > '../archaeological_finds/fixtures/initial_data-'$(default_data)'.json' fixtures_warehouse: cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 \ archaeological_warehouse.containertype \ archaeological_warehouse.warehousetype \ + archaeological_warehouse.warehousedivision \ > '../archaeological_warehouse/fixtures/initial_data-'$(default_data)'.json' fixtures_files: @@ -244,7 +247,7 @@ fixtures_files: archaeological_files.permittype \ > '../archaeological_files/fixtures/initial_data-'$(default_data)'.json' -translations_push: translations_pull makemessages +translations_push: makemessages zanata-cli push translations_pull: diff --git a/archaeological_context_records/fixtures/initial_data-fr.json b/archaeological_context_records/fixtures/initial_data-fr.json index 22b96aa41..f43b46a2a 100644 --- a/archaeological_context_records/fixtures/initial_data-fr.json +++ b/archaeological_context_records/fixtures/initial_data-fr.json @@ -13,7 +13,7 @@ "pk": 2, "model": "archaeological_context_records.datingquality", "fields": { - "comment": "datation a v\u00e9rifier", + "comment": "Datation \u00e0 v\u00e9rifier", "available": true, "txt_idx": "estimated", "label": "Estim\u00e9e " @@ -218,15 +218,15 @@ } }, { - "pk": 7, + "pk": 15, "model": "archaeological_context_records.unit", "fields": { "comment": "", "available": true, "parent": null, - "label": "Alt\u00e9ration", + "label": "Anomalie", "order": 100, - "txt_idx": "alteration" + "txt_idx": "anomaly" } }, { @@ -242,51 +242,15 @@ } }, { - "pk": 4, + "pk": 16, "model": "archaeological_context_records.unit", "fields": { "comment": "", "available": true, "parent": null, - "label": "Couche", - "order": 100, - "txt_idx": "layer" - } - }, - { - "pk": 5, - "model": "archaeological_context_records.unit", - "fields": { - "comment": "", - "available": true, - "parent": 4, - "label": "Couche construite", - "order": 100, - "txt_idx": "builded_layer" - } - }, - { - "pk": 2, - "model": "archaeological_context_records.unit", - "fields": { - "comment": "", - "available": true, - "parent": 1, - "label": "Creusement", - "order": 100, - "txt_idx": "digging" - } - }, - { - "pk": 3, - "model": "archaeological_context_records.unit", - "fields": { - "comment": "", - "available": true, - "parent": 1, - "label": "D\u00e9rasement", + "label": "Fait", "order": 100, - "txt_idx": "partial_destruction" + "txt_idx": "fact" } }, { @@ -302,15 +266,15 @@ } }, { - "pk": 8, + "pk": 18, "model": "archaeological_context_records.unit", "fields": { "comment": "", "available": true, - "parent": 7, - "label": "Impact thermique", + "parent": null, + "label": "Log", "order": 100, - "txt_idx": "thermal_impact" + "txt_idx": "log" } }, { @@ -319,25 +283,13 @@ "fields": { "comment": "Cette unit\u00e9 n'a pas de volume.", "available": true, - "parent": null, + "parent": 17, "label": "N\u00e9gative", "order": 100, "txt_idx": "negative" } }, { - "pk": 6, - "model": "archaeological_context_records.unit", - "fields": { - "comment": "", - "available": true, - "parent": 4, - "label": "Remblai", - "order": 100, - "txt_idx": "embankment" - } - }, - { "pk": 13, "model": "archaeological_context_records.unit", "fields": { @@ -374,6 +326,18 @@ } }, { + "pk": 17, + "model": "archaeological_context_records.unit", + "fields": { + "comment": "", + "available": true, + "parent": null, + "label": "US", + "order": 100, + "txt_idx": "stratigraphic-unit" + } + }, + { "pk": 14, "model": "archaeological_context_records.unit", "fields": { @@ -420,6 +384,20 @@ } }, { + "pk": 10, + "model": "archaeological_context_records.relationtype", + "fields": { + "comment": "UE remplie par une autre", + "available": true, + "tiny_label": "", + "label": "Combl\u00e9e par", + "symmetrical": false, + "inverse_relation": 2, + "order": 1, + "txt_idx": "filled_by" + } + }, + { "pk": 1, "model": "archaeological_context_records.relationtype", "fields": { @@ -439,8 +417,8 @@ "fields": { "comment": "UE recoup\u00e9e par une autre", "available": true, - "tiny_label": null, - "label": "Coup\u00e9 par", + "tiny_label": "", + "label": "Coup\u00e9e par", "symmetrical": false, "inverse_relation": 1, "order": 1, @@ -462,31 +440,45 @@ } }, { - "pk": 3, + "pk": 6, "model": "archaeological_context_records.relationtype", "fields": { - "comment": "UE situ\u00e9e au-dessus d'une autre", + "comment": "UE faisant partie d'une autre", "available": true, "tiny_label": "", - "label": "Est au-dessus de", + "label": "Incluse dans", "symmetrical": false, - "inverse_relation": 7, + "inverse_relation": 5, "order": 1, - "txt_idx": "is_above" + "txt_idx": "is_included" } }, { - "pk": 10, + "pk": 5, "model": "archaeological_context_records.relationtype", "fields": { - "comment": "UE remplie par une autre", + "comment": "UE en incluant (regroupant) d'autres (ex: tranch\u00e9e / structures ou entre structure / US, etc.)", "available": true, "tiny_label": "", - "label": "Est combl\u00e9 par", + "label": "Inclut", "symmetrical": false, - "inverse_relation": 2, + "inverse_relation": 6, "order": 1, - "txt_idx": "filled_by" + "txt_idx": "include" + } + }, + { + "pk": 4, + "model": "archaeological_context_records.relationtype", + "fields": { + "comment": "\u00c0 pr\u00e9ciser ", + "available": true, + "tiny_label": "", + "label": "Relation indirecte", + "symmetrical": true, + "inverse_relation": null, + "order": 1, + "txt_idx": "indirect_relation" } }, { @@ -496,7 +488,7 @@ "comment": "UE situ\u00e9e en-dessous d'une autre", "available": true, "tiny_label": "", - "label": "Est en-dessous de", + "label": "Sous", "symmetrical": false, "inverse_relation": 3, "order": 1, @@ -504,45 +496,187 @@ } }, { - "pk": 6, + "pk": 3, "model": "archaeological_context_records.relationtype", "fields": { - "comment": "UE faisant partie d'une autre", + "comment": "UE situ\u00e9e au-dessus d'une autre", "available": true, "tiny_label": "", - "label": "Est inclus dans", + "label": "Sur", "symmetrical": false, - "inverse_relation": 5, + "inverse_relation": 7, "order": 1, - "txt_idx": "is_included" + "txt_idx": "is_above" + } + }, + { + "pk": 1, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "manual-overflowing-cut", + "label": "Coupe manuelle d\u00e9bordante" + } + }, + { + "pk": 2, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "mechanical-overflowing-cut", + "label": "Coupe m\u00e9canique d\u00e9bordante" + } + }, + { + "pk": 3, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "mechanical-stripping", + "label": "D\u00e9capage m\u00e9canique" + } + }, + { + "pk": 6, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "100-percent-excavated", + "label": "Fouill\u00e9e \u00e0 100%" + } + }, + { + "pk": 4, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "25-percent-excavated", + "label": "Fouill\u00e9e \u00e0 25%" } }, { "pk": 5, - "model": "archaeological_context_records.relationtype", + "model": "archaeological_context_records.excavationtechnictype", "fields": { - "comment": "UE en incluant (regroupant) d'autres (ex: tranch\u00e9e / structures ou entre structure / US, etc.)", + "comment": "", "available": true, - "tiny_label": "", - "label": "Inclut", - "symmetrical": false, - "inverse_relation": 6, - "order": 1, - "txt_idx": "include" + "txt_idx": "50-percent-excavated", + "label": "Fouill\u00e9e \u00e0 50%" + } + }, + { + "pk": 7, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "manual-dig", + "label": "Fouille manuelle" + } + }, + { + "pk": 10, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "manual-dig-by-planimetry", + "label": "Fouille manuelle en planim\u00e9trie" + } + }, + { + "pk": 9, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "manual-dig-by-half", + "label": "Fouille manuelle par moiti\u00e9" + } + }, + { + "pk": 8, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "manual-dig-by-quarter", + "label": "Fouille manuelle par quart" + } + }, + { + "pk": 11, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "mechanical-dig", + "label": "Fouille m\u00e9canique" + } + }, + { + "pk": 12, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "not-digged", + "label": "Non fouill\u00e9e" + } + }, + { + "pk": 13, + "model": "archaeological_context_records.excavationtechnictype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "tested", + "label": "Test\u00e9e" + } + }, + { + "pk": 2, + "model": "archaeological_context_records.documentationtype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "section", + "label": "Coupe" + } + }, + { + "pk": 3, + "model": "archaeological_context_records.documentationtype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "photo", + "label": "Photo" } }, { "pk": 4, - "model": "archaeological_context_records.relationtype", + "model": "archaeological_context_records.documentationtype", "fields": { - "comment": "\u00c0 pr\u00e9ciser ", + "comment": "", "available": true, - "tiny_label": "", - "label": "Relation indirecte", - "symmetrical": true, - "inverse_relation": null, - "order": 1, - "txt_idx": "indirect_relation" + "txt_idx": "map", + "label": "Plan" + } + }, + { + "pk": 1, + "model": "archaeological_context_records.documentationtype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "has-furniture", + "label": "Pr\u00e9sence de mobilier" } } ]
\ No newline at end of file diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py index 4226b42ea..e697459b5 100644 --- a/archaeological_context_records/tests.py +++ b/archaeological_context_records/tests.py @@ -60,7 +60,7 @@ class ImportContextRecordTest(ImportTest, TestCase): unit__txt_idx='not_in_context').count(), 3) self.assertEqual( models.ContextRecord.objects.filter( - unit__txt_idx='layer').count(), 1) + unit__txt_idx='negative').count(), 1) def test_model_limitation(self): old_nb = models.ContextRecord.objects.count() @@ -405,12 +405,14 @@ class ContextRecordSearchTest(ContextRecordInit, TestCase): cr = self.context_records[0] c = Client() + su = models.Unit.objects.get(txt_idx='stratigraphic-unit') neg = models.Unit.objects.get(txt_idx='negative') - dig = models.Unit.objects.get(txt_idx='digging') - dest = models.Unit.objects.get(txt_idx='partial_destruction') - cr.unit = (dig) + dest = models.Unit.objects.get(txt_idx='sector') + dest.parent = su + dest.save() + cr.unit = (neg) cr.save() - search = {'unit': dig.pk} + search = {'unit': neg.pk} # no result when no authentication response = c.get(reverse('get-contextrecord'), search) @@ -424,7 +426,7 @@ class ContextRecordSearchTest(ContextRecordInit, TestCase): res = json.loads(response.content) self.assertTrue(res['total'] == 1) self.assertEqual(res["rows"][0]["unit"], - unicode(dig)) + unicode(neg)) # no result for the brother search = {'unit': dest.pk} @@ -433,7 +435,7 @@ class ContextRecordSearchTest(ContextRecordInit, TestCase): self.assertEqual(json.loads(response.content)['total'], 0) # one result for the father - search = {'unit': neg.pk} + search = {'unit': su.pk} response = c.get(reverse('get-contextrecord'), search) self.assertEqual(response.status_code, 200) self.assertEqual(json.loads(response.content)['total'], 1) diff --git a/archaeological_finds/fixtures/initial_data-fr.json b/archaeological_finds/fixtures/initial_data-fr.json index 341b351f8..b8f233f88 100644 --- a/archaeological_finds/fixtures/initial_data-fr.json +++ b/archaeological_finds/fixtures/initial_data-fr.json @@ -892,7 +892,7 @@ "fields": { "comment": "", "available": true, - "txt_idx": "In_progress", + "txt_idx": "in_progress", "label": "En cours" } }, @@ -7570,5 +7570,68 @@ "txt_idx": "integrity_lost", "label": "Perte d'int\u00e9grit\u00e9 totale" } + }, + { + "pk": 1, + "model": "archaeological_finds.batchtype", + "fields": { + "comment": null, + "available": true, + "txt_idx": "inconnu", + "order": 0, + "label": "Inconnu" + } + }, + { + "pk": 2, + "model": "archaeological_finds.batchtype", + "fields": { + "comment": null, + "available": true, + "txt_idx": "objet", + "order": 1, + "label": "Objet" + } + }, + { + "pk": 3, + "model": "archaeological_finds.batchtype", + "fields": { + "comment": null, + "available": true, + "txt_idx": "lot", + "order": 2, + "label": "Lot" + } + }, + { + "pk": 1, + "model": "archaeological_finds.treatmentfiletype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "loan_demand_study", + "label": "Demande de pr\u00eat pour \u00e9tude" + } + }, + { + "pk": 2, + "model": "archaeological_finds.treatmentfiletype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "loan_demand_exposure", + "label": "Demande de pr\u00eat pour exposition" + } + }, + { + "pk": 3, + "model": "archaeological_finds.treatmentfiletype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "gift_wish", + "label": "Intention de donation" + } } ]
\ No newline at end of file diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 8fe945e88..bdb602606 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -148,8 +148,7 @@ class FindForm(ManageOldType, forms.Form): is_complete = forms.NullBooleanField(label=_(u"Is complete?"), required=False) material_type = widgets.Select2MultipleField( - model=models.MaterialType, label=_(u"Material type"), required=False, - available=True + label=_(u"Material type"), required=False ) conservatory_state = forms.ChoiceField(label=_(u"Conservatory state"), choices=[], required=False) @@ -157,18 +156,17 @@ class FindForm(ManageOldType, forms.Form): label=_(u"Conservatory comment"), required=False, widget=forms.Textarea) object_type = widgets.Select2MultipleField( - model=models.ObjectType, label=_(u"Object types"), required=False, - available=True + label=_(u"Object types"), required=False, ) preservation_to_consider = forms.MultipleChoiceField( label=_(u"Preservation type"), choices=[], widget=widgets.Select2Multiple, required=False) integritie = forms.MultipleChoiceField( label=_(u"Integrity / interest"), choices=[], - widget=widgets.CheckboxSelectMultiple, required=False) + widget=widgets.Select2Multiple, required=False) remarkabilitie = forms.MultipleChoiceField( label=_(u"Remarkability"), choices=[], - widget=widgets.CheckboxSelectMultiple, required=False) + widget=widgets.Select2Multiple, required=False) get_first_base_find__topographic_localisation = forms.CharField( label=_(u"Point of topographic reference"), required=False, max_length=120 @@ -232,8 +230,18 @@ class FindForm(ManageOldType, forms.Form): self.fields[srs].help_text = \ SpatialReferenceSystem.get_help() self.fields['checked'].choices = models.CHECK_CHOICES + self.fields['material_type'].choices = models.MaterialType.get_types( + initial=self.init_data.get('material_type'), + empty_first=False + ) self.fields['material_type'].help_text = models.MaterialType.get_help() + self.fields['object_type'].choices = models.ObjectType.get_types( + initial=self.init_data.get('object_type'), + empty_first=False + ) + self.fields['object_type'].help_text = models.ObjectType.get_help() + self.fields['get_first_base_find__batch'].choices = \ models.BatchType.get_types( initial=self.init_data.get('get_first_base_find__batch')) diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index d3e18122c..47f60bb44 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -629,12 +629,6 @@ class TreatmentFileSource(Source): permissions = ( ("view_filetreatmentsource", ugettext(u"Can view Treatment request source")), - ("add_filetreatmentsource", - ugettext(u"Can add Treatment request source")), - ("change_filetreatmentsource", - ugettext(u"Can change Treatment request source")), - ("delete_filetreatmentsource", - ugettext(u"Can delete Treatment request source")), ("view_own_filetreatmentsource", ugettext(u"Can view own Treatment request source")), ("add_own_filetreatmentsource", diff --git a/archaeological_operations/fixtures/initial_data-fr.json b/archaeological_operations/fixtures/initial_data-fr.json index 9f514a097..304f07a38 100644 --- a/archaeological_operations/fixtures/initial_data-fr.json +++ b/archaeological_operations/fixtures/initial_data-fr.json @@ -1970,22 +1970,22 @@ } }, { - "pk": 2, + "pk": 221, "model": "archaeological_operations.remaintype", "fields": { - "comment": "", + "comment": null, "available": true, - "txt_idx": "enclosure", + "txt_idx": "enclos", "label": "enclos" } }, { - "pk": 221, + "pk": 2, "model": "archaeological_operations.remaintype", "fields": { - "comment": null, + "comment": "", "available": true, - "txt_idx": "enclos", + "txt_idx": "enclosure", "label": "enclos" } }, @@ -2914,31 +2914,31 @@ } }, { - "pk": 3, + "pk": 2, "model": "archaeological_operations.relationtype", "fields": { "comment": "", "available": true, "tiny_label": "", - "label": "En relation diffuse avec", - "symmetrical": true, - "inverse_relation": null, + "label": "Comprise dans", + "symmetrical": false, + "inverse_relation": 1, "order": 1, - "txt_idx": "fuzzy_relation" + "txt_idx": "is_in" } }, { - "pk": 2, + "pk": 3, "model": "archaeological_operations.relationtype", "fields": { "comment": "", "available": true, - "tiny_label": null, - "label": "Est compris dans", - "symmetrical": false, - "inverse_relation": 1, + "tiny_label": "", + "label": "Relation diffuse", + "symmetrical": true, + "inverse_relation": null, "order": 1, - "txt_idx": "is_in" + "txt_idx": "fuzzy_relation" } }, { @@ -2992,7 +2992,7 @@ "comment": "Le rapport (unique) a \u00e9t\u00e9 re\u00e7u et d\u00e9pouill\u00e9.", "available": true, "txt_idx": "one_report_received_and_processed", - "order": 4, + "order": 5, "label": "Re\u00e7u et d\u00e9pouill\u00e9" } }, @@ -3003,7 +3003,7 @@ "comment": "Tous les rapports ont \u00e9t\u00e9 re\u00e7us mais n'ont pas \u00e9t\u00e9 encore d\u00e9pouill\u00e9s.", "available": true, "txt_idx": "received_and_processed", - "order": 4, + "order": 6, "label": "Re\u00e7us et d\u00e9pouill\u00e9s" } }, @@ -3014,8 +3014,8 @@ "comment": "Il n'existe pas de rapport pour cette op\u00e9ration.", "available": true, "txt_idx": "no-report", - "order": 4, + "order": 7, "label": "Rapport inexistant" } } -]
\ No newline at end of file +] diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 67f9454fa..183a2f682 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -142,7 +142,7 @@ class ImportTest(object): hc = Unit.objects.get(txt_idx='not_in_context').pk self.set_target_key('unit', 'hc', hc, imp=imp) self.set_target_key('unit', 'hors-contexte', hc, imp=imp) - layer = Unit.objects.get(txt_idx='layer').pk + layer = Unit.objects.get(txt_idx='negative').pk self.set_target_key('unit', 'couche', layer, imp=imp) def init_context_record(self): diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index c132c24be..07206cc18 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -278,7 +278,6 @@ class OperationModificationWizard(OperationWizard): def get_form_kwargs(self, step, **kwargs): kwargs = super(OperationModificationWizard, self).get_form_kwargs( step, **kwargs) - print(step) if step != "relations-operation_modification": return kwargs kwargs["left_record"] = self.get_current_object() diff --git a/archaeological_warehouse/fixtures/initial_data-fr.json b/archaeological_warehouse/fixtures/initial_data-fr.json index a1b4f9254..d67f8b0a1 100644 --- a/archaeological_warehouse/fixtures/initial_data-fr.json +++ b/archaeological_warehouse/fixtures/initial_data-fr.json @@ -168,5 +168,105 @@ "txt_idx": "museum", "label": "Mus\u00e9e" } + }, + { + "pk": 1, + "model": "archaeological_warehouse.warehousedivision", + "fields": { + "comment": "", + "available": true, + "txt_idx": "building", + "label": "B\u00e2timent" + } + }, + { + "pk": 2, + "model": "archaeological_warehouse.warehousedivision", + "fields": { + "comment": "", + "available": true, + "txt_idx": "floor", + "label": "\u00c9tage" + } + }, + { + "pk": 3, + "model": "archaeological_warehouse.warehousedivision", + "fields": { + "comment": "", + "available": true, + "txt_idx": "room", + "label": "Salle" + } + }, + { + "pk": 4, + "model": "archaeological_warehouse.warehousedivision", + "fields": { + "comment": "", + "available": true, + "txt_idx": "span", + "label": "Trav\u00e9e" + } + }, + { + "pk": 5, + "model": "archaeological_warehouse.warehousedivision", + "fields": { + "comment": "", + "available": true, + "txt_idx": "shelf", + "label": "\u00c9tag\u00e8re" + } + }, + { + "pk": 6, + "model": "archaeological_warehouse.warehousedivision", + "fields": { + "comment": "", + "available": true, + "txt_idx": "place", + "label": "Lieu dans la salle" + } + }, + { + "pk": 7, + "model": "archaeological_warehouse.warehousedivision", + "fields": { + "comment": "", + "available": true, + "txt_idx": "alley", + "label": "All\u00e9e" + } + }, + { + "pk": 8, + "model": "archaeological_warehouse.warehousedivision", + "fields": { + "comment": "", + "available": true, + "txt_idx": "rank", + "label": "Rang" + } + }, + { + "pk": 9, + "model": "archaeological_warehouse.warehousedivision", + "fields": { + "comment": "", + "available": true, + "txt_idx": "space", + "label": "Espace" + } + }, + { + "pk": 10, + "model": "archaeological_warehouse.warehousedivision", + "fields": { + "comment": "", + "available": true, + "txt_idx": "level", + "label": "Niveau" + } } ]
\ No newline at end of file diff --git a/archaeological_warehouse/ishtar_menu.py b/archaeological_warehouse/ishtar_menu.py index d2ebc2306..bcbfe881b 100644 --- a/archaeological_warehouse/ishtar_menu.py +++ b/archaeological_warehouse/ishtar_menu.py @@ -25,7 +25,7 @@ from archaeological_finds.models import Treatment import models -# be carreful: each access_controls must be relevant with check_rights in urls +# be careful: each access_controls must be relevant with check_rights in urls MENU_SECTIONS = [ diff --git a/ishtar_common/fixtures/initial_data-fr.json b/ishtar_common/fixtures/initial_data-fr.json index 5f3205c74..54b0c5d7b 100644 --- a/ishtar_common/fixtures/initial_data-fr.json +++ b/ishtar_common/fixtures/initial_data-fr.json @@ -6,6 +6,7 @@ "comment": "Cette personne est l'auteur principal de la source. Les autres auteurs sont des collaborateurs.", "available": true, "txt_idx": "main_author", + "order": 1, "label": "Auteur principal" } }, @@ -16,6 +17,7 @@ "comment": "Il y a plusieurs auteurs pour une m\u00eame source. Au m\u00eame niveau de responsabilit\u00e9.", "available": true, "txt_idx": "co_author", + "order": 1, "label": "Co-auteur " } }, @@ -26,6 +28,7 @@ "comment": "Cet auteur n'est pas l'auteur principal de la source mais un collaborateur. Il n'est pas auteur au m\u00eame niveau que l'auteur principal.", "available": true, "txt_idx": "associate_author", + "order": 1, "label": "Collaborateur" } }, @@ -35,9 +38,9 @@ "fields": { "comment": "Un acc\u00e8s limit\u00e9 \u00e0 la base, uniquement en lecture. Apr\u00e8s enregistrement.", "available": true, - "txt_idx": "public_access", + "txt_idx": "reader_access", "groups": [], - "label": "Acc\u00e8s public" + "label": "Acc\u00e8s en lecture" } }, { @@ -55,7 +58,7 @@ "pk": 6, "model": "ishtar_common.persontype", "fields": { - "comment": "Responsable de l'am\u00e9nagement", + "comment": "Responsable de l'am\u00e9nagement (pr\u00e9ventif).", "available": true, "txt_idx": "general_contractor", "groups": [], @@ -66,7 +69,7 @@ "pk": 8, "model": "ishtar_common.persontype", "fields": { - "comment": null, + "comment": "", "available": true, "txt_idx": "responsible_planning_service", "groups": [], @@ -77,7 +80,7 @@ "pk": 9, "model": "ishtar_common.persontype", "fields": { - "comment": "Personnes pouvant intervenir sur les donn\u00e9es d'une op\u00e9ration sans en \u00eatre responsable", + "comment": "Peut intervenir sur les donn\u00e9es d'une op\u00e9ration sans en \u00eatre responsable.", "available": true, "txt_idx": "collaborator", "groups": [], @@ -88,7 +91,7 @@ "pk": 10, "model": "ishtar_common.persontype", "fields": { - "comment": "Personne demandant une action sur le mobilier (traitements)", + "comment": "Personne demandant une action sur le mobilier (traitements).", "available": true, "txt_idx": "applicant", "groups": [], @@ -99,7 +102,7 @@ "pk": 5, "model": "ishtar_common.persontype", "fields": { - "comment": "Cette personne peut g\u00e9rer du mobilier qu'il n'a pas cr\u00e9\u00e9\r\n\r\n", + "comment": "Peut g\u00e9rer du mobilier qu'il n'a pas cr\u00e9\u00e9.\r\n\r\n", "available": true, "txt_idx": "warehouse_manager", "groups": [], @@ -150,7 +153,7 @@ "pk": 2, "model": "ishtar_common.persontype", "fields": { - "comment": "Responsable d'op\u00e9ration arch\u00e9ologique", + "comment": "Responsable d'op\u00e9ration arch\u00e9ologique.", "available": true, "txt_idx": "head_scientist", "groups": [], @@ -161,14 +164,13 @@ "pk": 4, "model": "ishtar_common.persontype", "fields": { - "comment": "", + "comment": "Peut utiliser toutes les fonctionnalit\u00e9s du module Administratif.", "available": true, "txt_idx": "secretarial_dept", "groups": [ - 2, 1, - 3, - 7, + 2, + 4, 6, 8, 9, @@ -553,30 +555,6 @@ } }, { - "pk": 123, - "model": "ishtar_common.operationtype", - "fields": { - "comment": "", - "available": false, - "label": "Prospection inventaire (pr\u00e9ventif)", - "preventive": true, - "order": 1, - "txt_idx": "inventory_survey" - } - }, - { - "pk": 124, - "model": "ishtar_common.operationtype", - "fields": { - "comment": null, - "available": false, - "label": "Prospection (pr\u00e9ventif)", - "preventive": true, - "order": 1, - "txt_idx": "survey" - } - }, - { "pk": 22, "model": "ishtar_common.operationtype", "fields": { @@ -733,18 +711,6 @@ } }, { - "pk": 126, - "model": "ishtar_common.operationtype", - "fields": { - "comment": "", - "available": false, - "label": "Prospection a\u00e9rienne (pr\u00e9ventif)", - "preventive": false, - "order": 1, - "txt_idx": "aerial_survey" - } - }, - { "pk": 117, "model": "ishtar_common.operationtype", "fields": { @@ -781,18 +747,6 @@ } }, { - "pk": 114, - "model": "ishtar_common.operationtype", - "fields": { - "comment": "", - "available": false, - "label": "Prospection diachronique", - "preventive": false, - "order": 1, - "txt_idx": "diachronic_prospection" - } - }, - { "pk": 17, "model": "ishtar_common.operationtype", "fields": { @@ -805,18 +759,6 @@ } }, { - "pk": 18, - "model": "ishtar_common.operationtype", - "fields": { - "comment": "", - "available": false, - "label": "Prospection (programm\u00e9)", - "preventive": false, - "order": 1, - "txt_idx": "survey_research" - } - }, - { "pk": 134, "model": "ishtar_common.operationtype", "fields": { @@ -853,18 +795,6 @@ } }, { - "pk": 21, - "model": "ishtar_common.operationtype", - "fields": { - "comment": "Pas assez gros pour \u00eatre une fouille, mais porte n\u00e9anmoins atteinte au sous-sol.", - "available": false, - "label": "Sondage", - "preventive": false, - "order": 1, - "txt_idx": "sampling_research" - } - }, - { "pk": 127, "model": "ishtar_common.operationtype", "fields": { diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 988254359..83cb25d46 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -568,7 +568,7 @@ class GeneralType(Cached, models.Model): @classmethod def _get_childs(cls, item, dct, prefix=0, instances=False, exclude=[], - is_last=False): + is_last=False, last_of=[]): prefix += 1 dct['parent'] = item childs = cls.objects.filter(**dct) @@ -580,6 +580,7 @@ class GeneralType(Cached, models.Model): child_lst = childs.all() total = len(child_lst) for idx, child in enumerate(child_lst): + mylast_of = last_of[:] if instances: child.rank = prefix lst.append(child) @@ -594,15 +595,24 @@ class GeneralType(Cached, models.Model): else: p += cls.PREFIX_MEDIUM elif is_last: - p += cls.PREFIX_EMPTY + if mylast_of: + clast = mylast_of.pop(0) + if clast: + p += cls.PREFIX_EMPTY + else: + p += cls.PREFIX + else: + p += cls.PREFIX_EMPTY else: p += cls.PREFIX lst.append(( child.pk, SafeUnicode(p + unicode(_(unicode(child)))) )) + clast_of = last_of[:] + clast_of.append(idx + 1 == total) for sub_child in cls._get_childs( child, dct, prefix, instances, exclude=exclude, - is_last=((idx + 1) == total)): + is_last=((idx + 1) == total), last_of=clast_of): lst.append(sub_child) return lst diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 011db3652..056046e95 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -101,6 +101,12 @@ div.form { border:1px solid #D14; } +.select2-container .select2-results__option { + font-family: monospace; + padding: 0 6px; + font-size: 1.1em; +} + hr.spacer{ clear:both; border:0; @@ -207,14 +213,24 @@ select{ max-width:550px; } +.form select{ + width:370px; +} + /*label{display:block}*/ label:first-letter { text-transform: uppercase; } + +.form input[type="text"]{ + width: 370px; +} + textarea{ - height:80px; + height: 80px; + width: 370px; } textarea.xlarge{ diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 94709406c..b0f28a6cf 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -118,7 +118,7 @@ class Select2Multiple(forms.SelectMultiple): try: choices.append((v, self.model.objects.get(pk=v))) except (self.model.DoesNotExist, ValueError): - # an old reference ? it should not happen + # an old reference? it should not happen pass html = super(Select2Multiple, self).render(name, value, attrs, choices) diff --git a/version.py b/version.py index d0ef38afd..d39ed2187 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,4 @@ -VERSION = (0, 99, 17) +VERSION = (0, 99, 18) def get_version(): |