diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/models_common.py | 6 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/blocks/window_field_flex.html | 2 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html | 2 | 
3 files changed, 7 insertions, 3 deletions
| diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 9aec54534..403c020dc 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -751,10 +751,14 @@ class HierarchicalType(GeneralType):      class Meta:          abstract = True +    has_full_label = True +      def full_label(self):          lbls = [self.label]          item = self -        while item.parent: +        parents = [self.pk]  # prevent loop +        while item.parent and item.parent_id not in parents: +            parents.append(item.parent_id)              item = item.parent              lbls.append(item.label)          return " > ".join(reversed(lbls)) diff --git a/ishtar_common/templates/ishtar/blocks/window_field_flex.html b/ishtar_common/templates/ishtar/blocks/window_field_flex.html index 133750bee..b1cb1ed30 100644 --- a/ishtar_common/templates/ishtar/blocks/window_field_flex.html +++ b/ishtar_common/templates/ishtar/blocks/window_field_flex.html @@ -1,6 +1,6 @@  {% load i18n %}{% if data %}      <dl class="col-12 {% if size == 2 %}col-lg-6{% else %}col-md-6 col-lg-3{% endif %} flex-wrap">          <dt>{% trans caption %}</dt> -        <dd>{{pre_data|safe}}{{data|linebreaksbr}}{{post_data|safe }}</dd> +        <dd>{{pre_data|safe}}{% if data.has_full_label %}{{data.full_label}}{% else %}{{data|linebreaksbr}}{% endif %}{{post_data|safe }}</dd>      </dl>  {% endif %} diff --git a/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html b/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html index 1587963c5..4ed64cc05 100644 --- a/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html +++ b/ishtar_common/templates/ishtar/blocks/window_field_flex_multiple.html @@ -2,7 +2,7 @@  <dl class="col-12 {% if size == 2 %}col-lg-6{% else %}col-md-6 col-lg-3{% endif %} flex-wrap">      <dt>{% trans caption %}</dt>      <dd>{% if not external %}{% for d in data.all %} -        {% if forloop.counter0 %} ; {% endif %}{{ d }} +        {% if forloop.counter0 %} ; {% endif %}{% if d.has_full_label %}{{ d.full_label }}{% else %}{{d}}{% endif %}      {% endfor %}{% else %}{{data}}{% endif %}</dd>  </dl>  {% endif %} | 
