From 9e42291e3430a2efcb96503a3363fa45fa0e54d7 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Tue, 22 May 2018 14:44:51 -0300 Subject: [PATCH 1/3] Implements tabs on Collection List --- .../components/lists/collections-list.vue | 4 +-- src/admin/components/lists/items-list.vue | 2 +- src/admin/pages/lists/collections-page.vue | 32 ++++++++++++++++--- src/admin/scss/tainacan-admin.scss | 7 +++- src/js/store/modules/collection/actions.js | 9 ++++-- 5 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/admin/components/lists/collections-list.vue b/src/admin/components/lists/collections-list.vue index d8b2986d8..8c3dd35ec 100644 --- a/src/admin/components/lists/collections-list.vue +++ b/src/admin/components/lists/collections-list.vue @@ -331,7 +331,7 @@ export default { .selection-control { - padding: 6px 0px 0px 18px; + padding: 6px 0px 0px 12px; background: white; height: 40px; @@ -394,7 +394,7 @@ export default { justify-content: center; } - label.control-label { + label span.control-label { display: none; } &.is-selecting { diff --git a/src/admin/components/lists/items-list.vue b/src/admin/components/lists/items-list.vue index 230a725d0..29b1be4e3 100644 --- a/src/admin/components/lists/items-list.vue +++ b/src/admin/components/lists/items-list.vue @@ -294,7 +294,7 @@ export default { .selection-control { - padding: 6px 0px 0px 18px; + padding: 6px 0px 0px 12px; background: white; height: 40px; diff --git a/src/admin/pages/lists/collections-page.vue b/src/admin/pages/lists/collections-page.vue index b33940856..a6e7d88e9 100644 --- a/src/admin/pages/lists/collections-page.vue +++ b/src/admin/pages/lists/collections-page.vue @@ -30,6 +30,19 @@
+
{ this.isLoading = false; this.totalCollections = res.total; @@ -134,9 +151,11 @@ export default { }, computed: { collections(){ + let collectionsList = this.getCollections(); for (let collection of collectionsList) collection['creation'] = this.$i18n.get('info_created_by') + collection['author_name'] + '
' + this.$i18n.get('info_date') + collection['creation_date']; + return collectionsList; } }, @@ -185,7 +204,12 @@ export default { } } } - + .tabs { + padding-top: 20px; + margin-bottom: 20px; + padding-left: $page-side-padding; + padding-right: $page-side-padding; + } .above-subheader { margin-bottom: 0; margin-top: 0; diff --git a/src/admin/scss/tainacan-admin.scss b/src/admin/scss/tainacan-admin.scss index 3580df753..125a601b9 100644 --- a/src/admin/scss/tainacan-admin.scss +++ b/src/admin/scss/tainacan-admin.scss @@ -549,7 +549,12 @@ a:hover { overflow: auto; .table { tbody { - td { border-bottom: 0px solid $gray-light !important; } + td { + border-bottom: 0px solid $gray-light !important; + } + .b-checkbox.checkbox .control-label { + display: none; + } } .th-wrap { font-size: 12px !important; diff --git a/src/js/store/modules/collection/actions.js b/src/js/store/modules/collection/actions.js index b99053675..fec8b715e 100644 --- a/src/js/store/modules/collection/actions.js +++ b/src/js/store/modules/collection/actions.js @@ -43,10 +43,15 @@ export const deleteItem = ({ commit }, item_id ) => { }); }; -export const fetchCollections = ({commit} , { page, collectionsPerPage }) => { +export const fetchCollections = ({commit} , { page, collectionsPerPage, status }) => { commit('cleanCollections'); return new Promise((resolve, reject) => { - axios.tainacan.get('/collections?paged='+page+'&perpage='+collectionsPerPage+'&context=edit') + let endpoint = '/collections?paged='+page+'&perpage='+collectionsPerPage+'&context=edit'; + + if (status != '' && status != undefined) + endpoint = endpoint + '&status=' + status; + + axios.tainacan.get(endpoint) .then(res => { let collections = res.data; commit('setCollections', collections); From c321cd0c937ae953b66438a152395f1dde53ef70 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Tue, 22 May 2018 15:35:36 -0300 Subject: [PATCH 2/3] Finishes implementation of tabs in collection list --- .../edition/collection-edition-form.vue | 4 +-- .../components/edition/item-edition-form.vue | 4 +-- .../components/lists/collections-list.vue | 33 ++++------------- src/admin/components/lists/items-list.vue | 2 +- src/admin/pages/lists/collections-page.vue | 36 +++++++++++++++++-- src/admin/tainacan-admin-i18n.php | 2 ++ 6 files changed, 46 insertions(+), 35 deletions(-) diff --git a/src/admin/components/edition/collection-edition-form.vue b/src/admin/components/edition/collection-edition-form.vue index 9aad87c53..b31c588c9 100644 --- a/src/admin/components/edition/collection-edition-form.vue +++ b/src/admin/components/edition/collection-edition-form.vue @@ -25,12 +25,12 @@
{{ $i18n.get('label_empty_thumbnail') }} + :src="(collection.thumbnail.thumb == undefined || collection.thumbnail.thumb == false) ? thumbPlaceholderPath : collection.thumbnail.thumb">
{{ $i18n.get('label_empty_thumbnail') }} -
+
@@ -11,7 +13,7 @@
- - -
-
-
-

- -

-

{{ $i18n.get('info_no_collection_created') }}

- - {{ $i18n.getFrom('collections', 'new_item') }} - -
-
-
-
@@ -319,8 +299,7 @@ export default { // document.addEventListener('mouseup', function () { // thElm = undefined; // }); - // })(); - + // })(); } } @@ -331,7 +310,7 @@ export default { .selection-control { - padding: 6px 0px 0px 12px; + padding: 6px 0px 0px 13px; background: white; height: 40px; diff --git a/src/admin/components/lists/items-list.vue b/src/admin/components/lists/items-list.vue index 29b1be4e3..54d555232 100644 --- a/src/admin/components/lists/items-list.vue +++ b/src/admin/components/lists/items-list.vue @@ -294,7 +294,7 @@ export default { .selection-control { - padding: 6px 0px 0px 12px; + padding: 6px 0px 0px 13px; background: white; height: 40px; diff --git a/src/admin/pages/lists/collections-page.vue b/src/admin/pages/lists/collections-page.vue index a6e7d88e9..3a08a09e8 100644 --- a/src/admin/pages/lists/collections-page.vue +++ b/src/admin/pages/lists/collections-page.vue @@ -3,7 +3,7 @@
+ v-if="checkIfUserCanEdit()">