Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / record_template / dialog.html
1 [%- USE T8 %]
2 [%- USE L %]
3 [%- USE LxERP %]
4 [%- USE HTML %][%- USE JavaScript -%]
5
6 [% L.hidden_tag("", SELF.template_type, id="record_template_dialog_template_type",
7                 "data-controller"=SELF.data.controller,
8                 "data-load_action"=SELF.data.load_action,
9                 "data-save_action"=SELF.data.save_action,
10                 "data-form_selector"=SELF.data.form_selector) %]
11
12 <h2 class="listheading">[% LxERP.t8("Add new record template") %]</h2>
13
14 <p>
15  [% LxERP.t8("Name") %]:
16  [% L.input_tag("", "", id="record_template_dialog_new_template_name") %]
17  [% L.button_tag("kivi.RecordTemplate.create()", LxERP.t8("Save")) %]
18 </p>
19
20 <h2 class="listheading">[% LxERP.t8("Filter record template") %]</h2>
21 <p>
22 <form method="post" action="javascript:kivi.RecordTemplate.filter_templates()">
23  [% LxERP.t8("Name") %]:
24  [% L.input_tag("template_filter", SELF.template_filter) %]
25  [% L.submit_tag('', LxERP.t8("Filter")) %]
26  [% L.button_tag('$("#template_filter").val("")', LxERP.t8('Reset')) %]
27 </form>
28 </p>
29
30 [% SET templates = SELF.templates.as_list %]
31
32 [% IF templates.size %]
33
34 <h2 class="listheading">[% LxERP.t8("Existing templates") %]</h2>
35
36 <table>
37  <thead>
38   <tr class="listheading">
39    <th>[% LxERP.t8("Action") %]</th>
40    <th>[% LxERP.t8("Name") %]</th>
41    <th>[% LxERP.t8("Modification date") %]</th>
42   </tr>
43  </thead>
44
45  <tbody>
46 [% FOREACH template = templates %]
47   <tr class="listrow">
48    <td>
49     [% L.hidden_tag("", template.template_name, id="record_template_dialog_template_name_" _ template.id) %]
50     [% L.button_tag("kivi.RecordTemplate.load(" _ template.id _ ")", LxERP.t8("Load")) %]
51     [% L.button_tag("kivi.RecordTemplate.save(" _ template.id _ ")", LxERP.t8("Save")) %]
52     [% L.button_tag("kivi.RecordTemplate.rename(" _ template.id _ ")", LxERP.t8("Rename")) %]
53     [% L.button_tag("kivi.RecordTemplate.delete(" _ template.id _ ")", LxERP.t8("Delete")) %]
54    </td>
55    <td>[% HTML.escape(template.template_name) %]</td>
56    <td>[% HTML.escape(template.mtime.to_kivitendo) %] [% HTML.escape(template.mtime.to_kivitendo_time) %]</td>
57   </tr>
58 [% END %]
59  </tbody>
60
61 </table>
62 [% ELSE %]
63
64 <p>[% LxERP.t8("There are no record templates yet.") %]</p>
65
66 [% END %]