Commit 11131f9d authored by Klaus Stein's avatar Klaus Stein
Browse files

Improve map index display

parent 3f8ad7f9
......@@ -59,11 +59,14 @@ main.maps {
.right {
text-align: right;
}
.wide, .narrow {
.wwide, .wide, .narrow {
overflow: hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
.wwide {
max-width: 20em;
}
.wide {
max-width: 8em;
}
......
module ApplicationHelper
def joined(*strs, joiner: ' • ')
strs.compact.join(joiner)
strs.reject(&:blank?).compact.join(joiner)
end
end
......@@ -63,11 +63,10 @@
place = map.place.name
place = place.to_s + " (#{map.district})" unless map.district.blank?
%>
<%= td(place, a: map.place, klass: 'wide') %>
<%= td(joined(map.place&.name, map.district), a: map.place, klass: 'wide') %>
<%= td(map.categories.sort.map{|c| c.name}.join(' • '), klass: 'narrow') %>
<%= td(joined(map.repo_doc_ref, map.repo_doc_ref_part) , klass: 'full') %>
<% repo = [map.repository&.name, map.repository&.location].compact.join(', ') %>
<%= td(repo, a: map.repository , klass: 'wide') %>
<%= td(joined(map.repo_doc_ref, map.repo_doc_ref_part) , klass: 'wwide') %>
<%= td(joined(map.repository&.name, map.repository&.location, joiner: ', '), a: map.repository , klass: 'wide') %>
<%= td(map.description, klass: 'narrow') %>
<%= td(map.dates, klass: 'narrow') %>
<%= td(map.basemap, klass: 'wide') %>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment