aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorjpl2017-07-31 11:44:24 +0200
committerjpl2017-07-31 11:45:10 +0200
commitb455261a4b611e86d3f4072c5f62e6dbeaa582c6 (patch)
tree98c51a7d9cc431f20471fe7bf42844b3b9d35dd1 /app
parentbba83cb56a56d2f26e9c380b22fc542228d2eabc (diff)
downloadchouette-core-b455261a4b611e86d3f4072c5f62e6dbeaa582c6.tar.bz2
Refs #4187: updating routes#show table
Diffstat (limited to 'app')
-rw-r--r--app/helpers/table_builder_helper.rb5
-rw-r--r--app/views/routes/show.html.slim14
2 files changed, 7 insertions, 12 deletions
diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb
index 897e842a8..375697bec 100644
--- a/app/helpers/table_builder_helper.rb
+++ b/app/helpers/table_builder_helper.rb
@@ -175,12 +175,11 @@ module TableBuilderHelper
sort_on,
sort_direction
)
- if !table_is_sortable
+
+ if !table_is_sortable || !column.sortable
return column.header_label(collection_model)
end
- return column.name if !column.sortable
-
direction =
if column.key.to_s == sort_on && sort_direction == 'desc'
'asc'
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index f2f8f1a9d..ec9719355 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -37,8 +37,7 @@
[ \
TableBuilderHelper::Column.new( \
name: 'ID Reflex', \
- attribute: Proc.new { |s| s.try(:stop_area).try(:user_objectid) }, \
- sortable: false \
+ attribute: Proc.new { |s| s.try(:stop_area).try(:user_objectid) } \
), \
TableBuilderHelper::Column.new( \
key: :name, \
@@ -46,7 +45,7 @@
), \
TableBuilderHelper::Column.new( \
key: :deleted_at, \
- attribute: Proc.new { |s| s.try(:stop_area).deleted_at ? t('false') : t('true') } \
+ attribute: Proc.new { |s| s.try(:stop_area).deleted_at ? t('false') : t('true') }, \
), \
TableBuilderHelper::Column.new( \
key: :zip_code, \
@@ -63,14 +62,11 @@
TableBuilderHelper::Column.new( \
key: :for_alighting, \
attribute: Proc.new { |s| t("stop_points.stop_point.for_alighting.#{s.for_alighting}") } \
- ), \
- TableBuilderHelper::Column.new( \
- key: :position, \
- attribute: 'position' \
- ), \
+ ) \
],
links: [:show],
- cls: 'table'
+ sortable: false,
+ cls: 'table has-stoppoints'
- else
= replacement_msg t('stop_areas.search_no_results')