Skip to content

Commit

Permalink
Merge pull request #356 from a-thousand-channels/ut/353-ui-popup
Browse files Browse the repository at this point in the history
Ut/353 UI Improvements for popups
  • Loading branch information
ut authored Jan 6, 2025
2 parents 7fc4b79 + 04da642 commit e6de835
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .bundler-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
ignore:
- CVE-2024-54133
2 changes: 2 additions & 0 deletions app/assets/javascripts/helpers/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ function PopupFullContent(place) {
content += "<img src='" + place.imagelink + "' />";
}
content += '<div class="leaflet-popup-content-text">';

content += "<p class='label' style='background-color: "+place.color+"; color: #444;'>" + place.layer_title + "</p>";
if (place.date_with_qualifier) {
content += "<p>" + place.date_with_qualifier;
if (place.address) {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/1_basics.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ div.small {
}
.hide, .hidden {display: none;}
.shy {
color: #888;
color: #666;
font-size: 14px;
}
.small {
Expand Down
9 changes: 8 additions & 1 deletion app/assets/stylesheets/4_map.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,15 @@
margin-right: 5px;
}
#map.leaflet-container a {
color: darken(#c6c600,10%);
color: darken(#c6c600,10%);
}
#map.leaflet-container h4 a {
text-decoration: underline;
}

#map.leaflet-container a:hover {
text-decoration: underline;
color: darken(#c6c600,20%);
}
.leaflet-bar a, .leaflet-bar a:hover {
background-color: #333;
Expand Down
2 changes: 1 addition & 1 deletion app/models/place.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class Place < ApplicationRecord
has_many :relations_froms, foreign_key: 'relation_from_id',
class_name: 'Relation',
dependent: :destroy
has_many :annotations
accepts_nested_attributes_for :relations_tos, allow_destroy: true
accepts_nested_attributes_for :relations_froms, allow_destroy: true
accepts_nested_attributes_for :annotations, reject_if: ->(a) { a[:title].blank? }, allow_destroy: true

has_many :images, dependent: :destroy
has_many :videos, dependent: :destroy
has_many :submissions, dependent: :destroy
has_many :annotations

validate :check_audio_format
validates :title, presence: true
Expand Down
2 changes: 1 addition & 1 deletion app/views/layers/_layer.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ json.extract! layer, :id, :title, :subtitle, :text, :credits, :image_link, :publ
json.url map_layer_url(layer, format: :json)
json.iconset layer.map.iconset, :title, :icon_anchor, :icon_size, :popup_anchor, :class_name if layer.map.iconset
json.places layer.places do |place|
json.extract! place, :id, :title, :subtitle, :teaser, :text, :sources, :link, :startdate, :enddate, :full_address, :location, :address, :zip, :city, :country, :published, :featured, :layer_id, :layer_type, :created_at, :updated_at, :date, :date_with_qualifier, :edit_link, :show_link, :imagelink2, :imagelink, :icon_link, :icon_class, :icon_name
json.extract! place, :id, :title, :subtitle, :teaser, :text, :sources, :link, :startdate, :enddate, :full_address, :location, :address, :zip, :city, :country, :published, :featured, :layer_id, :layer_type, :layer_title, :color, :created_at, :updated_at, :date, :date_with_qualifier, :edit_link, :show_link, :imagelink2, :imagelink, :icon_link, :icon_class, :icon_name
json.lat place.public_lat
json.lon place.public_lon
json.annotations place.annotations do |annotation|
Expand Down
2 changes: 1 addition & 1 deletion app/views/maps/_map.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ json.layers map.layers do |layer|
json.extract! layer, :id, :title, :subtitle, :text, :credits, :image_link, :published, :map_id, :color, :relations_bending, :relations_coloring, :image_alt, :image_licence, :image_source, :image_creator, :image_caption, :created_at, :updated_at, :ltype
json.iconset layer.map.iconset, :title, :icon_anchor, :icon_size, :popup_anchor, :class_name if layer.map.iconset
json.places layer.places do |place|
json.extract! place, :id, :title, :subtitle, :teaser, :text, :sources, :link, :startdate, :enddate, :full_address, :location, :address, :zip, :city, :country, :published, :featured, :shy, :layer_id, :layer_color, :layer_type, :created_at, :updated_at, :date, :edit_link, :show_link, :imagelink2, :imagelink, :icon_link, :icon_class, :icon_name
json.extract! place, :id, :title, :subtitle, :teaser, :text, :sources, :link, :startdate, :enddate, :full_address, :location, :address, :zip, :city, :country, :published, :featured, :shy, :layer_id, :layer_title, :layer_color, :layer_type, :created_at, :updated_at, :date, :edit_link, :show_link, :imagelink2, :imagelink, :icon_link, :icon_class, :icon_name
json.lat place.public_lat
json.lon place.public_lon
json.annotations place.annotations do |annotation|
Expand Down
6 changes: 3 additions & 3 deletions app/views/places/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#{@old_place.lat[0..4]}/#{@old_place.lon[0..4]}
\-->
- if @place.lat && @place.lon
#{@place.lat[0..4]}/#{@place.lon[0..4]}
#{@place.lat[0..9]}, #{@place.lon[0..9]}
%a{href: '', title: 'Edit coordinates', id: 'edit_coordinates'}
%i.fi.fi-pencil.fi-13
%a{href: '', title: 'Edit coordinates', id: 'edit_coordinates_cancel'}
Expand Down Expand Up @@ -121,10 +121,10 @@
.large-5.medium-4.small-4.cell
%p.small.compact#startdate_qualifier_label
%a{href: '', title: 'Define date quality', id: 'define_startdate_qualifier'}
Startdate quality
Startdate qualifier
%i.fi.fi-pencil.fi-13
%a{href: '', title: 'Define date quality', id: 'define_startdate_qualifier_cancel'}
Startdate quality
Startdate qualifier
%i.fi.fi-x.fi-13
%span#startdate_qualifier_preview
= f.input :startdate_qualifier, :label => false, :collection => qualifier_for_select, include_blank: ' ', :selected => @place.startdate_qualifier
Expand Down
3 changes: 2 additions & 1 deletion spec/features/places_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
within '#selection-hint' do
expect(page).to have_content 'Searching...'
end

within '#selection-hint' do
expect(page).to have_content 'Please select one result below (or type in another address).'
# expect(page).to have_content 'Please select one result below (or type in another address).'
end
end

Expand Down

0 comments on commit e6de835

Please sign in to comment.