diff options
Diffstat (limited to 'ishtar_common')
| -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 | 
4 files changed, 45 insertions, 89 deletions
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)  | 
