diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-10 00:26:07 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-10 00:26:07 +0100 |
commit | c0f14049777002bf0849f04dabc99a6bc66de295 (patch) | |
tree | 777c2f1bcfc1cde0056a64b04d0ee322948ade56 /archaeological_files | |
parent | 229a5559e9933ea76020963ca3778906d39279d4 (diff) | |
parent | 1191cb323ca087ea05d5f58acb555b8e2d266801 (diff) | |
download | Ishtar-c0f14049777002bf0849f04dabc99a6bc66de295.tar.bz2 Ishtar-c0f14049777002bf0849f04dabc99a6bc66de295.zip |
Merge branch 'master' into v0.9
Conflicts:
archaeological_files/migrations/0014_auto__add_field_file_requested_operation_type__add_field_file_organiza.py
Diffstat (limited to 'archaeological_files')
-rw-r--r-- | archaeological_files/forms.py | 4 | ||||
-rw-r--r-- | archaeological_files/ishtar_menu.py | 2 | ||||
-rw-r--r-- | archaeological_files/locale/django.pot | 159 | ||||
-rw-r--r-- | archaeological_files/migrations/0001_initial.py | 2 | ||||
-rw-r--r-- | archaeological_files/models.py | 20 | ||||
-rw-r--r-- | archaeological_files/templates/ishtar/sheet_file.html | 16 | ||||
-rw-r--r-- | archaeological_files/urls.py | 10 | ||||
-rw-r--r-- | archaeological_files/wizards.py | 5 |
8 files changed, 107 insertions, 111 deletions
diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py index 42a645171..45a05b9b1 100644 --- a/archaeological_files/forms.py +++ b/archaeological_files/forms.py @@ -290,7 +290,7 @@ class FileFormPreventive(ManageOldType, forms.Form): validators=[valid_id(Person)]) responsible_town_planning_service = forms.IntegerField( required=False, - label=_(u"Responsible for town planning service"), + label=_(u"Responsible for planning service"), widget=widgets.JQueryAutoComplete( reverse_lazy( 'autocomplete-person', @@ -389,7 +389,7 @@ class FinalFileClosingForm(FinalForm): class FinalFileDeleteForm(FinalForm): confirm_msg = " " - confirm_end_msg = _(u"Would you like to delete this archaelogical file ?") + confirm_end_msg = _(u"Would you like to delete this archaeological file ?") class AdministrativeActFileModifySelect(TableSelect): diff --git a/archaeological_files/ishtar_menu.py b/archaeological_files/ishtar_menu.py index dfff7d0ab..7ed921b2c 100644 --- a/archaeological_files/ishtar_menu.py +++ b/archaeological_files/ishtar_menu.py @@ -61,7 +61,7 @@ MENU_SECTIONS = [ model=AdministrativeAct, access_controls=['change_administrativeact']), MenuItem('file_administrativeactfil', - _(u"Add"), + _(u"Creation"), model=AdministrativeAct, access_controls=['change_administrativeact']), MenuItem('file_administrativeactfil_modification', diff --git a/archaeological_files/locale/django.pot b/archaeological_files/locale/django.pot index c8e5b3952..b3e38bacf 100644 --- a/archaeological_files/locale/django.pot +++ b/archaeological_files/locale/django.pot @@ -8,247 +8,248 @@ msgid "" msgstr "" -#: forms.py:52 forms.py:212 forms.py:257 forms.py:404 forms.py:431 +#: forms.py:47 forms.py:210 forms.py:255 forms.py:396 forms.py:423 #: models.py:108 templates/ishtar/sheet_file.html:146 msgid "Year" msgstr "" -#: forms.py:53 forms.py:217 forms.py:259 models.py:111 +#: forms.py:48 forms.py:215 forms.py:257 models.py:111 msgid "Numeric reference" msgstr "" -#: forms.py:55 forms.py:219 +#: forms.py:50 forms.py:217 msgid "Other reference" msgstr "" -#: forms.py:57 forms.py:439 +#: forms.py:52 forms.py:431 msgid "Parcel (section/number/public domain)" msgstr "" -#: forms.py:60 forms.py:415 forms.py:442 models.py:543 +#: forms.py:55 forms.py:407 forms.py:434 models.py:546 msgid "Department" msgstr "" -#: forms.py:61 forms.py:451 +#: forms.py:56 forms.py:443 msgid "File name" msgstr "" -#: forms.py:62 forms.py:158 forms.py:223 models.py:119 +#: forms.py:57 forms.py:154 forms.py:221 models.py:119 msgid "File type" msgstr "" -#: forms.py:63 +#: forms.py:58 msgid "Is active?" msgstr "" -#: forms.py:64 forms.py:160 forms.py:321 +#: forms.py:59 forms.py:156 forms.py:314 msgid "Saisine type" msgstr "" -#: forms.py:65 forms.py:311 models.py:60 models.py:150 +#: forms.py:60 forms.py:304 models.py:60 models.py:150 msgid "Permit type" msgstr "" -#: forms.py:67 forms.py:314 models.py:151 +#: forms.py:62 forms.py:307 models.py:151 msgid "Permit reference" msgstr "" -#: forms.py:68 forms.py:229 forms.py:372 models.py:180 +#: forms.py:63 forms.py:227 forms.py:364 models.py:180 #: templates/ishtar/sheet_file.html:99 msgid "Comment" msgstr "" -#: forms.py:70 templates/ishtar/sheet_file.html:119 +#: forms.py:65 templates/ishtar/sheet_file.html:119 msgid "In charge" msgstr "" -#: forms.py:77 forms.py:289 forms.py:453 models.py:126 +#: forms.py:72 forms.py:281 forms.py:445 models.py:126 msgid "General contractor" msgstr "" -#: forms.py:84 forms.py:462 +#: forms.py:79 forms.py:453 msgid "Organization of general contractor" msgstr "" -#: forms.py:91 forms.py:485 +#: forms.py:87 forms.py:476 msgid "Created by" msgstr "" -#: forms.py:98 forms.py:493 +#: forms.py:94 forms.py:484 msgid "Modified by" msgstr "" -#: forms.py:129 +#: forms.py:125 msgid "Archaeological file search" msgstr "" -#: forms.py:143 +#: forms.py:139 msgid "You should select a file." msgstr "" -#: forms.py:146 forms.py:221 models.py:159 +#: forms.py:142 forms.py:219 models.py:159 msgid "Creation date" msgstr "" -#: forms.py:147 forms.py:324 models.py:161 +#: forms.py:143 forms.py:317 models.py:161 msgid "Reception date" msgstr "" -#: forms.py:152 +#: forms.py:148 msgid "Slicing" msgstr "" -#: forms.py:154 +#: forms.py:150 msgid "Department detail" msgstr "" -#: forms.py:156 +#: forms.py:152 msgid "Date get from" msgstr "" -#: forms.py:162 +#: forms.py:158 msgid "Date after" msgstr "" -#: forms.py:164 +#: forms.py:160 msgid "Date before" msgstr "" -#: forms.py:201 templates/ishtar/sheet_file.html:14 +#: forms.py:197 templates/ishtar/sheet_file.html:14 msgid "General" msgstr "" -#: forms.py:206 models.py:121 +#: forms.py:202 models.py:121 msgid "Person in charge" msgstr "" -#: forms.py:220 models.py:118 +#: forms.py:218 models.py:118 msgid "Name" msgstr "" -#: forms.py:225 models.py:163 +#: forms.py:223 models.py:163 msgid "Related file" msgstr "" -#: forms.py:233 models.py:171 +#: forms.py:231 models.py:171 msgid "Total surface (m2)" msgstr "" -#: forms.py:236 models.py:177 +#: forms.py:234 models.py:177 msgid "Main address" msgstr "" -#: forms.py:237 +#: forms.py:235 msgid "Main address - complement" msgstr "" -#: forms.py:250 +#: forms.py:248 #, python-format msgid "<br/>(last recorded: %s)" msgstr "" -#: forms.py:272 +#: forms.py:270 msgid "Another file with this numeric id exists." msgstr "" -#: forms.py:283 +#: forms.py:275 msgid "Preventive informations" msgstr "" -#: forms.py:301 models.py:138 -msgid "Responsible for town planning service" +#: forms.py:293 models.py:138 +msgid "Responsible for planning service" msgstr "" -#: forms.py:317 models.py:174 +#: forms.py:310 models.py:174 msgid "Total developed surface (m2)" msgstr "" -#: forms.py:340 templates/ishtar/sheet_file.html:89 +#: forms.py:333 templates/ishtar/sheet_file.html:89 #: templates/ishtar/dashboards/dashboard_file.html:45 msgid "Research archaeology" msgstr "" -#: forms.py:348 models.py:183 templates/ishtar/sheet_file.html:90 +#: forms.py:341 models.py:183 templates/ishtar/sheet_file.html:90 msgid "Departments" msgstr "" -#: forms.py:359 models.py:192 +#: forms.py:351 models.py:192 msgid "Scientist in charge" msgstr "" -#: forms.py:361 models.py:186 templates/ishtar/sheet_file.html:92 +#: forms.py:353 models.py:186 templates/ishtar/sheet_file.html:92 msgid "Requested operation type" msgstr "" -#: forms.py:363 +#: forms.py:355 msgid "Lead organization" msgstr "" -#: forms.py:379 models.py:196 templates/ishtar/sheet_file.html:97 +#: forms.py:371 models.py:196 templates/ishtar/sheet_file.html:97 msgid "Classified area" msgstr "" -#: forms.py:381 models.py:198 templates/ishtar/sheet_file.html:98 +#: forms.py:373 models.py:198 templates/ishtar/sheet_file.html:98 msgid "Protected area" msgstr "" -#: forms.py:395 +#: forms.py:387 msgid "Would you like to close this archaeological file?" msgstr "" -#: forms.py:400 -msgid "Would you like to delete this archaelogical file ?" +#: forms.py:392 +msgid "Would you like to delete this archaeological file ?" msgstr "" -#: forms.py:405 forms.py:432 forms.py:556 +#: forms.py:397 forms.py:424 forms.py:547 msgid "Index" msgstr "" -#: forms.py:409 forms.py:436 forms.py:542 +#: forms.py:401 forms.py:428 forms.py:533 msgid "Act type" msgstr "" -#: forms.py:410 +#: forms.py:402 msgid "Object (full text search)" msgstr "" -#: forms.py:437 +#: forms.py:429 msgid "Indexed?" msgstr "" -#: forms.py:443 +#: forms.py:435 msgid "Object" msgstr "" -#: forms.py:447 +#: forms.py:439 msgid "Signature date after" msgstr "" -#: forms.py:449 +#: forms.py:441 msgid "Signature date before" msgstr "" -#: forms.py:470 +#: forms.py:461 msgid "File numeric reference" msgstr "" -#: forms.py:471 +#: forms.py:462 msgid "File year" msgstr "" -#: forms.py:473 +#: forms.py:464 msgid "File other reference" msgstr "" -#: forms.py:475 +#: forms.py:466 msgid "File in charge" msgstr "" -#: forms.py:483 +#: forms.py:474 msgid "File permit reference" msgstr "" -#: ishtar_menu.py:33 models.py:220 templates/ishtar/sheet_file.html:4 +#: ishtar_menu.py:33 models.py:220 wizards.py:155 wizards.py:165 +#: templates/ishtar/sheet_file.html:4 msgid "Archaeological file" msgstr "" @@ -256,7 +257,7 @@ msgstr "" msgid "Search" msgstr "" -#: ishtar_menu.py:41 +#: ishtar_menu.py:41 ishtar_menu.py:64 msgid "Creation" msgstr "" @@ -276,10 +277,6 @@ msgstr "" msgid "Administrative act" msgstr "" -#: ishtar_menu.py:64 -msgid "Add" -msgstr "" - #: ishtar_menu.py:76 msgid "Documents" msgstr "" @@ -334,11 +331,11 @@ msgid "General contractor organization" msgstr "" #: models.py:141 -msgid "Town planning service (raw)" +msgid "Planning service (raw)" msgstr "" #: models.py:147 -msgid "Town planning service organization" +msgid "Planning service organization" msgstr "" #: models.py:153 @@ -382,23 +379,23 @@ msgid "Imported line" msgstr "" #: models.py:223 -msgid "Can view all Archaelogical files" +msgid "Can view all Archaeological files" msgstr "" #: models.py:224 -msgid "Can view own Archaelogical file" +msgid "Can view own Archaeological file" msgstr "" #: models.py:225 -msgid "Can add own Archaelogical file" +msgid "Can add own Archaeological file" msgstr "" #: models.py:227 -msgid "Can change own Archaelogical file" +msgid "Can change own Archaeological file" msgstr "" #: models.py:229 -msgid "Can delete own Archaelogical file" +msgid "Can delete own Archaeological file" msgstr "" #: models.py:230 @@ -409,15 +406,15 @@ msgstr "" msgid "FILE" msgstr "" -#: models.py:404 +#: models.py:406 msgid "Multi-town" msgstr "" -#: models.py:410 +#: models.py:412 msgid "No town" msgstr "" -#: models.py:542 +#: models.py:545 msgid "File" msgstr "" @@ -461,10 +458,6 @@ msgstr "" msgid "Associated operations" msgstr "" -#: wizards.py:154 wizards.py:164 -msgid "Archaelogical file" -msgstr "" - #: templates/ishtar/administrativeact_document.html:9 msgid "Document generation" msgstr "" @@ -534,7 +527,7 @@ msgid "Surface:" msgstr "" #: templates/ishtar/sheet_file.html:62 -msgid "Preventive archaelogical file" +msgid "Preventive archaeological file" msgstr "" #: templates/ishtar/sheet_file.html:64 @@ -577,7 +570,7 @@ msgid "Excavation end date" msgstr "" #: templates/ishtar/sheet_file.html:135 -msgid "No operation associated to this archaelogical file" +msgid "No operation associated to this archaeological file" msgstr "" #: templates/ishtar/sheet_file.html:141 diff --git a/archaeological_files/migrations/0001_initial.py b/archaeological_files/migrations/0001_initial.py index d1d3ea4e6..b8bfe0841 100644 --- a/archaeological_files/migrations/0001_initial.py +++ b/archaeological_files/migrations/0001_initial.py @@ -495,4 +495,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['archaeological_files']
\ No newline at end of file + complete_apps = ['archaeological_files'] diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 1d8317b31..638b19d18 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -135,16 +135,16 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, responsible_town_planning_service = models.ForeignKey( Person, related_name='responsible_town_planning_service_files', blank=True, null=True, - verbose_name=_(u"Responsible for town planning service"), + verbose_name=_(u"Responsible for planning service"), on_delete=models.SET_NULL,) # service instructeur - personne raw_town_planning_service = models.CharField( - _(u"Town planning service (raw)"), max_length=200, + _(u"Planning service (raw)"), max_length=200, blank=True, null=True) planning_service = models.ForeignKey( Organization, related_name='planning_service_files', blank=True, null=True, - verbose_name=_(u"Town planning service organization"), + verbose_name=_(u"Planning service organization"), on_delete=models.SET_NULL,) # service instructeur permit_type = models.ForeignKey( PermitType, verbose_name=_(u"Permit type"), blank=True, null=True) @@ -220,13 +220,13 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, verbose_name = _(u"Archaeological file") verbose_name_plural = _(u"Archaeological files") permissions = ( - ("view_file", ugettext(u"Can view all Archaelogical files")), - ("view_own_file", ugettext(u"Can view own Archaelogical file")), - ("add_own_file", ugettext(u"Can add own Archaelogical file")), + ("view_file", ugettext(u"Can view all Archaeological files")), + ("view_own_file", ugettext(u"Can view own Archaeological file")), + ("add_own_file", ugettext(u"Can add own Archaeological file")), ("change_own_file", - ugettext(u"Can change own Archaelogical file")), + ugettext(u"Can change own Archaeological file")), ("delete_own_file", - ugettext(u"Can delete own Archaelogical file")), + ugettext(u"Can delete own Archaeological file")), ("close_file", ugettext(u"Can close File")), ) ordering = ('cached_label',) @@ -352,7 +352,9 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, cache_key, val = get_cache(self.__class__, [self.pk, 'short_class_name']) cls = 'normal' - if not self.has_adminact and self.reception_date: + if not self.file_type.txt_idx == 'preventive': + cls = "blue" + elif not self.has_adminact and self.reception_date: delta = datetime.date.today() - self.reception_date cls = 'red' if self.saisine_type and self.saisine_type.delay: diff --git a/archaeological_files/templates/ishtar/sheet_file.html b/archaeological_files/templates/ishtar/sheet_file.html index 211d2b181..249a9846c 100644 --- a/archaeological_files/templates/ishtar/sheet_file.html +++ b/archaeological_files/templates/ishtar/sheet_file.html @@ -41,7 +41,7 @@ {% field_li "Type" item.file_type %} -{% if item.related_file %}<li><label>{%trans "Related file:"%}</label> <span class='value'><a href='#' onclick='load_window("{% url show-file item.related_file.pk ''%}")'>{{ item.related_file }}</a></span></li>{% endif %} +{% if item.related_file %}<li><label>{%trans "Related file:"%}</label> <span class='value'><a href='#' onclick='load_window("{% url show-file item.related_file.pk "" %}")'>{{ item.related_file }}</a></span></li>{% endif %} </ul> {% field "Comment" item.comment "<pre>" "</pre>" %} @@ -59,18 +59,18 @@ {% if item.is_preventive %} -<h3>{% trans "Preventive archaelogical file"%}</h3> +<h3>{% trans "Preventive archaeological file"%}</h3> <ul class='form-flex'> {% if item.total_developed_surface %}<li><label>{%trans "Developed surface:"%}</label> <span class='value'>{{ item.total_developed_surface }} m<sup>2</sup> ({{ item.total_developed_surface_ha }} ha)</span></li>{% endif %} {% field_li "Saisine type" item.saisine_type %} -{% field_li_detail "Responsible for town planning service" item.responsible_town_planning_service %} -{% field_li "Responsible for town planning service address" item.responsible_town_planning_service.full_address %} +{% field_li_detail "Responsible for planning service" item.responsible_town_planning_service %} +{% field_li "Responsible for planning service address" item.responsible_town_planning_service.full_address %} {% if item.town_planning_service %} - {% field_li "Town planning service organization" item.town_planning_service.full_address %} + {% field_li "Planning service organization" item.town_planning_service.full_address %} {% else %} - {% field_li "Town planning service organization" item.responsible_town_planning_service.attached_to.full_address %} + {% field_li "Planning service organization" item.responsible_town_planning_service.attached_to.full_address %} {% endif %} {% field_li "Permit type" item.permit_type %} @@ -129,10 +129,10 @@ <td class='string'>{{operation.in_charge|default:""}}</td> <td>{{operation.start_date|default:""}}</td> <td>{{operation.excavation_end_date|default:""}}</td> - <td class='link'><a href="#" class='display_details' onclick='load_window("{%url show-operation operation.pk ''%}")'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td> + <td class='link'><a href="#" class='display_details' onclick='load_window("{%url show-operation operation.pk "" %}")'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td> </tr> {% empty %} - <tr><td colspan="8" class='no_items'>{% trans "No operation associated to this archaelogical file" %}</td></tr> + <tr><td colspan="8" class='no_items'>{% trans "No operation associated to this archaeological file" %}</td></tr> {% endfor %} </table> </div> diff --git a/archaeological_files/urls.py b/archaeological_files/urls.py index b762a54b3..110851f80 100644 --- a/archaeological_files/urls.py +++ b/archaeological_files/urls.py @@ -50,14 +50,14 @@ urlpatterns = patterns( check_rights(['view_file', 'view_own_file'])( views.file_search_wizard), name='file_search'), - url(r'file_creation/(?P<step>.+)?$', + url(r'^file_creation/(?P<step>.+)?$', check_rights(['add_file'])( views.file_creation_wizard), name='file_creation'), - url(r'file_modification/(?P<step>.+)?$', + url(r'^file_modification/(?P<step>.+)?$', check_rights(['change_file', 'change_own_file'])( views.file_modification_wizard), name='file_modification'), - url(r'file_modify/(?P<pk>.+)/$', views.file_modify, name='file_modify'), - url(r'file_closing/(?P<step>.+)?$', + url(r'^file_modify/(?P<pk>.+)/$', views.file_modify, name='file_modify'), + url(r'^file_closing/(?P<step>.+)?$', check_rights(['change_file'])( views.file_closing_wizard), name='file_closing'), @@ -93,5 +93,5 @@ urlpatterns += patterns( 'archaeological_operations.views', url(r'file_administrativeact_document/$', 'administrativeactfile_document', - name='file-administrativeact-document', kwargs={'operation': False}), + name='file-administrativeact-document', kwargs={'file': True}), ) diff --git a/archaeological_files/wizards.py b/archaeological_files/wizards.py index ea06a48f7..1558cd46e 100644 --- a/archaeological_files/wizards.py +++ b/archaeological_files/wizards.py @@ -142,6 +142,7 @@ class FileDeletionWizard(FileClosingWizard): class FileAdministrativeActWizard(OperationAdministrativeActWizard): model = models.File current_obj_slug = 'administrativeactfile' + ref_object_key = 'associated_file' def get_reminder(self): form_key = 'selec-' + self.url_name @@ -151,7 +152,7 @@ class FileAdministrativeActWizard(OperationAdministrativeActWizard): file_id = self.session_get_value(form_key, "pk") try: return ( - (_(u"Archaelogical file"), + (_(u"Archaeological file"), unicode(models.File.objects.get(pk=file_id))),) except models.File.DoesNotExist: return @@ -161,7 +162,7 @@ class FileAdministrativeActWizard(OperationAdministrativeActWizard): admin = AdministrativeAct.objects.get(pk=admin_id) if not admin.associated_file: return - return ((_(u"Archaelogical file"), + return ((_(u"Archaeological file"), unicode(admin.associated_file)),) except AdministrativeAct.DoesNotExist: return |