aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorTeddy Wing2017-06-12 15:48:20 +0200
committerTeddy Wing2017-06-12 15:48:20 +0200
commit0159b8b8127b91a4eff8bfeaccc17df9504aa3b1 (patch)
tree0b4e2d8df716fef13e3a98d3b06fcbd79f51f436 /app
parent295e1fe4503bfb580da1e1a55601897786d87a8b (diff)
downloadchouette-core-0159b8b8127b91a4eff8bfeaccc17df9504aa3b1.tar.bz2
TableBuilder#build_column_header: Rename `pic` variables to `arrow`
The name "pic" felt too ambiguous. Instead, give these variables names that reflect the icons that they represent. Also add some whitespace around to get the lines below 80 columns. Refs #3479
Diffstat (limited to 'app')
-rw-r--r--app/helpers/table_builder_helper.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb
index 97234753b..b61b169f1 100644
--- a/app/helpers/table_builder_helper.rb
+++ b/app/helpers/table_builder_helper.rb
@@ -191,14 +191,24 @@ module TableBuilderHelper
end
link_to(params.merge({direction: direction, sort: column.key})) do
- pic1 = content_tag :span, '', class: "fa fa-sort-asc #{(direction == 'desc') ? 'active' : ''}"
- pic2 = content_tag :span, '', class: "fa fa-sort-desc #{(direction == 'asc') ? 'active' : ''}"
+ arrow_up = content_tag(
+ :span,
+ '',
+ class: "fa fa-sort-asc #{direction == 'desc' ? 'active' : ''}"
+ )
+ arrow_down = content_tag(
+ :span,
+ '',
+ class: "fa fa-sort-desc #{direction == 'asc' ? 'active' : ''}"
+ )
- pics = content_tag :span, pic1 + pic2, class: 'orderers'
+ arrow_icons = content_tag :span, arrow_up + arrow_down, class: 'orderers'
# TODO: figure out a way to maybe explicitise the dynamicness of getting the model type from the `collection`.
- # TODO: rename `pics` to something like `icons` or arrow icons or some such
- (column_header_label(collection_model, column.key) + pics).html_safe
+ (
+ column_header_label(collection_model, column.key) +
+ arrow_icons
+ ).html_safe
end
end