diff --git a/templates/shortcut/list.html.ep b/templates/shortcut/list.html.ep new file mode 100644 index 0000000000000000000000000000000000000000..120df12ad724288bfc3f56854203aac151c6bfd0 --- /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>