Removes instances of v-for and v-if in the same tag. First step towards #794.

This commit is contained in:
mateuswetah 2023-07-10 10:34:38 -03:00
parent 0ef39e2c35
commit f125790799
22 changed files with 721 additions and 642 deletions

View File

@ -22,8 +22,6 @@ module.exports = {
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/prop-name-casing': 'off',
'vue/no-confusing-v-for-v-if': 'off',
'vue/no-use-v-if-with-v-for': 'warn',
'vue/multi-word-component-names': 'off',
'vue/require-default-prop': 'off',
'vue/no-v-text-v-html-on-component': 'off'

View File

@ -18,16 +18,17 @@
<div
role="list"
class="exporter-types-container">
<template v-for="exporterType in availableExporters">
<div
role="listitem"
class="exporter-type"
v-for="exporterType in availableExporters"
:key="exporterType.slug"
v-if="!(hideWhenManualCollection && !exporterType.manual_collection)"
@click="onSelectExporter(exporterType)">
<h4>{{ exporterType.name }}</h4>
<p>{{ exporterType.description }}</p>
</div>
</template>
</div>
<footer class="field is-grouped form-submit">
<div class="control">

View File

@ -7,9 +7,7 @@
tabindex="-1"
aria-modal
ref="availableImportersModal">
<div
class="tainacan-modal-content"
style="width: auto">
<div style="width: auto">
<header class="tainacan-modal-title">
<h2>{{ $i18n.get('importers') }}</h2>
<hr>
@ -19,16 +17,17 @@
<div
role="list"
class="importer-types-container">
<template v-for="importerType in availableImporters">
<div
role="listitem"
class="importer-type"
v-for="importerType in availableImporters"
:key="importerType.slug"
v-if="!(hideWhenManualCollection && !importerType.manual_collection)"
@click="onSelectImporter(importerType)">
<h4>{{ importerType.name }}</h4>
<p>{{ importerType.description }}</p>
</div>
</template>
<b-loading
:is-full-page="false"

View File

@ -42,13 +42,14 @@
v-if="metadatum.id && metadatum.metadata_type_object.component === 'tainacan-compound' && metadatum.multiple !== 'yes'"
:key="index"
:label="metadatum.name">
<template v-for="(childMetadatum, childIndex) of metadatum.metadata_type_options.children_objects">
<option
v-for="(childMetadatum, childIndex) of metadatum.metadata_type_options.children_objects"
:key="childIndex"
v-if="childMetadatum.id"
:value="childMetadatum">
{{ childMetadatum.name }}
</option>
</template>
</optgroup>
</template>
<option :value="{ id: 'status' }">
@ -172,13 +173,14 @@
v-if="metadatumForCopy.id && metadatumForCopy.metadata_type_object.component === 'tainacan-compound'"
:key="index"
:label="metadatumForCopy.name">
<template v-for="(childmetadatumForCopy, childIndex) of metadatumForCopy.metadata_type_options.children_objects">
<option
v-for="(childmetadatumForCopy, childIndex) of metadatumForCopy.metadata_type_options.children_objects"
:key="childIndex"
v-if="childMetadatumForCopy.id"
:value="childMetadatumForCopy.id">
{{ childMetadatumForCopy.name }}
</option>
</template>
</optgroup>
</template>
<option

View File

@ -16,15 +16,16 @@
<p>{{ $i18n.get('info_associated_roles') }}</p>
<br>
<div class="roles-list">
<template v-for="(role, roleIndex) of existingRoles">
<b-checkbox
v-if="!capability.roles_inherited[role.slug]"
v-for="(role, roleIndex) of existingRoles"
:key="roleIndex"
:value="capability.roles[role.slug] || capability.roles_inherited[role.slug] ? true : false"
@input="($event) => updateRole(role.slug, $event)"
name="roles">
{{ role.name }}
</b-checkbox>
</template>
</div>
</b-field>
</template>
@ -48,9 +49,9 @@
</label>
<br>
<div class="roles-list">
<template v-for="(role, roleIndex) of existingRoles">
<b-checkbox
v-if="capability.roles_inherited[role.slug]"
v-for="(role, roleIndex) of existingRoles"
:key="roleIndex"
class="has-text-yellow2"
:value="capability.roles[role.slug] || capability.roles_inherited[role.slug] ? true : false"
@ -58,6 +59,7 @@
disabled>
{{ role.name }}
</b-checkbox>
</template>
</div>
</b-field>
</template>

View File

@ -59,16 +59,17 @@
v-if="selectedEstrategy == 'mappers'"
class="collection-creation-options-container"
role="list">
<template v-for="metadatumMapper in metadatumMappers">
<button
class="collection-creation-option"
@click="$router.push($routerHelper.getNewMappedCollectionPath(metadatumMapper.slug)); $parent.close();"
:key="metadatumMapper.slug"
v-for="metadatumMapper in metadatumMappers"
v-if="metadatumMapper.metadata != false"
aria-role="listitem">
<h3>{{ metadatumMapper.name }}</h3>
<p>{{ metadatumMapper.description }}</p>
</button>
</template>
</div>
<div

View File

@ -19,15 +19,16 @@
<div
v-if="!isLoading"
class="collection-types-container">
<template v-for="(collection, index) in collections">
<div
class="collection-type"
v-for="(collection, index) in collections"
:key="index"
v-if="collection && collection.current_user_can_edit_items"
@click="onSelectCollection(collection)">
<h4>{{ collection.name }}</h4>
<p>{{ collection.description.length > 200 ? (collection.description.substring(0,197) + '...') : collection.description }}</p>
</div>
</template>
<div
v-if="collections.length <= 0"
class="block">

View File

@ -18,8 +18,8 @@
</span>
</a>
</li>
<template v-for="(statusOption, index) of $statusHelper.getStatuses()">
<li
v-for="(statusOption, index) of $statusHelper.getStatuses()"
v-if="(isRepositoryLevel || statusOption.slug != 'private') || (statusOption.slug == 'private' && collection && collection.current_user_can_read_private_items)"
:key="index"
@click="onChangeTab(statusOption.slug)"
@ -48,6 +48,7 @@
</span>
</a>
</li>
</template>
</ul>
</div>
</template>

View File

@ -49,10 +49,10 @@
<!-- TAXONOMY TERM ITEMS FILTERS -->
<template v-if="taxonomy && taxonomyFilters">
<template v-for="(taxonomyFilter, key, index) of taxonomyFilters">
<div
v-if="key == 'repository-filters'"
:key="index"
v-for="(taxonomyFilter, key, index) of taxonomyFilters">
:key="index">
<div
v-tooltip="{
delay: {
@ -98,10 +98,11 @@
</p> -->
<hr v-if="taxonomyFilter.length > 1">
</div>
</template>
<template v-for="(taxonomyFilter, key, index) of taxonomyFilters">
<div
v-if="key != 'repository-filters'"
:key="index"
v-for="(taxonomyFilter, key, index) of taxonomyFilters">
:key="index">
<div
v-tooltip="{
delay: {
@ -148,13 +149,14 @@
<hr v-if="taxonomyFilter.length > 1">
</div>
</template>
</template>
<!-- REPOSITORY ITEMS FILTERS -->
<template v-else-if="isRepositoryLevel && !taxonomy">
<template v-for="(repositoryCollectionFilter, key, index) of repositoryCollectionFilters">
<div
v-if="key == 'repository-filters'"
:key="index"
v-for="(repositoryCollectionFilter, key, index) of repositoryCollectionFilters">
:key="index">
<div
v-tooltip="{
delay: {
@ -200,10 +202,11 @@
</p> -->
<hr v-if="repositoryCollectionFilters.length > 1">
</div>
</template>
<template v-for="(repositoryCollectionFilter, key, index) of repositoryCollectionFilters">
<div
v-if="key != 'repository-filters'"
:key="index"
v-for="(repositoryCollectionFilter, key, index) of repositoryCollectionFilters">
:key="index">
<div
v-tooltip="{
delay: {
@ -250,6 +253,7 @@
<hr v-if="repositoryCollectionFilters.length > 1">
</div>
</template>
</template>
<!-- COLLECTION ITEMS FILTERS -->
<template v-else>

View File

@ -42,13 +42,14 @@
aria-controls="items-list-results"
aria-labelledby="items-per-page-select"
@input="onChangeItemsPerPage">
<template v-for="(itemsPerPageOption, index) of itemsPerPageOptions">
<option
v-for="(itemsPerPageOption, index) of itemsPerPageOptions"
:key="index"
v-if="maxItemsPerPage >= 12"
:value="itemsPerPageOption">
{{ itemsPerPageOption }} &nbsp;
</option>
</template>
</b-select>
</b-field>
</div>

View File

@ -205,9 +205,8 @@
</a>
</li>
<li
v-for="(statusOption, index) of $statusHelper.getStatuses().filter((status) => status.slug != 'draft')"
v-for="(statusOption, index) of statusOptionsForCollections"
:key="index"
v-if="statusOption.slug != 'private' || (statusOption.slug == 'private' && $userCaps.hasCapability('tnc_rep_read_private_collections'))"
@click="onChangeTab(statusOption.slug)"
:class="{ 'is-active': status == statusOption.slug}"
:style="{ marginRight: statusOption.slug == 'private' ? 'auto' : '', marginLeft: statusOption.slug == 'trash' ? 'auto' : '' }"
@ -252,13 +251,7 @@
</span>
</p>
<p v-if="status == undefined || status == ''">{{ $i18n.get('info_no_collection_created') }}</p>
<p
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
v-if="status == statusOption.slug">
{{ $i18n.get('info_no_collections_' + statusOption.slug) }}
</p>
<p v-else>{{ $i18n.get('info_no_collections_' + status) }}</p>
<div v-if="!$adminOptions.hideCollectionsListCreationDropdown && $userCaps.hasCapability('tnc_rep_edit_collections') && status == undefined || status == ''">
<b-dropdown
id="collection-creation-options-dropdown"
@ -406,6 +399,9 @@ export default {
}
return {};
},
statusOptionsForCollections() {
return this.$statusHelper.getStatuses().filter((status) => status.slug != 'draft' && (status.slug != 'private' || (status.slug == 'private' && this.$userCaps.hasCapability('tnc_rep_read_private_collections'))));
}
},
created() {

View File

@ -321,17 +321,18 @@
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-arrowdown" />
</span>
</button>
<template v-for="metadatum of sortingMetadata">
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': (orderBy != 'meta_value' && orderBy != 'meta_value_num' && orderBy == metadatum.slug) || ((orderBy == 'meta_value' || orderBy == 'meta_value_num') && metaKey == metadatum.id) }"
v-for="metadatum of sortingMetadata"
v-if="metadatum != undefined"
:value="metadatum"
:key="metadatum.slug"
aria-role="listitem">
{{ metadatum.name }}
</b-dropdown-item>
</template>
</b-dropdown>
</b-field>
</div>
@ -630,11 +631,8 @@
<p v-if="status == undefined || status == '' || status == 'publish,private,draft'">
{{ (hasFiltered || openAdvancedSearch || searchQuery) ? $i18n.get('info_no_item_found_filter') : (isSortingByCustomMetadata ? $i18n.get('info_no_item_found') : $i18n.get('info_no_item_created')) }}
</p>
<p
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
v-if="status == statusOption.slug">
{{ $i18n.get('info_no_items_' + statusOption.slug) }}
<p v-else>
{{ $i18n.get('info_no_items_' + status) }}
</p>
<router-link

View File

@ -125,9 +125,8 @@
</a>
</li>
<li
v-for="(statusOption, index) of $statusHelper.getStatuses().filter((status) => status.slug != 'draft')"
v-for="(statusOption, index) of statusOptionsForTaxonomies"
:key="index"
v-if="statusOption.slug != 'private' || (statusOption.slug == 'private' && $userCaps.hasCapability('tnc_rep_read_private_taxonomies'))"
@click="onChangeTab(statusOption.slug)"
:class="{ 'is-active': status == statusOption.slug}"
:style="{ marginRight: statusOption.slug == 'draft' ? 'auto' : '', marginLeft: statusOption.slug == 'trash' ? 'auto' : '' }"
@ -171,11 +170,8 @@
</span>
</p>
<p v-if="status == undefined || status == ''">{{ $i18n.get('info_no_taxonomy_created') }}</p>
<p
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
v-if="status == statusOption.slug">
{{ $i18n.get('info_no_taxonomies_' + statusOption.slug) }}
<p v-else>
{{ $i18n.get('info_no_taxonomies_' + status) }}
</p>
<router-link
v-if="status == undefined || status == ''"
@ -269,6 +265,9 @@
},
repositoryTotalTaxonomies(){
return this.getRepositoryTotalTaxonomies();
},
statusOptionsForTaxonomies() {
return this.$statusHelper.getStatuses().filter((status) => status.slug != 'draft' && (status.slug != 'private' || (status.slug == 'private' && this.$userCaps.hasCapability('tnc_rep_read_private_taxonomies'))));
}
},
created() {

View File

@ -45,16 +45,28 @@
shown: 500,
hide: 300,
},
content: item.metadata != undefined ? renderMetadata(item, column) : '',
content: item.metadata != undefined ? renderMetadata(item, titleItemMetadatum) : '',
html: true,
autoHide: false,
placement: 'auto-start',
popperClass: ['tainacan-tooltip', 'tooltip']
}"
v-for="(column, metadatumIndex) in displayedMetadata"
:key="metadatumIndex"
v-if="column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
v-html="item.metadata != undefined && collectionId ? renderMetadata(item, column) : (item.title ? item.title :`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)" />
v-if="collectionId && titleItemMetadatum"
v-html="item.metadata != undefined ? renderMetadata(item, titleItemMetadatum) : ''" />
<p
v-tooltip="{
delay: {
shown: 500,
hide: 300,
},
content: item.title != undefined ? item.title : (`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`),
html: true,
autoHide: false,
placement: 'auto-start',
popperClass: ['tainacan-tooltip', 'tooltip']
}"
v-if="!collectionId && titleItemMetadatum"
v-html="item.title != undefined ? item.title : (`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)" />
<span
v-if="isSlideshowViewModeEnabled"
v-tooltip="{
@ -94,8 +106,8 @@
:src="$thumbHelper.getSrc(item['thumbnail'], 'tainacan-medium-full', item.document_mimetype)"> -->
</div>
<div class="list-metadata media-body">
<template v-for="(column, metadatumIndex) in displayedMetadata">
<span
v-for="(column, metadatumIndex) in displayedMetadata"
:key="metadatumIndex"
:class="{ 'metadata-type-textarea': column.metadata_type_object.component == 'tainacan-textarea' }"
v-if="renderMetadata(item, column) != '' && column.display && column.slug != 'thumbnail' && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop != 'title')">
@ -104,6 +116,7 @@
v-html="renderMetadata(item, column)"
class="metadata-value"/>
</span>
</template>
</div>
</div>

View File

@ -45,16 +45,28 @@
shown: 500,
hide: 300,
},
content: item.metadata != undefined ? renderMetadata(item, column) : '',
content: item.metadata != undefined ? renderMetadata(item, titleItemMetadatum) : '',
html: true,
autoHide: false,
placement: 'top-start',
popperClass: ['tainacan-tooltip', 'tooltip']
}"
v-for="(column, metadatumIndex) in displayedMetadata"
:key="metadatumIndex"
v-if="column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
v-html="item.metadata != undefined && collectionId && renderMetadata(item, column) ? renderMetadata(item, column) : (item.title ? item.title :`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)" />
v-if="collectionId && titleItemMetadatum"
v-html="item.metadata != undefined ? renderMetadata(item, titleItemMetadatum) : ''" />
<p
v-tooltip="{
delay: {
shown: 500,
hide: 300,
},
content: item.title != undefined ? item.title : (`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`),
html: true,
autoHide: false,
placement: 'top-start',
popperClass: ['tainacan-tooltip', 'tooltip']
}"
v-if="!collectionId && titleItemMetadatum"
v-html="item.title != undefined ? item.title : (`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)" />
<div class="tainacan-map-card-thumbnail">
<blur-hash-image
v-if="item.thumbnail != undefined"
@ -257,16 +269,28 @@
shown: 500,
hide: 300,
},
content: item.metadata != undefined ? renderMetadata(item, column) : '',
content: item.metadata != undefined ? renderMetadata(item, titleItemMetadatum) : '',
html: true,
autoHide: false,
placement: 'auto-start',
popperClass: ['tainacan-tooltip', 'tooltip']
}"
v-for="(column, metadatumIndex) in displayedMetadata"
:key="metadatumIndex"
v-if="column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
v-html="item.metadata != undefined && collectionId ? renderMetadata(item, column) : (item.title ? item.title :`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)" />
v-if="collectionId && titleItemMetadatum"
v-html="item.metadata != undefined ? renderMetadata(item, titleItemMetadatum) : ''" />
<p
v-tooltip="{
delay: {
shown: 500,
hide: 300,
},
content: item.title != undefined ? item.title : (`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`),
html: true,
autoHide: false,
placement: 'auto-start',
popperClass: ['tainacan-tooltip', 'tooltip']
}"
v-if="!collectionId && titleItemMetadatum"
v-html="item.title != undefined ? item.title : (`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)" />
<span
v-if="isSlideshowViewModeEnabled"
v-tooltip="{
@ -309,8 +333,8 @@
marginTop: '-' + getItemImageHeight(item['thumbnail']['tainacan-medium-full'] ? item['thumbnail']['tainacan-medium-full'][1] : (item['thumbnail'].medium_large ? item['thumbnail'].medium_large[1] : 120), item['thumbnail']['tainacan-medium-full'] ? item['thumbnail']['tainacan-medium-full'][2] : (item['thumbnail'].medium_large ? item['thumbnail'].medium_large[2] : 120)) + 'px'
}" />
</div>
<template v-for="(column, metadatumIndex) in displayedMetadata">
<span
v-for="(column, metadatumIndex) in displayedMetadata"
:key="metadatumIndex"
:class="{ 'metadata-type-textarea': column.metadata_type_object.component == 'tainacan-textarea' }"
v-if="renderMetadata(item, column) != '' &&
@ -323,6 +347,7 @@
v-html="renderMetadata(item, column)"
class="metadata-value"/>
</span>
</template>
</div>
</div>

View File

@ -48,16 +48,28 @@
shown: 500,
hide: 300,
},
content: item.metadata != undefined ? renderMetadata(item, column) : '',
content: item.metadata != undefined ? renderMetadata(item, titleItemMetadatum) : '',
html: true,
autoHide: false,
placement: 'auto-start',
popperClass: ['tainacan-tooltip', 'tooltip']
}"
v-for="(column, metadatumIndex) in displayedMetadata"
:key="metadatumIndex"
v-if="column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
v-html="item.metadata != undefined && collectionId ? renderMetadata(item, column) : (item.title ? item.title :`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)" />
v-if="collectionId && titleItemMetadatum"
v-html="item.metadata != undefined ? renderMetadata(item, titleItemMetadatum) : ''" />
<p
v-tooltip="{
delay: {
shown: 500,
hide: 300,
},
content: item.title != undefined ? item.title : (`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`),
html: true,
autoHide: false,
placement: 'auto-start',
popperClass: ['tainacan-tooltip', 'tooltip']
}"
v-if="!collectionId && titleItemMetadatum"
v-html="item.title != undefined ? item.title : (`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)" />
<span
v-if="isSlideshowViewModeEnabled"
v-tooltip="{
@ -100,8 +112,8 @@
marginTop: '-' + getItemImageHeight(item['thumbnail']['tainacan-medium-full'] ? item['thumbnail']['tainacan-medium-full'][1] : (item['thumbnail'].medium_large ? item['thumbnail'].medium_large[1] : 120), item['thumbnail']['tainacan-medium-full'] ? item['thumbnail']['tainacan-medium-full'][2] : (item['thumbnail'].medium_large ? item['thumbnail'].medium_large[2] : 120)) + 'px'
}" />
</div>
<template v-for="(column, metadatumIndex) in displayedMetadata">
<span
v-for="(column, metadatumIndex) in displayedMetadata"
:key="metadatumIndex"
:class="{ 'metadata-type-textarea': column.metadata_type_object.component == 'tainacan-textarea' }"
v-if="renderMetadata(item, column) != '' && column.display && column.slug != 'thumbnail' && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop != 'title')">
@ -110,6 +122,7 @@
v-html="renderMetadata(item, column)"
class="metadata-value"/>
</span>
</template>
</div>
</div>

View File

@ -288,8 +288,8 @@
<div class="is-large control has-icons-right is-loading is-clearfix" />
</span>
<template v-for="(metadatum, index) of item.metadata">
<div
v-for="(metadatum, index) of item.metadata"
v-if="metadatum.value_as_html != undefined && metadatum.value_as_html != ''"
:key="index"
class="field">
@ -328,7 +328,7 @@
</b-collapse>
</div>
</template>
<br>
<br>

View File

@ -12,8 +12,8 @@
class="tainacan-table tainacan-table-skeleton"
tabindex="0">
<thead>
<template v-for="(column, metadatumIndex) in displayedMetadata">
<th
v-for="(column, metadatumIndex) in displayedMetadata"
:key="metadatumIndex"
v-if="column.display"
class="column-default-width"
@ -29,17 +29,19 @@
}">
<div class="th-wrap">{{ column.name }}</div>
</th>
</template>
</thead>
<tbody>
<tr
:key="item"
v-for="item in 12">
<template v-for="(column, metadatumIndex) in displayedMetadata">
<td
v-for="(column, metadatumIndex) in displayedMetadata"
:key="metadatumIndex"
v-if="column.display"
:class="{ 'thumbnail-cell': metadatumIndex == 0 }"
class="column-default-width skeleton"/>
</template>
</tr>
</tbody>
</table>
@ -51,8 +53,8 @@
<thead>
<tr>
<!-- Displayed Metadata -->
<template v-for="(column, index) in displayedMetadata">
<th
v-for="(column, index) in displayedMetadata"
:key="index"
v-if="column.display"
class="column-default-width"
@ -71,7 +73,7 @@
}">
<div class="th-wrap">{{ column.name }}</div>
</th>
</template>
<th
v-if="isSlideshowViewModeEnabled"
class="actions-header">
@ -99,9 +101,9 @@
v-html="getBeforeHook(item)" />
<!-- Item Displayed Metadata -->
<template v-for="(column, metadatumIndex) in displayedMetadata">
<td
:key="metadatumIndex"
v-for="(column, metadatumIndex) in displayedMetadata"
v-if="column.display"
class="column-default-width"
:class="{
@ -183,6 +185,7 @@
</span>
</a>
</td>
</template>
<!-- Actions -->
<td
@ -212,6 +215,7 @@
v-if="hasAfterHook()"
class="faceted-search-hook faceted-search-hook-item-after"
v-html="getAfterHook(item)" />
</tr>
</tbody>
</table>

View File

@ -28,7 +28,23 @@ export const viewModesMixin = {
delete currentQueries['fetch_only_meta'];
}
return currentQueries
}
},
/*
* This computed property only returns the metadatum object where the title is.
* In repository level, there is not "title metadatum", this information comes directly from the item.title.
*/
titleItemMetadatum() {
const possibleTitleItemMetadatum = this.displayedMetadata.find(aMetadatum => aMetadatum.display && aMetadatum.metadata_type_object && aMetadatum.metadata_type_object.related_mapped_prop == 'title');
return possibleTitleItemMetadatum ? possibleTitleItemMetadatum : false;
},
/*
* This computed property only returns the metadatum object where the description is.
* In repository level, there is not "description metadatum", this information comes directly from the item.description.
*/
descriptionItemMetadatum() {
const possibleDescriptionItemMetadatum = this.displayedMetadata.find(aMetadatum => aMetadatum.display && aMetadatum.metadata_type_object && aMetadatum.metadata_type_object.related_mapped_prop == 'description');
return possibleDescriptionItemMetadatum ? possibleDescriptionItemMetadatum : false;
},
},
mounted() {
this.isSlideshowViewModeEnabled = (this.enabledViewModes && Array.isArray(this.enabledViewModes)) ? (this.enabledViewModes.findIndex((viewMode) => viewMode == 'slideshow') >= 0) : false;

View File

@ -273,17 +273,18 @@
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-arrowdown" />
</span>
</button>
<template v-for="metadatum of sortingMetadata">
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': (orderBy != 'meta_value' && orderBy != 'meta_value_num' && orderBy == metadatum.slug) || ((orderBy == 'meta_value' || orderBy == 'meta_value_num') && metaKey == metadatum.id) }"
v-for="metadatum of sortingMetadata"
v-if="metadatum != undefined"
:value="metadatum"
:key="metadatum.slug"
aria-role="listitem">
{{ metadatum.name }}
</b-dropdown-item>
</template>
</b-dropdown>
</template>
</b-field>
@ -325,14 +326,14 @@
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-arrowdown" />
</span>
</button>
<template v-for="(viewModeOption, index) of enabledViewModes">
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': viewModeOption == viewMode }"
v-for="(viewModeOption, index) of enabledViewModes"
v-if="(registeredViewModes[viewModeOption] != undefined && registeredViewModes[viewModeOption].full_screen == false) || (showFullscreenWithViewModes && registeredViewModes[viewModeOption] != undefined)"
:key="index"
:value="viewModeOption"
v-if="(registeredViewModes[viewModeOption] != undefined && registeredViewModes[viewModeOption].full_screen == false) || (showFullscreenWithViewModes && registeredViewModes[viewModeOption] != undefined)"
aria-role="listitem">
<span
v-if="!showInlineViewModeOptions"
@ -354,6 +355,7 @@
v-html="registeredViewModes[viewModeOption].icon"/>
<span v-if="!showInlineViewModeOptions">{{ registeredViewModes[viewModeOption].label }}</span>
</b-dropdown-item>
</template>
</b-dropdown>
</b-field>
</div>
@ -362,19 +364,20 @@
<div
id="tainacanFullScreenViewMode"
class="search-control-item search-control-item--full-screen-view-mode">
<template v-for="(viewModeOption, index) of enabledViewModes">
<button
class="button is-white"
:aria-label="$i18n.get('label_slides')"
@click="onChangeViewMode(viewModeOption)"
v-for="(viewModeOption, index) of enabledViewModes"
v-if="!showFullscreenWithViewModes && registeredViewModes[viewModeOption] != undefined && registeredViewModes[viewModeOption].full_screen == true"
:key="index"
:value="viewModeOption"
v-if="!showFullscreenWithViewModes && registeredViewModes[viewModeOption] != undefined && registeredViewModes[viewModeOption].full_screen == true ">
:value="viewModeOption">
<span
class="gray-icon view-mode-icon"
v-html="registeredViewModes[viewModeOption].icon"/>
<span class="is-hidden-tablet-only">{{ registeredViewModes[viewModeOption].label }}</span>
</button>
</template>
</div>
<!-- Exposers or alternative links modal button -->

View File

@ -17,8 +17,8 @@
&nbsp;{{ $i18n.get(entityType) }}
</p>
<ul class="has-text-gray status-list">
<template v-for="(statusOption, index) of $statusHelper.getStatuses()">
<li
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
@mouseenter="currentHoveredStatus = statusOption.slug"
@mouseleave="currentHoveredStatus = ''"
@ -40,6 +40,7 @@
</span>
<!-- {{ statusOption.name }} -->
</li>
</template>
</ul>
<p
v-if="summary.totals && summary.totals[entityType] && entityType == 'taxonomies'"

View File

@ -29,14 +29,15 @@
:aria-hidden="showDropdownMenu">
<!-- <p class="dropdown-menu-intro">{{ $i18n.get('Create a new role based on: ') }}</p> -->
<ul>
<template v-for="role of roles">
<li
v-for="role of roles"
:key="role.slug"
v-if="role.slug.match('tainacan')">
<router-link :to="'/roles/new?template=' + role.slug">
{{ role.name }}
</router-link>
</li>
</template>
<li><router-link to="/roles/new"><em>{{ $i18n.get('Blank') }}</em></router-link></li>
</ul>
</div>