summaryrefslogtreecommitdiffstats
path: root/modules-available/exams
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-25 11:46:50 +0100
committerSimon Rettberg2019-03-25 11:46:50 +0100
commit03424ad19ac1bb42635a3d6653565aa0dc6ccf5a (patch)
treef3b068d5ca0aff6b897f98bb7eb7a5d097cec749 /modules-available/exams
parent[dozmod] How about implementing runscript deletion (diff)
downloadslx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.tar.gz
slx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.tar.xz
slx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.zip
Introduce JS helper for bootstrap confirm dialogs on button-submit
Diffstat (limited to 'modules-available/exams')
-rw-r--r--modules-available/exams/templates/page-exams.html22
1 files changed, 14 insertions, 8 deletions
diff --git a/modules-available/exams/templates/page-exams.html b/modules-available/exams/templates/page-exams.html
index df6a7dc9..89743c95 100644
--- a/modules-available/exams/templates/page-exams.html
+++ b/modules-available/exams/templates/page-exams.html
@@ -5,6 +5,8 @@
</div>
<div class="panel-body">
<div class="slx-space">
+ <form method="POST" action="?do=exams&amp;action=delete">
+ <input type="hidden" name="token" value="{{token}}">
<table class="table stupidtable">
<thead>
<tr>
@@ -39,20 +41,24 @@
<td class="text-nowrap" data-sort-value={{starttime}}>{{starttime_s}}</td>
<td class="text-nowrap" data-sort-value={{endtime}}>{{endtime_s}}</td>
<td class="text-nowrap text-right">
- <form method="POST" action="?do=exams&action=delete" {{^liesInPast}}onsubmit="return confirm('{{lang_deleteConfirmation}}');"{{/liesInPast}} >
- {{^liesInPast}}
- <a onclick="slxShow({{starttime}}, {{endtime}})" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-eye-open"></span></a>
- {{/liesInPast}}
- <a href="?do=exams&action=edit&examid={{examid}}" class="btn btn-default btn-sm {{edit.disabled}}"><span class="glyphicon glyphicon-edit"></span></a> <input type="hidden" name="token" value="{{token}}">
- <input type="hidden" name="examid" value="{{examid}}">
- <button {{edit.disabled}} class="btn {{btnClass}} btn-sm"><span class="glyphicon glyphicon-trash"></span></button>
- </form>
+ {{^liesInPast}}
+ <a onclick="slxShow({{starttime}}, {{endtime}})" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-eye-open"></span></a>
+ {{/liesInPast}}
+ <a href="?do=exams&amp;action=edit&amp;examid={{examid}}" class="btn btn-default btn-sm {{edit.disabled}}">
+ <span class="glyphicon glyphicon-edit"></span>
+ </a>
+ <button type="submit" {{edit.disabled}} class="btn {{btnClass}} btn-sm" name="examid" value="{{examid}}"
+ {{^liesInPast}}data-confirm="#confirm-delete" data-title="{{description}}"{{/liesInPast}}>
+ <span class="glyphicon glyphicon-trash"></span>
+ </button>
</td>
</tr>
{{/exams}}
</tbody>
</table>
+ </form>
</div>
+ <div class="hidden" id="confirm-delete">{{lang_deleteConfirmation}}</div>
<div class="text-right">
<div class="btn-group" role="group">
<a href="?do=exams&action=add" class="btn btn-success {{perms.exams.edit.disabled}}"><span class="glyphicon glyphicon-plus-sign"></span> {{lang_addExam}}</a>