Module: Decidim::Admin::ResourceScopeHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/decidim/admin/resource_scope_helper.rb
Overview
This module includes helpers to show scopes in admin
Instance Method Summary collapse
-
#td_resource_scope_for(current_scope) ⇒ Object
Public: This helper shows the td for the given scope.
-
#th_resource_scope_label(scope_label = t("decidim.admin.resources.index.headers.scope")) ⇒ Object
Public: This helper shows the th with the scope label.
-
#th_scope_sort_link ⇒ Object
Public: This helper shows th with the sort link element.
Instance Method Details
#td_resource_scope_for(current_scope) ⇒ Object
Public: This helper shows the td for the given scope.
current_scope - Scope object to show
21 22 23 24 25 26 27 28 29 30 |
# File 'app/helpers/decidim/admin/resource_scope_helper.rb', line 21 def td_resource_scope_for(current_scope) return unless resource_with_scopes_enabled? scope_name = if current_scope translated_attribute(current_scope.name) else t("decidim.scopes.global") end content_tag(:td, scope_name) end |
#th_resource_scope_label(scope_label = t("decidim.admin.resources.index.headers.scope")) ⇒ Object
Public: This helper shows the th with the scope label.
scope_label - I18n translation to show
11 12 13 14 15 |
# File 'app/helpers/decidim/admin/resource_scope_helper.rb', line 11 def th_resource_scope_label(scope_label = t("decidim.admin.resources.index.headers.scope")) return unless resource_with_scopes_enabled? content_tag(:th, scope_label) end |
#th_scope_sort_link ⇒ Object
Public: This helper shows th with the sort link element.
33 34 35 36 37 38 39 |
# File 'app/helpers/decidim/admin/resource_scope_helper.rb', line 33 def th_scope_sort_link return unless resource_with_scopes_enabled? content_tag(:th) do sort_link(query, :scope_name, t("decidim.admin.resources.index.headers.scope")) end end |