card 1.99.1 → 1.99.2
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/config/initializers/01_core_extensions/array.rb +1 -0
- data/config/initializers/01_core_extensions/persistent_identifiers.rb +1 -1
- data/config/initializers/02_patches/zeitwerk.rb +13 -0
- data/config/initializers/patches.rb +7 -0
- data/config/initializers/recaptcha.rb +1 -2
- data/config/initializers/zeitwerk.rb +5 -0
- data/config/locales/de.yml +1 -1
- data/config/locales/en.yml +1 -1
- data/config/locales/es.yml +1 -1
- data/db/migrate/20110511221913_require_earlier_migrations.rb +0 -3
- data/db/migrate/20141001105348_move_revisions_to_actions.rb +1 -1
- data/db/migrate_core_cards/20140629222005_add_email_cards.rb +5 -5
- data/db/migrate_core_cards/20141120120605_fix_notification_html_message.rb +1 -1
- data/db/migrate_core_cards/20141204061304_watchers_to_following.rb +1 -1
- data/db/migrate_core_cards/20150202143810_import_bootstrap_layout.rb +2 -2
- data/db/migrate_core_cards/20150317162412_bootstrap_themes.rb +4 -4
- data/db/migrate_core_cards/20150724123438_update_file_and_image_cards.rb +1 -1
- data/db/migrate_core_cards/20190204195039_add_rule_card.rb +1 -1
- data/db/migrate_core_cards/20191008201046_fixture_fix.rb +3 -1
- data/db/migrate_core_cards/20191028135243_add_link_editor_to_tiny_mce_config.rb +8 -0
- data/db/migrate_core_cards/20191115160748_history_cleanup.rb +27 -0
- data/db/migrate_core_cards/20191118145629_codename_fixes.rb +6 -0
- data/db/seed/new/card_actions.yml +874 -874
- data/db/seed/new/card_acts.yml +2 -2
- data/db/seed/new/card_references.yml +2 -2
- data/db/seed/new/cards.yml +1576 -1576
- data/db/seed/new/schema_migrations_core_cards.yml +8 -0
- data/db/seed/test/fixtures/card_actions.yml +1815 -1815
- data/db/seed/test/fixtures/card_acts.yml +499 -499
- data/db/seed/test/fixtures/card_changes.yml +66 -66
- data/db/seed/test/fixtures/card_references.yml +634 -634
- data/db/seed/test/fixtures/cards.yml +2730 -2730
- data/db/seed/test/fixtures/schema_migrations_core_cards.yml +8 -0
- data/db/test_seed.rb +10 -11
- data/lib/card.rb +9 -30
- data/lib/card/act_manager.rb +0 -2
- data/lib/card/auth.rb +0 -5
- data/lib/card/auth/current.rb +32 -59
- data/lib/card/auth/setup.rb +1 -1
- data/lib/card/codename.rb +5 -6
- data/lib/card/content.rb +5 -8
- data/lib/card/content/chunk.rb +0 -78
- data/lib/card/content/chunk/abstract.rb +88 -0
- data/lib/card/content/clean.rb +3 -3
- data/lib/card/content/diff/{lcs.rb → l_c_s.rb} +5 -7
- data/lib/card/content/diff/{processor.rb → l_c_s/processor.rb} +0 -0
- data/lib/card/content/parser.rb +1 -1
- data/lib/card/dirty.rb +25 -31
- data/lib/card/dirty/method_factory.rb +15 -0
- data/lib/card/env.rb +0 -3
- data/lib/card/error.rb +6 -2
- data/lib/card/format.rb +5 -5
- data/lib/card/format/nest/fetch.rb +2 -1
- data/lib/card/mark.rb +1 -0
- data/lib/card/migration.rb +4 -0
- data/lib/card/mod.rb +2 -5
- data/lib/card/mod/dirs.rb +1 -0
- data/lib/card/mod/load_strategy.rb +23 -12
- data/lib/card/mod/loader.rb +13 -13
- data/lib/card/mod/loader/set_loader.rb +7 -1
- data/lib/card/mod/loader/set_pattern_loader.rb +2 -2
- data/lib/card/mod/module_template.rb +1 -5
- data/lib/card/mod_inflector.rb +16 -0
- data/lib/card/model/save_helper.rb +2 -2
- data/lib/card/name.rb +2 -2
- data/lib/card/name/name_variants.rb +19 -0
- data/lib/card/query.rb +4 -2
- data/lib/card/query/card_query/reference_attributes.rb +2 -2
- data/lib/card/query/sql_statement.rb +4 -0
- data/lib/card/set.rb +18 -3
- data/lib/card/set/abstract.rb +6 -0
- data/lib/card/set/event.rb +13 -11
- data/lib/card/set/event/delayed_event.rb +2 -0
- data/lib/card/set/format.rb +3 -3
- data/lib/card/set/helpers.rb +20 -8
- data/lib/card/set/loader.rb +1 -1
- data/lib/card/set/pattern.rb +47 -0
- data/lib/card/{set_pattern.rb → set/pattern/base.rb} +11 -92
- data/lib/card/set/required_field.rb +64 -30
- data/lib/card/set/trait.rb +3 -2
- data/lib/card/set/type.rb +46 -0
- data/lib/card/subcards.rb +0 -4
- data/lib/card/tasks/card.rake +1 -0
- data/lib/card/tasks/card/migrate.rake +1 -1
- data/lib/card/view.rb +2 -7
- data/lib/card/view/cache.rb +3 -0
- data/lib/card/view/cache/stub.rb +5 -0
- data/lib/cardio.rb +73 -46
- data/mod/account/set/abstract/accountable.rb +49 -0
- data/mod/account/set/all/account.rb +3 -3
- data/mod/account/set/right/account.rb +1 -1
- data/mod/account/set/self/signin.rb +2 -2
- data/mod/account/set/type/role.rb +1 -1
- data/mod/account/set/type/signup.rb +2 -2
- data/mod/account/set/type/signup/views.rb +1 -1
- data/mod/account/set/type/user.rb +1 -1
- data/mod/account/spec/set/abstract/accountable_spec.rb +7 -0
- data/mod/account/spec/set/all/account_spec.rb +3 -3
- data/mod/account/spec/set/right/account_spec.rb +1 -1
- data/mod/account/spec/set/type/signup_spec.rb +4 -4
- data/mod/admin/set/self/admin.rb +1 -1
- data/mod/admin/set/self/admin_info.rb +2 -2
- data/mod/admin/set/self/version.rb +1 -1
- data/mod/basic_types/set/type/json.rb +4 -0
- data/mod/basic_types/spec/set/type/html_spec.rb +1 -1
- data/mod/bootstrap/db/migrate_core_cards/data/20181108181219_migrate_classic_skins_to_bootstrap.rb +2 -2
- data/mod/bootstrap/lib/bootstrap/component_loader.rb +1 -1
- data/mod/bootstrap/lib/stylesheets/style_bootstrap_cards.scss +1 -0
- data/mod/bootstrap/set/abstract/bootswatch_theme.rb +1 -1
- data/mod/bootstrap/set/all/bootstrap/tabs.rb +4 -4
- data/mod/bootstrap/set/type/customized_bootswatch_skin.rb +5 -4
- data/mod/carrierwave/config/core_initializers/carrierwave.rb +1 -3
- data/mod/carrierwave/lib/carrier_wave/{cardmount.rb → card_mount.rb} +2 -2
- data/mod/carrierwave/lib/carrier_wave/file_card_uploader.rb +27 -12
- data/mod/carrierwave/set/abstract/attachment.rb +0 -2
- data/mod/carrierwave/set/all/file_utils.rb +5 -1
- data/mod/carrierwave/set/self/admin.rb +1 -1
- data/mod/core/chunk/link.rb +99 -91
- data/mod/core/chunk/nest.rb +2 -2
- data/mod/core/chunk/query_reference.rb +79 -74
- data/mod/core/chunk/view_stub.rb +10 -1
- data/mod/core/format/html_format.rb +1 -1
- data/mod/core/set/abstract/code_file.rb +6 -6
- data/mod/core/set/all/content.rb +1 -1
- data/mod/core/set/all/event_conditions.rb +1 -2
- data/mod/core/set/all/fetch.rb +22 -19
- data/mod/core/set/all/fetch_helper.rb +7 -5
- data/mod/core/set/all/initialize.rb +35 -9
- data/mod/core/set/all/item.rb +16 -6
- data/mod/core/set/all/name.rb +19 -15
- data/mod/core/set/all/pattern.rb +4 -0
- data/mod/core/set/all/permissions.rb +13 -11
- data/mod/core/set/all/rename.rb +1 -0
- data/mod/core/set/all/rules.rb +4 -4
- data/mod/core/set/all/subcards.rb +36 -1
- data/mod/core/set/all/type.rb +1 -1
- data/mod/core/set_pattern/03_type.rb +2 -0
- data/mod/core/spec/chunk/nest_spec.rb +7 -2
- data/mod/core/spec/set/all/fetch_spec.rb +1 -1
- data/mod/core/spec/set/all/permissions_spec.rb +11 -12
- data/mod/core/spec/set/all/rules_spec.rb +3 -3
- data/mod/edit/set/all/bridge.rb +1 -3
- data/mod/edit/set/all/bridge/tab_views.rb +0 -7
- data/mod/edit/set/all/bridge/tab_visibility.rb +5 -7
- data/mod/edit/set/all/form_buttons.rb +1 -1
- data/mod/edit/set/all/form_elements.rb +1 -0
- data/mod/edit/set/all/new.rb +2 -2
- data/mod/edit/spec/set/all/bridge/tab_views_spec.rb +1 -1
- data/mod/edit/spec/set/all/{nest_editor → reference_editor/nest_editor}/nest_parser_spec.rb +1 -1
- data/mod/edit/spec/set/all/{nest_editor_spec.rb → reference_editor/nest_editor_spec.rb} +6 -3
- data/mod/edit/spec/set/all/{nest_image_spec.rb → reference_editor/nest_image_spec.rb} +1 -1
- data/mod/email/set/abstract/test_context.rb +1 -1
- data/mod/email/set/type/email_template/email_config.rb +1 -1
- data/mod/follow/set/all/notify.rb +1 -1
- data/mod/follow/set/all/notify/base_views.rb +1 -1
- data/mod/follow/set/right/account.rb +8 -6
- data/mod/follow/set/right/followers.rb +2 -5
- data/mod/follow/set/right/following.rb +1 -1
- data/mod/follow/spec/set/all/follow_spec.rb +3 -3
- data/mod/follow/spec/set/all/notify_spec.rb +1 -1
- data/mod/follow/spec/set/right/followers_spec.rb +2 -2
- data/mod/history/lib/card/act.rb +3 -1
- data/mod/history/lib/card/action.rb +3 -3
- data/mod/history/lib/card/action/admin.rb +0 -11
- data/mod/history/set/all/history_bridge.rb +1 -1
- data/mod/machines/file/all_script_machine_output/file.js +38415 -69
- data/mod/machines/file/all_style_machine_output/file.css +2 -2
- data/mod/machines/file/script_html5shiv_printshiv_machine_output/file.js +1 -1
- data/mod/machines/lib/javascript/decko/filter.js.coffee +7 -1
- data/mod/machines/lib/javascript/decko/filter_links.js.coffee +13 -2
- data/mod/machines/lib/javascript/decko/link_editor.js.coffee +64 -0
- data/mod/machines/lib/javascript/decko/mod.js.coffee +3 -0
- data/mod/machines/lib/javascript/decko/nest_editor.js.coffee +49 -29
- data/mod/machines/lib/javascript/decko/nest_editor_name.js.coffee +30 -7
- data/mod/machines/lib/javascript/decko/slot.js.coffee +4 -1
- data/mod/machines/lib/stylesheets/style_cards.scss +31 -19
- data/mod/machines/set/abstract/machine/output_cache.rb +1 -1
- data/mod/machines/set/abstract/machine/output_update.rb +1 -1
- data/mod/machines/set/all/reset_machines.rb +2 -2
- data/mod/machines/set/self/script_decko.rb +1 -0
- data/mod/media/set/abstract/media.rb +1 -1
- data/mod/media/set/type/image.rb +1 -1
- data/mod/navbar/set/abstract/account_dropdown.rb +5 -1
- data/mod/navbar/set/right/enabled_roles.rb +1 -1
- data/mod/navbar/set/self/account_links.rb +1 -1
- data/mod/pointer/set/abstract/02_pointer.rb +1 -1
- data/mod/pointer/set/abstract/02_pointer/events.rb +30 -10
- data/mod/pointer/set/abstract/02_pointer/html_views.rb +6 -2
- data/mod/pointer/set/abstract/02_pointer/html_views/autocomplete_input.haml +1 -1
- data/mod/pointer/set/abstract/02_pointer/html_views/filter.rb +1 -1
- data/mod/pointer/set/abstract/02_pointer/item_api.rb +51 -31
- data/mod/pointer/set/abstract/id_pointer.rb +21 -0
- data/mod/pointer/set/type/link_list.rb +1 -1
- data/mod/pointer/set/type/mirror_list.rb +1 -1
- data/mod/pointer/set/type/mirrored_list.rb +2 -2
- data/mod/pointer/spec/set/abstract/paging_params_spec.rb +1 -1
- data/mod/pointer/spec/set/abstract/pointer/item_api_spec.rb +1 -1
- data/mod/recaptcha/set/all/recaptcha.rb +4 -9
- data/mod/rules/set/rule/editor.rb +2 -2
- data/mod/rules/set/type/set/html_views/rule_lists.rb +1 -1
- data/mod/rules/spec/set/type/set_spec.rb +1 -1
- data/mod/search/set/abstract/03_filter/filter_form.haml +1 -1
- data/mod/search/set/abstract/03_filter/filter_form.rb +23 -2
- data/mod/search/set/abstract/03_filter/quick_filters.haml +7 -10
- data/mod/search/template/abstract/search/checkbox_item.haml +5 -6
- data/mod/settings/set/abstract/permission.rb +2 -2
- data/mod/settings/set/right/input_type.rb +3 -3
- data/mod/settings/set/right/structure.rb +1 -1
- data/mod/settings/set/right/style.rb +1 -1
- data/mod/settings/set/type/setting.rb +2 -2
- data/mod/standard/set/all/rich_html/html_views/guide.rb +1 -1
- data/mod/standard/set/all/rich_html/menu.rb +6 -5
- data/mod/standard/set/self/cardtype.rb +1 -1
- data/mod/standard/set/type/cardtype.rb +33 -17
- data/mod/standard/set/type/session.rb +12 -0
- data/mod/standard/spec/set/type/email_template/email_config_spec.rb +1 -2
- data/mod/standard/spec/set/type/email_template_spec.rb +1 -3
- data/mod/tinymce_editor/lib/javascript/script_tinymce_config.js.coffee +3 -2
- data/mod/tinymce_editor/public/assets/tinymce/plugins/nest/plugin.min.js +1 -1
- data/mod/tinymce_editor/set/all/reference_editor.rb +23 -0
- data/mod/tinymce_editor/set/all/reference_editor/_link_editor.haml +18 -0
- data/mod/tinymce_editor/set/all/reference_editor/_nest_editor.haml +17 -0
- data/mod/tinymce_editor/set/all/reference_editor/link_editor.rb +33 -0
- data/mod/tinymce_editor/set/all/reference_editor/link_editor/link_parser.rb +35 -0
- data/mod/tinymce_editor/set/all/reference_editor/nest_editor.rb +174 -0
- data/mod/{edit/set/all → tinymce_editor/set/all/reference_editor}/nest_editor/_help.haml +0 -0
- data/mod/tinymce_editor/set/all/reference_editor/nest_editor/_options.haml +12 -0
- data/mod/{edit/set/all → tinymce_editor/set/all/reference_editor}/nest_editor/_options_select.haml +0 -0
- data/mod/{edit/set/all → tinymce_editor/set/all/reference_editor}/nest_editor/_options_select_row.haml +0 -0
- data/mod/{edit/set/all → tinymce_editor/set/all/reference_editor}/nest_editor/nest_parser.rb +7 -1
- data/mod/tinymce_editor/set/all/reference_editor/nest_image.rb +70 -0
- data/mod/tinymce_editor/set/all/reference_editor/reference_editor.haml +18 -0
- metadata +39 -21
- data/mod/account/set/abstract/accounted.rb +0 -15
- data/mod/edit/set/all/bridge/account_section.rb +0 -16
- data/mod/edit/set/all/nest_editor.rb +0 -122
- data/mod/edit/set/all/nest_editor/_options.haml +0 -12
- data/mod/edit/set/all/nest_editor/nest_editor.haml +0 -31
- data/mod/edit/set/all/nest_image.rb +0 -37
@@ -1,15 +0,0 @@
|
|
1
|
-
def account
|
2
|
-
fetch trait: :account, new: {}
|
3
|
-
end
|
4
|
-
|
5
|
-
def default_account_status
|
6
|
-
"active"
|
7
|
-
end
|
8
|
-
|
9
|
-
format :html do
|
10
|
-
def account_formgroups
|
11
|
-
Auth.as_bot do
|
12
|
-
subformat(card.account)._render :content_formgroups, structure: true
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
format :html do
|
2
|
-
def account_details_items
|
3
|
-
[
|
4
|
-
["Email and Password", :account,
|
5
|
-
{ path: { slot: { hide: %i[help_link bridge_link] } } }],
|
6
|
-
["Roles", :roles,
|
7
|
-
{ path: { view: :content_with_edit_button } }],
|
8
|
-
["Notifications", :follow]
|
9
|
-
]
|
10
|
-
end
|
11
|
-
|
12
|
-
def account_content_items
|
13
|
-
[["Created", :created],
|
14
|
-
["Edited", :edited]]
|
15
|
-
end
|
16
|
-
end
|
@@ -1,122 +0,0 @@
|
|
1
|
-
format :html do
|
2
|
-
NEST_OPTIONS = %i[view title show hide wrap help variant size params].freeze
|
3
|
-
# Card::View::Options.shark_keys - %i[nest_syntax nest_name items cache]
|
4
|
-
# TODO: connect to Card::View::Options
|
5
|
-
# (that way a mod can add an option that becomes available to nests)
|
6
|
-
|
7
|
-
view :nest_editor, cache: :never, unknown: true, template: :haml,
|
8
|
-
wrap: { slot: { class: "_overlay d0-card-overlay card nodblclick" } } do
|
9
|
-
@nest_editor_mode = :overlay
|
10
|
-
end
|
11
|
-
|
12
|
-
view :modal_nest_editor, cache: :never, unknown: true,
|
13
|
-
wrap: { slot: { class: "nodblclick" } } do
|
14
|
-
modal_nest_editor
|
15
|
-
end
|
16
|
-
|
17
|
-
def nest_editor_tabs
|
18
|
-
static_tabs({ rules: nest_rules_tab,
|
19
|
-
options: haml_partial(:options),
|
20
|
-
help: haml_partial(:help) },
|
21
|
-
:options, "tabs")
|
22
|
-
end
|
23
|
-
|
24
|
-
def nest_rules_tab
|
25
|
-
[
|
26
|
-
empty_nest_name_alert(edit_nest.name.blank?),
|
27
|
-
nest_rules_editor
|
28
|
-
]
|
29
|
-
end
|
30
|
-
|
31
|
-
def nest_rules_editor
|
32
|
-
if edit_nest.name.blank?
|
33
|
-
content_tag :div, "", class: "card-slot" # placeholder
|
34
|
-
else
|
35
|
-
nest(set_name_for_nest_rules, view: :nest_rules)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def empty_nest_name_alert show
|
40
|
-
alert :warning, false, false,
|
41
|
-
class: "mb-0 _empty-nest-name-alert #{'d-none' unless show}" do
|
42
|
-
"nest name required" # LOCALIZE
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def modal_nest_editor
|
47
|
-
wrap_with :modal do
|
48
|
-
haml :nest_editor, nest_editor_mode: "modal"
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def edit_nest
|
53
|
-
@edit_nest ||= NestParser.new params[:edit_nest], default_nest_view, default_item_view
|
54
|
-
end
|
55
|
-
|
56
|
-
def left_type_for_nest_editor_set_selection
|
57
|
-
card.type_name
|
58
|
-
end
|
59
|
-
|
60
|
-
def set_name_for_nest_rules
|
61
|
-
nest_name = edit_nest.name
|
62
|
-
if left_type_for_nest_editor_set_selection
|
63
|
-
[left_type_for_nest_editor_set_selection, nest_name, :type_plus_right]
|
64
|
-
else
|
65
|
-
[nest_name, :right]
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def tinymce_id
|
70
|
-
params[:tinymce_id]
|
71
|
-
end
|
72
|
-
|
73
|
-
def apply_data
|
74
|
-
data = { "data-tinymce-id": tinymce_id }
|
75
|
-
data["data-nest-start".to_sym] = params[:nest_start] if params[:nest_start].present?
|
76
|
-
data["data-nest-size".to_sym] = edit_nest.raw.size if params[:edit_nest].present?
|
77
|
-
data
|
78
|
-
end
|
79
|
-
|
80
|
-
def default_nest_editor_item_options
|
81
|
-
[[:view, default_item_view]]
|
82
|
-
end
|
83
|
-
|
84
|
-
def nest_option_name_select selected=nil, level=0
|
85
|
-
classes = "form-control form-control-sm _nest-option-name"
|
86
|
-
classes += " _new-row" unless selected
|
87
|
-
select_tag "nest_option_name_#{unique_id}",
|
88
|
-
nest_option_name_select_options(selected, level),
|
89
|
-
class: classes, id: nil
|
90
|
-
# id: nil ensures that select2 generates its own unique identifier
|
91
|
-
# that ensures that we can clone this tag without breaking select2
|
92
|
-
end
|
93
|
-
|
94
|
-
def nest_option_name_select_options selected, level
|
95
|
-
options = selected ? [] : ["--"]
|
96
|
-
options += NEST_OPTIONS
|
97
|
-
options_for_select(
|
98
|
-
options, disabled: nest_option_name_disabled(selected, level),
|
99
|
-
selected: selected
|
100
|
-
)
|
101
|
-
end
|
102
|
-
|
103
|
-
def nest_option_name_disabled selected, level
|
104
|
-
disabled = if level == 0
|
105
|
-
edit_nest.options
|
106
|
-
else
|
107
|
-
edit_nest.item_options[level - 1] || default_nest_editor_item_options
|
108
|
-
end
|
109
|
-
|
110
|
-
disabled = disabled&.map(&:first)
|
111
|
-
disabled&.delete selected if selected
|
112
|
-
disabled
|
113
|
-
end
|
114
|
-
|
115
|
-
def nest_option_value_select value=nil
|
116
|
-
# select_tag "nest_option_value_#{unique_id}"
|
117
|
-
text_field_tag "value", value,
|
118
|
-
class: "_nest-option-value form-control form-control-sm",
|
119
|
-
disabled: !value,
|
120
|
-
id: nil
|
121
|
-
end
|
122
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
.options-container.p-2.border-bottom
|
2
|
-
= haml_partial :options_select, template: false, level: 0, data: edit_nest.options
|
3
|
-
- edit_nest.item_options.each_with_index do |options, i|
|
4
|
-
.options-container.p-2.border-bottom._configure-items
|
5
|
-
%h6
|
6
|
-
= "#{'sub' * i} items"
|
7
|
-
= haml_partial :options_select, template: false, level: i + 1, data: options
|
8
|
-
.options-container.p-2.border-bottom._configure-items
|
9
|
-
= button_tag "Configure #{'sub' * edit_nest.item_options.size}items", situation: "secondary", class: "_configure-items-button btn-sm"
|
10
|
-
= haml_partial :options_select, template: true, level: edit_nest.item_options.size + 1, data: default_nest_editor_item_options
|
11
|
-
|
12
|
-
|
@@ -1,31 +0,0 @@
|
|
1
|
-
%div._nest-editor
|
2
|
-
.nest-header.d-flex.ml-2
|
3
|
-
%h5.mt-1 Nest
|
4
|
-
.ml-auto
|
5
|
-
= link_to fa_icon(:close), path: "#", "data-dismiss": nest_editor_mode, class: "text-dark p-1 ml-1"
|
6
|
-
|
7
|
-
.form
|
8
|
-
.form-row.align-items-center.mb-4.ml-1
|
9
|
-
.col-9
|
10
|
-
.input-group{class: [edit_nest.field? ? "show-prefix" : "hide-prefix"]}
|
11
|
-
.input-group-prepend._field-indicator
|
12
|
-
.input-group-text.text-muted
|
13
|
-
+
|
14
|
-
= text_field_tag "nest_name", edit_nest.name, class: "form-control _nest-name",
|
15
|
-
"data-left-type" => left_type_for_nest_editor_set_selection
|
16
|
-
|
17
|
-
.col-3
|
18
|
-
= check_box_tag :field, "field", edit_nest.field?,
|
19
|
-
class: "_nest-field-toggle", id: "nest-editor-field"
|
20
|
-
%label.form-check-label{for: "nest-editor-field"} field
|
21
|
-
|
22
|
-
= nest_editor_tabs
|
23
|
-
|
24
|
-
.card-footer.p-0
|
25
|
-
.preview.mx-1.my-1.form-control-feedback
|
26
|
-
= text_field_tag "preview", edit_nest.raw, class: "_nest-preview w-100 text-muted", readonly: true
|
27
|
-
%hr.mt-1.mb-1
|
28
|
-
.form-group.d-flex.justify-content-center.py-2
|
29
|
-
= button_tag "Apply", apply_data.merge(class: "_nest-apply btn-sm mr-3")
|
30
|
-
%a.border-light.text-dark.btn.btn-sm.btn-outline-secondary{"data-dismiss": nest_editor_mode, href: "#"}
|
31
|
-
Close
|
@@ -1,37 +0,0 @@
|
|
1
|
-
format :html do
|
2
|
-
view :nest_image, wrap: { modal: { footer: "" } } do
|
3
|
-
nest card.autoname(card.name.field("image01")), view: :new_image, type: :image
|
4
|
-
end
|
5
|
-
|
6
|
-
view :new_image, perms: :create, unknown: true, cache: :never do
|
7
|
-
new_view_frame_and_form new_image_form_opts
|
8
|
-
end
|
9
|
-
|
10
|
-
def new_image_form_opts
|
11
|
-
{ buttons: new_image_buttons,
|
12
|
-
success: { view: :open_nest_editor, format: :js,
|
13
|
-
tinymce_id: Env.params[:tinymce_id] },
|
14
|
-
"data-slotter-mode": "silent-success" }
|
15
|
-
end
|
16
|
-
|
17
|
-
def new_image_buttons
|
18
|
-
button_formgroup do
|
19
|
-
[standard_save_and_close_button(no_origin_update: true),
|
20
|
-
modal_close_button("Cancel", class: "btn-sm")]
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
format :js do
|
26
|
-
view :open_nest_editor do
|
27
|
-
tm_id = if Env.params[:tinymce_id].present?
|
28
|
-
"\"#{Env.params[:tinymce_id]}\""
|
29
|
-
else
|
30
|
-
'$(".tinymce-textarea").attr("id")'
|
31
|
-
end
|
32
|
-
<<-JAVASCRIPT.strip_heredoc
|
33
|
-
tm = tinymce.get(#{tm_id});
|
34
|
-
nest.insertNest(tm, "{{+#{card.name.tag}|size: medium}}");
|
35
|
-
JAVASCRIPT
|
36
|
-
end
|
37
|
-
end
|