diff --git a/resources/templates/dashboard/grid.twig b/resources/templates/dashboard/grid.twig index c78ec6b..7afd29c 100644 --- a/resources/templates/dashboard/grid.twig +++ b/resources/templates/dashboard/grid.twig @@ -34,11 +34,13 @@ -
- -
-
- bottom + +
+ +
+
+
+
diff --git a/resources/templates/dashboard/list.twig b/resources/templates/dashboard/list.twig index 33cdda2..7ed9039 100644 --- a/resources/templates/dashboard/list.twig +++ b/resources/templates/dashboard/list.twig @@ -40,9 +40,14 @@ {% endif %} - {{ media.filename }} + + {{ media.filename }} +

+ +

+ {{ media.size }} - + {% if media.published %} {% else %} diff --git a/resources/templates/user/index.twig b/resources/templates/user/index.twig index fb2eb2b..c641183 100644 --- a/resources/templates/user/index.twig +++ b/resources/templates/user/index.twig @@ -36,14 +36,14 @@
{{ user.user_code|default(lang('none')) }}
{{ humanFileSize(user.current_disk_quota) }}{% if quota_enabled == 'on' %}/{{ user.max_disk_quota > 0 ? humanFileSize(user.max_disk_quota) : '∞' }}{% endif %} - + {% if user.active %} {% else %} {% endif %} - + {% if user.is_admin %} {% else %} diff --git a/src/css/app.css b/src/css/app.css index 4e96fb8..0c3c208 100644 --- a/src/css/app.css +++ b/src/css/app.css @@ -184,4 +184,18 @@ body { .pt-2d5 { padding-top: .8rem +} + +.bg-light { + border: 0 !important; +} + +.form-control-verysm { + height: calc(1em + .2rem + 2px); + font-size: .8rem; +} + +.tag-item { + user-select: none; + cursor: pointer; } \ No newline at end of file diff --git a/src/js/app.js b/src/js/app.js index 295bb28..a7d45a5 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -29,6 +29,9 @@ var app = { $('.bulk-selector').contextmenu(app.bulkSelect); $('#bulk-delete').click(app.bulkDelete); + $('.tag-add').click(app.addTag); + $('.tag-item').dblclick(app.removeTag); + $('.alert').fadeTo(10000, 500).slideUp(500, function () { $('.alert').slideUp(500); }); @@ -138,6 +141,47 @@ var app = { }); }); $(this).addClass('disabled'); + }, + addTag: function (e) { + var $caller = $(this); + var $newAddTag = $caller.clone() + .click(app.addTag) + .appendTo($caller.parent()); + + var tagInput = $(document.createElement('input')) + .addClass('form-control form-control-verysm tag-input') + .keydown(function (e) { + if (e.keyCode === 13 || e.keyCode === 32) { // enter -> save tag + app.saveTag.call($(this)); // change context + if (e.keyCode === 32) { // space -> save and add new tag + $newAddTag.click(); + } + return false; + } + }) + .focusout(app.saveTag); + + $caller.off() + .removeClass('badge-success badge-light') + .html(tagInput) + .children() + .focus(); + }, + saveTag: function () { + var tag = $(this).val(); + if (tag === '') { + $(this).parent().remove(); + } + console.log(tag); + var $newTag = $(document.createElement('span')) + .addClass('badge badge-pill badge-light shadow-sm tag-item') + .dblclick(app.removeTag) + .text(tag); + $(this).parent().replaceWith($newTag); + }, + removeTag: function (e) { + e.preventDefault(); + $(this).remove(); } };