diff options
author | hellekin <hellekin@cepheide.org> | 2021-01-22 18:17:38 +0100 |
---|---|---|
committer | hellekin <hellekin@cepheide.org> | 2021-01-22 18:17:38 +0100 |
commit | fc5482a30a9756eea25f312a09b6056152c9c317 (patch) | |
tree | 448413bb61eb453531914d5bd9adf9e55a2205ac /app/helpers/taxonomies | |
parent | b5514684c48aa3c521da76c099412264c32c7769 (diff) | |
download | incommon-map-fc5482a30a9756eea25f312a09b6056152c9c317.tar.gz |
Fix category styles
Make category style independent of database ID to prevent
bad surprises between development and production. Instead
we use the rank.
Diffstat (limited to 'app/helpers/taxonomies')
-rw-r--r-- | app/helpers/taxonomies/filter_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/taxonomies/filter_helper.rb b/app/helpers/taxonomies/filter_helper.rb index 92a501f..486fe56 100644 --- a/app/helpers/taxonomies/filter_helper.rb +++ b/app/helpers/taxonomies/filter_helper.rb @@ -11,10 +11,10 @@ module Taxonomies::FilterHelper @taxonomy.categories.each do |cat| list = [] cat.sections.each do |sec| - list << tag.li(h("#{sec.rank}. #{sec.name}"), id: "section-#{sec.id}", data: { action: "click->taxonomy#section", target: 'taxonomy.section', 'taxonomy-section-id': sec.id }) + list << tag.li(h("#{sec.rank}. #{sec.name}"), id: "section-#{sec.rank}", data: { action: "click->taxonomy#section", target: 'taxonomy.section', 'taxonomy-section-id': sec.id }) end html << tag.li(h("#{cat.rank}. #{cat.name}") << tag.ol(list.join.html_safe), - id: "category-#{cat.id}", + id: "category-#{cat.rank}", data: { action: "click->taxonomy#category", target: 'taxonomy.category', 'taxonomy-category-id': cat.id }) end raw(tag.nav(tag.ol(html.join.html_safe), id: "taxonomy-#{@taxonomy.uuid}")) |