Merge branch 'develop' into feature/gutenberg-faceted-search

This commit is contained in:
Mateus Machado Luna 2020-02-26 18:57:00 -03:00
commit 4038ca5bea
50 changed files with 392 additions and 502 deletions

6
package-lock.json generated
View File

@ -1964,9 +1964,9 @@
} }
}, },
"buefy": { "buefy": {
"version": "0.8.10", "version": "0.8.11",
"resolved": "https://registry.npmjs.org/buefy/-/buefy-0.8.10.tgz", "resolved": "https://registry.npmjs.org/buefy/-/buefy-0.8.11.tgz",
"integrity": "sha512-Lw/UP3Ku7o+oqam9TIoRMG5SrytGQwXWAoxAtqt6Wb9eSsMEqp/5o+jZnz8oteR06YWgjdSIfOv2YeEdjEkQCg==", "integrity": "sha512-+LcnrK4b3UKRXm1aalDfXvp5be7EJKJzLtRAhptnaHpCGySPDjm7MCvyIHnV02qjUMgwOF1UWp0xkkWc8suQOQ==",
"requires": { "requires": {
"bulma": "0.7.5" "bulma": "0.7.5"
} }

View File

@ -8,7 +8,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.19.0",
"buefy": "^0.8.10", "buefy": "^0.8.11",
"bulma": "^0.7.5", "bulma": "^0.7.5",
"css-vars-ponyfill": "^2.1.2", "css-vars-ponyfill": "^2.1.2",
"mdi": "^2.2.43", "mdi": "^2.2.43",

View File

@ -41,6 +41,7 @@ class Metadata extends Repository {
add_filter( 'pre_delete_post', array( &$this, 'force_delete_core_metadata' ), 10, 3 ); add_filter( 'pre_delete_post', array( &$this, 'force_delete_core_metadata' ), 10, 3 );
add_action('tainacan-insert-tainacan-taxonomy', [$this, 'hook_taxonomies_saved_as_private']); add_action('tainacan-insert-tainacan-taxonomy', [$this, 'hook_taxonomies_saved_as_private']);
add_action('tainacan-insert-tainacan-taxonomy', [$this, 'hook_taxonomies_saved_not_allow_insert_new_terms']);
} }
@ -1081,7 +1082,7 @@ class Metadata extends Repository {
FROM FROM
$wpdb->terms t INNER JOIN $wpdb->term_taxonomy tt ON t.term_id = tt.term_id $wpdb->terms t INNER JOIN $wpdb->term_taxonomy tt ON t.term_id = tt.term_id
LEFT JOIN ( LEFT JOIN (
SELECT DISTINCT term_taxonomy_id FROM $wpdb->term_relationships SELECT DISTINCT term_taxonomy_id FROM $wpdb->term_relationships
INNER JOIN ($items_query) as posts ON $wpdb->term_relationships.object_id = posts.ID INNER JOIN ($items_query) as posts ON $wpdb->term_relationships.object_id = posts.ID
) as tr ON tt.term_taxonomy_id = tr.term_taxonomy_id ) as tr ON tt.term_taxonomy_id = tr.term_taxonomy_id
WHERE tt.taxonomy = %s ORDER BY t.name ASC", $taxonomy_slug WHERE tt.taxonomy = %s ORDER BY t.name ASC", $taxonomy_slug
@ -1496,13 +1497,13 @@ class Metadata extends Repository {
$taxonomy_id = $taxonomy->get_id(); $taxonomy_id = $taxonomy->get_id();
$args = [ $args = [
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy', 'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
'meta_query' => [ 'meta_query' => [
[ [
'key' => '_option_taxonomy_id', 'key' => '_option_taxonomy_id',
'value' => $taxonomy_id 'value' => $taxonomy_id
] ]
], ],
'post_status' => $stati 'post_status' => $stati
]; ];
$metadata = $this->fetch($args, 'OBJECT'); $metadata = $this->fetch($args, 'OBJECT');
@ -1521,4 +1522,49 @@ class Metadata extends Repository {
} }
} }
/**
* When a taxonomy is saved disabling allow_insert. All related metadata should set allow_new_terms to 'no'
*
* @param \Tainacan\Entities\Taxonomy $taxonomy
* @return void
*/
public function hook_taxonomies_saved_not_allow_insert_new_terms($taxonomy) {
if ( $taxonomy instanceof Entities\Taxonomy && 'no' === $taxonomy->get_allow_insert() ) {
$taxonomy_id = $taxonomy->get_id();
$args = [
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
'meta_query' => [
[
'key' => '_option_taxonomy_id',
'value' => $taxonomy_id
],
[
'key' => '_option_allow_new_terms',
'value' => 'yes'
]
],
'post_status' => 'any',
];
$metadata = $this->fetch($args, 'OBJECT');
foreach ($metadata as $meta) {
$options = $meta->get_metadata_type_options();
$options['allow_new_terms'] = 'no';
$meta->set_metadata_type_options( $options );
if ( $meta->validate() ) {
$this->insert($meta);
}
}
}
}
} }

View File

@ -1009,8 +1009,8 @@ export default {
} }
.selected-cover-page { .selected-cover-page {
border: 1px solid var(--tainacan-gray2); border: 1px solid var(--tainacan-gray2);
padding: 8px; padding: 3px 8px;
font-size: .75em; font-size: .875em;
.span { vertical-align: middle;} .span { vertical-align: middle;}
.selected-cover-page-control { .selected-cover-page-control {

View File

@ -148,6 +148,7 @@
:placeholder="$i18n.get('instruction_parent_term')" :placeholder="$i18n.get('instruction_parent_term')"
:data="parentTerms" :data="parentTerms"
field="name" field="name"
clearable
v-model="parentTermName" v-model="parentTermName"
@select="onSelectParentTerm($event)" @select="onSelectParentTerm($event)"
:loading="isFetchingParentTerms" :loading="isFetchingParentTerms"

View File

@ -11,6 +11,7 @@
@input="search" @input="search"
field="label" field="label"
@select="onSelect" @select="onSelect"
clearable
:placeholder="(metadatumType === 'Tainacan\\Metadata_Types\\Relationship') ? $i18n.get('info_type_to_search_items') : $i18n.get('info_type_to_search_metadata')"> :placeholder="(metadatumType === 'Tainacan\\Metadata_Types\\Relationship') ? $i18n.get('info_type_to_search_items') : $i18n.get('info_type_to_search_metadata')">
<template slot-scope="props"> <template slot-scope="props">
<div class="media"> <div class="media">
@ -22,7 +23,9 @@
width="24" width="24"
:src="props.option.img"> :src="props.option.img">
</div> </div>
<div class="media-content"> <div
:style="{ width: props.option.img ? '' : '100%'}"
class="media-content">
<span class="ellipsed-text">{{ props.option.label }}</span> <span class="ellipsed-text">{{ props.option.label }}</span>
<span <span
v-if="props.option.total_items != undefined" v-if="props.option.total_items != undefined"

View File

@ -4,7 +4,6 @@
:aria-labelledby="'filter-label-id-' + filter.id" :aria-labelledby="'filter-label-id-' + filter.id"
:placeholder="$i18n.get('label_selectbox_init')" :placeholder="$i18n.get('label_selectbox_init')"
v-model="dateInit" v-model="dateInit"
size="is-small"
@focus="isTouched = true" @focus="isTouched = true"
@input="validadeValues()" @input="validadeValues()"
editable editable
@ -26,12 +25,11 @@
style="font-size: 0.75em; margin-bottom: 0.125em;" style="font-size: 0.75em; margin-bottom: 0.125em;"
class="has-text-centered is-marginless"> class="has-text-centered is-marginless">
{{ $i18n.get('label_until') }} {{ $i18n.get('label_until') }}
</p> </p>
<b-datepicker <b-datepicker
:aria-labelledby="'filter-label-id-' + filter.id" :aria-labelledby="'filter-label-id-' + filter.id"
:placeholder="$i18n.get('label_selectbox_init')" :placeholder="$i18n.get('label_selectbox_init')"
v-model="dateEnd" v-model="dateEnd"
size="is-small"
@input="validadeValues()" @input="validadeValues()"
@focus="isTouched = true" @focus="isTouched = true"
editable editable

View File

@ -77,7 +77,6 @@
:trap-focus="false" :trap-focus="false"
:date-formatter="(date) => dateFormatter(date)" :date-formatter="(date) => dateFormatter(date)"
:date-parser="(date) => dateParser(date)" :date-parser="(date) => dateParser(date)"
size="is-small"
icon="calendar-today" icon="calendar-today"
:years-range="[-200, 50]" :years-range="[-200, 50]"
:day-names="[ :day-names="[

View File

@ -175,11 +175,10 @@
flex-grow: 2; flex-grow: 2;
.dropdown-trigger button { .dropdown-trigger button {
padding: 0 0.5em !important;
height: auto !important; height: auto !important;
font-size: 1em !important;
i:not(.tainacan-icon-arrowdown) { i:not(.tainacan-icon-arrowdown) {
margin-top: -3px;
font-size: 1.25em; font-size: 1.25em;
font-style: normal; font-style: normal;
color: var(--tainacan-info-color); color: var(--tainacan-info-color);

View File

@ -194,13 +194,14 @@
.b-checkbox.checkbox { .b-checkbox.checkbox {
font-weight: normal; font-weight: normal;
font-size: 1em; font-size: 1em !important;
margin-right: 2px; margin-right: 2px;
} }
.datepicker { .datepicker {
.dropdown-menu { .dropdown-menu {
left: -18px; left: -18px;
right: 0;
} }
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
@ -210,19 +211,17 @@
max-width: 165px !important; max-width: 165px !important;
} }
.pagination .pagination-list .control { .pagination .pagination-list .control {
width: 77px !important; width: 50% !important;
.select { .select {
min-width: 100% !important; min-width: 100% !important;
select { select {
padding-left: 1px !important; padding-left: 1px !important;
font-size: 0.875em !important; min-width: 100% !important;
height: 24px !important;
min-width: 100% !important;
} }
&:not(.is-loading)::after { &:not(.is-loading)::after {
margin-top: -10px !important; font-size: 1em;
} }
} }
} }

View File

@ -872,12 +872,13 @@ export default {
margin-left: 0.5em; margin-left: 0.5em;
} }
.controls { .controls {
font-size: 0.875em;
position: absolute; position: absolute;
right: 5px; right: 5px;
top: 10px; top: 10px;
.switch { .switch {
position: relative; position: relative;
bottom: 3px; bottom: 2px;
} }
.icon { .icon {
bottom: 1px; bottom: 1px;

View File

@ -1117,12 +1117,13 @@ export default {
margin-left: 0.5em; margin-left: 0.5em;
} }
.controls { .controls {
font-size: 0.875em;
position: absolute; position: absolute;
right: 5px; right: 5px;
top: 10px; top: 10px;
.switch { .switch {
position: relative; position: relative;
bottom: 3px; bottom: 1px;
} }
.icon { .icon {
bottom: 1px; bottom: 1px;

View File

@ -59,23 +59,18 @@
</b-dropdown> </b-dropdown>
</b-field> </b-field>
<div class="search-area is-hidden-mobile"> <div class="search-area is-hidden-mobile">
<div class="control has-icons-right is-small is-clearfix"> <b-input
<input :placeholder="$i18n.get('instruction_search')"
class="input is-small" size="is-small"
:placeholder="$i18n.get('instruction_search')" type="search"
type="search" :aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('terms')"
:aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('terms')" autocomplete="on"
autocomplete="on" v-model="searchQuery"
v-model="searchQuery" icon-right="magnify"
@keyup.enter="searchTerms(0)" icon-right-clickable
:disabled="isEditingTerm"> @icon-right-click="searchTerms(0)"
<span @keyup.enter.native="searchTerms(0)"
@click="searchTerms(0)" :disabled="isEditingTerm"/>
class="icon is-right"
:class="{ 'has-text-gray3': isEditingTerm }">
<i class="tainacan-icon tainacan-icon-search" />
</span>
</div>
</div> </div>
</div> </div>
<div class="columns"> <div class="columns">
@ -528,14 +523,6 @@ export default {
} }
.control { .control {
width: 100%; width: 100%;
.icon {
pointer-events: all;
cursor: pointer;
color: var(--tainacan-blue5);
height: 27px;
font-size: 1.125em !important;
height: auto !important;
}
} }
a { a {
margin-left: 12px; margin-left: 12px;

View File

@ -19,20 +19,6 @@ class Compound extends Metadata_Type {
$this->set_component('tainacan-compound'); $this->set_component('tainacan-compound');
} }
/**
* @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata
* @return string
*/
public function render( $itemMetadata ){
return '<tainacan-text
id="tainacan-text-' . $itemMetadata->get_item()->WP_Post->post_name . '"
metadatum_id ="'.$itemMetadata->get_metadatum()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_metadatum()->get_name().'"></tainacan-text>';
}
/** /**
* generate the metadata for this metadatum type * generate the metadata for this metadatum type
*/ */

View File

@ -23,20 +23,6 @@ class Core_Description extends Metadata_Type {
$this->set_description( __('The "Core Description" is a compulsory metadata automatically created for all collections by default. This is the main description displayed in items lists and where the basic research tools will do their searches.', 'tainacan') ); $this->set_description( __('The "Core Description" is a compulsory metadata automatically created for all collections by default. This is the main description displayed in items lists and where the basic research tools will do their searches.', 'tainacan') );
} }
/**
* @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata
* @return string
*/
public function render( $itemMetadata ){
return '<tainacan-textarea
id="tainacan-textarea-' . $itemMetadata->get_item()->WP_Post->post_name . '"
metadatum_id ="'.$itemMetadata->get_metadatum()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_metadatum()->get_name().'"></tainacan-textarea>';
}
/** /**
* generate the metadata for this metadatum type * generate the metadata for this metadatum type
*/ */

View File

@ -23,20 +23,6 @@ class Core_Title extends Metadata_Type {
$this->set_description( __('The "Core Title" is a compulsory metadata automatically created for all collections by default. It is the main metadatum of the item and where the basic research tools will do their searches.', 'tainacan') ); $this->set_description( __('The "Core Title" is a compulsory metadata automatically created for all collections by default. It is the main metadatum of the item and where the basic research tools will do their searches.', 'tainacan') );
} }
/**
* @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata
* @return string
*/
public function render( $itemMetadata ){
return '<tainacan-text
id="tainacan-text-' . $itemMetadata->get_item()->WP_Post->post_name . '"
metadatum_id ="'.$itemMetadata->get_metadatum()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_metadatum()->get_name().'"></tainacan-text>';
}
/** /**
* generate the metadata for this metadatum type * generate the metadata for this metadatum type
*/ */

View File

@ -27,19 +27,6 @@ class Date extends Metadata_Type {
'); ');
} }
/**
* @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata
* @return string
*/
public function render( $itemMetadata ){
return '<tainacan-date metadatum_id ="'.$itemMetadata->get_metadatum()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_metadatum()->get_name().'"></tainacan-date>';
}
public function validate( Item_Metadata_Entity $item_metadata) { public function validate( Item_Metadata_Entity $item_metadata) {
$value = $item_metadata->get_value(); $value = $item_metadata->get_value();
$format = 'Y-m-d'; $format = 'Y-m-d';

View File

@ -89,8 +89,6 @@ abstract class Metadata_Type {
* @var string * @var string
*/ */
private $preview_template; private $preview_template;
abstract function render( $itemMetadata );
public function __construct(){ public function __construct(){

View File

@ -37,17 +37,4 @@ class Numeric extends Metadata_Type {
] ]
]; ];
} }
/**
* @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata
* @return string
*/
public function render( $itemMetadata ){
return '<tainacan-numeric
metadatum_id ="'.$itemMetadata->get_metadatum()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_metadatum()->get_name().'"></tainacan-numeric>';
}
} }

View File

@ -65,20 +65,6 @@ class Relationship extends Metadata_Type {
] ]
]; ];
} }
/**
* @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata
* @return string
*/
public function render( $itemMetadata ){
return '<tainacan-relationship
collection_id="' . $this->get_options()['collection_id'] . '"
metadatum_id ="'.$itemMetadata->get_metadatum()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_metadatum()->get_name().'"></tainacan-relationship>';
}
public function validate_options(\Tainacan\Entities\Metadatum $metadatum) { public function validate_options(\Tainacan\Entities\Metadatum $metadatum) {
if ( !in_array($metadatum->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) ) if ( !in_array($metadatum->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )

View File

@ -41,20 +41,6 @@ class Selectbox extends Metadata_Type {
] ]
]; ];
} }
/**
* @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata
* @return string
*/
public function render( $itemMetadata ){
$options = $this->get_option('options');
return '<tainacan-selectbox
options="' . $options . '"
metadatum_id ="'.$itemMetadata->get_metadatum()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_metadatum()->get_name().'"></tainacan-selectbox>';
}
/** /**
* @param \Tainacan\Entities\Metadatum $metadatum * @param \Tainacan\Entities\Metadatum $metadatum

View File

@ -53,6 +53,7 @@
:data="parentTerms" :data="parentTerms"
field="name" field="name"
v-model="parentTermName" v-model="parentTermName"
clearable
@select="onSelectParentTerm($event)" @select="onSelectParentTerm($event)"
:loading="isFetchingParentTerms" :loading="isFetchingParentTerms"
@input="fecthParentTerms($event)" @input="fecthParentTerms($event)"

View File

@ -93,21 +93,6 @@ class Taxonomy extends Metadata_Type {
]; ];
} }
/**
* @param $itemMetadata Item_Metadata_Entity The instace of the entity itemMetadata
* @return string
*/
public function render( $itemMetadata ){
$options = ( isset( $this->get_options()['options'] ) ) ? $this->get_options()['options'] : '';
return '<tainacan-selectbox
options="' . $options . '"
metadatum_id ="'.$itemMetadata->get_metadatum()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_metadatum()->get_name().'"></tainacan-selectbox>';
}
public function validate_options( Metadatum $metadatum) { public function validate_options( Metadatum $metadatum) {
if ( !in_array($metadatum->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) ) if ( !in_array($metadatum->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )

View File

@ -25,18 +25,6 @@ class Text extends Metadata_Type {
</div> </div>
'); ');
} }
/**
* @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata
* @return string
*/
public function render( $itemMetadata ){
return '<tainacan-text metadatum_id ="'.$itemMetadata->get_metadatum()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_metadatum()->get_name().'"></tainacan-text>';
}
/** /**
* Get the value as a HTML string with links * Get the value as a HTML string with links

View File

@ -26,19 +26,6 @@ class Textarea extends Metadata_Type {
'); ');
} }
/**
* @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata
* @return string
*/
public function render( $itemMetadata ) {
return '<tainacan-textarea
metadatum_id ="'.$itemMetadata->get_metadatum()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_metadatum()->get_name().'"></tainacan-textarea>';
}
public function get_multivalue_prefix() { public function get_multivalue_prefix() {
return '<p>'; return '<p>';

View File

@ -242,7 +242,6 @@ export default {
color: turquoise5; color: turquoise5;
text-shadow: none; text-shadow: none;
background-color: var(--tainacan-turquoise2); background-color: var(--tainacan-turquoise2);
font-size: 0.75em;
font-weight: 400; font-weight: 400;
padding: 10px 14px; padding: 10px 14px;
} }

View File

@ -41,22 +41,19 @@
</button> </button>
</div> </div>
<div class="search-area is-hidden-mobile"> <div class="search-area is-hidden-mobile">
<div class="control has-icons-right is-small is-clearfix"> <b-input
<input type="search"
autocomplete="on" autocomplete="on"
:aria-label="$i18n.get('instruction_search_in_repository')" :aria-label="$i18n.get('instruction_search_in_repository')"
:placeholder="$i18n.get('instruction_search_in_repository')" :placeholder="$i18n.get('instruction_search_in_repository')"
class="input is-small search-header" class="search-header"
type="search" size="is-small"
:value="searchQuery" :value="searchQuery"
@input="futureSearchQuery = $event.target.value" @input.native="futureSearchQuery = $event.target.value"
@keyup.enter="updateSearch()"> @keyup.enter.native="updateSearch()"
<span class="icon is-right"> icon-right="magnify"
<i icon-right-clickable
@click="updateSearch()" @icon-right-click="updateSearch()" />
class="tainacan-icon tainacan-icon-search"/>
</span>
</div>
<b-dropdown <b-dropdown
ref="advancedSearchShortcut" ref="advancedSearchShortcut"
class="advanced-search-header-dropdown" class="advanced-search-header-dropdown"
@ -276,14 +273,6 @@
.search-header:focus, .search-header:active { .search-header:focus, .search-header:active {
width: 372px !important; width: 372px !important;
} }
.icon:not(.add-i) {
pointer-events: all;
color: var(--tainacan-blue5);
cursor: pointer;
height: 27px;
font-size: 1.125em;
width: 30px !important;
}
} }
} }
} }

View File

@ -131,7 +131,6 @@ export default {
color: var(--tainacan-white); color: var(--tainacan-white);
text-shadow: 1px 1px var(--tainacan-turquoise4); text-shadow: 1px 1px var(--tainacan-turquoise4);
background-color: var(--tainacan-turquoise3); background-color: var(--tainacan-turquoise3);
font-size: 0.75em;
font-weight: 400; font-weight: 400;
padding: 10px 14px; padding: 10px 14px;
} }
@ -142,7 +141,6 @@ export default {
.repository-header-tooltips .tooltip-inner { .repository-header-tooltips .tooltip-inner {
color: var(--tainacan-white); color: var(--tainacan-white);
background-color: var(--tainacan-blue3); background-color: var(--tainacan-blue3);
font-size: 0.75em;
font-weight: 400; font-weight: 400;
padding: 10px 14px; padding: 10px 14px;
} }

View File

@ -42,7 +42,6 @@
@input="searchActivities()" @input="searchActivities()"
:date-formatter="(date) => dateFormatter(date)" :date-formatter="(date) => dateFormatter(date)"
:date-parser="(date) => dateParser(date)" :date-parser="(date) => dateParser(date)"
size="is-small"
icon="calendar-today" icon="calendar-today"
:years-range="[-50, 3]" :years-range="[-50, 3]"
:day-names="[ :day-names="[
@ -82,53 +81,48 @@
<b-field <b-field
style="margin-left: auto" style="margin-left: auto"
class="header-item"> class="header-item">
<div class="control has-icons-right is-small is-clearfix"> <b-autocomplete
<b-autocomplete clearable
:data="users" :data="users"
:placeholder="$i18n.get('instruction_type_search_users_filter')" :placeholder="$i18n.get('instruction_type_search_users_filter')"
keep-first keep-first
open-on-focus open-on-focus
@input="fetchUsersForFiltering" @input="fetchUsersForFiltering"
@focus.once="($event) => fetchUsersForFiltering($event.target.value)" @focus.once="($event) => fetchUsersForFiltering($event.target.value)"
@select="filterActivitiesByUser" @select="filterActivitiesByUser"
:loading="isFetchingUsers" :loading="isFetchingUsers"
field="name" field="name"
icon="account"> icon="account">
<template slot-scope="props"> <template slot-scope="props">
<div class="media"> <div class="media">
<div <div
v-if="props.option.avatar_urls && props.option.avatar_urls['24']" v-if="props.option.avatar_urls && props.option.avatar_urls['24']"
class="media-left"> class="media-left">
<img <img
width="24" width="24"
:src="props.option.avatar_urls['24']"> :src="props.option.avatar_urls['24']">
</div>
<div class="media-content">
{{ props.option.name }}
</div>
</div> </div>
</template> <div class="media-content">
{{ props.option.name }}
</div>
</div>
</template>
<template slot="empty">{{ $i18n.get('info_no_user_found') }}</template> <template slot="empty">{{ $i18n.get('info_no_user_found') }}</template>
</b-autocomplete> </b-autocomplete>
</div>
</b-field> </b-field>
<b-field class="header-item"> <b-field class="header-item">
<div class="control has-icons-right is-small is-clearfix"> <b-input
<input :placeholder="$i18n.get('instruction_search')"
class="input is-small" type="search"
:placeholder="$i18n.get('instruction_search')" size="is-small"
type="search" :aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('activities')"
:aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('activities')" autocomplete="on"
autocomplete="on" v-model="searchQuery"
v-model="searchQuery" @keyup.enter.native="searchActivities()"
@keyup.enter="searchActivities()"> icon-right="magnify"
<span icon-right-clickable
@click="searchActivities()" @icon-right-click="searchActivities()" />
class="icon is-right">
<i class="tainacan-icon tainacan-icon-search" />
</span>
</div>
</b-field> </b-field>
</div> </div>

View File

@ -13,6 +13,7 @@
class="header-item"> class="header-item">
<div class="control has-icons-right is-small is-clearfix"> <div class="control has-icons-right is-small is-clearfix">
<b-autocomplete <b-autocomplete
clearable
v-model="filteredRole" v-model="filteredRole"
:data="filteredRoles" :data="filteredRoles"
:placeholder="$i18n.get('instruction_type_search_roles_filter')" :placeholder="$i18n.get('instruction_type_search_roles_filter')"

View File

@ -125,21 +125,17 @@
<!-- Textual Search --------------> <!-- Textual Search -------------->
<b-field class="header-item"> <b-field class="header-item">
<div class="control has-icons-right is-small is-clearfix"> <b-input
<input :placeholder="$i18n.get('instruction_search')"
class="input is-small" type="search"
:placeholder="$i18n.get('instruction_search')" size="is-small"
type="search" :aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('collections')"
:aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('collections')" autocomplete="on"
autocomplete="on" v-model="searchQuery"
v-model="searchQuery" @keyup.enter.native="searchCollections()"
@keyup.enter="searchCollections()"> icon-right="magnify"
<span icon-right-clickable
@click="searchCollections()" @icon-right-click="searchCollections()" />
class="icon is-right">
<i class="tainacan-icon tainacan-icon-search" />
</span>
</div>
</b-field> </b-field>
</div> </div>

View File

@ -77,22 +77,17 @@
<div <div
role="search" role="search"
class="search-area"> class="search-area">
<div class="control has-icons-right is-small is-clearfix"> <b-input
<input size="is-small"
class="input is-small" :placeholder="$i18n.get('instruction_search')"
:placeholder="$i18n.get('instruction_search')" type="search"
type="search" :aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('items')"
:aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('items')" :value="searchQuery"
:value="searchQuery" @input.native="futureSearchQuery = $event.target.value"
@input="futureSearchQuery = $event.target.value" @keyup.enter.native="updateSearch()"
@keyup.enter="updateSearch()"> icon-right="magnify"
<span icon-right-clickable
aria-controls="items-list-results" @icon-right-click="updateSearch()" />
@click="updateSearch()"
class="icon is-right">
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-search"/>
</span>
</div>
<a <a
@click="openAdvancedSearch = !openAdvancedSearch" @click="openAdvancedSearch = !openAdvancedSearch"
style="font-size: 0.75em;" style="font-size: 0.75em;"
@ -1332,17 +1327,6 @@
position: relative; position: relative;
position: sticky; position: sticky;
} }
.label {
font-size: 0.75em;
font-weight: normal;
}
.checkbox {
margin-bottom: 5px;
align-items: baseline;
}
} }
#filter-menu-compress-button { #filter-menu-compress-button {
position: absolute; position: absolute;
@ -1426,7 +1410,7 @@
color: var(--tainacan-label-color); color: var(--tainacan-label-color);
font-size: 0.875em; font-size: 0.875em;
font-weight: normal; font-weight: normal;
margin-top: 3px; margin-top: 2px;
margin-bottom: 2px; margin-bottom: 2px;
cursor: default; cursor: default;
} }
@ -1498,11 +1482,6 @@
.control { .control {
width: 100%; width: 100%;
.icon {
pointer-events: all;
cursor: pointer;
color: var(--tainacan-label-color);
}
margin-bottom: 5px; margin-bottom: 5px;
} }
.is-pulled-right { .is-pulled-right {
@ -1510,10 +1489,6 @@
right: 15px; right: 15px;
top: 100%; top: 100%;
} }
.input {
border: 1px solid var(--tainacan-input-border-color);
min-height: 30px !important;
}
a { a {
margin-left: 12px; margin-left: 12px;
white-space: nowrap; white-space: nowrap;
@ -1566,6 +1541,7 @@
p { p {
margin: 0 auto; margin: 0 auto;
font-size: 0.885em;
} }
&>div { &>div {
@ -1575,8 +1551,8 @@
.button:hover, .button:hover,
.button:active, .button:active,
.button:focus { .button:focus {
background: none; background: none !important;
color:var(--tainacan-yellow2); color: var(--tainacan-yellow2) !important;
font-weight: bold; font-weight: bold;
border: none; border: none;
cursor: pointer; cursor: pointer;

View File

@ -87,21 +87,17 @@
<!-- Textual Search --------------> <!-- Textual Search -------------->
<b-field class="header-item"> <b-field class="header-item">
<div class="control has-icons-right is-small is-clearfix"> <b-input
<input :placeholder="$i18n.get('instruction_search')"
class="input is-small" type="search"
:placeholder="$i18n.get('instruction_search')" size="is-small"
type="search" :aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('taxonomies')"
:aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('taxonomies')" autocomplete="on"
autocomplete="on" v-model="searchQuery"
v-model="searchQuery" @keyup.enter.native="searchTaxonomies()"
@keyup.enter="searchTaxonomies()"> icon-right="magnify"
<span icon-right-clickable
@click="searchTaxonomies()" @icon-right-click="searchTaxonomies()" />
class="icon is-right">
<i class="tainacan-icon tainacan-icon-search" />
</span>
</div>
</b-field> </b-field>
</div> </div>

View File

@ -0,0 +1,46 @@
// This used to be inside the TainacanForm class but there are meny places where this settings might be desirable.
.control {
font-size: 1em;
.is-clickable {
pointer-events: auto !important;
cursor: pointer;
}
&.has-icons-right,
&.has-icons-left {
.icon {
height: 100%;
.mdi::before {
color: var(--tainacan-info-color);
display: inline-block;
font: normal normal normal 20px/1 "TainacanIcons";
font-size: inherit;
text-rendering: auto;
vertical-align: middle;
line-height: inherit;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 1.25em;
text-transform: none !important;
letter-spacing: normal !important;
}
.mdi-alert-circle::before {
content: "close";
color: inherit;
}
.mdi-magnify::before {
content: 'search';
}
.mdi-close-circle::before {
content: 'close';
font-size: 1em;
}
.mdi-account::before {
content: 'user';
}
}
}
&.has-icons-right .icon .mdi-magnify::before {
color: var(--tainacan-blue5);
}
}

View File

@ -138,6 +138,8 @@
color: var(--tainacan-black) !important; color: var(--tainacan-black) !important;
} }
a { a,
a:hover,
a:focus {
color: var(--tainacan-secondary); color: var(--tainacan-secondary);
} }

View File

@ -20,11 +20,8 @@
cursor: default; cursor: default;
} }
} }
&>.control.has-icons-left .icon {
height: 100%;//2.125em;
width: 2.125em;
}
.dropdown-menu { .dropdown-menu {
font-size: 1em;
padding: 0px; padding: 0px;
margin-top: 0; margin-top: 0;
border-radius: 0px; border-radius: 0px;
@ -61,6 +58,7 @@
.media-left { .media-left {
margin-right: 0.5em; margin-right: 0.5em;
display: flex;
} }
.media-content { .media-content {
display: flex; display: flex;
@ -101,21 +99,6 @@
.taginput.is-expanded { .taginput.is-expanded {
width: 100%; width: 100%;
} }
.taginput-container .mdi-magnify::before,
.autocomplete .mdi-magnify::before {
color: var(--tainacan-info-color);
content: 'search';
display: inline-block;
font: normal normal normal 20px/1 "TainacanIcons";
font-size: inherit;
text-rendering: auto;
vertical-align: middle;
line-height: inherit;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 1.25em;
text-transform: none !important;
}
.taginput-container { .taginput-container {
padding: 0px !important; padding: 0px !important;
@ -158,6 +141,9 @@
} }
} }
} }
.autocomplete .icon {
height: 100% !important;
}
} }
.selected-list-box { .selected-list-box {
padding: 4px 6px 0px 6px; padding: 4px 6px 0px 6px;
@ -222,6 +208,14 @@
// } // }
// } // }
& .dropdown.is-mobile-modal {
@media screen and (max-width: 768px) {
.field.has-addons {
font-size: 1.125em;
}
}
}
.dropdown-menu { .dropdown-menu {
background: transparent; background: transparent;
border: none; border: none;
@ -232,6 +226,7 @@
} }
.datepicker-header { .datepicker-header {
.pagination { .pagination {
a>span>i:before { a>span>i:before {
display: inline-block; display: inline-block;
@ -253,7 +248,7 @@
&>span>i:before { &>span>i:before {
content: 'previous'; content: 'previous';
font-size: 1em; font-size: 1.25em;
} }
} }
@ -263,7 +258,7 @@
&>span>i:before { &>span>i:before {
content: 'next'; content: 'next';
font-size: 1em; font-size: 1.25em;
} }
} }
} }
@ -271,7 +266,8 @@
.datepicker-table { .datepicker-table {
padding: 0; padding: 0;
margin-bottom: 0px; margin: 0px;
width: 100%;
.datepicker-cell { .datepicker-cell {
border: none !important; border: none !important;
@ -316,6 +312,7 @@
padding-bottom: 0.5em; padding-bottom: 0.5em;
.pagination { .pagination {
font-size: 1.1em;
flex-wrap: wrap; flex-wrap: wrap;
.pagination-list { .pagination-list {
@ -325,24 +322,36 @@
width: 100% !important; width: 100% !important;
.control { .control {
height: 24px !important; select {
border: none !important;
min-height: 26px;
}
}
.control:first-child {
margin-right: 1px;
.select {
border-right: 1px solid var(--tainacan-input-border-color);
margin-right: 1px;
}
} }
} }
} }
.pagination-previous { .pagination-previous {
margin: 0; margin: 0;
height: 24px; height: 1.5em;
padding: 0; padding: 0;
font-size: 0.75em;
order: 3; order: 3;
min-height: 24px;
margin-bottom: 0.35em;
} }
.pagination-next { .pagination-next {
margin: 0; margin: 0;
height: 24px; height: 1.5em;
padding: 0; padding: 0;
font-size: 0.75em; min-height: 24px;
margin-bottom: 0.35em;
} }
} }
} }

View File

@ -1,7 +1,10 @@
#filters-modal { #filters-modal {
z-index: 999;
padding: 0; padding: 0;
&.is-fullscreen {
z-index: 9999;
}
.modal-content { .modal-content {
padding: 24px 18px $page-side-padding; padding: 24px 18px $page-side-padding;
padding: 24px 18px 24px 4.1666667vw; padding: 24px 18px 24px 4.1666667vw;
@ -22,7 +25,7 @@
.modal-close { .modal-close {
top: 32px; top: 32px;
right: calc(8.3333333% + 28px); right: calc(8.3333333% + 28px);
background-color: var(--tainacan-white); background-color: var(--tainacan-background-color);
&::before, &::after { &::before, &::after {
background-color: var(--tainacan-secondary); background-color: var(--tainacan-secondary);
@ -32,7 +35,7 @@
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.modal-content { .modal-content {
background-color: var(--tainacan-white); background-color: var(--tainacan-background-color);
margin: 0 12% 0 0; margin: 0 12% 0 0;
margin: 0 12vw 0 0; margin: 0 12vw 0 0;
padding: $page-small-side-padding; padding: $page-small-side-padding;

View File

@ -46,6 +46,7 @@ input[type="week"].input {
&::placeholder { &::placeholder {
font-size: 0.875em; font-size: 0.875em;
color: var(--tainacan-info-color) !important; color: var(--tainacan-info-color) !important;
text-overflow: ellipsis;
} }
&::-ms-input-placeholder { &::-ms-input-placeholder {
font-size: 0.875em; font-size: 0.875em;

View File

@ -1,5 +1,6 @@
// Tainacan modals // Tainacan modals
.modal .animation-content { .modal .animation-content {
background: none;
width: 91.6666667%; width: 91.6666667%;
width: 91.6666667vw; width: 91.6666667vw;
max-height: 86%; max-height: 86%;
@ -96,11 +97,12 @@
} }
// Bulma modals customized for Tainacan (custom-dialog.vue) // Bulma modals customized for Tainacan (custom-dialog.vue)
.dialog { .dialog {
.modal-background { .modal-background {
background-color: rgba(0, 0, 0, 0.70); background-color: rgba(0, 0, 0, 0.70);
} }
.modal-card { .modal-card {
background-color: var(--tainacan-white); background-color: var(--tainacan-background-color);
color: var(--tainacan-secondary); color: var(--tainacan-secondary);
border-radius: 10px; border-radius: 10px;
flex-wrap: wrap; flex-wrap: wrap;
@ -135,6 +137,7 @@
background: var(--tainacan-background-color); background: var(--tainacan-background-color);
padding: 0px 0px 12px 20px; padding: 0px 0px 12px 20px;
width: 50%; width: 50%;
font-size: 0.875em;
} }
.modal-card-foot { .modal-card-foot {
justify-content: space-between; justify-content: space-between;
@ -159,7 +162,7 @@
border: none; border: none;
} }
.button:not(.is-success):not(.is-secondary) { .button:not(.is-success):not(.is-secondary) {
background-color: var(--tainacan-white); background-color: var(--tainacan-background-color);
color: var(--tainacan-secondary); color: var(--tainacan-secondary);
border: 1px solid var(--tainacan-gray4); border: 1px solid var(--tainacan-gray4);
} }
@ -179,7 +182,7 @@
top: 100px; top: 100px;
bottom: 100px; bottom: 100px;
right: 100px; right: 100px;
background-color: var(--tainacan-white); background-color: var(--tainacan-background-color);
z-index: 99999999999 !important; z-index: 99999999999 !important;
.media-toolbar button.button:not(.is-small):not(.is-medium):not(.is-large){ .media-toolbar button.button:not(.is-small):not(.is-medium):not(.is-large){

View File

@ -26,10 +26,6 @@
color: var(--tainacan-input-color) !important; color: var(--tainacan-input-color) !important;
} }
.control {
font-size: 1em;
}
.shown-items { .shown-items {
font-size: 0.875em; font-size: 0.875em;
} }

View File

@ -5,13 +5,16 @@
&:not(.is-multiple) { &:not(.is-multiple) {
height: auto; height: auto;
} }
&.is-small select {
min-height: 24px !important;
}
select { select {
background: transparent; // WordPress 5.3 adds arrows here background: transparent; // WordPress 5.3 adds arrows here
border: none; border: none;
border-radius: 1px !important; border-radius: 1px !important;
font-weight: normal; font-weight: normal;
font-size: 0.875em !important; font-size: 0.875em !important;
min-height: 30px !important; line-height: 1.5em;
height: auto !important; height: auto !important;
padding: calc(0.375em - 1px) 20px calc(0.375em - 1px) 10px !important; padding: calc(0.375em - 1px) 20px calc(0.375em - 1px) 10px !important;
margin-top: 0px !important; margin-top: 0px !important;
@ -27,6 +30,7 @@
&[disabled=disabled] { &[disabled=disabled] {
background: var(--tainacan-gray1) !important; background: var(--tainacan-gray1) !important;
} }
} }
&:not(.is-loading)::after { &:not(.is-loading)::after {
content: "arrowdown" !important; content: "arrowdown" !important;
@ -42,6 +46,7 @@
text-transform: none !important; text-transform: none !important;
letter-spacing: normal !important; letter-spacing: normal !important;
font-size: 1.2em; font-size: 1.2em;
line-height: 1.5em;
} }
&.is-loading.is-small::after { &.is-loading.is-small::after {
font-size: 0.875em; font-size: 0.875em;

View File

@ -4,9 +4,6 @@
width: 100%; width: 100%;
padding: 0; padding: 0;
.control {
font-size: 1em;
}
.form-submit { .form-submit {
justify-content: space-between !important; justify-content: space-between !important;
padding: 12px 0px ; padding: 12px 0px ;
@ -80,7 +77,7 @@
border: 1px solid var(--tainacan-input-border-color); border: 1px solid var(--tainacan-input-border-color);
background-color: var(--tainacan-gray1) !important; background-color: var(--tainacan-gray1) !important;
color: var(--tainacan-secondary) !important; color: var(--tainacan-secondary) !important;
padding: 0.26em 0.6em !important; padding: 0.25em 0.6em !important;
border-radius: 0 !important; border-radius: 0 !important;
.mdi::before { .mdi::before {
@ -105,28 +102,6 @@
} }
} }
} }
.control {
&.has-icons-right {
.icon {
height: 2.0em;
.mdi-alert-circle::before {
content: "close";
display: inline-block;
font: normal normal normal 20px/1 "TainacanIcons";
font-size: inherit;
text-rendering: auto;
vertical-align: middle;
line-height: inherit;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: none !important;
text-transform: none !important;
letter-spacing: normal !important;
font-size: 1em;
}
}
}
}
.radio, .checkbox { .radio, .checkbox {
align-items: center; align-items: center;
margin-bottom: 5px; margin-bottom: 5px;

View File

@ -21,6 +21,7 @@
} }
} }
.tooltip { .tooltip {
font-size: 0.6875em;
z-index: 999999999; z-index: 999999999;
display: block !important; display: block !important;
@ -31,7 +32,7 @@
.tooltip-inner { .tooltip-inner {
background: var(--tainacan-primary); background: var(--tainacan-primary);
color: var(--tainacan-info-color); color: var(--tainacan-info-color);
font-size: 0.6875em; font-size: 1em;
border-radius: 5px; border-radius: 5px;
padding: 10px 14px; padding: 10px 14px;
max-width: 280px; max-width: 280px;
@ -138,6 +139,7 @@
pointer-events: none; pointer-events: none;
cursor: none; cursor: none;
flex-wrap: wrap; flex-wrap: wrap;
font-size: 1.25em;
.metadata-type-label { .metadata-type-label {
font-weight: 600; font-weight: 600;

View File

@ -11,6 +11,7 @@
// Import Tainacan custom styles // Import Tainacan custom styles
@import "../scss/_tainacan-form.scss"; @import "../scss/_tainacan-form.scss";
@import "../scss/_control.scss";
@import "../scss/_buttons.scss"; @import "../scss/_buttons.scss";
@import "../scss/_selects.scss"; @import "../scss/_selects.scss";
@import "../scss/_inputs.scss"; @import "../scss/_inputs.scss";

View File

@ -213,6 +213,7 @@ export default {
paged: undefined, paged: undefined,
totalCollections: 0, totalCollections: 0,
swiperOptions: { swiperOptions: {
watchOverflow: true,
mousewheel: true, mousewheel: true,
observer: true, observer: true,
preventInteractionOnTransition: true, preventInteractionOnTransition: true,

View File

@ -223,6 +223,7 @@ export default {
paged: undefined, paged: undefined,
totalItems: 0, totalItems: 0,
swiperOptions: { swiperOptions: {
watchOverflow: true,
mousewheel: true, mousewheel: true,
observer: true, observer: true,
preventInteractionOnTransition: true, preventInteractionOnTransition: true,

View File

@ -204,6 +204,7 @@ export default {
paged: undefined, paged: undefined,
totalTerms: 0, totalTerms: 0,
swiperOptions: { swiperOptions: {
watchOverflow: true,
mousewheel: true, mousewheel: true,
observer: true, observer: true,
preventInteractionOnTransition: true, preventInteractionOnTransition: true,

View File

@ -58,22 +58,17 @@
<div <div
role="search" role="search"
class="search-area"> class="search-area">
<div class="control has-icons-right is-small is-clearfix"> <b-input
<input size="is-small"
class="input is-small" :placeholder="$i18n.get('instruction_search')"
:placeholder="$i18n.get('instruction_search')" type="search"
type="search" :aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('items')"
:aria-label="$i18n.get('instruction_search') + ' ' + $i18n.get('items')" :value="searchQuery"
:value="searchQuery" @input.native="futureSearchQuery = $event.target.value"
@input="futureSearchQuery = $event.target.value" @keyup.enter.native="updateSearch()"
@keyup.enter="updateSearch()"> icon-right="magnify"
<span icon-right-clickable
aria-controls="items-list-results" @icon-right-click="updateSearch()" />
@click="updateSearch()"
class="icon is-right">
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-search"/>
</span>
</div>
<a <a
v-if="!hideAdvancedSearch" v-if="!hideAdvancedSearch"
@click="openAdvancedSearch = !openAdvancedSearch" @click="openAdvancedSearch = !openAdvancedSearch"
@ -1185,29 +1180,6 @@
padding: 0; padding: 0;
} }
.filters-menu {
border-right: 0;
.columns {
display: flex;
}
.taginput-container {
.control.has-icons-left .icon {
top: 5px;
}
}
.label {
font-size: 0.75em;
font-weight: normal;
}
.checkbox {
margin-bottom: 5px;
align-items: baseline;
}
}
#filter-menu-compress-button { #filter-menu-compress-button {
position: absolute; position: absolute;
z-index: 99; z-index: 99;
@ -1306,7 +1278,7 @@
color: var(--tainacan-label-color); color: var(--tainacan-label-color);
font-size: 0.875em; font-size: 0.875em;
font-weight: normal; font-weight: normal;
margin-top: 3px; margin-top: 2px;
margin-bottom: 2px; margin-bottom: 2px;
cursor: default; cursor: default;
} }
@ -1373,11 +1345,6 @@
.control { .control {
width: 100%; width: 100%;
.icon {
pointer-events: all;
cursor: pointer;
color: var(--tainacan-blue5);
}
margin: -2px 0 5px 0; margin: -2px 0 5px 0;
} }
.is-pulled-right { .is-pulled-right {
@ -1385,9 +1352,6 @@
right: 0; right: 0;
top: 100%; top: 100%;
} }
.input {
border: 1px solid var(--tainacan-input-border-color);
}
a { a {
margin-left: 12px; margin-left: 12px;
white-space: nowrap; white-space: nowrap;
@ -1410,6 +1374,39 @@
} }
} }
.metadata-alert {
display: flex;
justify-content: space-between;
align-items: center;
margin: 6px $page-side-padding;
border-radius: 3px;
padding: 4px 12px;
color: var(--tainacan-yellow2);
background: var(--tainacan-yellow1);
animation-name: appear;
animation-duration: 0.5s;
p {
margin: 0 auto;
font-size: 0.885em;
}
&>div {
display: flex;
.button,
.button:hover,
.button:active,
.button:focus {
background: none !important;
color: var(--tainacan-yellow2) !important;
font-weight: bold;
border: none;
cursor: pointer;
}
}
}
#items-list-area { #items-list-area {
position: relative; position: relative;
height: 100%; height: 100%;

View File

@ -47,6 +47,7 @@ export default {
@import "../../../node_modules/buefy/src/scss/components/_loading.scss"; @import "../../../node_modules/buefy/src/scss/components/_loading.scss";
@import "../../../node_modules/buefy/src/scss/components/_dropdown.scss"; @import "../../../node_modules/buefy/src/scss/components/_dropdown.scss";
@import "../../../node_modules/buefy/src/scss/components/_modal.scss"; @import "../../../node_modules/buefy/src/scss/components/_modal.scss";
@import "../../../node_modules/buefy/src/scss/components/_dialog.scss";
@import "../../../node_modules/buefy/src/scss/components/_notices.scss"; @import "../../../node_modules/buefy/src/scss/components/_notices.scss";
@import "../../../node_modules/buefy/src/scss/components/_numberinput.scss"; @import "../../../node_modules/buefy/src/scss/components/_numberinput.scss";
@ -63,6 +64,7 @@ export default {
@import "../admin/scss/_selects.scss"; @import "../admin/scss/_selects.scss";
@import "../admin/scss/_dropdown-and-autocomplete.scss"; @import "../admin/scss/_dropdown-and-autocomplete.scss";
@import "../admin/scss/_tooltips.scss"; @import "../admin/scss/_tooltips.scss";
@import "../admin/scss/_control.scss";
@import "../admin/scss/_tainacan-form.scss"; @import "../admin/scss/_tainacan-form.scss";
@import "../admin/scss/_filters-menu-modal.scss"; @import "../admin/scss/_filters-menu-modal.scss";
@import "./scss/_layout.scss"; @import "./scss/_layout.scss";
@ -102,8 +104,11 @@ export default {
opacity: 0; // Will make it 1 once window.load is done; opacity: 0; // Will make it 1 once window.load is done;
} }
a, a:not([href]){ color: var(--tainacan-secondary) } a, a:not([href]) {
a:hover, a:hover:not([href]) { color: var(--tainacan-secondary);
}
a:hover,
a:hover:not([href]) {
cursor: pointer; cursor: pointer;
color: var(--tainacan-secondary); color: var(--tainacan-secondary);
text-decoration: underline; text-decoration: underline;
@ -112,18 +117,10 @@ export default {
list-style: none; list-style: none;
} }
.dropdown { // We need this because bootstrap messes up with this class
display: inline-flex;
position: relative;
vertical-align: top;
}
.dropdown-menu { .dropdown-menu {
display: block; display: block;
} }
.dropdown .dropdown-trigger .button .icon,
.autocomplete .dropdown-trigger .button .icon {
align-items: center;
}
.dropdown.is-inline .dropdown-content { .dropdown.is-inline .dropdown-content {
display: flex; display: flex;
border: none; border: none;
@ -136,53 +133,6 @@ export default {
} }
} }
} }
.collapse-all {
font-size: 0.75em;
}
.collapse .collapse-trigger {
display: inline;
cursor: pointer;
.label {
vertical-align: middle;
margin-bottom: 0px;
}
}
.metadata-alert {
display: flex;
justify-content: space-between;
align-items: center;
margin: 6px $page-side-padding;
border-radius: 3px;
padding: 4px 12px;
color: var(--tainacan-yellow2);
background: var(--tainacan-yellow1);
animation-name: appear;
animation-duration: 0.5s;
p {
margin: 0 auto;
}
&>div {
display: flex;
.button,
.button:hover,
.button:active,
.button:focus {
background: none;
color:var(--tainacan-yellow2);
font-weight: bold;
border: none;
cursor: pointer;
}
}
}
.b-checkbox.checkbox.is-small {
font-size: 1em;
}
} }
.loading-overlay { .loading-overlay {
min-height: auto !important; min-height: auto !important;

View File

@ -746,6 +746,57 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
$this->assertTrue( $taxCheck instanceof \Tainacan\Entities\Taxonomy ); $this->assertTrue( $taxCheck instanceof \Tainacan\Entities\Taxonomy );
$this->assertEquals($tax->get_id(), $taxCheck->get_id()); $this->assertEquals($tax->get_id(), $taxCheck->get_id());
} }
function test_set_metadata_to_not_allow_new_terms_after_taxonomy_is_set_to_it() {
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
$Tainacan_Taxonomies = \Tainacan\Repositories\Taxonomies::get_instance();
$Tainacan_ItemMetadata = \Tainacan\Repositories\Item_Metadata::get_instance();
$collection = $this->tainacan_entity_factory->create_entity(
'collection',
array(
'name' => 'test',
'status' => 'publish'
),
true
);
$tax = $this->tainacan_entity_factory->create_entity(
'taxonomy',
array(
'name' => 'tax_test',
'status' => 'publish'
),
true
);
$metadatum = $this->tainacan_entity_factory->create_entity(
'metadatum',
array(
'name' => 'meta',
'description' => 'description',
'collection' => $collection,
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
'status' => 'publish',
'metadata_type_options' => [
'taxonomy_id' => $tax->get_id(),
'allow_new_terms' => 'yes'
]
),
true
);
$tax->set_allow_insert('no');
$tax->validate();
$Tainacan_Taxonomies->insert($tax);
$checkMeta = $Tainacan_Metadata->fetch( $metadatum->get_id() );
$this->assertEquals('no', $checkMeta->get_metadata_type_options()['allow_new_terms']);
}
} }