From ac4c4d2f5fa6536660b3ed38c9dfa1b9ce407f12 Mon Sep 17 00:00:00 2001 From: weryques Date: Fri, 18 May 2018 16:01:29 -0300 Subject: [PATCH] Adds a prototype of item page --- src/admin/pages/singles/item-page.vue | 284 ++++++++++++++++++-------- 1 file changed, 204 insertions(+), 80 deletions(-) diff --git a/src/admin/pages/singles/item-page.vue b/src/admin/pages/singles/item-page.vue index c7ed3ad2e..555de6ff1 100644 --- a/src/admin/pages/singles/item-page.vue +++ b/src/admin/pages/singles/item-page.vue @@ -3,91 +3,127 @@ + -
- - {{ $i18n.getFrom('items','edit_item') }} - - - {{ $i18n.getFrom('items', 'view_item') }} - -
+
+
+
+ + {{ $i18n.getFrom('items','edit_item') }} + + + {{ $i18n.getFrom('items', 'view_item') }} + -
-
-
-
+
+
-
-
-

- -

-
-
- {{ $i18n.get('label_thumbnail') }} + + +
+

{{ item.status }}

+
+ +
+ + + +
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+
+ +
+ + + +
+
+
+ + {{ attachment.title.rendered }} + +
+
+
+
+
+
+
+ +
+ + {{ open ? $i18n.get('label_collapse_all') : $i18n.get('label_expand_all') }} + + -
- -

-

-

--

- -

- - {{ metadata.name }} - -

-
- -
- -
- +
+
- {{ attachment.guid.rendered }} -
- + class="field"> + + +
+
+
+
+
+
+ +
-

--

- -

- - {{ $i18n.get('label_attachments') }} - -

-
@@ -101,24 +137,36 @@ return { collectionId: Number, itemId: Number, - isLoading: false + isLoading: false, + open: false, } }, methods: { ...mapActions('item', [ 'fetchItem', - 'fetchAttachments' + 'fetchAttachments', + 'fetchFields', ]), ...mapGetters('item', [ 'getItem', + 'getFields', 'getAttachments' ]), + loadMetadata() { + // Obtains Item Field + this.fetchFields(this.itemId).then(() => { + this.isLoading = false; + }); + }, }, computed: { item() { return this.getItem(); }, - attachments() { + fieldList() { + return JSON.parse(JSON.stringify(this.getFields())); + }, + attachmentsList() { return this.getAttachments(); } }, @@ -129,11 +177,10 @@ // Puts loading on Item Loading this.isLoading = true; - let loadingInstance = this; // Obtains Item this.fetchItem(this.itemId).then(() => { - loadingInstance.isLoading = false; + this.loadMetadata(); }); // Get attachments @@ -142,3 +189,80 @@ } + + +