diff --git a/gui/app/components/folder/settings-category.js b/gui/app/components/folder/settings-category.js index 4154ee6b..f60f5c4c 100644 --- a/gui/app/components/folder/settings-category.js +++ b/gui/app/components/folder/settings-category.js @@ -22,6 +22,8 @@ export default Component.extend(ModalMixin, Notifer, { categorySvc: service('category'), appMeta: service(), store: service(), + editId: '', + editName: '', deleteId: '', newCategory: '', @@ -122,6 +124,14 @@ export default Component.extend(ModalMixin, Notifer, { }); }, + onShowEdit(id) { + let cat = this.get('category').findBy('id', id); + this.set('editId', cat.get('id')); + this.set('editName', cat.get('category')); + + this.modalOpen('#category-edit-modal', {show: true}, "#edit-category-id"); + }, + onShowDelete(id) { let cat = this.get('category').findBy('id', id); this.set('deleteId', cat.get('id')); @@ -137,24 +147,18 @@ export default Component.extend(ModalMixin, Notifer, { }); }, - onEdit(id) { - this.setEdit(id, true); - }, - - onEditCancel(id) { - this.setEdit(id, false); - this.load(); - }, - - onSave(id) { - let cat = this.setEdit(id, true); - if (cat.get('category') === '') { - $('#edit-category-' + cat.get('id')).addClass('is-invalid').focus(); + onSave() { + let name = this.get('editName'); + if (name === '') { + $('#edit-category-name').addClass('is-invalid').focus(); return false; } - cat = this.setEdit(id, false); - $('#edit-category-' + cat.get('id')).removeClass('is-invalid'); + let cat = this.get('category').findBy('id', this.get('editId')); + cat.set('category', name); + + this.modalClose('#category-edit-modal'); + $('#edit-category-name').removeClass('is-invalid'); this.get('categorySvc').save(cat).then(() => { this.load(); diff --git a/gui/app/styles/core/view/space.scss b/gui/app/styles/core/view/space.scss index f736cf9a..bb016638 100644 --- a/gui/app/styles/core/view/space.scss +++ b/gui/app/styles/core/view/space.scss @@ -195,37 +195,48 @@ } } + .add-users { + text-align: center; + + > .item { + margin: 7px; + display: inline-block; + } + } + > .categories { padding: 0; margin: 0; - > .item { - margin: 15px 0; - padding: 15px; + > .category { @include card(); - @include ease-in(); + list-style-type: none; + margin: 0 0 2rem 0; + padding: 15px 20px; + width: 100%; + position: relative; - > .category { - display: inline-block; + > .info { + padding: 0; + align-self: self-start; + justify-self: self-start; > .name { - font-size: 1.2rem; - color: $theme-500; + font-size: 1.3rem; + font-weight: 700; + color: map-get($gray-shades, 800); } - > .info { - font-size: 0.9rem; - margin-top: 8px; - color: map-get($gray-shades, 600); + > .desc { + font-size: 1.1rem; + font-weight: 400; + margin-top: 0.4rem; + color: $color-black-light-3; } } - > .buttons { - margin-top: 5px; - } - - > .action { - display: inline-block; + > .actions { + margin-top: 20px; } } } diff --git a/gui/app/templates/components/folder/documents-list.hbs b/gui/app/templates/components/folder/documents-list.hbs index 032ea82a..d49f0411 100644 --- a/gui/app/templates/components/folder/documents-list.hbs +++ b/gui/app/templates/components/folder/documents-list.hbs @@ -8,9 +8,9 @@ {{/link-to}}