Show file extension
This commit is contained in:
parent
06b51a87ff
commit
9deba5b28f
3 changed files with 9 additions and 2 deletions
|
@ -1,9 +1,11 @@
|
||||||
|
{% load i18n %}
|
||||||
|
{% load main_extras %}
|
||||||
<table class="file-input">
|
<table class="file-input">
|
||||||
{% if widget.is_initial %}
|
{% if widget.is_initial %}
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ widget.initial_text }}</th>
|
<th>{{ widget.initial_text }}</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ widget.value.url }}">Fichier</a>
|
<a href="{{ widget.value.url }}">{% translate "File" %} [{{ widget.value|extension }}]</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if not widget.required %}
|
{% if not widget.required %}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<a href="{{ invoice.get_absolute_url }}">{{ invoice.name }}</a>
|
<a href="{{ invoice.get_absolute_url }}">{{ invoice.name }}</a>
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ invoice.file.url }}">{% translate "File" %}</a>
|
<a href="{{ invoice.file.url }}">{% translate "File" %} [{{ invoice.file|extension }}]</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ invoice.get_delete_url }}">{% translate "Delete" %}
|
<a href="{{ invoice.get_delete_url }}">{% translate "Delete" %}
|
||||||
|
|
|
@ -45,3 +45,8 @@ def form_buttons(instance):
|
||||||
@register.filter
|
@register.filter
|
||||||
def remix(icon):
|
def remix(icon):
|
||||||
return mark_safe(f"""<span class="ri-{icon}-line"></span>""")
|
return mark_safe(f"""<span class="ri-{icon}-line"></span>""")
|
||||||
|
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def extension(file):
|
||||||
|
return file.name.split(".")[-1].upper()
|
||||||
|
|
Loading…
Reference in a new issue