summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/blocks/sheet_document_list.html
blob: 1a18496362638108395e3d190892a74782d15cdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{% load i18n l10n ishtar_helpers link_to_window %}
    {% with can_edit_current_item=item|can_edit_item:request %}
    <h3>{% trans "Associated documents" %}</h3>
    {% if item.documents.count %}
    <table class='table table-striped datatables'
           id="{{window_id}}-docs-table">
        {% for doc in item.documents.all %}{% if not forloop.counter0 %}
        <thead>
            <tr>
                <th>&nbsp;</th>
                <th>{% trans "Title" %}</th>
                <th>{% trans "Type" %}</th>
                <th>{% trans "Authors" %}</th>
                <th>{% trans "Numerical ressource" %}</th>
                {% if not IS_HISTORY and permission_change_document %}<th>&nbsp;</th>{% endif %}
                {% if not IS_HISTORY and permission_change_item %}<th>&nbsp;</th>{% endif %}
            </tr>
        </thead>
        {% endif %}
        <tr>
            <td>
                <a class="display_details" href="#" onclick="load_window('{% url 'show-document' doc.id '' %}')"><i class="fa fa-info-circle" aria-hidden="true"></i></a>
            </td>
            <td>
                {{doc.title|default:'-'}}
            </td>
            <td>
                {{doc.source_type|default:'-'}}
            </td>
            <td>
                {{doc.authors_list|default:'-'}}
            </td>
            <td>{% if doc.associated_url %}
                <a href='{{doc.associated_url}}' target="_blank">{% trans "Link" %} <i class="fa fa-external-link" aria-hidden="true"></i></a>
                {% else%}-{% endif %}
            </td>
            {% if not IS_HISTORY and permission_change_document %}<td>
            {% autoescape off %}{% if doc|can_edit_item:request %}
            <a class="btn btn-success btn-sm" title="{% trans 'Edit' %}" href="{% url 'edit-document' doc.pk %}"><i class="fa fa-pencil"></i></a>
            {% else %}&ndash;{% endif %}{% endautoescape %}
            </td>{% endif %}
            {% if not IS_HISTORY and permission_change_item %}<td>
            {% autoescape off %}
            <a class="btn-qa btn btn-danger btn-sm wait-button" title="{% trans 'Unlink' %}" href="#" data-target='{% url 'document-qa-unlink' doc.pk model_slug item.pk %}'><i class="fa fa-chain-broken" aria-hidden="true"></i></a>
            {% endautoescape %}
            </td>{% endif %}
        </tr>
        {% endfor %}
    </table>
    {% elif item.documents_list %}
    {% include "ishtar/blocks/api_document_list.html" %}
    {% endif %}
    {% endwith %}