Class: Katalyst::Navigation::Editor::StatusBar
- Inherits:
-
Base
- Object
- Base
- Katalyst::Navigation::Editor::StatusBar
show all
- Defined in:
- app/helpers/katalyst/navigation/editor/status_bar.rb
Constant Summary
collapse
- ACTIONS =
"navigation:change@document->\#{STATUS_BAR_CONTROLLER}#change\n".gsub(/\s+/, " ").freeze
Constants inherited
from Base
Base::ATTRIBUTES_SCOPE, Base::ITEM_CONTROLLER, Base::LIST_CONTROLLER, Base::MENU_CONTROLLER, Base::NEW_ITEM_CONTROLLER, Base::STATUS_BAR_CONTROLLER, Base::TURBO_FRAME
Instance Attribute Summary
Attributes inherited from Base
#menu, #template
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #menu_form_id
Instance Method Details
#action(action, **options) ⇒ Object
35
36
37
38
39
40
41
42
43
|
# File 'app/helpers/katalyst/navigation/editor/status_bar.rb', line 35
def action(action, **options)
tag.li do
button_tag(t("views.katalyst.navigation.editor.#{action}"),
name: "commit",
value: action,
form: ,
**options)
end
end
|
#actions ⇒ Object
26
27
28
29
30
31
32
33
|
# File 'app/helpers/katalyst/navigation/editor/status_bar.rb', line 26
def actions
tag. do
concat action(:discard, class: "button button--text")
concat action(:revert, class: "button button--text") if .state == :draft
concat action(:save, class: "button button--secondary")
concat action(:publish, class: "button button--primary")
end
end
|
#build(**options) ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'app/helpers/katalyst/navigation/editor/status_bar.rb', line 11
def build(**options)
tag.div **default_options(**options) do
concat status(:published, last_update: l(.updated_at, format: :short))
concat status(:draft)
concat status(:dirty)
concat actions
end
end
|
#status(state, **options) ⇒ Object
20
21
22
23
24
|
# File 'app/helpers/katalyst/navigation/editor/status_bar.rb', line 20
def status(state, **options)
tag.span(t("views.katalyst.navigation.editor.#{state}_html", **options),
class: "status-text",
data: { state => "" })
end
|