Adds isOnTheme property to check if SearchControl and ItemsList should render or not certain parts.
This commit is contained in:
parent
ea77249da1
commit
e75594ad43
|
@ -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,12 +35,16 @@
|
|||
<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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
<script>
|
||||
import TainacanSubheader from '../../components/navigation/tainacan-subheader.vue';
|
||||
import {mapActions} from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'CollectionPage',
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
<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"
|
||||
class="button is-secondary"
|
||||
:to="{ path: $routerHelper.getItemEditPath(collectionId, itemId)}">
|
||||
{{ $i18n.get('edit') + ' ' + $i18n.get('item') }}
|
||||
</router-link>
|
||||
|
@ -80,7 +80,6 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
Loading…
Reference in New Issue