From b0574efcd695f85c4cfd6d27295758bdae70dbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrej=20Rama=C5=A1euski?= <andrej@x2.cz> Date: Tue, 2 Aug 2022 00:29:20 +0200 Subject: [PATCH] Seznam shortcutu --- templates/shortcut/list.html.ep | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 templates/shortcut/list.html.ep diff --git a/templates/shortcut/list.html.ep b/templates/shortcut/list.html.ep new file mode 100644 index 0000000..120df12 --- /dev/null +++ b/templates/shortcut/list.html.ep @@ -0,0 +1,45 @@ +<div class="card elevation-4 space-y-4 mt-2"> + <div class="card__body"> +<h2>Moje zkratky</h2> +<table id="Shortcuts" + class="table table--bordered" + data-row-style="rowStyle" + data-unique-id="id" + data-url="/api/shortcuts" > + + <thead> + <tr> + <th data-field="shortcut" data-width="10" data-width-unit="%" data-sortable="true">Zkratka</th> + <th data-field="url" data-width="90" data-width-unit="%" data-sortable="true">URL</th> + </tr> + </thead> +</table> + </div> +</div> + +<script> +$('#Shortcuts').bootstrapTable({ + ajaxOptions: { + headers: { + 'X-Auth-Token': '<%= $c->current_user->token %>' + } + }, + sortable: true, + pagination: true, + pageSize: 50, + paginationParts: ['pageInfo', 'pageList'], + sidePagination: 'server', +// onClickCell: function (field, value, row, $element) { +// window.location.href ='/archive/' + row.id; +// }, +}); + +function rowStyle(row, index) { + return { + css: { + cursor: 'pointer' + } + } +} + +</script> -- GitLab