Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / drafts / form.html
diff --git a/templates/webpages/drafts/form.html b/templates/webpages/drafts/form.html
new file mode 100644 (file)
index 0000000..1036de6
--- /dev/null
@@ -0,0 +1,43 @@
+[%- USE T8 %]
+[%- USE L %]
+[%- USE LxERP %]
+[%- USE HTML %]
+
+[% INCLUDE 'common/flash.html' %]
+
+[%- IF FORM.id %]
+<h3>[% 'Update this draft.' | $T8 %]</h3>
+[%- ELSE %]
+<h3>[% 'Save as a new draft.' | $T8 %]</h3>
+[%- END %]
+
+[% L.hidden_tag('', FORM.id, id='new_draft_id') %]
+[% 'Description' | $T8 %]: [% L.input_tag('new_draft_description', FORM.description) %]
+[% L.button_tag('kivi.Draft.save("' _ HTML.escape(SELF.module) _ '", "' _ HTML.escape(SELF.submodule) _ '")', LxERP.t8('Save draft')) %]
+
+[%- IF drafts_list.size %]
+<h3>[% 'Load an existing draft' | $T8 %]</h3>
+
+<p>[% 'Warning! Loading a draft will discard unsaved data!' | $T8 %]</p>
+
+<table>
+ <tr class="listheading">
+  <th>[% 'Date' | $T8 %]</th>
+  <th>[% 'Description' | $T8 %]</th>
+ </tr>
+
+[% FOREACH row = drafts_list %]
+ <tr class="listrow">
+  <td>[% row.date | html %]</td>
+  <td>
+  [%- IF row.id == FORM.id %]
+   <b>[% row.description | html %]</b>
+  [%- ELSE %]
+   [% L.link(SELF.url_for(action='load',id=row.id), row.description) %]
+  [%- END %]
+  </td>
+  <td>[% L.html_tag('span', LxERP.t8('Delete'), class='cursor-pointer interact', onclick="kivi.Draft.delete('" _ row.id _ "')") %]</a></td>
+ </tr>
+[% END %]
+</table>
+[%- END %]