24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'app/components/katalyst/content/editor/status_bar_component.rb', line 24
def status(state, **)
status_text = t("views.katalyst.content.editor.#{state}_html", **)
html_options = { class: "status-text", data: { state => "", turbo: false } }
case state.to_sym
when :published
link_to status_text, url_for(container), **html_options
when :unpublished, :draft
link_to status_text, "#{url_for(container)}/preview", **html_options
else
tag.span status_text, **html_options
end
end
|