Last adjustments on CollectionEditionPage before revision. Closes #75.

This commit is contained in:
Mateus Machado Luna 2018-06-27 13:15:28 -03:00
parent 013cbdac95
commit 5a590bedb6
4 changed files with 105 additions and 55 deletions

View File

@ -10,7 +10,7 @@
<!-- Header Page -------------------------------- -->
<b-field :addons="false">
<label class="section-label">{{ $i18n.get('label_header_image') }}</label>
<label class="label">{{ $i18n.get('label_header_image') }}</label>
<div class="header-field">
<figure class="image">
<span
@ -26,14 +26,18 @@
id="button-edit-header-image"
:aria-label="$i18n.get('label_button_edit_header_image')"
@click="headerImageMediaFrame.openFrame($event)">
<b-icon icon="pencil" />
<b-icon
size="is-small"
icon="pencil" />
</a>
<a
class="button is-rounded is-secondary"
id="button-delete-header-image"
:aria-label="$i18n.get('label_button_delete_thumb')"
@click="deleteHeaderImage()">
<b-icon icon="delete" />
<b-icon
size="is-small"
icon="delete" />
</a>
</div>
</div>
@ -44,7 +48,7 @@
<!-- Thumbnail -------------------------------- -->
<b-field :addons="false">
<label class="section-label">{{ $i18n.get('label_thumbnail') }}</label>
<label class="label">{{ $i18n.get('label_thumbnail') }}</label>
<div class="thumbnail-field">
<figure class="image">
@ -62,14 +66,18 @@
id="button-edit-thumbnail"
:aria-label="$i18n.get('label_button_edit_thumb')"
@click.prevent="thumbnailMediaFrame.openFrame($event)">
<b-icon icon="pencil" />
<b-icon
size="is-small"
icon="pencil" />
</a>
<a
class="button is-rounded is-secondary"
id="button-delete-header-image"
:aria-label="$i18n.get('label_button_delete_thumb')"
@click="deleteThumbnail()">
<b-icon icon="delete" />
<b-icon
size="is-small"
icon="delete" />
</a>
</div>
</div>
@ -112,25 +120,45 @@
class="control selected-cover-page">
<span v-html="coverPage.title.rendered" />
<span class="selected-cover-page-control">
<a
target="_blank"
:href="coverPage.link">
<b-icon icon="eye"/>
</a>
&nbsp;&nbsp;
<a
target="blank"
:href="coverPageEditPath">
<b-icon icon="pencil"/>
</a>
&nbsp;&nbsp;
<a
target="_blank"
@click.prevent="removeCoverPage()">
<b-icon icon="delete"/>
<b-icon
size="is-small"
icon="close"/>
</a>
</span>
</div>
<span
:class="{'disabled': form.enable_cover_page != 'yes' || coverPage == undefined || coverPage.title == undefined}"
class="selected-cover-page-buttons">
<a
target="_blank"
:href="coverPage.link">
<b-icon
size="is-small"
icon="eye"/>
</a>
&nbsp;&nbsp;
<a
target="blank"
:href="coverPageEditPath">
<b-icon
size="is-small"
icon="pencil"/>
</a>
</span>
<br>
<a
class="is-inline add-link"
:class="{'disabled': form.enable_cover_page != 'yes'}"
target="_blank"
:href="newPagePath">
<b-icon
icon="plus-circle"
size="is-small"
type="is-secondary"/>
{{ $i18n.get('label_create_new_page') }}</a>
</b-field>
<!-- Enabled View Modes ------------------------------- -->
@ -206,6 +234,7 @@
:title="$i18n.getHelperTitle('collections', 'status')"
:message="$i18n.getHelperMessage('collections', 'status')"/>
<b-select
expanded
id="tainacan-select-status"
v-model="form.status"
@focus="clearErrors('status')"
@ -250,6 +279,32 @@
@focus="clearErrors('description')"/>
</b-field>
<!-- Parent Collection -------------------------------- -->
<b-field
:addons="false"
:label="$i18n.get('label_parent_collection')"
:type="editFormErrors['parent'] != undefined ? 'is-danger' : ''"
:message="editFormErrors['parent'] != undefined ? editFormErrors['parent'] : ''">
<help-button
:title="$i18n.getHelperTitle('collections', 'parent')"
:message="$i18n.getHelperMessage('collections', 'parent')"/>
<b-select
expanded
id="tainacan-select-parent"
v-model="form.parent"
@focus="clearErrors('parent')"
:loading="isFetchingCollections"
:placeholder="$i18n.get('instruction_select_a_parent_collection')">
<option value="0">{{ $i18n.get('label_no_parent_collection') }}</option>
<option
v-if="collection.id != anotherCollection.id"
v-for="anotherCollection of collections"
:key="anotherCollection.id"
:value="anotherCollection.id">{{ anotherCollection.name }}
</option>
</b-select>
</b-field>
<!-- Moderators List -------------------------------- -->
<b-field
:addons="false"
@ -307,31 +362,6 @@
v-model="form.slug"
@focus="clearErrors('slug')"/>
</b-field>
<!-- Parent Collection -------------------------------- -->
<b-field
:addons="false"
:label="$i18n.get('label_parent_collection')"
:type="editFormErrors['parent'] != undefined ? 'is-danger' : ''"
:message="editFormErrors['parent'] != undefined ? editFormErrors['parent'] : ''">
<help-button
:title="$i18n.getHelperTitle('collections', 'parent')"
:message="$i18n.getHelperMessage('collections', 'parent')"/>
<b-select
id="tainacan-select-parent"
v-model="form.parent"
@focus="clearErrors('parent')"
:loading="isFetchingCollections"
:placeholder="$i18n.get('instruction_select_a_parent_collection')">
<option value="0">{{ $i18n.get('label_no_parent_collection') }}</option>
<option
v-if="collection.id != anotherCollection.id"
v-for="anotherCollection of collections"
:key="anotherCollection.id"
:value="anotherCollection.id">{{ anotherCollection.name }}
</option>
</b-select>
</b-field>
</div>
</div>
@ -421,7 +451,8 @@ export default {
headerImageMediaFrame: undefined,
registeredViewModes: tainacan_plugin.registered_view_modes,
viewModesList: [],
fromImporter: ''
fromImporter: '',
newPagePath: tainacan_plugin.admin_url + 'post-new.php?post_type=page'
}
},
methods: {
@ -575,7 +606,7 @@ export default {
this.form.cover_page_id = selectedPage.id;
this.coverPage = selectedPage;
this.coverPageTitle = this.coverPage.title.rendered;
this.coverPageEditPath = tainacan_plugin.admin_url + '/post.php?post=' + selectedPage.id + '&action=edit';
this.coverPageEditPath = tainacan_plugin.admin_url + 'post.php?post=' + selectedPage.id + '&action=edit';
},
fecthModerators(search) {
this.isFetchingModerators = true;
@ -772,16 +803,17 @@ export default {
#button-delete-header-image {
border-radius: 100px !important;
height: 40px !important;
width: 40px !important;
height: 30px !important;
width: 30px !important;
z-index: 99;
margin-left: 16px !important;
margin-left: 10px !important;
.icon {
display: inherit;
padding: 0;
margin: 0;
margin-top: 1px;
font-size: 18px;
}
}
.header-field {
@ -806,7 +838,8 @@ export default {
}
.header-buttons-row {
text-align: right;
top: -42px;
top: -35px;
right: 5px;
position: relative;
}
}
@ -838,20 +871,27 @@ export default {
}
.thumbnail-buttons-row {
position: relative;
left: 80px;
left: 100px;
bottom: -136px;
}
}
.selected-cover-page {
background-color: $tainacan-input-background;
padding: 8px;
font-size: .85rem;
font-size: .75rem;
.span { vertical-align: middle;}
.selected-cover-page-control {
float: right;
}
}
.selected-cover-page-buttons {
float: right;
padding: 4px 6px;
.icon { font-size: 20px; }
&.disabled {
.icon { color: $tainacan-input-background; }
}
}
.moderators-empty-list {
color: gray;

View File

@ -58,7 +58,7 @@
visibility: hidden;
}
img {
width: 170px;
width: 172px;
height: auto;
border-radius: 2px;
}
@ -87,7 +87,7 @@
width: 100%;
.list-metadata {
padding: 0.75rem 1.5rem;
padding: 0.75rem 1.375rem;
flex: 1;
font-size: 0.6875rem;
color: gray;

View File

@ -52,6 +52,15 @@ a:hover {
.add-link {
display: inline;
font-size: 12px;
&.disabled {
pointer-events: none;
cursor: default;
color: $tainacan-input-background;
.icon {
color: $tainacan-input-background !important;
}
}
}
// Page settings

View File

@ -237,6 +237,7 @@ return apply_filters('tainacan-admin-i18n',[
'label_to_target_collection' => __( 'To target collection', 'tainacan' ),
'label_add_value' => __( 'Add value', 'tainacan' ),
'label_remove_value' => __( 'Remove value', 'tainacan' ),
'label_create_new_page' => __( 'Create new page', 'tainacan' ),
// Instructions. More complex sentences to guide user and placeholders
'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),