1 | {% extends "base.html" %} |
---|
2 | {% load i18n plmapp_tags %} |
---|
3 | |
---|
4 | <!-- Manage html display in the Content div which correspond to the "files" menu --> |
---|
5 | |
---|
6 | {% block scripts %} |
---|
7 | |
---|
8 | <script type="text/javascript"> |
---|
9 | $(document).ready(function () { |
---|
10 | $("#dialog_check-out").dialog({ |
---|
11 | modal: true, |
---|
12 | autoOpen: false |
---|
13 | }); |
---|
14 | $("a.check-out").click(function(e) { |
---|
15 | e.preventDefault(); |
---|
16 | var url = $(this).attr("href"); |
---|
17 | $("#dialog_check-out").dialog('option', 'buttons', { |
---|
18 | |
---|
19 | "CANCEL": function() { |
---|
20 | $(this).dialog("close"); |
---|
21 | |
---|
22 | }, |
---|
23 | "CHECK-OUT": function() { |
---|
24 | $(location).attr('href',url); |
---|
25 | $(this).dialog("close"); |
---|
26 | } |
---|
27 | |
---|
28 | }); |
---|
29 | $("#dialog_check-out").dialog(); |
---|
30 | $("#dialog_check-out").dialog("open"); |
---|
31 | return false; |
---|
32 | }); |
---|
33 | |
---|
34 | |
---|
35 | }); |
---|
36 | </script> |
---|
37 | |
---|
38 | {% endblock scripts %} |
---|
39 | |
---|
40 | {% block content %} |
---|
41 | |
---|
42 | {% if file_formset.total_form_count %} |
---|
43 | <form class="archive_form" method="GET" action="./archive/"> |
---|
44 | {{ archive_form.as_p }} |
---|
45 | <input type="submit" class="{{"Button"|button}}" value="{% trans "Download all files" %}"/> |
---|
46 | </form> |
---|
47 | {% endif %} |
---|
48 | <form method="POST" action=""> |
---|
49 | {% if is_owner and obj.is_editable %} |
---|
50 | {{ file_formset.management_form }} |
---|
51 | <a class="{{"Button"|button:"button-text-icon-primary"}}" href="./add/"> |
---|
52 | <span class="ui-button-icon-primary ui-icon ui-icon-document"> </span> |
---|
53 | <span class="ui-button-text">{% trans "ADD" %}</span> |
---|
54 | </a> |
---|
55 | {% if file_formset.total_form_count %} |
---|
56 | <input type="submit" class="{{"Button"|button}}" value="{% trans "DELETE" %}"/> |
---|
57 | {% endif %} |
---|
58 | {% else %} |
---|
59 | {# placeholder since archive_form: float is right #} |
---|
60 | <span> </span> |
---|
61 | {% endif %} |
---|
62 | <table class="Content"> |
---|
63 | {% for form in file_formset.forms %} |
---|
64 | <tr class="Content"> |
---|
65 | {{ form.id }} |
---|
66 | {{ form.document }} |
---|
67 | {% with form.instance as instance %} |
---|
68 | <td class="Content" style="width:50px; text-align:center">{{ form.delete }}</td> |
---|
69 | <td class="Content ui-state-default ui-state-corner-all"> |
---|
70 | {% if instance.locked %} |
---|
71 | <span class="ui-icon ui-icon-locked">{% trans "Locked" %}</span> |
---|
72 | {% else %} |
---|
73 | <span class="ui-icon ui-icon-unlocked">{% trans "Unlocked" %}</span> |
---|
74 | {% endif %} |
---|
75 | </td> |
---|
76 | <td class="Content"> |
---|
77 | <a href="/file/{{instance.id}}/{{instance.filename}}">{{instance.filename}}</a></td> |
---|
78 | <td class="Content">{{instance.size|filesizeformat}}</td> |
---|
79 | <td class="Content"> |
---|
80 | <a class="{{"Button"|button}}" href="/file/{{instance.id}}/"><span class="ui-button-text">{% trans "DOWNLOAD" %}</span></a> |
---|
81 | </td> |
---|
82 | <td class="Content"> |
---|
83 | |
---|
84 | {% if is_owner and obj.is_editable %} |
---|
85 | |
---|
86 | {% if instance.locked %} |
---|
87 | <a class="{{"Button"|button}}" href="./checkin/{{instance.id}}/"> |
---|
88 | <span class="ui-button-text check-in">{% trans "CHECK-IN" %}</span> |
---|
89 | </a> |
---|
90 | {% else %} |
---|
91 | |
---|
92 | {% if instance.checkout_valid %} |
---|
93 | |
---|
94 | <a class="{{"Button"|button}} |
---|
95 | {% if instance.native_related %}check-out {% endif %}" |
---|
96 | href="./checkout/{{instance.id}}/"> |
---|
97 | <span id="{{instance.id}}" class="ui-button-text">{% trans "CHECK-OUT" %}</span> |
---|
98 | </a> |
---|
99 | |
---|
100 | |
---|
101 | {% else %} |
---|
102 | {% trans "Native related file is locked" %} |
---|
103 | {% endif %} |
---|
104 | {% endif %} |
---|
105 | |
---|
106 | {% else %} |
---|
107 | {{ is_owner|yesno:"Object is not editable, you are not the owner" }} |
---|
108 | {% endif %} |
---|
109 | |
---|
110 | </td> |
---|
111 | <td class="Content"> |
---|
112 | {% if instance.thumbnail %} |
---|
113 | <img class="thumbnail" src="{{instance.thumbnail.url}}" |
---|
114 | alt="Thumbnail"/> |
---|
115 | {% else %} |
---|
116 | {% trans "No thumbnail available" %} |
---|
117 | {% endif %} |
---|
118 | </td> |
---|
119 | {% endwith %} |
---|
120 | </tr> |
---|
121 | {% endfor %} |
---|
122 | </table> |
---|
123 | |
---|
124 | </form> |
---|
125 | {% if can_generate_pdf %} |
---|
126 | <div> |
---|
127 | <a href="../pdf/" class="{{"Button"|button}}"> |
---|
128 | <span class="ui-button-text">{% trans "Download merged PDF files"%}</span> |
---|
129 | </a> |
---|
130 | </div> |
---|
131 | |
---|
132 | {% endif %} |
---|
133 | |
---|
134 | <div id="dialog_check-out" title="{% trans "Confirm CHECK-OUT" %}"> |
---|
135 | {% trans "You'are checking out a standardfile while a native file is available. Your native file will be deprecated and will not be usable anymore." %} |
---|
136 | </div> |
---|
137 | |
---|
138 | {% if deprecated_files %} |
---|
139 | |
---|
140 | <div id="deprecated_files"> |
---|
141 | <h6>{% trans "Deprecated files:" %}</h6> |
---|
142 | {% for doc_file in deprecated_files %} |
---|
143 | <p><a href="/file/{{doc_file.id}}/">{{doc_file.filename}}</a></p> |
---|
144 | {% endfor %} |
---|
145 | </div> |
---|
146 | {% endif %} |
---|
147 | {% endblock %} |
---|
148 | |
---|
149 | |
---|