card 1.19.6 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/card.gemspec +8 -7
- data/config/initializers/01_core_extensions/array.rb +4 -0
- data/config/initializers/01_core_extensions/persistent_identifiers.rb +12 -0
- data/config/initializers/02_patches/better_errors.rb +56 -0
- data/config/initializers/core_extensions.rb +13 -18
- data/config/initializers/patches.rb +8 -0
- data/config/locales/de.yml +0 -2
- data/db/migrate_core_cards/20150202143810_import_bootstrap_layout.rb +22 -12
- data/db/migrate_core_cards/20161102202156_tweak_recaptcha_setting_cards.rb +17 -0
- data/db/migrate_core_cards/20161103154836_update_keys.rb +46 -0
- data/lib/card.rb +1 -8
- data/lib/card/act_manager.rb +4 -0
- data/lib/card/auth/permissions.rb +5 -3
- data/lib/card/cache.rb +1 -20
- data/lib/card/cache/persistent.rb +6 -0
- data/lib/card/content/chunk.rb +4 -3
- data/lib/card/content/diff.rb +2 -2
- data/lib/card/content/diff/result.rb +11 -0
- data/lib/card/env/success.rb +4 -0
- data/lib/card/error.rb +2 -0
- data/lib/card/format.rb +14 -17
- data/lib/card/format/content.rb +16 -8
- data/lib/card/format/error.rb +3 -5
- data/lib/card/format/names.rb +22 -16
- data/lib/card/format/nest.rb +67 -61
- data/lib/card/format/nest/fetch.rb +40 -33
- data/lib/card/format/nest/main.rb +39 -19
- data/lib/card/format/nest/subformat.rb +3 -16
- data/lib/card/format/nest/view.rb +23 -32
- data/lib/card/format/permission.rb +49 -34
- data/lib/card/format/registration.rb +12 -6
- data/lib/card/format/render.rb +62 -73
- data/lib/card/migration.rb +14 -10
- data/lib/card/migration/import.rb +20 -19
- data/lib/card/migration/import/import_data.rb +50 -59
- data/lib/card/migration/import/import_data/card_attributes.rb +56 -0
- data/lib/card/migration/import/import_data/card_content.rb +33 -0
- data/lib/card/migration/import/merger.rb +47 -0
- data/lib/card/mod/loader.rb +4 -4
- data/lib/card/model/save_helper.rb +49 -10
- data/lib/card/name.rb +16 -52
- data/lib/card/name/fields_and_traits.rb +67 -0
- data/lib/card/name/variants.rb +17 -0
- data/lib/card/query.rb +6 -2
- data/lib/card/query/attributes.rb +1 -1
- data/lib/card/query/interpretation.rb +3 -3
- data/lib/card/set/event.rb +2 -1
- data/lib/card/set/format.rb +18 -7
- data/lib/card/set_pattern.rb +17 -13
- data/lib/card/tasks/card.rake +1 -1
- data/lib/card/view.rb +55 -0
- data/lib/card/view/cache.rb +90 -0
- data/lib/card/view/fetch.rb +109 -0
- data/lib/card/view/options.rb +164 -0
- data/lib/card/view/stub.rb +30 -0
- data/lib/card/view/visibility.rb +95 -0
- data/lib/cardio.rb +3 -2
- data/lib/cardio/schema.rb +21 -8
- data/lib/generators/card.rb +16 -2
- data/lib/generators/card/format/format_generator.rb +10 -9
- data/lib/generators/card/migration/migration_generator.rb +10 -5
- data/lib/generators/card/set/USAGE +1 -1
- data/lib/generators/card/set/set_generator.rb +11 -9
- data/mod/account/set/right/account.rb +38 -40
- data/mod/account/set/right/token.rb +2 -1
- data/mod/account/set/self/account_links.rb +34 -54
- data/mod/account/set/self/signin.rb +107 -93
- data/mod/account/set/type/signup.rb +33 -32
- data/mod/account/set/type/user.rb +28 -21
- data/mod/account/spec/set/all/account_spec.rb +9 -9
- data/mod/account/spec/set/right/account_spec.rb +23 -14
- data/mod/account/spec/set/right/email_spec.rb +6 -6
- data/mod/account/spec/set/right/password_spec.rb +4 -4
- data/mod/account/spec/set/right/token_spec.rb +3 -3
- data/mod/account/spec/set/self/account_links_spec.rb +3 -3
- data/mod/account/spec/set/self/signin_spec.rb +2 -2
- data/mod/account/spec/set/type/signup_spec.rb +7 -8
- data/mod/ace_editor/set/abstract/ace_editor.rb +1 -4
- data/mod/admin/set/self/admin.rb +2 -2
- data/mod/admin/set/self/admin_info.rb +1 -1
- data/mod/admin/set/self/recaptcha_private_key.rb +3 -0
- data/mod/admin/set/self/recaptcha_proxy.rb +3 -0
- data/mod/admin/set/self/recaptcha_public_key.rb +3 -0
- data/mod/admin/set/self/trash.rb +4 -4
- data/mod/admin/spec/set/self/admin_spec.rb +4 -4
- data/mod/admin/spec/set/self/version_spec.rb +1 -1
- data/mod/basic_formats/set/all/all_css.rb +3 -3
- data/mod/basic_formats/set/all/all_csv.rb +6 -6
- data/mod/basic_formats/set/all/all_js.rb +4 -0
- data/mod/basic_formats/set/all/base.rb +40 -62
- data/mod/basic_formats/set/all/json.rb +34 -39
- data/mod/basic_formats/set/all/rss.rb +6 -6
- data/mod/basic_formats/set/all/text.rb +3 -2
- data/mod/basic_formats/set/self/01_head/javascript.rb +2 -2
- data/mod/basic_formats/set/self/head.rb +6 -10
- data/mod/basic_formats/spec/set/all/all_css_spec.rb +1 -1
- data/mod/basic_formats/spec/set/all/all_csv_spec.rb +1 -1
- data/mod/basic_formats/spec/set/all/base_spec.rb +8 -5
- data/mod/basic_formats/spec/set/all/json_spec.rb +2 -2
- data/mod/basic_formats/spec/set/all/rss_spec.rb +4 -4
- data/mod/basic_types/set/type/plain_text.rb +3 -5
- data/mod/basic_types/spec/set/type/plain_text_spec.rb +2 -2
- data/mod/bootstrap/lib/bootstrap.rb +16 -0
- data/mod/bootstrap/lib/bootstrap/basic_tags.rb +26 -0
- data/mod/bootstrap/lib/bootstrap/component.rb +133 -0
- data/mod/bootstrap/lib/bootstrap/component/form.rb +31 -0
- data/mod/bootstrap/lib/bootstrap/component/horizontal_form.rb +38 -0
- data/mod/bootstrap/lib/bootstrap/component/layout.rb +83 -0
- data/mod/bootstrap/lib/bootstrap/component/panel.rb +9 -0
- data/mod/bootstrap/lib/bootstrap/component_loader.rb +30 -0
- data/mod/bootstrap/lib/bootstrap/delegate.rb +16 -0
- data/mod/bootstrap/lib/bootstrapper.rb +16 -0
- data/mod/bootstrap/lib/stylesheets/bootstrap/_tables.scss +55 -52
- data/mod/bootstrap/lib/stylesheets/bootstrap/mixins/_table-row.scss +12 -12
- data/mod/bootstrap/lib/stylesheets/bootstrap_cards.scss +12 -0
- data/mod/bootstrap/set/all/bootstrap/accordion.rb +63 -0
- data/mod/bootstrap/set/all/bootstrap/helper.rb +7 -140
- data/mod/bootstrap/set/all/bootstrap/navbar.rb +74 -0
- data/mod/bootstrap/set/all/bootstrap/table.rb +76 -46
- data/mod/bootstrap/set/all/bootstrap/tabs.rb +58 -23
- data/mod/bootstrap/set/all/bootstrap/wrapper.rb +14 -8
- data/mod/bootstrap/set/all/rich_bootstrap.rb +5 -3
- data/mod/bootstrap/spec/set/all/bootstrap/bootstrap_builder_spec.rb +31 -0
- data/mod/bootstrap/spec/set/all/bootstrap/bootstrap_spec.rb +20 -0
- data/mod/bootstrap/spec/set/all/bootstrap/form_spec.rb +59 -1
- data/mod/bootstrap/spec/set/all/bootstrap/layout_spec.rb +104 -15
- data/mod/carrierwave/set/abstract/attachment.rb +4 -3
- data/mod/carrierwave/set/abstract/attachment/paths.rb +1 -1
- data/mod/carrierwave/set/abstract/attachment/storage_type.rb +5 -11
- data/mod/carrierwave/set/type/file.rb +39 -32
- data/mod/carrierwave/set/type/image.rb +59 -34
- data/mod/carrierwave/spec/set/type/image_spec.rb +3 -3
- data/mod/core/chunk/link.rb +5 -0
- data/mod/core/chunk/{include.rb → nest.rb} +8 -29
- data/mod/core/chunk/reference.rb +5 -6
- data/mod/core/chunk/view_stub.rb +42 -0
- data/mod/core/format/html_format.rb +23 -26
- data/mod/core/set/abstract/code_file.rb +1 -1
- data/mod/core/set/all/actify.rb +1 -1
- data/mod/core/set/all/active_card.rb +0 -1
- data/mod/core/set/all/{tracked_attributes.rb → assign_attributes.rb} +55 -24
- data/mod/core/set/all/collection.rb +136 -122
- data/mod/core/set/all/content.rb +8 -0
- data/mod/core/set/all/event.rb +5 -2
- data/mod/core/set/all/export.rb +7 -7
- data/mod/core/set/all/fetch.rb +90 -26
- data/mod/core/set/all/initialize.rb +17 -6
- data/mod/core/set/all/name.rb +2 -3
- data/mod/core/set/all/permissions.rb +19 -11
- data/mod/core/set/all/states.rb +12 -2
- data/mod/core/set/all/trash.rb +1 -1
- data/mod/core/set/all/type.rb +2 -0
- data/mod/core/set/all/utils.rb +4 -3
- data/mod/core/spec/chunk/literal_spec.rb +2 -2
- data/mod/core/spec/chunk/uri_spec.rb +17 -17
- data/mod/core/spec/format/html_format_spec.rb +11 -13
- data/mod/core/spec/set/all/attribute_tracking_spec.rb +2 -2
- data/mod/core/spec/set/all/collection_spec.rb +21 -24
- data/mod/core/spec/set/all/content_spec.rb +1 -1
- data/mod/core/spec/set/all/export_spec.rb +3 -3
- data/mod/core/spec/set/all/fetch_spec.rb +5 -5
- data/mod/core/spec/set/all/initialize_spec.rb +4 -4
- data/mod/core/spec/set/all/name_spec.rb +6 -6
- data/mod/core/spec/set/all/permissions_spec.rb +10 -10
- data/mod/core/spec/set/all/references_spec.rb +1 -1
- data/mod/core/spec/set/all/rules2_spec.rb +24 -24
- data/mod/core/spec/set/all/rules_spec.rb +1 -1
- data/mod/core/spec/set/all/templating_spec.rb +8 -8
- data/mod/core/spec/set/all/tracked_attributes_spec.rb +6 -6
- data/mod/core/spec/set/all/type_spec.rb +5 -5
- data/mod/developer/spec/set/all/event_viz_spec.rb +1 -1
- data/mod/developer/spec/set/right/debug_spec.rb +1 -1
- data/mod/email/set/all/email_html.rb +2 -2
- data/mod/email/set/all/notify.rb +8 -3
- data/mod/email/set/right/bcc.rb +3 -3
- data/mod/email/set/right/follow.rb +5 -5
- data/mod/email/set/right/following.rb +1 -1
- data/mod/email/set/self/follow_defaults.rb +27 -16
- data/mod/email/set/type/email_template.rb +1 -1
- data/mod/email/set/type_plus_right/user/follow.rb +10 -9
- data/mod/history/lib/card/act.rb +4 -0
- data/mod/history/lib/card/act/act_renderer.rb +194 -0
- data/mod/history/lib/card/act/act_renderer/absolute_act_renderer.rb +25 -0
- data/mod/history/lib/card/act/act_renderer/relative_act_renderer.rb +41 -0
- data/mod/history/lib/card/action.rb +1 -0
- data/mod/history/lib/card/action/action_renderer.rb +92 -0
- data/mod/history/lib/card/action/differ.rb +6 -1
- data/mod/history/set/all/act_view.rb +64 -0
- data/mod/history/set/all/action_view.rb +65 -0
- data/mod/history/set/all/content_history.rb +44 -37
- data/mod/history/set/all/history.rb +49 -263
- data/mod/machines/lib/stylesheets/style_cards.scss +30 -115
- data/mod/machines/set/abstract/script.rb +42 -7
- data/mod/machines/set/right/machine_input.rb +4 -0
- data/mod/machines/set/type/coffee_script.rb +8 -22
- data/mod/machines/set/type/css.rb +2 -2
- data/mod/machines/set/type/java_script.rb +4 -24
- data/mod/machines/set/type/scss.rb +1 -1
- data/mod/machines/spec/set/type/css_spec.rb +1 -1
- data/mod/machines/spec/set/type/scss_spec.rb +3 -3
- data/mod/machines/spec/set/type/skin_spec.rb +7 -7
- data/mod/pointer/set/abstract/01_pointer.rb +44 -46
- data/mod/pointer/set/abstract/01_pointer/edit.rb +13 -13
- data/mod/pointer/set/right/options.rb +4 -0
- data/mod/pointer/spec/set/type/pointer_spec.rb +7 -7
- data/mod/prosemirror_editor/set/abstract/prosemirror_editor.rb +3 -3
- data/mod/settings/set/abstract/permission.rb +25 -18
- data/mod/settings/set/right/add_help.rb +3 -3
- data/mod/settings/set/right/structure.rb +10 -16
- data/mod/settings/spec/set/right/comment_spec.rb +3 -3
- data/mod/settings/spec/set/right/create_spec.rb +1 -1
- data/mod/settings/spec/set/right/style_spec.rb +1 -1
- data/mod/settings/spec/set/type/setting_spec.rb +1 -1
- data/mod/solid_cache/set/abstract/solid_cache.rb +4 -4
- data/mod/solid_cache/set/right/solid_cache.rb +9 -10
- data/mod/standard/set/abstract/01_search_params.rb +41 -0
- data/mod/standard/set/abstract/search.rb +132 -0
- data/mod/standard/set/abstract/search/paging.rb +81 -0
- data/mod/standard/set/abstract/search/paging/paging_links.rb +90 -0
- data/mod/standard/set/abstract/wql_search.rb +67 -0
- data/mod/standard/set/all/error.rb +89 -82
- data/mod/standard/set/all/links.rb +1 -1
- data/mod/standard/set/all/rich_html/content.rb +125 -141
- data/mod/standard/set/all/rich_html/editing.rb +115 -178
- data/mod/standard/set/all/rich_html/form.rb +111 -131
- data/mod/standard/set/all/rich_html/header.rb +57 -39
- data/mod/standard/set/all/rich_html/menu.rb +94 -94
- data/mod/standard/set/all/rich_html/modal.rb +5 -10
- data/mod/standard/set/all/rich_html/new.rb +103 -0
- data/mod/standard/set/all/rich_html/toolbar.rb +54 -74
- data/mod/standard/set/all/rich_html/wrapper.rb +111 -138
- data/mod/standard/set/rstar/rules.rb +27 -38
- data/mod/standard/set/rstar/rules_editor.rb +298 -277
- data/mod/standard/set/self/navbox.rb +20 -15
- data/mod/standard/set/self/recent.rb +25 -17
- data/mod/standard/set/self/search.rb +25 -4
- data/mod/standard/set/type/cardtype.rb +11 -9
- data/mod/standard/set/type/date.rb +1 -1
- data/mod/standard/set/type/number.rb +1 -1
- data/mod/standard/set/type/phrase.rb +1 -1
- data/mod/standard/set/type/search_type.rb +17 -282
- data/mod/standard/set/type/session.rb +1 -1
- data/mod/standard/set/type/set.rb +155 -131
- data/mod/standard/set/type/toggle.rb +1 -1
- data/mod/standard/set/type/uri.rb +4 -4
- data/mod/standard/spec/chunk/include_spec.rb +13 -31
- data/mod/standard/spec/chunk/link_spec.rb +1 -1
- data/mod/standard/spec/set/all/error_spec.rb +1 -1
- data/mod/standard/spec/set/all/history_spec.rb +2 -2
- data/mod/standard/spec/set/all/rich_html/form_spec.rb +4 -4
- data/mod/standard/spec/set/all/rich_html/toolbar_spec.rb +22 -0
- data/mod/standard/spec/set/all/rich_html/wrapper_spec.rb +3 -2
- data/mod/standard/spec/set/right/when_created_spec.rb +1 -1
- data/mod/standard/spec/set/right/when_last_edited_spec.rb +1 -1
- data/mod/standard/spec/set/rstar/rules_spec.rb +2 -3
- data/mod/standard/spec/set/self/head_spec.rb +2 -2
- data/mod/standard/spec/set/self/navbox_spec.rb +1 -1
- data/mod/standard/spec/set/self/now_spec.rb +1 -1
- data/mod/standard/spec/set/type/date_spec.rb +1 -1
- data/mod/standard/spec/set/type/email_template_spec.rb +1 -1
- data/mod/standard/spec/set/type/layout_type_spec.rb +1 -1
- data/mod/standard/spec/set/type/number_spec.rb +1 -1
- data/mod/standard/spec/set/type/phrase_spec.rb +1 -1
- data/mod/standard/spec/set/type/search_type_spec.rb +2 -2
- data/mod/standard/spec/set/type/set_spec.rb +2 -2
- data/mod/standard/spec/set/type/toggle_spec.rb +2 -2
- data/mod/standard/spec/set/type/uri_spec.rb +3 -1
- data/mod/tinymce_editor/set/abstract/tinymce_editor.rb +1 -1
- data/spec/config/initializers/core_extensions_spec.rb +40 -10
- data/spec/lib/card/auth_spec.rb +8 -8
- data/spec/lib/card/cache_spec.rb +3 -3
- data/spec/lib/card/chunk_spec.rb +4 -4
- data/spec/lib/card/codename_spec.rb +2 -2
- data/spec/lib/card/content_spec.rb +23 -23
- data/spec/lib/card/diff_spec.rb +1 -1
- data/spec/lib/card/format_spec.rb +19 -24
- data/spec/lib/card/loader_spec.rb +4 -4
- data/spec/lib/card/name_spec.rb +16 -16
- data/spec/lib/card/query_spec.rb +80 -80
- data/spec/lib/card/reference_spec.rb +5 -5
- data/spec/lib/card/set_spec.rb +6 -6
- data/spec/lib/card/subcards_spec.rb +14 -0
- data/spec/lib/card/view_cache_spec.rb +5 -5
- data/spec/models/card/cardtype_spec.rb +15 -15
- data/spec/models/card/create_spec.rb +2 -2
- data/spec/models/card/trash_spec.rb +24 -24
- data/spec/models/card/type_transition_spec.rb +8 -8
- data/spec/models/card/validation_spec.rb +5 -5
- data/spec/models/card_spec.rb +14 -14
- data/spec/spec_helper.rb +6 -2
- data/spec/support/card_spec_helper.rb +21 -11
- data/spec/support/helper/card_helper.rb +11 -4
- metadata +73 -15
- data/lib/card/cache/view_cache.rb +0 -103
- data/mod/bootstrap/set/all/bootstrap/layout.rb +0 -58
- data/mod/core/set/all/view_cache.rb +0 -9
@@ -1,106 +1,103 @@
|
|
1
1
|
format :html do
|
2
|
-
view :menu, denial: :blank, tags: :unknown_ok do
|
3
|
-
return _render_template_closer if args[:menu_hack] == :template_closer
|
2
|
+
view :menu, denial: :blank, tags: :unknown_ok do
|
4
3
|
return "" if card.unknown?
|
5
4
|
wrap_with :div, class: "menu-slot nodblclick" do
|
6
5
|
[
|
7
|
-
|
8
|
-
_render_menu_link
|
9
|
-
_render_modal_slot(
|
6
|
+
_render(:horizontal_menu, optional: :hide),
|
7
|
+
_render_menu_link,
|
8
|
+
_render_modal_slot(modal_id: card.cardname.safe_key)
|
10
9
|
]
|
11
10
|
end
|
12
11
|
end
|
13
12
|
|
14
|
-
view :menu_link do
|
15
|
-
menu_icon = glyphicon args[:menu_icon]
|
16
|
-
path_opts = { slot: { home_view: args[:home_view] } }
|
17
|
-
path_opts[:is_main] = true if main?
|
13
|
+
view :menu_link do
|
18
14
|
css_class =
|
19
|
-
|
20
|
-
|
21
|
-
"visible-xs"
|
22
|
-
else
|
23
|
-
"show-on-hover"
|
24
|
-
end
|
15
|
+
show_view?(:horizontal_menu, :hide) ? "visible-xs" : "show-on-hover"
|
16
|
+
|
25
17
|
wrap_with :div, class: "vertical-card-menu card-menu #{css_class}" do
|
26
|
-
|
27
|
-
link_to_view(:vertical_menu, menu_icon, path:
|
18
|
+
wrap_with :div, class: "btn-group slotter card-slot pull-right" do
|
19
|
+
link_to_view(:vertical_menu, menu_icon, path: menu_path_opts).html_safe
|
28
20
|
end
|
29
21
|
end
|
30
22
|
end
|
31
23
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
24
|
+
def menu_path_opts
|
25
|
+
opts = { slot: { home_view: (voo.home_view || @slot_view),
|
26
|
+
name_context: context_names_to_params } }
|
27
|
+
opts[:is_main] = true if main?
|
28
|
+
opts
|
29
|
+
end
|
30
|
+
|
31
|
+
def menu_icon
|
32
|
+
glyphicon "cog"
|
33
|
+
end
|
34
|
+
|
35
|
+
view :vertical_menu, tags: :unknown_ok do
|
36
36
|
wrap_with :ul, class: "btn-group pull-right slotter" do
|
37
|
-
[
|
38
|
-
content_tag(:span,
|
39
|
-
"<a href='#'>#{glyphicon args[:menu_icon]}</a>".html_safe,
|
40
|
-
class: "open-menu dropdown-toggle",
|
41
|
-
"data-toggle" => "dropdown", "aria-expanded" => "false"),
|
42
|
-
content_tag(:ul, items.html_safe, class: "dropdown-menu", role: "menu")
|
43
|
-
]
|
37
|
+
[vertical_menu_toggle, vertical_menu_item_list]
|
44
38
|
end
|
45
39
|
end
|
46
40
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
41
|
+
def vertical_menu_toggle
|
42
|
+
wrap_with :span, "<a href='#'>#{menu_icon}</a>".html_safe,
|
43
|
+
class: "open-menu dropdown-toggle",
|
44
|
+
"data-toggle" => "dropdown",
|
45
|
+
"aria-expanded" => "false"
|
46
|
+
end
|
47
|
+
|
48
|
+
def vertical_menu_item_list
|
49
|
+
wrap_with :ul, class: "dropdown-menu", role: "menu" do
|
50
|
+
menu_item_list.map do |item|
|
51
|
+
"<li>#{item}</li>"
|
52
|
+
end.join("\n").html_safe
|
52
53
|
end
|
53
54
|
end
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
menu_items << menu_page_link(args) if args[:show_menu_item][:page]
|
61
|
-
menu_items << menu_rules_link(args) if args[:show_menu_item][:rules]
|
62
|
-
menu_items << menu_account_link(args) if args[:show_menu_item][:account]
|
63
|
-
menu_items << menu_more_link(args) if args[:show_menu_item][:more]
|
64
|
-
menu_items
|
56
|
+
view :horizontal_menu do
|
57
|
+
wrap_with :div, class: "btn-group slotter pull-right card-menu "\
|
58
|
+
"horizontal-card-menu hidden-xs" do
|
59
|
+
menu_item_list(class: "btn btn-default").join("\n").html_safe
|
60
|
+
end
|
65
61
|
end
|
66
62
|
|
67
|
-
def
|
68
|
-
|
69
|
-
|
63
|
+
def menu_item_list link_opts={}
|
64
|
+
[:edit, :discuss, :follow, :page, :rules, :account, :more].map do |item|
|
65
|
+
next unless send "show_menu_item_#{item}?"
|
66
|
+
send "menu_#{item}_link", link_opts
|
67
|
+
end.compact
|
70
68
|
end
|
71
69
|
|
72
|
-
def menu_edit_link
|
73
|
-
menu_item "edit", "edit",
|
70
|
+
def menu_edit_link opts
|
71
|
+
menu_item "edit", "edit", opts.merge(view: :edit, path: menu_path_opts)
|
74
72
|
end
|
75
73
|
|
76
|
-
def menu_discuss_link
|
77
|
-
|
78
|
-
menu_item "discuss", "comment", opts
|
74
|
+
def menu_discuss_link opts
|
75
|
+
menu_item "discuss", "comment", opts.merge(related: Card[:discussion].key)
|
79
76
|
end
|
80
77
|
|
81
|
-
def menu_follow_link
|
82
|
-
_render_follow_link(
|
78
|
+
def menu_follow_link opts
|
79
|
+
_render_follow_link(icon: true, link_opts: opts)
|
83
80
|
end
|
84
81
|
|
85
|
-
def menu_page_link
|
86
|
-
menu_item "page", "new-window",
|
82
|
+
def menu_page_link opts
|
83
|
+
menu_item "page", "new-window", opts.merge(card: card)
|
87
84
|
end
|
88
85
|
|
89
|
-
def menu_rules_link
|
90
|
-
menu_item "rules", "wrench",
|
86
|
+
def menu_rules_link opts
|
87
|
+
menu_item "rules", "wrench", opts.merge(view: :options)
|
91
88
|
end
|
92
89
|
|
93
|
-
def menu_account_link
|
94
|
-
menu_item "account", "user",
|
95
|
-
|
96
|
-
|
90
|
+
def menu_account_link opts
|
91
|
+
menu_item "account", "user", opts.merge(
|
92
|
+
view: :related,
|
93
|
+
path: { related: { name: "+*account", view: :edit } }
|
97
94
|
)
|
98
95
|
end
|
99
96
|
|
100
|
-
def menu_more_link
|
101
|
-
view =
|
102
|
-
menu_item "", "option-horizontal",
|
103
|
-
|
97
|
+
def menu_more_link opts
|
98
|
+
view = voo.home_view || :open
|
99
|
+
menu_item "", "option-horizontal", opts.merge(
|
100
|
+
view: view, path: { slot: { show: :toolbar } }
|
104
101
|
)
|
105
102
|
end
|
106
103
|
|
@@ -109,41 +106,44 @@ format :html do
|
|
109
106
|
smart_link_to link_text.html_safe, opts
|
110
107
|
end
|
111
108
|
|
112
|
-
def
|
113
|
-
|
109
|
+
def show_menu_item_discuss?
|
110
|
+
discussion_card = menu_discussion_card
|
111
|
+
return unless discussion_card
|
112
|
+
permission_task = discussion_card.new_card? ? :comment : :read
|
113
|
+
discussion_card.ok? permission_task
|
114
114
|
end
|
115
115
|
|
116
|
-
def
|
117
|
-
|
118
|
-
args.merge! show_menu_item: show_menu_items
|
116
|
+
def show_menu_item_page?
|
117
|
+
card.name.present? && !main?
|
119
118
|
end
|
120
119
|
|
121
|
-
def
|
122
|
-
|
120
|
+
def show_menu_item_rules?
|
121
|
+
card.virtual?
|
123
122
|
end
|
124
123
|
|
125
|
-
def
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
card.cardname.tag_name.key == disc_tagname.key
|
130
|
-
Card.fetch "#{card.name}+#{disc_tagname}", skip_modules: true, new: {}
|
131
|
-
end
|
124
|
+
def show_menu_item_edit?
|
125
|
+
return unless card.real?
|
126
|
+
card.ok?(:update) || structure_editable?
|
127
|
+
end
|
132
128
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
129
|
+
def show_menu_item_account?
|
130
|
+
return unless card.real?
|
131
|
+
card.account && card.ok?(:update)
|
132
|
+
end
|
133
|
+
|
134
|
+
def show_menu_item_follow?
|
135
|
+
return unless card.real?
|
136
|
+
show_follow?
|
137
|
+
end
|
138
|
+
|
139
|
+
def show_menu_item_more?
|
140
|
+
card.real?
|
141
|
+
end
|
142
|
+
|
143
|
+
def menu_discussion_card
|
144
|
+
return if card.new_card?
|
145
|
+
disc_tagname = Card.quick_fetch(:discussion).cardname
|
146
|
+
return if card.junction? && card.cardname.tag_name.key == disc_tagname.key
|
147
|
+
card.fetch trait: :discussion, skip_modules: true, new: {}
|
148
148
|
end
|
149
149
|
end
|
@@ -15,7 +15,7 @@ format :html do
|
|
15
15
|
add_class dialog_args, args[:dialog_class]
|
16
16
|
wrap_with(:div, class: "modal fade", role: "dialog", id: id) do
|
17
17
|
wrap_with(:div, dialog_args) do
|
18
|
-
|
18
|
+
wrap_with :div, class: "modal-content" do
|
19
19
|
""
|
20
20
|
end
|
21
21
|
end
|
@@ -40,14 +40,9 @@ format :html do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
view :modal_footer, tags: :unknown_ok do
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
def default_modal_footer_args args
|
48
|
-
args[:buttons] ||=
|
49
|
-
button_tag "Close",
|
50
|
-
class: "btn-xs close-modal pull-right",
|
51
|
-
"data-dismiss" => "modal"
|
43
|
+
view :modal_footer, tags: :unknown_ok do
|
44
|
+
button_tag "Close",
|
45
|
+
class: "btn-xs close-modal pull-right",
|
46
|
+
"data-dismiss" => "modal"
|
52
47
|
end
|
53
48
|
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
format :html do
|
2
|
+
view :new, perms: :create, tags: :unknown_ok, cache: :never do
|
3
|
+
voo.title ||= new_view_title if new_name_prompt?
|
4
|
+
voo.show :help
|
5
|
+
frame_and_form :create, "main-success" => "REDIRECT" do
|
6
|
+
[
|
7
|
+
new_view_hidden,
|
8
|
+
new_view_name,
|
9
|
+
new_view_type,
|
10
|
+
_optional_render_content_formgroup,
|
11
|
+
_optional_render_new_buttons
|
12
|
+
]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def new_view_title
|
17
|
+
output(
|
18
|
+
"New",
|
19
|
+
(card.type_name unless card.type_id == Card.default_type_id)
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
def new_view_hidden
|
24
|
+
target = card.rule(:thanks) || "_self"
|
25
|
+
hidden_field_tag "success", target
|
26
|
+
end
|
27
|
+
|
28
|
+
# NAME HANDLING
|
29
|
+
|
30
|
+
def new_view_name
|
31
|
+
if new_name_prompt?
|
32
|
+
new_name_formgroup
|
33
|
+
elsif !autoname?
|
34
|
+
hidden_field_tag "card[name]", card.name
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def new_name_formgroup
|
39
|
+
output _optional_render_name_formgroup,
|
40
|
+
hidden_field_tag("name_prompt", true)
|
41
|
+
end
|
42
|
+
|
43
|
+
def new_name_prompt?
|
44
|
+
voo.visible? :name_formgroup do
|
45
|
+
needs_name? || params[:name_prompt]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def autoname?
|
50
|
+
@autoname.nil? ? (@autoname = card.rule_card :autoname).present? : @autoname
|
51
|
+
end
|
52
|
+
|
53
|
+
def needs_name?
|
54
|
+
card.name.blank? && !autoname?
|
55
|
+
end
|
56
|
+
|
57
|
+
# TYPE HANDLING
|
58
|
+
|
59
|
+
def new_view_type
|
60
|
+
if new_type_prompt?
|
61
|
+
_render_new_type_formgroup
|
62
|
+
else
|
63
|
+
hidden_field_tag "card[type_id]", card.type_id
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def new_type_prompt?
|
68
|
+
voo.visible? :new_type_formgroup do
|
69
|
+
!new_type_preset? && new_type_prompt_context? && new_type_permitted?
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def new_type_preset?
|
74
|
+
params[:type] || voo.type
|
75
|
+
end
|
76
|
+
|
77
|
+
def new_type_prompt_context?
|
78
|
+
main? || card.simple? || card.is_template?
|
79
|
+
end
|
80
|
+
|
81
|
+
def new_type_permitted?
|
82
|
+
Card.new(type_id: card.type_id).ok? :create
|
83
|
+
end
|
84
|
+
|
85
|
+
view :new_type_formgroup do
|
86
|
+
wrap_type_formgroup do
|
87
|
+
type_field class: "type-field live-type-field",
|
88
|
+
href: path(view: :new),
|
89
|
+
"data-remote" => true
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
view :new_buttons do
|
94
|
+
cancel_path = !main? && path(view: :missing)
|
95
|
+
button_formgroup do
|
96
|
+
[standard_create_button, standard_cancel_button(cancel_path)]
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
def standard_create_button
|
101
|
+
submit_button class: "submit-button create-submit-button"
|
102
|
+
end
|
103
|
+
end
|
@@ -5,7 +5,7 @@ format :html do
|
|
5
5
|
|
6
6
|
view :toolbar do |args|
|
7
7
|
collapsed = close_link(args.merge(class: "pull-right visible-xs"))
|
8
|
-
navbar "toolbar-#{card.cardname.safe_key}-#{
|
8
|
+
navbar "toolbar-#{card.cardname.safe_key}-#{voo.home_view}",
|
9
9
|
toggle_align: :left, class: "slotter toolbar",
|
10
10
|
navbar_type: "inverse",
|
11
11
|
collapsed_content: collapsed do
|
@@ -20,7 +20,7 @@ format :html do
|
|
20
20
|
]
|
21
21
|
end),
|
22
22
|
(wrap_with(:form, class: "navbar-form navbar-right") do
|
23
|
-
|
23
|
+
wrap_with :div, class: "form-group" do
|
24
24
|
_optional_render(:toolbar_buttons, args, :show)
|
25
25
|
end
|
26
26
|
end)
|
@@ -29,7 +29,7 @@ format :html do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def default_toolbar_args args
|
32
|
-
args[:nested_fields] = nested_fields
|
32
|
+
args[:nested_fields] = nested_fields
|
33
33
|
args[:active_toolbar_button] ||= active_toolbar_button @slot_view, args
|
34
34
|
end
|
35
35
|
|
@@ -86,32 +86,41 @@ format :html do
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def rules_split_button args
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
89
|
+
button_hash = {
|
90
|
+
common_rules: edit_rules_link("common", :common_rules),
|
91
|
+
grouped_rules: edit_rules_link("by group", :grouped_rules),
|
92
|
+
all_rules: edit_rules_link("by name", :all_rules)
|
93
|
+
}
|
94
|
+
recently_edited_rules_link button_hash
|
95
|
+
nest_rules_link button_hash, args[:nested_fields]
|
96
|
+
toolbar_split_button("rules", { view: :edit_rules }, args) { button_hash }
|
97
|
+
end
|
98
|
+
|
99
|
+
def nest_rules_link button_hash, nested_fields
|
100
|
+
return unless nested_fields.present?
|
101
|
+
button_hash[:separator] = separator
|
102
|
+
button_hash[:edit_nest_rules] = edit_nest_rules_link "nests"
|
103
|
+
end
|
104
|
+
|
105
|
+
def recently_edited_rules_link button_hash
|
106
|
+
return unless recently_edited_settings?
|
107
|
+
button_hash[:recent_rules] = edit_rules_link "recent", :recent_rules
|
108
|
+
end
|
109
|
+
|
110
|
+
def edit_nest_rules_link text
|
111
|
+
smart_link_to text, view: :edit_nest_rules,
|
112
|
+
path: { slot: { rule_view: :field_related_rules } }
|
113
|
+
end
|
114
|
+
|
115
|
+
def edit_rules_link text, rule_view
|
116
|
+
smart_link_to text, view: :edit_rules,
|
117
|
+
path: { slot: { rule_view: rule_view } }
|
109
118
|
end
|
110
119
|
|
111
120
|
def edit_split_button args
|
112
121
|
toolbar_split_button "edit", { view: :edit }, args do
|
113
122
|
{
|
114
|
-
edit:
|
123
|
+
edit: _render_edit_link(args),
|
115
124
|
edit_nests: (_render_edit_nests_link if nests_editable?(args)),
|
116
125
|
structure: (_render_edit_structure_link if structure_editable?),
|
117
126
|
edit_name: _render_edit_name_link,
|
@@ -186,8 +195,7 @@ format :html do
|
|
186
195
|
[
|
187
196
|
_optional_render(:delete_button, args, show_or_hide_delete),
|
188
197
|
_optional_render(:refresh_button, args, :show),
|
189
|
-
_optional_render(:related_button, args, :show)
|
190
|
-
_optional_render(:history_button, args, :hide)
|
198
|
+
_optional_render(:related_button, args, :show)
|
191
199
|
]
|
192
200
|
end
|
193
201
|
end
|
@@ -242,62 +250,34 @@ format :html do
|
|
242
250
|
icon = glyphicon symbol
|
243
251
|
hide ||= "hidden-xs hidden-sm hidden-md hidden-lg"
|
244
252
|
css_classes = "menu-item-label #{hide}"
|
245
|
-
rich_text =
|
253
|
+
rich_text = wrap_with :span, text.html_safe, class: css_classes
|
246
254
|
icon + rich_text
|
247
255
|
end
|
248
256
|
|
249
|
-
def autosaved_draft_link
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
def default_edit_content_link_args args
|
256
|
-
args[:title] ||= "content"
|
257
|
-
end
|
258
|
-
|
259
|
-
view :edit_content_link do |args|
|
260
|
-
toolbar_view_link :edit, args
|
257
|
+
def autosaved_draft_link opts={}
|
258
|
+
text = opts.delete(:text) || "autosaved draft"
|
259
|
+
opts[:path] = { edit_draft: true, slot: { show: :toolbar } }
|
260
|
+
add_class opts, "navbar-link slotter"
|
261
|
+
link_to_view :edit, text, opts
|
261
262
|
end
|
262
263
|
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
args[:title] ||= "type"
|
272
|
-
end
|
273
|
-
|
274
|
-
view :edit_type_link do |args|
|
275
|
-
toolbar_view_link :edit_type, args
|
276
|
-
end
|
277
|
-
|
278
|
-
view :edit_structure_link do |_args|
|
279
|
-
link_to_view :edit_structure, "structure"
|
280
|
-
end
|
264
|
+
{
|
265
|
+
edit: "content",
|
266
|
+
edit_name: "name",
|
267
|
+
edit_type: "type",
|
268
|
+
edit_nests: "nests",
|
269
|
+
edit_structure: "structure",
|
270
|
+
history: "history"
|
271
|
+
}.each do |viewname, viewtitle|
|
281
272
|
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
view :history_link do |args|
|
287
|
-
toolbar_view_link :history, args
|
288
|
-
end
|
289
|
-
|
290
|
-
def default_edit_nests_link_args args
|
291
|
-
args[:title] ||= "nests"
|
292
|
-
end
|
293
|
-
|
294
|
-
view :edit_nests_link do |args|
|
295
|
-
toolbar_view_link :edit_nests, args
|
273
|
+
view "#{viewname}_link" do
|
274
|
+
voo.title ||= viewtitle
|
275
|
+
toolbar_view_link viewname
|
276
|
+
end
|
296
277
|
end
|
297
278
|
|
298
|
-
def toolbar_view_link view
|
299
|
-
|
300
|
-
link_to_view view, text, args
|
279
|
+
def toolbar_view_link view
|
280
|
+
link_to_view view, voo.title
|
301
281
|
end
|
302
282
|
|
303
283
|
def recently_edited_settings?
|