5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/fiona7/scrivito_patches/page_config.rb', line 5
def current_page_config
return {} unless obj
config = {
id: obj.id,
path: obj.path,
obj_class: obj.obj_class,
description_for_editor: obj.description_for_editor,
has_children: obj.children.reject(&:binary?).any?,
has_conflict: obj.has_conflict?,
has_details_view: obj_has_details_view?,
modification: modification(obj),
parent_path: obj.parent_path,
restriction_messages: editor.restriction_messages_for(obj),
}
if ::Fiona7.workflows_enabled?
fiona_obj = obj.fiona_obj
if fiona_obj.workflow.present?
config[:workflow] = true
config[:editor] = fiona_obj.editor
config[:editing_disabled] = fiona_obj.editor != editor.id
config[:buttons] = fiona_obj.send(:crul_obj).valid_actions
end
end
config
end
|