From f8d61f287cc68bd241b6588c1ab07a14a3a9f282 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Thu, 19 Dec 2019 18:03:09 +0100 Subject: [PATCH 1/4] Remove font-size overrides for traces and user lists This makes them much easier to read --- app/assets/stylesheets/common.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 6e73da63b..b28b2547d 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1487,7 +1487,6 @@ tr.turn:hover { /* Rules for the trace list shown by the traces tab etc */ #trace_list { - font-size: $lineheight/2; border-width: 0px; text-align: right; @@ -1642,7 +1641,6 @@ tr.turn:hover { /* Rules for the user list */ #user_list { - font-size: $lineheight/2; width: 100%; tr { From a3e3be007efa55dd80bd056ba0b877f692003918 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Thu, 19 Dec 2019 19:15:36 +0100 Subject: [PATCH 2/4] Use text-danger style for pending trace warning --- app/assets/stylesheets/common.scss | 8 -------- app/views/traces/_trace.html.erb | 2 +- app/views/traces/show.html.erb | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index b28b2547d..5db46be68 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1495,10 +1495,6 @@ tr.turn:hover { color: gray; } - .trace_pending { - color: red; - } - .trace_public { color: green; } @@ -1519,10 +1515,6 @@ tr.turn:hover { /* Rules for the trace view */ .trace-show { - .trace_pending { - color: red; - } - .geo { display: inline; } diff --git a/app/views/traces/_trace.html.erb b/app/views/traces/_trace.html.erb index 1fde78790..9b377eb81 100644 --- a/app/views/traces/_trace.html.erb +++ b/app/views/traces/_trace.html.erb @@ -5,7 +5,7 @@ <% if trace.inserted %> "show", :id => trace.id, :display_name => trace.user.display_name %>"> "icon", :id => trace.id, :display_name => trace.user.display_name %>" border="0" alt="" /> <% else %> - <%= t ".pending" %> + <%= t ".pending" %> <% end %> <% end %> diff --git a/app/views/traces/show.html.erb b/app/views/traces/show.html.erb index a9978fdc4..a1c38cab6 100644 --- a/app/views/traces/show.html.erb +++ b/app/views/traces/show.html.erb @@ -6,7 +6,7 @@ <% if @trace.inserted %> "picture", :id => @trace.id, :display_name => @trace.user.display_name %>"> <% else %> - <%= t ".pending" %> + <%= t ".pending" %> <% end %> <% end %> From 1586e2ba802e051f122d42fd8ad30aa3e6fdbf18 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Thu, 19 Dec 2019 19:18:00 +0100 Subject: [PATCH 3/4] Use badges for the trace visibility labels Our green is currently just on the side of triggering black text, hence the override to make it look consistent with the other badges. --- app/assets/stylesheets/_bootstrap-custom.scss | 2 +- app/assets/stylesheets/common.scss | 16 ---------------- app/views/traces/_trace.html.erb | 8 +++++++- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/app/assets/stylesheets/_bootstrap-custom.scss b/app/assets/stylesheets/_bootstrap-custom.scss index 0cbec1a27..6bbaecbe4 100644 --- a/app/assets/stylesheets/_bootstrap-custom.scss +++ b/app/assets/stylesheets/_bootstrap-custom.scss @@ -27,7 +27,7 @@ @import "bootstrap/card"; // @import "bootstrap/breadcrumb"; // @import "bootstrap/pagination"; -// @import "bootstrap/badge"; +@import "bootstrap/badge"; // @import "bootstrap/jumbotron"; // @import "bootstrap/alert"; // @import "bootstrap/progress"; diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 5db46be68..bd0b574e5 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1494,22 +1494,6 @@ tr.turn:hover { font-size: 12px; color: gray; } - - .trace_public { - color: green; - } - - .trace_identifiable { - color: green; - } - - .trace_trackable { - color: red; - } - - .trace_private { - color: red; - } } /* Rules for the trace view */ diff --git a/app/views/traces/_trace.html.erb b/app/views/traces/_trace.html.erb index 9b377eb81..8b754a591 100644 --- a/app/views/traces/_trace.html.erb +++ b/app/views/traces/_trace.html.erb @@ -17,7 +17,13 @@ ... <%= time_ago_in_words(trace.timestamp, :scope => :'datetime.distance_in_words_ago') %> <%= link_to_if trace.inserted?, t(".map"), { :controller => "site", :action => "index", :mlat => trace.latitude, :mlon => trace.longitude, :anchor => "map=14/#{trace.latitude}/#{trace.longitude}" }, { :title => t(".view_map") } %> / <%= link_to t(".edit"), { :controller => "site", :action => "edit", :gpx => trace.id }, { :title => t(".edit_map") } %> - <%= t("." + trace.visibility) %> + + <% badge_class = case trace.visibility + when "public", "identifiable" then "success" + else "danger" + end %> + <%= t("." + trace.visibility) %> +
<%= trace.description %>
From 1ff7e3ac71f0e31d6c4d26673d6357a76ef957aa Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Thu, 19 Dec 2019 19:18:52 +0100 Subject: [PATCH 4/4] Replace custom css class with bootstrap inline utility This has actually been broken since the controller was renamed, but nobody noticed. --- app/assets/stylesheets/common.scss | 8 -------- app/views/traces/show.html.erb | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index bd0b574e5..5abd817f8 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1496,14 +1496,6 @@ tr.turn:hover { } } -/* Rules for the trace view */ - -.trace-show { - .geo { - display: inline; - } -} - /* Rules for the new trace form */ #new_trace { diff --git a/app/views/traces/show.html.erb b/app/views/traces/show.html.erb index a1c38cab6..728b29c45 100644 --- a/app/views/traces/show.html.erb +++ b/app/views/traces/show.html.erb @@ -25,7 +25,7 @@ <%= @trace.size.to_s.gsub(/(\d)(?=(\d{3})+$)/, '\1,') %> <%= t ".start_coordinates" %> -
<%= @trace.latitude %>; <%= @trace.longitude %>
(<%= link_to t(".map"), :controller => "site", :action => "index", :mlat => @trace.latitude, :mlon => @trace.longitude, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %> / <%= link_to t(".edit"), :controller => "site", :action => "edit", :gpx => @trace.id, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %>) +
<%= @trace.latitude %>; <%= @trace.longitude %>
(<%= link_to t(".map"), :controller => "site", :action => "index", :mlat => @trace.latitude, :mlon => @trace.longitude, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %> / <%= link_to t(".edit"), :controller => "site", :action => "edit", :gpx => @trace.id, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %>) <% end %>