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

This commit is contained in:
erickungarelli 2018-05-08 16:30:25 -03:00
commit b9fa1c6e62
5 changed files with 98 additions and 84 deletions

View File

@ -15,16 +15,16 @@
:data="items"
@selection-change="handleSelectionChange"
:checked-rows.sync="selectedItems"
checkable
:checkable="!isOnTheme"
:loading="isLoading"
hoverable
striped
selectable
:selectable="!isOnTheme"
backend-sorting>
<template slot-scope="props">
<b-table-column
v-for="(column, index) in tableFields"
v-if="column.field != 'row_actions' || (column.field == 'row_actions' && props.row.current_user_can_edit)"
v-if="column.field != 'row_actions' || (column.field == 'row_actions' && props.row.current_user_can_edit && !isOnTheme)"
:key="index"
:custom-key="column.slug"
:label="column.name"
@ -35,13 +35,17 @@
<template v-if="column.field != 'row_thumbnail' && column.field != 'row_actions' && column.field != 'row_creation'">
<span
class="clickable-row"
v-if="props.row.metadata[column.slug].value_as_html == props.row.metadata[column.slug].value_as_string"
v-if="!isOnTheme && props.row.metadata[column.slug].value_as_html == props.row.metadata[column.slug].value_as_string"
@click.prevent="goToItemPage(props.row.id)"
v-html="renderMetadata( props.row.metadata[column.slug] )" />
<span
class="clickable-row"
v-if="props.row.metadata[column.slug].value_as_html != props.row.metadata[column.slug].value_as_string"
v-if="!isOnTheme && props.row.metadata[column.slug].value_as_html != props.row.metadata[column.slug].value_as_string"
v-html="renderMetadata( props.row.metadata[column.slug] )" />
<a
v-if="isOnTheme"
:href="getDecodedURI(props.row.url)"
v-html="renderMetadata( props.row.metadata[column.slug] )" />
</template>
@ -101,7 +105,8 @@ export default {
collectionId: Number,
tableFields: Array,
items: Array,
isLoading: false
isLoading: false,
isOnTheme: false
},
methods: {
...mapActions('collection', [
@ -184,6 +189,9 @@ export default {
},
getCreationHtml(item) {
return this.$i18n.get('info_created_by') + item['author_name'] + '<br>' + this.$i18n.get('info_date') + moment( item['creation_date'], 'YYYY-MM-DD').format('DD/MM/YYYY');
},
getDecodedURI(url) {
return decodeURIComponent(url);
}
}
}

View File

@ -2,7 +2,9 @@
<span>
<div class="header-item">
<b-dropdown id="item-creation-options-dropdown">
<b-dropdown
v-if="!isOnTheme"
id="item-creation-options-dropdown">
<button
class="button is-secondary"
slot="trigger">
@ -88,7 +90,8 @@
props: {
collectionId: Number,
isRepositoryLevel: false,
tableFields: Array
tableFields: Array,
isOnTheme: false
},
computed: {
orderBy() {

View File

@ -82,7 +82,8 @@
:is-repository-level="isRepositoryLevel"
:collection-id="collectionId"
:table-fields="tableFields"
:pref-table-fields="prefTableFields"/>
:pref-table-fields="prefTableFields"
:is-on-theme="isOnTheme"/>
</div>
<div
:items="items"
@ -97,7 +98,8 @@
:collection-id="collectionId"
:table-fields="tableFields"
:items="items"
:is-loading="isLoading"/>
:is-loading="isLoading"
:is-on-theme="isOnTheme"/>
<section
v-if="!isLoadingItems && items.length <= 0"
class="section">
@ -147,6 +149,7 @@
hasFiltered: false,
isFiltersMenuCompressed: false,
collapseAll: false,
isOnTheme: false
}
},
props: {
@ -206,6 +209,8 @@
themeList.appendChild(e);
}); */
this.isOnTheme = (this.$route.name == null);
this.isRepositoryLevel = (this.collectionId == undefined);
this.$eventBusSearch.$on('isLoadingItems', isLoadingItems => {

View File

@ -11,7 +11,6 @@
<script>
import TainacanSubheader from '../../components/navigation/tainacan-subheader.vue';
import {mapActions} from 'vuex';
export default {
name: 'CollectionPage',

View File

@ -3,82 +3,81 @@
<b-loading
:active.sync="isLoading"
:can-cancel="false"/>
<div class="card">
<div class="card-content">
<tainacan-title />
<div class="content">
<router-link
class="card-footer-item"
:to="{ path: $routerHelper.getItemEditPath(collectionId, itemId)}">
{{ $i18n.get('edit') + ' ' + $i18n.get('item') }}
</router-link>
<div
class="card-image"
v-if="item.document">
<figure
class="image"
v-html="item.document_as_html" />
</div>
<br>
<div
v-if="item.thumbnail"
class="media">
<figure
class="media-left" >
<p class="image is-128x128">
<img :src="item.thumbnail">
</p>
</figure>
<div class="media-content">
{{ $i18n.get('label_thumbnail') }}
</div>
</div>
<div
v-for="(metadata, index) in item.metadata"
:key="index"
class="box">
<p
v-if="metadata.value_as_html"
class="is-size-3"
v-html="metadata.value_as_html"/>
<p
v-else>--</p>
<p>
<i>
{{ metadata.name }}
</i>
</p>
</div>
<div
class="box">
<div
v-if="attachments && attachments.length > 0">
<span
v-for="(attachment, index) in attachments"
:key="index"
>
<a
target="blank"
:href="attachment.guid.rendered">{{ attachment.guid.rendered }}</a>
<br>
</span>
</div>
<p v-else>--</p>
<p>
<i>
{{ $i18n.get('label_attachments') }}
</i>
</p>
</div>
<router-link
class="button is-secondary"
:to="{ path: $routerHelper.getItemEditPath(collectionId, itemId)}">
{{ $i18n.get('edit') + ' ' + $i18n.get('item') }}
</router-link>
<div
class="card-image"
v-if="item.document">
<figure
class="image"
v-html="item.document_as_html" />
</div>
<br>
<div
v-if="item.thumbnail"
class="media">
<figure
class="media-left" >
<p class="image is-128x128">
<img :src="item.thumbnail">
</p>
</figure>
<div class="media-content">
{{ $i18n.get('label_thumbnail') }}
</div>
</div>
<div
v-for="(metadata, index) in item.metadata"
:key="index"
class="box">
<p
v-if="metadata.value_as_html"
class="is-size-3"
v-html="metadata.value_as_html"/>
<p
v-else>--</p>
<p>
<i>
{{ metadata.name }}
</i>
</p>
</div>
<div
class="box">
<div
v-if="attachments && attachments.length > 0">
<span
v-for="(attachment, index) in attachments"
:key="index"
>
<a
target="blank"
:href="attachment.guid.rendered">{{ attachment.guid.rendered }}</a>
<br>
</span>
</div>
<p v-else>--</p>
<p>
<i>
{{ $i18n.get('label_attachments') }}
</i>
</p>
</div>
</div>
</div>
</template>