You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
793 B
38 lines
793 B
class SubjectsAccordionComponent < BaseComponent |
|
with_collection_parameter :search_result |
|
attr_reader :search_result, :opts |
|
|
|
def initialize(search_result:, current_user:, opts: {}) |
|
@search_result = search_result |
|
@opts = opts |
|
end |
|
|
|
def accordion_name |
|
"subjectsAccordion" |
|
end |
|
|
|
def accordion_body_name |
|
"subjectsAccordionBody" |
|
end |
|
|
|
def parent_accordion_id |
|
[accordion_name, search_result["parent_id"]].join |
|
end |
|
|
|
def children_accordion_id |
|
[accordion_name, search_result["heirarchy_level"], search_result["id"]].join |
|
end |
|
|
|
def accordion_id |
|
[accordion_name, search_result["id"]].join |
|
end |
|
|
|
def accordion_body_id |
|
[accordion_body_name, search_result["id"]].join |
|
end |
|
|
|
def custom_url |
|
subject_index_path(search_result["id"]) |
|
end |
|
end |
|
|