Browse Source

Cria forma provisoria para colocar links nas URLs nas telas de detail

pull/713/head
Eduardo Calil 8 years ago
parent
commit
935dff1add
  1. 9
      sapl/base/templatetags/common_tags.py
  2. 7
      sapl/templates/crud/detail.html

9
sapl/base/templatetags/common_tags.py

@ -140,3 +140,12 @@ def str2intabs(value):
return v
except:
return ''
@register.filter
def url(value):
# import ipdb; ipdb.set_trace()
string = value[:8]
if 'http://' in string or 'https://' in string:
return True
return False

7
sapl/templates/crud/detail.html

@ -38,7 +38,12 @@
<div id="div_id_{{ column.id }}" class="form-group">
<p class="control-label">{{ column.verbose_name }}</p>
<div class="controls">
<div class="form-control-static">{{ column.text|safe }}</div>
<!-- TODO Transformar os links em URLs diretamente no CRUD -->
{% if column.text|url %}
<div class="form-control-static"><a href="{{ column.text|safe }}"> {{ column.text|safe }} </a></div>
{% else %}
<div class="form-control-static">{{ column.text|safe }}</div>
{% endif %}
</div>
</div>
</div>

Loading…
Cancel
Save