Merge branch 'develop' of https://github.com/tainacan/tainacan into develop

This commit is contained in:
leogermani 2018-12-14 15:02:26 -02:00
commit c7d7099ca5
17 changed files with 116 additions and 145 deletions

View File

@ -714,7 +714,6 @@
.advanced-search-header-dropdown {
height: 27px !important;
padding-bottom: 2rem;
a, .has-text-secondary {
color: $blue4 !important;

View File

@ -46,6 +46,7 @@
<file-item
v-if="collection.thumbnail != undefined && ((collection.thumbnail['tainacan-medium'] != undefined && collection.thumbnail['tainacan-medium'] != false) || (collection.thumbnail.medium != undefined && collection.thumbnail.medium != false))"
:show-name="false"
:modal-on-click="false"
:size="178"
:file="{
media_type: 'image',
@ -797,6 +798,7 @@ export default {
'my-thumbnail-media-frame', {
button_labels: {
frame_title: this.$i18n.get('instruction_select_collection_thumbnail'),
frame_button: this.$i18n.get('label_select_file'),
},
relatedPostId: this.collectionId,
onSave: (mediaId) => {
@ -813,6 +815,7 @@ export default {
'my-header-image-media-frame', {
button_labels: {
frame_title: this.$i18n.get('instruction_select_collection_header_image'),
frame_button: this.$i18n.get('label_select_file'),
},
relatedPostId: this.collectionId,
onSave: (media) => {

View File

@ -51,7 +51,7 @@
class="is-block"
v-if="Object.keys(exporterSession).length &&
Object.keys(exporterSession.mapping_accept).length &&
exporterSession.mapping_accept.any"
exporterSession.mapping_list.length"
:label="$i18n.get('mapping')">
<b-select
@ -61,10 +61,10 @@
:placeholder="$i18n.get('instruction_select_a_mapper')">
<option :value="''">-</option>
<option
v-for="(mapping, key) in exporterSession.mapping_list"
:value="key"
:key="key">
{{ key.replace(/-/, ' ') }}
v-for="(mapping) in exporterSession.mapping_list"
:value="mapping"
:key="mapping">
{{ mapping.replace(/-/, ' ') }}
</option>
</b-select>
@ -102,6 +102,9 @@
</div>
</div>
</form>
<pre>
{{ exporterSession }}
</pre>
</div>
</template>
@ -174,11 +177,12 @@
formIsValid(){
return (
this.selectedCollection &&
((!this.exporterSession.accept_no_mapping && this.selectedMapping) ||
this.exporterSession.accept_no_mapping) &&
!this.formErrorMessage
);
},
verifyError(response){
console.log(response);
if(response.constructor.name === 'Object' &&
(response.data && response.data.status &&
response.data.status.toString().split('')[0] != 2) || response.error_message) {

View File

@ -251,6 +251,7 @@
<file-item
v-if="item.thumbnail != undefined && ((item.thumbnail['tainacan-medium'] != undefined && item.thumbnail['tainacan-medium'] != false) || (item.thumbnail.medium != undefined && item.thumbnail.medium != false))"
:show-name="false"
:modal-on-click="false"
:size="178"
:file="{
media_type: 'image',
@ -324,7 +325,8 @@
:key="index">
<file-item
:style="{ margin: 15 + 'px'}"
v-if="attachmentsList.length > 0"
v-if="attachmentsList.length > 0"
:modal-on-click="true"
:show-name="true"
:file="attachment"/>
<span class="file-item-control">

View File

@ -47,30 +47,17 @@
<div
class="tainacan-attachments-in-modal"
v-if="diff.old.length">
<template v-for="(attachment, anotherIndex ) in diff.old">
<div
<template v-for="(attachment, anotherIndex) in diff.old">
<file-item
:key="anotherIndex"
class="box"
v-if="attachment.mime_type.includes('image')">
<p class="tainacan-p-overflow">{{ `${$i18n.get('label_title')}: ${attachment.title}` }}</p>
<figure class="image tainacan-figure">
<img
width="100%"
style="height: 100% !important;"
:src="attachment.url"
:alt="attributeName">
</figure>
</div>
<div
:key="anotherIndex"
class="box"
v-else-if="['pdf', 'audio', 'video'].includes(attachment.mime_type.split('/')[1])">
<p class="tainacan-p-overflow">{{ `${$i18n.get('label_title')}: ${attachment.title}` }}</p>
<object
width="100%"
:data="attachment.url"
:type="attachment.mime_type"/>
</div>
:modal-on-click="false"
:show-name="true"
:file="{
title: { rendered: attachment.title },
guid: { rendered: attachment.url },
mime_type: attachment.mime_type,
media_type: attachment.mime_type.includes('image') ? 'image' : 'other'
}"/>
</template>
</div>
<div v-else>
@ -170,29 +157,16 @@
class="tainacan-attachments-in-modal"
v-if="diff.new.length">
<template v-for="(attachment, index) in diff.new">
<div
<file-item
:key="index"
class="box"
v-if="attachment.mime_type.includes('image')">
<p class="tainacan-p-overflow">{{ `${$i18n.get('label_title')}: ${attachment.title}` }}</p>
<figure class="image tainacan-figure">
<img
width="100%"
style="height: 100% !important;"
:src="attachment.url"
:alt="attributeName">
</figure>
</div>
<div
:key="index"
class="box"
v-else-if="['pdf', 'audio', 'video'].includes(attachment.mime_type.split('/')[1])">
<p class="tainacan-p-overflow">{{ `${$i18n.get('label_title')}: ${attachment.title}` }}</p>
<object
width="100%"
:data="attachment.url"
:type="attachment.mime_type"/>
</div>
:modal-on-click="false"
:show-name="true"
:file="{
title: { rendered: attachment.title },
guid: { rendered: attachment.url },
mime_type: attachment.mime_type,
media_type: attachment.mime_type.includes('image') ? 'image' : 'other'
}"/>
</template>
</div>
<div v-else>
@ -306,13 +280,13 @@
<!--<span>{{ $i18n.get('undo') }}</span>-->
<!--</button>-->
<button
<!-- <button
v-if="activity.status == 'publish'"
@click="$parent.close()"
type="button"
class="button is-secondary">
<span>OK</span>
</button>
</button> -->
</div>
</div>
</footer>
@ -321,6 +295,7 @@
<script>
import moment from 'moment';
import FileItem from '../file-item.vue';
export default {
name: "ActivityDetailsModal",
@ -335,6 +310,9 @@
placeholderSquareImage: `${tainacan_plugin.base_url}/admin/images/placeholder_square.png`,
}
},
components: {
FileItem
},
created() {
let locale = navigator.language;
@ -368,7 +346,10 @@
}
</script>
<style scoped>
<style lang="scss" scoped>
@import "../../scss/_variables.scss";
.tainacan-modal-title {
align-self: baseline;
display: flex;
@ -389,7 +370,16 @@
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-between;
align-content: baseline;
resize: vertical;
overflow-y: auto;
overflow-x: hidden;
height: 200px;
border: 1px solid $gray3;
&>div {
margin: 0.5rem;
}
}
.tainacan-p-overflow {

View File

@ -2,7 +2,8 @@
<div>
<figure
class="file-item"
@click="isPreviewModalActive = true">
:class="{'shows-modal-on-click' : modalOnClick}"
@click="modalOnClick? isPreviewModalActive = true : null">
<figcaption
:style="{ 'max-width': size != undefined ? size + 'px' : '112px' }"
v-if="showName && file.title != undefined">{{ file.title.rendered }}</figcaption>
@ -13,7 +14,7 @@
v-if="file.media_type == 'image'"
class="image"
:style="{ 'background-image': 'url(' + file.guid.rendered + ')' }"/>
<div
<div
:style="{ 'background-color': '#f2f2f2' }"
v-else
class="file-placeholder">
@ -22,41 +23,47 @@
:class="'tainacan-icon-' + getIconForMimeType(file.mime_type)"
class="has-text-gray tainacan-icon tainacan-icon-36px"/>
</span>
</div>
</div>
</div>
</figure>
<!-- Preview Modal ----------------- -->
<b-modal
:can-cancel="false"
:active.sync="isPreviewModalActive"
:width="640"
scroll="keep">
<div class="tainacan-modal-content">
<div class="tainacan-modal-title">
<h2 v-if="file.title != undefined">{{ file.title.rendered }}</h2>
<a
@click="isPreviewModalActive = false"
class="back-link">{{ $i18n.get('exit') }}</a>
<hr>
<template v-if="modalOnClick">
<b-modal
:active.sync="isPreviewModalActive"
:width="640"
scroll="keep">
<div class="tainacan-modal-content">
<div class="tainacan-modal-title">
<h2 v-if="file.title != undefined">{{ file.title.rendered }}</h2>
<a
@click="isPreviewModalActive = false"
class="back-link">{{ $i18n.get('exit') }}</a>
<hr>
</div>
<div
class="is-flex rendered-content"
v-html="file.description.rendered" />
</div>
<div
class="is-flex rendered-content"
v-html="file.description.rendered" />
</div>
</b-modal>
</b-modal>
</template>
</div>
</template>
<script>
export default {
name: 'FileItem',
data() {
return {
isPreviewModalActive: false
}
},
props: {
file: Object,
size: 112,
showName: false,
isSelected: false,
isPreviewModalActive: false
modalOnClick: true
},
methods: {
getIconForMimeType(mimeType) {
@ -94,11 +101,13 @@ export default {
.file-item {
display: inline-block;
&:hover {
&.shows-modal-on-click:hover {
cursor: pointer;
.image, .file-placeholder {
transform: scale(1.05);
}
}
&:hover {
figcaption {
background-color: $gray1;
}

View File

@ -14,7 +14,6 @@ import Page from '../pages/lists/taxonomies-page.vue'
import ActivitiesPage from '../pages/lists/activities-page.vue'
import AvailableExportersPage from '../pages/lists/available-exporters-page.vue'
import AvailableImportersPage from '../pages/lists/available-importers-page.vue'
import ExportPage from '../pages/singles/export-page.vue'
// Edition Form Components
import CollectionEditionForm from '../components/edition/collection-edition-form.vue'
@ -82,9 +81,6 @@ const routes = [
{ path: '/importers/:importerSlug/:sessionId', name: 'ImporterCreationForm', component: ImporterEditionForm, meta: { title: i18nGet('title_importer_page'), icon: 'import' } },
{ path: '/importers/:importerType/:sessionId/mapping/:collectionId', name: 'ImporterMappingForm', component: ImporterMappingForm, meta: {title: i18nGet('title_importer_mapping_page'), icon: 'import'} },
{ path: '/exporters/collection/:collectionId', name: 'ExportCollection', component: ExportPage, meta: {title: i18nGet('title_export_collection_page'), icon: 'export'} },
{ path: '/exporters/item/:itemId', name: 'ExportItem', component: ExportPage, meta: {title: i18nGet('title_export_item_page'), icon: 'export'} },
{ path: '/exporters', name: 'ExportersPage', component: AvailableExportersPage, meta: {title: i18nGet('title_exporters_page'), icon: 'export'} },
{ path: '/exporters/:exporterSlug', name: 'ExporterEditionForm', component: ExporterEditionForm, meta: {title: i18nGet('title_exporter_page'), icon: 'export'}},

View File

@ -127,10 +127,18 @@ export default {
wp.media.view.settings.post = {
id: null
}
this.params.flex_width = tainacan_plugin.custom_header_support[0].flex_width ? 1 : 0;
this.params.flex_height = tainacan_plugin.custom_header_support[0].flex_height ? 1 : 0;
this.params.width = tainacan_plugin.custom_header_support[0].width;
this.params.height = tainacan_plugin.custom_header_support[0].height;
if (tainacan_plugin.custom_header_support[0] != undefined) {
this.params.flex_width = tainacan_plugin.custom_header_support[0].flex_width ? 1 : 0;
this.params.flex_height = tainacan_plugin.custom_header_support[0].flex_height ? 1 : 0;
this.params.width = tainacan_plugin.custom_header_support[0].width;
this.params.height = tainacan_plugin.custom_header_support[0].height;
} else {
this.params.flex_width = true;
this.params.flex_height = true;
this.params.width = 2000;
this.params.height = 280;
}
this.frame = wp.media({
frame: 'select',

View File

@ -4,7 +4,6 @@
:bread-crumb-items="[{ path: '', label: $i18n.get('exporters') }]" />
<h3>{{ $i18n.get('label_available_exporters') }}</h3>
<p>{{ $i18n.get('info_available_exporters_helper') }}</p>
<p>{{ $i18n.get('instruction_select_an_exporter_type') }}</p>
<div class="exporter-types-container">
<div

View File

@ -4,7 +4,6 @@
:bread-crumb-items="[{ path: '', label: $i18n.get('importers') }]" />
<h3>{{ $i18n.get('label_available_importers') }}</h3>
<p>{{ $i18n.get('info_available_importers_helper') }}</p>
<p>{{ $i18n.get('instruction_select_an_importer_type') }}</p>
<div class="importer-types-container">
<div

View File

@ -1,42 +0,0 @@
<template>
<div class="columns is-fullheight">
<section class="column is-secondary-content">
<tainacan-collection-subheader :id="collectionId"/>
<router-view
id="export-page-container"
:collection-id="collectionId"
class="page-container page-container-small"/>
</section>
</div>
</template>
<script>
import TainacanCollectionSubheader from '../../components/navigation/tainacan-collection-subheader.vue';
export default {
name: 'ExportPage',
data(){
return {
collectionId: Number,
itemId: Number,
selectedList: []
}
},
components: {
TainacanCollectionSubheader
},
created(){
this.collectionId = parseInt(this.$route.params.collectionId);
this.itemId = parseInt(this.$route.params.itemId);
this.selectedList = [];
this.$eventBusSearch.setCollectionId(this.collectionId);
}
}
</script>
<style scoped>
</style>

View File

@ -73,6 +73,7 @@
<file-item
v-if="item.thumbnail != undefined && ((item.thumbnail['tainacan-medium'] != undefined && item.thumbnail['tainacan-medium'] != false) || (item.thumbnail.medium != undefined && item.thumbnail.medium != false))"
:show-name="false"
:modal-on-click="false"
:size="178"
:file="{
media_type: 'image',
@ -102,6 +103,7 @@
v-for="(attachment, index) in attachmentsList"
:key="index"
:show-name="true"
:modal-on-click="true"
:file="attachment"/>
<p v-if="attachmentsList.length <= 0"><br>{{
$i18n.get('info_no_attachments_on_item_yet') }}</p>

View File

@ -13,7 +13,7 @@
h1, h2 {
font-size: 1.25rem;
font-weight: normal;
color: $blue5;
color: $gray5;
display: inline-block;
width: 90%;
margin-right: auto;

View File

@ -468,7 +468,6 @@ return apply_filters( 'tainacan-admin-i18n', [
'info_create_filters' => __( 'Click or Drag and Drop Metadata here for creating a new Filter.', 'tainacan' ),
'info_create_metadata' => __( 'Click or Drag and Drop Metadata Types here for creating a new Metadata.', 'tainacan' ),
'info_choose_your_metadata' => __( 'Choose your metadata.', 'tainacan' ),
'info_available_importers_helper' => __( 'The available importer type will affect the file or link that will provide your data besides deciding wich options are available to the importer.', 'tainacan' ),
'info_target_collection_helper' => __( 'The collection where imported item will be added.', 'tainacan' ),
'info_source_file_upload' => __( 'The file containing the data to be imported.', 'tainacan' ),
'info_metadata_mapping_helper' => __( 'Map each file metadata with the corresponding one in selected collection.', 'tainacan' ),
@ -513,7 +512,6 @@ return apply_filters( 'tainacan-admin-i18n', [
'info_leaving_bulk_edition' => __( 'You are leaving the bulk edition now.', 'tainacan' ),
'info_current_view_mode_metadata_not_allowed' => __( 'Current view mode does not allow displayed metadata selection.', 'tainacan' ),
'info_cant_select_metadata_without_items' => __( 'Can not select displayed metadata without items on list.', 'tainacan' ),
'info_available_exporters_helper' => __( '?', 'tainacan' ),
'info_empty' => __( 'empty', 'tainacan' ),
'info_url_copied' => __( 'URL link copied', 'tainacan' ),
'info_other_item_listing_options' => __('Other items listing options: ', 'tainacan'),

View File

@ -73,10 +73,12 @@ class GutenbergBlock {
array('wp-edit-blocks')
);
register_block_type('tainacan/items-grid', array(
'editor_script' => 'items-grid',
'style' => 'items-grid'
));
if(function_exists('register_block_type')) {
register_block_type( 'tainacan/items-grid', array(
'editor_script' => 'items-grid',
'style' => 'items-grid'
) );
}
}
public function register_tainacan_collections_carousel(){
@ -94,10 +96,12 @@ class GutenbergBlock {
array('wp-edit-blocks')
);
register_block_type('tainacan/collections-carousel', array(
'editor_script' => 'collections-carousel',
'style' => 'collections-carousel'
));
if(function_exists('register_block_type')) {
register_block_type( 'tainacan/collections-carousel', array(
'editor_script' => 'collections-carousel',
'style' => 'collections-carousel'
) );
}
}
public function get_plugin_js_settings(){

View File

@ -28,7 +28,6 @@ export const updateExporterSession = ({commit}, exporterSessionUpdated) => {
return tainacan.patch(`/exporters/session/${exporterSessionUpdated.id}`, exporterSessionUpdated.body)
.then(response => {
console.info(response.data);
commit('setExporterSession');
return response;

View File

@ -16,8 +16,9 @@ Tainacan is a powerful and flexible repository platform for WordPress. Manage an
= Features =
* "Metadata and Filters": Use a metadata standard or choose whatever set of metadata you want to describe the items in your collections. Also, choose which metadata will be used as a filter when browsing the collection
Faceted Search. Browse your collection (and let the public browse it) using a faceted search interface with the filters you have chosen.
* "Metadata and Filters": Use a metadata standard or choose whatever set of metadata you want to describe the items in your collections. Also, choose which metadata will be used as a filter when browsing the collection.
* "Faceted Search". Browse your collection (and let the public browse it) using a faceted search interface with the filters you have chosen.
* "Manage Taxonomies": Manage vocabularies that can be used accross all your collections.