Class: ActiveVersioning::Workflow::ShowResource
- Inherits:
-
ActiveAdmin::Views::Pages::Show
- Object
- ActiveAdmin::Views::Pages::Show
- ActiveVersioning::Workflow::ShowResource
show all
- Includes:
- PreviewLink
- Defined in:
- lib/active_versioning/workflow/show_resource.rb
Instance Method Summary
collapse
#preview_link_for, #preview_path_for
Instance Method Details
#committed_version_column ⇒ Object
45
46
47
48
49
|
# File 'lib/active_versioning/workflow/show_resource.rb', line 45
def committed_version_column
column class: 'committed-version-column column' do
committed_version_panels
end
end
|
#committed_version_panels ⇒ Object
33
34
35
|
# File 'lib/active_versioning/workflow/show_resource.rb', line 33
def committed_version_panels
instance_exec(resource, &version_block)
end
|
#current_draft_column ⇒ Object
51
52
53
54
55
|
# File 'lib/active_versioning/workflow/show_resource.rb', line 51
def current_draft_column
column class: 'current-draft-column column' do
current_draft_panels
end
end
|
#current_draft_panels ⇒ Object
37
38
39
40
41
42
43
|
# File 'lib/active_versioning/workflow/show_resource.rb', line 37
def current_draft_panels
if resource.current_draft?
instance_exec(resource.current_draft, &version_block)
else
blank_slate(draft_blank_slate_content)
end
end
|
#main_content ⇒ Object
6
7
8
|
# File 'lib/active_versioning/workflow/show_resource.rb', line 6
def main_content
instance_exec(resource, &show_block)
end
|
#version_attributes_panel(version, &block) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/active_versioning/workflow/show_resource.rb', line 10
def version_attributes_panel(version, &block)
args = if version.live?
[I18n.t('active_versioning.panels.committed_version'), id: 'committed-panel']
else
[I18n.t('active_versioning.panels.current_draft'), id: 'current-draft-panel']
end
panel(*args) do
if version.live?
(versions_link)
else
(discard_link)
(commit_link)
(preview_link)
(edit_link)
render 'commit_form'
end
instance_eval(&block)
end
end
|