Layout adjustments on ItemEditionPage.

This commit is contained in:
Mateus Machado Luna 2018-05-22 09:18:51 -03:00
parent c6b4b80f15
commit df0aada293
3 changed files with 71 additions and 25 deletions

View File

@ -1,6 +1,11 @@
<template> <template>
<div> <div>
<tainacan-title /> <tainacan-title />
<button
id="metadata-column-compress-button"
@click="isMetadataColumnCompressed = !isMetadataColumnCompressed">
<b-icon :icon="isMetadataColumnCompressed ? 'menu-left' : 'menu-right'" />
</button>
<form <form
v-if="!isLoading" v-if="!isLoading"
class="tainacan-form" class="tainacan-form"
@ -99,14 +104,14 @@
<div v-html="item.document_as_html" /> <div v-html="item.document_as_html" />
<button <button
type="button" type="button"
class="button is-primary" class="button is-secondary"
size="is-small" size="is-small"
@click.prevent="setURLDocument()"> @click.prevent="setURLDocument()">
{{ $i18n.get('edit') }} {{ $i18n.get('edit') }}
</button> </button>
<button <button
type="button" type="button"
class="button is-primary" class="button is-secondary"
size="is-small" size="is-small"
@click.prevent="removeDocument()"> @click.prevent="removeDocument()">
{{ $i18n.get('remove') }} {{ $i18n.get('remove') }}
@ -229,14 +234,21 @@
@click.prevent="thumbnailMediaFrame.openFrame($event)"> @click.prevent="thumbnailMediaFrame.openFrame($event)">
<b-icon icon="pencil" /> <b-icon icon="pencil" />
</a> </a>
<figure class="image"> <file-item
<span v-if="item.thumbnail != undefined && item.thumbnail != false"
:show-name="false"
:file="{
media_type: 'image',
guid: { rendered: item.thumbnail.thumb },
title: { rendered: $i18n.get('label_thumbnail')},
description: { rendered: `<img alt='Thumbnail' src='` + item.thumbnail.full + `'/>` }}"/>
<figure
v-if="item.thumbnail == undefined || item.thumbnail == false" v-if="item.thumbnail == undefined || item.thumbnail == false"
class="image-placeholder">{{ $i18n.get('label_empty_thumbnail') }}</span> class="image">
<span class="image-placeholder">{{ $i18n.get('label_empty_thumbnail') }}</span>
<img <img
id="thumbail-image"
:alt="$i18n.get('label_thumbnail')" :alt="$i18n.get('label_thumbnail')"
:src="(item.thumbnail == undefined || item.thumbnail == false) ? thumbPlaceholderPath : item.thumbnail.thumb"> :src="thumbPlaceholderPath">
</figure> </figure>
<div class="thumbnail-buttons-row"> <div class="thumbnail-buttons-row">
<a <a
@ -266,15 +278,20 @@
<div class="uploaded-files"> <div class="uploaded-files">
<file-item <file-item
:style="{ margin: 12 + 'px'}"
v-if="attachmentsList.length > 0"
v-for="(attachment, index) in attachmentsList" v-for="(attachment, index) in attachmentsList"
:key="index" :key="index"
:show-name="true" :show-name="true"
:file="attachment"/> :file="attachment"/>
<p v-if="attachmentsList.length <= 0"><br>{{ $i18n.get('info_no_attachments_on_item_yet') }}</p>
</div> </div>
</div> </div>
</div> </div>
<div class="column is-4-5"> <div
class="column is-4-5"
v-show="!isMetadataColumnCompressed">
<label class="section-label">{{ $i18n.get('fields') }}</label> <label class="section-label">{{ $i18n.get('fields') }}</label>
<br> <br>
<a <a
@ -319,6 +336,7 @@ export default {
item: null, item: null,
collectionId: Number, collectionId: Number,
isLoading: false, isLoading: false,
isMetadataColumnCompressed: false,
fieldCollapses: [], fieldCollapses: [],
collapseAll: false, collapseAll: false,
form: { form: {
@ -353,6 +371,14 @@ export default {
textLink: '' textLink: ''
} }
}, },
computed: {
fieldList() {
return JSON.parse(JSON.stringify(this.getFields()));
},
attachmentsList(){
return this.getAttachments();
}
},
components: { components: {
FileItem FileItem
}, },
@ -593,14 +619,6 @@ export default {
this.fieldCollapses.splice(index, 1, event); this.fieldCollapses.splice(index, 1, event);
} }
}, },
computed: {
fieldList() {
return JSON.parse(JSON.stringify(this.getFields()));
},
attachmentsList(){
return this.getAttachments();
}
},
created(){ created(){
// Obtains collection ID // Obtains collection ID
this.cleanFields(); this.cleanFields();
@ -666,6 +684,27 @@ export default {
@import '../../scss/_variables.scss'; @import '../../scss/_variables.scss';
#metadata-column-compress-button {
position: relative;
z-index: 99;
float: right;
max-width: 36px;
height: 36px;
width: 36px;
border: none;
background-color: $tainacan-input-background;
color: $secondary;
padding: 0px;
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
cursor: pointer;
.icon {
margin-top: 2px;
margin-right: 8px;
}
}
.page-container { .page-container {
padding: 25px 0px; padding: 25px 0px;
@ -682,11 +721,13 @@ export default {
width: 45.833333333%; width: 45.833333333%;
padding-left: $page-side-padding; padding-left: $page-side-padding;
padding-right: $page-side-padding; padding-right: $page-side-padding;
transition: width 0.6s;
} }
.column.is-4-5 { .column.is-4-5 {
width: 37.5%; width: 37.5%;
padding-left: $page-side-padding; padding-left: $page-side-padding;
padding-right: $page-side-padding; padding-right: $page-side-padding;
transition: all 0.6s;
} }
} }
@ -709,7 +750,7 @@ export default {
.section-box { .section-box {
border: 1px solid $draggable-border-color; border: 1px solid $draggable-border-color;
background-color: white; background-color: white;
padding: 30px; padding: 26px;
margin-top: 16px; margin-top: 16px;
margin-bottom: 38px; margin-bottom: 38px;
@ -736,15 +777,15 @@ export default {
} }
} }
.section-status{ .section-status{
width: 168px; width: 174px;
} }
.section-thumbnail { .section-thumbnail {
width: 168px; width: 174px;
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
} }
.section-attachments { .section-attachments {
height: 400px; height: 250px;
max-width: 100%; max-width: 100%;
resize: vertical; resize: vertical;
overflow: auto; overflow: auto;
@ -805,6 +846,9 @@ export default {
top: -3px; top: -3px;
position: relative; position: relative;
} }
i.mdi-24px.mdi-set, i.mdi-24px.mdi::before {
font-size: 20px;
}
} }
} }

View File

@ -28,7 +28,7 @@
scroll="keep"> scroll="keep">
<div class="tainacan-modal-content"> <div class="tainacan-modal-content">
<div class="tainacan-modal-title"> <div class="tainacan-modal-title">
<h2>{{ $i18n.get('label_attachment') + ': ' + file.title.rendered }}</h2> <h2>{{ file.title.rendered }}</h2>
<hr> <hr>
</div> </div>
<div <div
@ -80,8 +80,6 @@ export default {
.file-item { .file-item {
margin: 12px;
&:hover { &:hover {
cursor: pointer; cursor: pointer;
.image, .file-placeholder { .image, .file-placeholder {
@ -137,6 +135,9 @@ export default {
text-align: center; text-align: center;
} }
} }
.is-flex {
justify-content: center;
}
</style> </style>

View File

@ -254,6 +254,7 @@ return [
'info_possible_external_sources' => __( 'Possible external sources: CSV, Instagram, Youtube, etc.', 'tainacan' ), 'info_possible_external_sources' => __( 'Possible external sources: CSV, Instagram, Youtube, etc.', 'tainacan' ),
'info_help_term_name' => __( 'The term name', 'tainacan' ), 'info_help_term_name' => __( 'The term name', 'tainacan' ),
'info_help_term_description' => __( 'The description of the Term.', 'tainacan' ), 'info_help_term_description' => __( 'The description of the Term.', 'tainacan' ),
'info_no_attachments_on_item_yet' => __( 'The are no attachments on this item so far.', 'tainacan' ),
// Tainacan Field Types // Tainacan Field Types
'tainacan-text' => __( 'Text', 'tainacan' ), 'tainacan-text' => __( 'Text', 'tainacan' ),