diff --git a/src/views/admin/components/lists/items-list.vue b/src/views/admin/components/lists/items-list.vue index a00462588..66baa518d 100644 --- a/src/views/admin/components/lists/items-list.vue +++ b/src/views/admin/components/lists/items-list.vue @@ -1571,25 +1571,6 @@ - -
-

{{ selectedMarkerIndexes.length == 1 ? $i18n.get('label_one_selected_location') : $i18n.getWithVariables('label_%s_selected_locations', [ selectedMarkerIndexes.length ]) }}. {{ $i18n.get('label_clean') }}

-
-
-
-
-

- - - -

-

{{ $i18n.get('info_empty_geocoordinate_metadata_list') }}

-
-
{ if ( this.itemsLocations.length && this.$refs['tainacan-admin-view-mode-map'] && this.$refs['tainacan-admin-view-mode-map'].mapObject ) { if (this.itemsLocations.length == 1) - this.$refs['tainacan-admin-view-mode-map'].mapObject.panInsideBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 0] }); + this.$refs['tainacan-admin-view-mode-map'].mapObject.panInsideBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 0] }); else - this.$refs['tainacan-admin-view-mode-map'].mapObject.flyToBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 0] }); + this.$refs['tainacan-admin-view-mode-map'].mapObject.flyToBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 0] }); } }, 500) }, @@ -2431,9 +2412,9 @@ export default { this.selectedMarkerIndexes = []; if ( this.itemsLocations.length && this.$refs['tainacan-admin-view-mode-map'] && this.$refs['tainacan-admin-view-mode-map'].mapObject ) { if (this.itemsLocations.length == 1) - this.$refs['tainacan-admin-view-mode-map'].mapObject.panInsideBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 0] }); + this.$refs['tainacan-admin-view-mode-map'].mapObject.panInsideBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 0] }); else - this.$refs['tainacan-admin-view-mode-map'].mapObject.flyToBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 0] }); + this.$refs['tainacan-admin-view-mode-map'].mapObject.flyToBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 0] }); } }, showItemByLocation(index) { @@ -2441,7 +2422,7 @@ export default { this.selectedMarkerIndexes = []; this.selectedMarkerIndexes.push(index); if ( this.itemsLocations.length && this.$refs['tainacan-admin-view-mode-map'] && this.$refs['tainacan-admin-view-mode-map'].mapObject ) - this.$refs['tainacan-admin-view-mode-map'].mapObject.panInsideBounds( [ this.itemsLocations[index].location ], { animate: true, maxZoom: 12, paddingTopLeft: [0, 286] }); + this.$refs['tainacan-admin-view-mode-map'].mapObject.panInsideBounds( [ this.itemsLocations[index].location ], { animate: true, maxZoom: 16, paddingTopLeft: [0, 286] }); }, showLocationsByItem(item) { this.mapSelectedItemId = item.id; @@ -2456,9 +2437,9 @@ export default { if ( selectedLocationsByItem.length) { if ( this.itemsLocations.length && this.$refs['tainacan-admin-view-mode-map'] && this.$refs['tainacan-admin-view-mode-map'].mapObject ) { if (selectedLocationsByItem.length > 1) - this.$refs['tainacan-admin-view-mode-map'].mapObject.flyToBounds( selectedLocationsByItem.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 286] }); + this.$refs['tainacan-admin-view-mode-map'].mapObject.flyToBounds( selectedLocationsByItem.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 286] }); else - this.$refs['tainacan-admin-view-mode-map'].mapObject.panInsideBounds( selectedLocationsByItem.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 286] }); + this.$refs['tainacan-admin-view-mode-map'].mapObject.panInsideBounds( selectedLocationsByItem.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 286] }); } } else { this.$buefy.snackbar.open({ diff --git a/src/views/admin/components/metadata-types/geocoordinate/FormGeoCoordinate.vue b/src/views/admin/components/metadata-types/geocoordinate/FormGeoCoordinate.vue index 2da61dc97..5b05de346 100644 --- a/src/views/admin/components/metadata-types/geocoordinate/FormGeoCoordinate.vue +++ b/src/views/admin/components/metadata-types/geocoordinate/FormGeoCoordinate.vue @@ -11,20 +11,8 @@ - - - - - + @input="emitValues()" + placeholder="https://tile.openstreetmap.org/{z}/{x}/{y}.png" />  *  + :title="$i18n.getHelperTitle('tainacan-geocoordinate', 'attribution')" + :message="$i18n.getHelperMessage('tainacan-geocoordinate', 'attribution')" /> + @input="emitValues()" + placeholder="© OpenStreetMap contributors" /> @@ -49,15 +38,16 @@ {{ $i18n.getHelperTitle('tainacan-geocoordinate', 'initial_zoom') }}  *  + :title="$i18n.getHelperTitle('tainacan-geocoordinate', 'initial_zoom')" + :message="$i18n.getHelperMessage('tainacan-geocoordinate', 'initial_zoom')" /> - + :step="1" + :max="21" + :min="1" /> - + :step="1" + :max="21" + :min="1" /> @@ -96,18 +87,16 @@ }, created() { if (this.value) { - this.mapProvider = this.value.map_provider || 'http://?'; - this.extraTileLayer = this.value.extra_tile_layers || []; - this.attribution = this.value.attribution || ''; - this.initialZoom = this.value.initial_zoom || 5; - this.maximumZoom = this.value.maximum_zoom || 12; + this.mapProvider = this.value.map_provider || 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'; + this.attribution = this.value.attribution || '© OpenStreetMap contributors'; + this.initialZoom = Number(this.value.initial_zoom) || 5; + this.maximumZoom = Number(this.value.maximum_zoom) || 12; } }, methods: { emitValues(){ this.$emit('input',{ map_provider: this.mapProvider, - extra_tile_layers: this.extraTileLayer, attribution: this.attribution, initial_zoom: this.initialZoom, maximum_zoom: this.maximumZoom, diff --git a/src/views/admin/components/metadata-types/geocoordinate/GeoCoordinate.vue b/src/views/admin/components/metadata-types/geocoordinate/GeoCoordinate.vue index d45118332..ecc669be1 100644 --- a/src/views/admin/components/metadata-types/geocoordinate/GeoCoordinate.vue +++ b/src/views/admin/components/metadata-types/geocoordinate/GeoCoordinate.vue @@ -137,9 +137,6 @@ attribution() { return this.itemMetadatum && this.itemMetadatum.metadatum.metadata_type_options && this.itemMetadatum.metadatum.metadata_type_options.attribution ? this.itemMetadatum.metadatum.metadata_type_options.attribution : '© OpenStreetMap contributors'; }, - extraTileLayers() { - return this.itemMetadatum && this.itemMetadatum.metadatum.metadata_type_options && this.itemMetadatum.metadatum.metadata_type_options.extra_tile_layers ? this.itemMetadatum.metadatum.metadata_type_options.extra_tile_layers : []; - }, itemMetadatumIdentifier() { return 'tainacan-item-metadatum_id-' + this.itemMetadatum.metadatum.id + (this.itemMetadatum.parent_meta_id ? ('_parent_meta_id-' + this.itemMetadatum.parent_meta_id) : ''); }, @@ -198,7 +195,7 @@ this.selected = Array.isArray(this.value) ? (this.value.length == 1 && this.value[0] == "" ? [] : this.value) : [this.value]; // Listens to window resize event to update map bounds - // We need to pass mapComoponentRef here instead of creating it inside the function + // We need to pass mapComponentRef here instead of creating it inside the function // otherwise the listener would conflict when multiple geo metadata are inserted. const mapComponentRef = 'map--' + this.itemMetadatumIdentifier; eventBusItemMetadata.$on('itemEditionFormResize', () => this.handleWindowResize(mapComponentRef)); diff --git a/src/views/admin/components/metadata-types/geocoordinate/class-tainacan-geocoordinate.php b/src/views/admin/components/metadata-types/geocoordinate/class-tainacan-geocoordinate.php index 2e3c98562..92ab840cb 100644 --- a/src/views/admin/components/metadata-types/geocoordinate/class-tainacan-geocoordinate.php +++ b/src/views/admin/components/metadata-types/geocoordinate/class-tainacan-geocoordinate.php @@ -23,7 +23,6 @@ class GeoCoordinate extends Metadata_Type { $this->set_description( __('Represents a geographical location that is determined by latitude and longitude coordinates.', 'tainacan') ); $this->set_default_options([ 'map_provider' => 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', - 'extra_tile_layers' => [], 'attribution' => '© OpenStreetMap contributors', 'initial_zoom' => 5, 'maximum_zoom' => 12, @@ -43,12 +42,8 @@ class GeoCoordinate extends Metadata_Type { public function get_form_labels(){ return [ 'map_provider' => [ - 'title' => __( 'Tile provides', 'tainacan' ), - 'description' => __( 'Link to the service used as source for displaying tile layers on the map', 'tainacan' ), - ], - 'extra_tile_layers' => [ - 'title' => __( 'Extra tile layer', 'tainacan' ), - 'description' => __( 'The extra layer of blocks to be displayed on the map', 'tainacan' ), + 'title' => __( 'Map Tiles provider', 'tainacan' ), + 'description' => __( 'Link to the service used as source for displaying tile layers on the map.', 'tainacan' ), ], 'attribution' => [ 'title' => __( 'Attribution', 'tainacan' ), @@ -101,6 +96,7 @@ class GeoCoordinate extends Metadata_Type { public function get_value_as_html(\Tainacan\Entities\Item_Metadata_Entity $item_metadata) { global $TAINACAN_BASE_URL; $value = $item_metadata->get_value(); + $options = $this->get_options(); if ( ( is_string( $value ) && empty( $value ) ) || @@ -111,7 +107,8 @@ class GeoCoordinate extends Metadata_Type { $metadatum = $item_metadata->get_metadatum(); $item_metadatum_id = $metadatum->get_id(); $item_metadatum_id .= $metadatum->get_parent() ? ( $metadatum->get_parent() . '_parent_meta_id-') : ''; - + $zoom_geo_query = isset($options['initial_zoom']) ? ('z=' . $options['initial_zoom'] ) : '' ; + $return = ''; if ( $item_metadata->is_multiple() ) { @@ -125,7 +122,11 @@ class GeoCoordinate extends Metadata_Type { $latitude = isset($coordinate_as_array[0]) ? $coordinate_as_array[0] : ''; $longitude = isset($coordinate_as_array[1]) ? $coordinate_as_array[1] : ''; - $single_value = "{$latitude},{$longitude}"; + $single_value = " + {$latitude} + , + {$longitude} + "; $return .= empty($return) ? $prefix . $single_value . $suffix : $separator . $prefix . $single_value . $suffix; @@ -136,20 +137,21 @@ class GeoCoordinate extends Metadata_Type { $latitude = isset($coordinate_as_array[0]) ? $coordinate_as_array[0] : ''; $longitude = isset($coordinate_as_array[1]) ? $coordinate_as_array[1] : ''; - $return .= "{$latitude},{$longitude}"; + $return .= " + {$latitude} + , + {$longitude} + "; } wp_enqueue_style( 'tainacan-geocoordinate-item-metadatum', $TAINACAN_BASE_URL . '/assets/css/tainacan-gutenberg-block-geocoordinate-item-metadatum.css', array(), TAINACAN_VERSION); - $options = $this->get_options(); $options_as_strings = ''; foreach ( $options as $option_key => $option ) { if ( is_array($option) ) $options_as_strings .= 'data-' . $option_key . '="' . json_encode($option) . '" '; else if ( $option_key == 'attribution' ) $options_as_strings .= 'data-' . $option_key . '="' . htmlentities($option) . '" '; - else if ( $option_key == 'map_provider' ) - $options_as_strings .= 'data-' . $option_key . '="' . esc_url($option) . '" '; else $options_as_strings .= 'data-' . $option_key . '="' . $option . '" '; }; diff --git a/src/views/admin/scss/_notices.scss b/src/views/admin/scss/_notices.scss index a3f3df397..f3d61b9df 100644 --- a/src/views/admin/scss/_notices.scss +++ b/src/views/admin/scss/_notices.scss @@ -5,7 +5,7 @@ min-width: auto !important; font-size: 0.75em; border-radius: 3px; - box-shadow: 0 0 8px -6px rgba(0, 0, 0, 0.25); + box-shadow: 0 2px 7px -4px rgba(0, 0, 0, 0.65); &.is-dark, &.is-dark .button, diff --git a/src/views/admin/scss/_variables.scss b/src/views/admin/scss/_variables.scss index 71fde4f8a..dd364a40d 100644 --- a/src/views/admin/scss/_variables.scss +++ b/src/views/admin/scss/_variables.scss @@ -54,9 +54,9 @@ $green1-invert: findColorInvert($green1); $green2: #25a189; $green2-invert: findColorInvert($green2); // Warning, used for warning messages -$yellow1: #fcebd9; +$yellow1: #fff7ee; $yellow1-invert: findColorInvert($yellow1); -$yellow2: #e69810; +$yellow2: #bb7700; $yellow2-invert: findColorInvert($yellow2); // Text, no quite black diff --git a/src/views/admin/scss/_view-mode-map.scss b/src/views/admin/scss/_view-mode-map.scss index 484ac74af..4d168fc05 100644 --- a/src/views/admin/scss/_view-mode-map.scss +++ b/src/views/admin/scss/_view-mode-map.scss @@ -5,7 +5,7 @@ #tainacan-admin-view-mode-map, #tainacan-view-mode-map { - position: relative; + //position: relative; border: none; border-left: 1px solid var(--tainacan-input-border-color); float: right; diff --git a/src/views/gutenberg-blocks/blocks/faceted-search/theme-search/components/view-mode-map.vue b/src/views/gutenberg-blocks/blocks/faceted-search/theme-search/components/view-mode-map.vue index c6bdaca69..0d1939c7a 100644 --- a/src/views/gutenberg-blocks/blocks/faceted-search/theme-search/components/view-mode-map.vue +++ b/src/views/gutenberg-blocks/blocks/faceted-search/theme-search/components/view-mode-map.vue @@ -134,13 +134,6 @@ - -
-

{{ selectedMarkerIndexes.length == 1 ? $i18n.get('label_one_selected_location') : $i18n.getWithVariables('label_%s_selected_locations', [ selectedMarkerIndexes.length ]) }}. {{ $i18n.get('label_clean') }}

-
-
@@ -441,9 +434,9 @@ export default { setTimeout(() => { if ( this.itemsLocations.length && this.$refs['tainacan-view-mode-map'] && this.$refs['tainacan-view-mode-map'].mapObject ) { if (this.itemsLocations.length == 1) - this.$refs['tainacan-view-mode-map'].mapObject.panInsideBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 0] }); + this.$refs['tainacan-view-mode-map'].mapObject.panInsideBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 0] }); else - this.$refs['tainacan-view-mode-map'].mapObject.flyToBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 0] }); + this.$refs['tainacan-view-mode-map'].mapObject.flyToBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 0] }); } }, 500) }, @@ -474,9 +467,9 @@ export default { this.selectedMarkerIndexes = []; if ( this.itemsLocations.length && this.$refs['tainacan-view-mode-map'] && this.$refs['tainacan-view-mode-map'].mapObject ) { if (this.itemsLocations.length == 1) - this.$refs['tainacan-view-mode-map'].mapObject.panInsideBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 0] }); + this.$refs['tainacan-view-mode-map'].mapObject.panInsideBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 0] }); else - this.$refs['tainacan-view-mode-map'].mapObject.flyToBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 0] }); + this.$refs['tainacan-view-mode-map'].mapObject.flyToBounds(this.itemsLocations.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 0] }); } }, showItemByLocation(index) { @@ -484,7 +477,7 @@ export default { this.selectedMarkerIndexes = []; this.selectedMarkerIndexes.push(index); if ( this.itemsLocations.length && this.$refs['tainacan-view-mode-map'] && this.$refs['tainacan-view-mode-map'].mapObject ) - this.$refs['tainacan-view-mode-map'].mapObject.panInsideBounds( [ this.itemsLocations[index].location ], { animate: true, maxZoom: 12, paddingTopLeft: [0, 286] }); + this.$refs['tainacan-view-mode-map'].mapObject.panInsideBounds( [ this.itemsLocations[index].location ], { animate: true, maxZoom: 16, paddingTopLeft: [0, 286] }); }, showLocationsByItem(item) { this.mapSelectedItemId = item.id; @@ -499,9 +492,9 @@ export default { if ( selectedLocationsByItem.length) { if ( this.itemsLocations.length && this.$refs['tainacan-view-mode-map'] && this.$refs['tainacan-view-mode-map'].mapObject ) { if (selectedLocationsByItem.length > 1) - this.$refs['tainacan-view-mode-map'].mapObject.flyToBounds( selectedLocationsByItem.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 286] }); + this.$refs['tainacan-view-mode-map'].mapObject.flyToBounds( selectedLocationsByItem.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 286] }); else - this.$refs['tainacan-view-mode-map'].mapObject.panInsideBounds( selectedLocationsByItem.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 12, paddingTopLeft: [0, 286] }); + this.$refs['tainacan-view-mode-map'].mapObject.panInsideBounds( selectedLocationsByItem.map((anItemLocation) => anItemLocation.location), { animate: true, maxZoom: 16, paddingTopLeft: [0, 286] }); } } else { this.$buefy.snackbar.open({ diff --git a/src/views/gutenberg-blocks/blocks/geocoordinate-item-metadatum/theme.js b/src/views/gutenberg-blocks/blocks/geocoordinate-item-metadatum/theme.js index 314f625bf..f45853750 100644 --- a/src/views/gutenberg-blocks/blocks/geocoordinate-item-metadatum/theme.js +++ b/src/views/gutenberg-blocks/blocks/geocoordinate-item-metadatum/theme.js @@ -43,7 +43,7 @@ export default (element) => { const attribution = element.hasAttribute('data-attribution') ? element.getAttribute('data-attribution') : '© OpenStreetMap contributors'; const initial_zoom = element.hasAttribute('data-initial_zoom') ? element.getAttribute('data-initial_zoom') : 5; const maximum_zoom = element.hasAttribute('data-maximum_zoom') ? element.getAttribute('data-maximum_zoom') : 12; - + TainacanLeaflet.tileLayer(map_provider, { attribution: attribution, zoom: initial_zoom, @@ -55,6 +55,6 @@ export default (element) => { TainacanLeaflet.marker(coordinate).addTo(tainacanMap); }); - tainacanMap.flyToBounds(coordinates); + tainacanMap.flyToBounds(coordinates, { maxZoom: maximum_zoom }); } }; \ No newline at end of file diff --git a/src/views/reports/components/number-block.vue b/src/views/reports/components/number-block.vue index cae23b228..7aff63928 100644 --- a/src/views/reports/components/number-block.vue +++ b/src/views/reports/components/number-block.vue @@ -257,7 +257,7 @@ export default { color: #25a189 !important; } .tainacan-icon-delete { - color: #e69810 !important; + color: #bb7700 !important; } } &.number-block--items, @@ -301,7 +301,7 @@ export default { background-color: #25a189; } &:nth-child(5) { - background-color: #e69810; + background-color: #bb7700; } &:nth-child(6) { opacity: 0.35; diff --git a/src/views/reports/js/reports-main.js b/src/views/reports/js/reports-main.js index 53a481da6..7ab4303cf 100644 --- a/src/views/reports/js/reports-main.js +++ b/src/views/reports/js/reports-main.js @@ -45,7 +45,7 @@ export default (element) => { '#298596', // Tainacan Turquoise '#01295c', // Tainacan Blue '#25a189', // Tainacan Green - '#e69810', // Tainacan Yellow + '#bb7700', // Tainacan Yellow '#a23939', // Tainacan Red '#592570', // Tainacan Purple '#ed4f63', // Tainacan Pink diff --git a/src/views/roles/pages/role-edition-form.vue b/src/views/roles/pages/role-edition-form.vue index 60f74a3af..6c02e5a3d 100644 --- a/src/views/roles/pages/role-edition-form.vue +++ b/src/views/roles/pages/role-edition-form.vue @@ -555,7 +555,7 @@ padding: 1em 2em; } .dashicons-info { - color: #e69810; + color: #bb7700; } .capabilities-list { padding: 1em 0;