Class: Spina::Admin::Journal::IssuesListComponent
- Inherits:
-
ListComponent
- Object
- Spina::ApplicationComponent
- ApplicationComponent
- ListComponent
- Spina::Admin::Journal::IssuesListComponent
- Defined in:
- app/components/spina/admin/journal/issues_list_component.rb
Overview
A list of issues. Issues should only be sortable if presented within the contex of a volume.
Instance Attribute Summary collapse
-
#sortable ⇒ Object
readonly
Returns the value of attribute sortable.
Instance Method Summary collapse
- #before_render ⇒ Object
- #call ⇒ Object
-
#initialize(issues:, sortable: false) ⇒ IssuesListComponent
constructor
A new instance of IssuesListComponent.
- #sortable? ⇒ Boolean
Constructor Details
#initialize(issues:, sortable: false) ⇒ IssuesListComponent
Returns a new instance of IssuesListComponent.
11 12 13 14 |
# File 'app/components/spina/admin/journal/issues_list_component.rb', line 11 def initialize(issues:, sortable: false) @issues = issues @sortable = sortable end |
Instance Attribute Details
#sortable ⇒ Object (readonly)
Returns the value of attribute sortable.
9 10 11 |
# File 'app/components/spina/admin/journal/issues_list_component.rb', line 9 def sortable @sortable end |
Instance Method Details
#before_render ⇒ Object
16 17 18 |
# File 'app/components/spina/admin/journal/issues_list_component.rb', line 16 def before_render @list_items = generate_list_items(@issues) end |
#call ⇒ Object
20 21 22 23 24 |
# File 'app/components/spina/admin/journal/issues_list_component.rb', line 20 def call render ListComponent.new(list_items: @list_items, sortable: sortable?, sort_path: generate_sort_path) end |
#sortable? ⇒ Boolean
26 27 28 |
# File 'app/components/spina/admin/journal/issues_list_component.rb', line 26 def sortable? sortable end |