Display resolved attribute URL or fallback

Update template code to display the resolved attribute's absolute_url
and if it doesn't provide it, fallback to display the main object's
absolute_url.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-24 04:12:39 -04:00
parent b848737515
commit 32fb40548a
2 changed files with 2 additions and 2 deletions

View File

@@ -75,7 +75,7 @@
{% get_source_columns source=object only_identifier=True as source_column %}
{% source_column_resolve column=source_column as column_value %}
{% if source_column.is_absolute_url %}
<a href="{{ column_value.get_absolute_url }}">{{ column_value }}</a>
<a href="{{ column_value.get_absolute_url|default:object.get_absolute_url }}">{{ column_value }}</a>
{% else %}
{{ column_value }}
{% endif %}

View File

@@ -108,7 +108,7 @@
{% if column_value %}
<td>
{% if source_column.is_absolute_url %}
<a href="{{ column_value.get_absolute_url }}">{{ column_value }}</a>
<a href="{{ column_value.get_absolute_url|default:object.get_absolute_url }}">{{ column_value }}</a>
{% else %}
{{ column_value }}
{% endif %}