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
@@ -84,9 +84,9 @@ format :html do
|
|
84
84
|
return super unless card.is_template?
|
85
85
|
|
86
86
|
case Card.fetch_id(card.rule_set_pattern_name) # set_pattern_id
|
87
|
-
when TypeID
|
87
|
+
when Card::TypeID
|
88
88
|
card.rule_set.anchor_name
|
89
|
-
when SelfID
|
89
|
+
when Card::SelfID
|
90
90
|
card.rule_set.anchor.type_name
|
91
91
|
else
|
92
92
|
super
|
@@ -54,7 +54,7 @@ RSpec.describe Card::Set::Type::Set do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
it "produces template editor with close link within large brackets" do
|
57
|
-
set_card = nested_card.fetch
|
57
|
+
set_card = nested_card.fetch :right
|
58
58
|
expect(set_card.format.render(:template_link)).to have_tag("div.card-slot") do
|
59
59
|
with_text(/^\{\{.+\}\}$/)
|
60
60
|
with_tag "a", "modal_nest_rules"
|
@@ -14,8 +14,8 @@
|
|
14
14
|
method: "get"}
|
15
15
|
- not_ids = params.dig :filter, :not_ids
|
16
16
|
%input{ type: :hidden, name: "filter[not_ids]", class: "_not-ids", value: not_ids }
|
17
|
+
= render_quick_filters
|
17
18
|
.d-flex.flex-wrap
|
18
|
-
= render_quick_filters
|
19
19
|
- if sort_input_field.present?
|
20
20
|
// SORTING
|
21
21
|
.sort-in-filter-form
|
@@ -5,16 +5,37 @@ format :html do
|
|
5
5
|
sort_field: _render(:sort_formgroup)
|
6
6
|
end
|
7
7
|
|
8
|
-
view :quick_filters do
|
8
|
+
view :quick_filters, cache: :never do
|
9
9
|
return "" unless quick_filter_list.present?
|
10
10
|
|
11
|
-
haml :quick_filters
|
11
|
+
haml :quick_filters, filter_list: normalized_quick_filter_list
|
12
12
|
end
|
13
13
|
|
14
|
+
def normalized_quick_filter_list
|
15
|
+
quick_filter_list.map do |hash|
|
16
|
+
hash = hash.clone
|
17
|
+
filter_key = hash.keys.first
|
18
|
+
{
|
19
|
+
text: (hash.delete(:text) || hash[filter_key]),
|
20
|
+
icon: (hash.delete(:icon) || mapped_icon_tag(filter_key)),
|
21
|
+
# FIXME: mapped_icon_tag is a wikirate concept
|
22
|
+
class: css_classes(hash.delete(:class),
|
23
|
+
"_filter-link quick-filter-by-#{filter_key}"),
|
24
|
+
filter: JSON(hash[:filter] || hash)
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# for override
|
14
30
|
def quick_filter_list
|
15
31
|
[]
|
16
32
|
end
|
17
33
|
|
34
|
+
# for override
|
35
|
+
def custom_quick_filters
|
36
|
+
""
|
37
|
+
end
|
38
|
+
|
18
39
|
# @param data [Hash] the filter categories. The hash needs for every category
|
19
40
|
# a hash with a label and a input_field entry.
|
20
41
|
def filter_form data={}, sort_input_field=nil, form_args={}
|
@@ -1,14 +1,11 @@
|
|
1
1
|
.quick-filter._quick-filter
|
2
2
|
%i.fa.fa-bolt.filter-section-icon
|
3
3
|
.quick-filter-links.d-flex.flex-wrap
|
4
|
-
-
|
5
|
-
-
|
6
|
-
- filter_key = hash.keys.first
|
7
|
-
- value = hash.values.first
|
8
|
-
%a{ "data-filter": link_hash,
|
4
|
+
- filter_list.each do |f|
|
5
|
+
%a{ "data-filter": f[:filter],
|
9
6
|
href: "#",
|
10
|
-
class:
|
11
|
-
title: "Quick Filter" }
|
12
|
-
=
|
13
|
-
|
14
|
-
|
7
|
+
class: f[:class],
|
8
|
+
title: "Quick Filter: #{f[:text]}" }
|
9
|
+
= f[:icon]
|
10
|
+
= f[:text]
|
11
|
+
= custom_quick_filters
|
@@ -1,7 +1,6 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
= nest_item item_card
|
2
|
+
.search-checkbox-item._search-checkbox-item.w-100.d-flex
|
3
|
+
.checkbox-side
|
4
|
+
= check_box_tag item_card.name, item_card.key
|
5
|
+
.item-view-side{ style: "background: #fff" }
|
6
|
+
= nest_item item_card
|
@@ -64,7 +64,7 @@ format :html do
|
|
64
64
|
|
65
65
|
def group_options
|
66
66
|
Auth.as_bot do
|
67
|
-
Card.search({ type_id: RoleID, sort: "name" }, "roles by name")
|
67
|
+
Card.search({ type_id: Card::RoleID, sort: "name" }, "roles by name")
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
@@ -73,7 +73,7 @@ format :html do
|
|
73
73
|
begin
|
74
74
|
set_name = card.name.trunk_name
|
75
75
|
set_card = Card.fetch(set_name)
|
76
|
-
not_set = set_card && set_card.type_id != SetID
|
76
|
+
not_set = set_card && set_card.type_id != Card::SetID
|
77
77
|
not_set ? false : set_card.inheritable?
|
78
78
|
end
|
79
79
|
end
|
@@ -17,9 +17,9 @@ format :html do
|
|
17
17
|
"edit interface for list cards"
|
18
18
|
end
|
19
19
|
|
20
|
-
def option_label_text option_name
|
21
|
-
|
22
|
-
end
|
20
|
+
# def option_label_text option_name
|
21
|
+
# super.downcase
|
22
|
+
# end
|
23
23
|
|
24
24
|
def quick_edit
|
25
25
|
card.left.prototype_default_card.try(:show_input_type?) ? super : ""
|
@@ -38,7 +38,7 @@ end
|
|
38
38
|
|
39
39
|
event :customize_theme, :prepare_to_validate, on: :update, when: :customize_theme? do
|
40
40
|
skin_name = free_skin_name
|
41
|
-
add_subcard skin_name, type_id: CustomizedBootswatchSkinID
|
41
|
+
add_subcard skin_name, type_id: Card::CustomizedBootswatchSkinID
|
42
42
|
self.content = "[[#{skin_name}]]"
|
43
43
|
end
|
44
44
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
# require "json"
|
2
2
|
|
3
3
|
def self.member_names
|
4
4
|
@@member_names ||= begin
|
5
5
|
Card.search(
|
6
|
-
{ type_id: SettingID, return: "key" },
|
6
|
+
{ type_id: Card::SettingID, return: "key" },
|
7
7
|
"all setting cards"
|
8
8
|
).each_with_object({}) do |card_key, hash|
|
9
9
|
hash[card_key] = true
|
@@ -2,7 +2,7 @@ def guide_card
|
|
2
2
|
guide_card = rule_card(:guide)
|
3
3
|
return unless guide_card
|
4
4
|
|
5
|
-
guide_card = guide_card.
|
5
|
+
guide_card = guide_card.first_card if guide_card.type_id == Card::PointerID
|
6
6
|
guide_card if guide_card.ok?(:read)
|
7
7
|
end
|
8
8
|
|
@@ -59,18 +59,19 @@ format :html do
|
|
59
59
|
# no caching because help_text view doesn't cache, and we can't have a
|
60
60
|
# stub in the data-content attribute or it will get html escaped.
|
61
61
|
view :help_link, cache: :never, unknown: true do
|
62
|
-
help_link
|
62
|
+
help_link render_help_text, help_title
|
63
63
|
end
|
64
64
|
|
65
|
-
def help_link
|
66
|
-
opts = help_popover_opts
|
65
|
+
def help_link text=nil, title=nil
|
66
|
+
opts = help_popover_opts text, title
|
67
67
|
add_class opts, "_card-menu-popover"
|
68
68
|
link_to help_icon, opts
|
69
69
|
end
|
70
70
|
|
71
|
-
def help_popover_opts
|
71
|
+
def help_popover_opts text=nil, title=nil
|
72
|
+
text ||= render_help_text
|
72
73
|
opts = { "data-placement": :left, class: "help-link" }
|
73
|
-
popover_opts
|
74
|
+
popover_opts text, title, opts
|
74
75
|
end
|
75
76
|
|
76
77
|
def help_icon
|
@@ -32,7 +32,7 @@ format :html do
|
|
32
32
|
def custom_types
|
33
33
|
custom_types = []
|
34
34
|
|
35
|
-
Card.search(type_id: CardtypeID, return: "name").each do |name|
|
35
|
+
Card.search(type_id: Card::CardtypeID, return: "name").each do |name|
|
36
36
|
next if ::Card::Set::Self::Cardtype::GROUP_MAP[name]
|
37
37
|
|
38
38
|
custom_types << name
|
@@ -30,34 +30,39 @@ format :html do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
view :add_button do
|
33
|
-
add_link "btn btn-secondary"
|
33
|
+
add_link class: "btn btn-secondary"
|
34
34
|
end
|
35
35
|
|
36
|
-
def add_link
|
36
|
+
def add_link opts={}
|
37
37
|
voo.title ||= tr(:add_card, cardname: safe_name)
|
38
|
-
|
39
|
-
|
38
|
+
link_to render_title, add_link_opts(opts)
|
39
|
+
end
|
40
|
+
|
41
|
+
def add_link_opts opts
|
42
|
+
modal = opts.delete :modal
|
43
|
+
modal = true if modal.nil?
|
44
|
+
opts[:path] = add_path(modal ? :new_in_modal : :new)
|
45
|
+
modal ? modal_link_opts(opts) : opts
|
40
46
|
end
|
41
47
|
|
42
48
|
view :add_url do
|
43
49
|
card_url _render_add_path
|
44
50
|
end
|
45
51
|
|
46
|
-
|
47
|
-
path_args = {}
|
48
|
-
if voo.params
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
52
|
+
def add_path view
|
53
|
+
path_args = { mark: card.name }
|
54
|
+
process_voo_params(path_args) if voo.params
|
55
|
+
if view == :new
|
56
|
+
path_args[:action] = :new
|
57
|
+
else
|
58
|
+
path_args[:action] = :type
|
59
|
+
path_args[:view] = view
|
55
60
|
end
|
56
|
-
path path_args
|
61
|
+
path path_args
|
57
62
|
end
|
58
63
|
|
59
64
|
# don't cache because it depends on update permission for another card
|
60
|
-
view :configure_link, cache: :never, perms:
|
65
|
+
view :configure_link, cache: :never, perms: ->(fmt) { fmt.can_configure? } do
|
61
66
|
configure_link
|
62
67
|
end
|
63
68
|
|
@@ -77,7 +82,18 @@ format :html do
|
|
77
82
|
title = _render_title
|
78
83
|
link_to_card card, title, path: { view: :bridge, bridge: { tab: :rules_tab },
|
79
84
|
set: Card::Name[safe_name, :type] },
|
80
|
-
class: css_class
|
85
|
+
class: css_classes("configure-type-link ml-3", css_class)
|
86
|
+
end
|
87
|
+
|
88
|
+
private
|
89
|
+
|
90
|
+
def process_voo_params path_args
|
91
|
+
context = ((@parent&.card) || card).name
|
92
|
+
Rack::Utils.parse_nested_query(voo.params).each do |key, value|
|
93
|
+
value = value.to_name.absolute(context) if value
|
94
|
+
key = key.to_name.absolute(context)
|
95
|
+
path_args[key] = value
|
96
|
+
end
|
81
97
|
end
|
82
98
|
end
|
83
99
|
|
@@ -92,7 +108,7 @@ def create_ok?
|
|
92
108
|
end
|
93
109
|
|
94
110
|
def was_cardtype?
|
95
|
-
type_id_before_act == CardtypeID
|
111
|
+
type_id_before_act == Card::CardtypeID
|
96
112
|
end
|
97
113
|
|
98
114
|
event :check_for_cards_of_type, after: :validate_delete do
|
@@ -12,6 +12,10 @@ def followable?
|
|
12
12
|
false
|
13
13
|
end
|
14
14
|
|
15
|
+
def recaptcha_on?
|
16
|
+
false
|
17
|
+
end
|
18
|
+
|
15
19
|
def session_key
|
16
20
|
"_card_#{key}"
|
17
21
|
end
|
@@ -38,6 +42,14 @@ event :delete_in_session, :prepare_to_store, on: :delete do
|
|
38
42
|
abort :success
|
39
43
|
end
|
40
44
|
|
45
|
+
def ok_to_create
|
46
|
+
true
|
47
|
+
end
|
48
|
+
|
49
|
+
def ok_to_update
|
50
|
+
true
|
51
|
+
end
|
52
|
+
|
41
53
|
def add_to_trash args
|
42
54
|
yield args.merge trash: true
|
43
55
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
require "card/mailer"
|
4
3
|
require "card/seed_consts"
|
5
4
|
|
6
5
|
describe Card::Set::Type::EmailTemplate::EmailConfig do
|
@@ -20,7 +19,7 @@ describe Card::Set::Type::EmailTemplate::EmailConfig do
|
|
20
19
|
end
|
21
20
|
|
22
21
|
before do
|
23
|
-
Card::Auth.
|
22
|
+
Card::Auth.signin Card::WagnBotID
|
24
23
|
chunk_test = "Url(decko.org) Link([[https://decko.org|Decko]])"\
|
25
24
|
" Inclusion({{B|name}}) Card link([[A]])"
|
26
25
|
Card.create! name: email_name, type: :email_template, subcards: {
|
@@ -1,11 +1,9 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
require "card/mailer"
|
4
|
-
|
5
3
|
describe Card::Set::Type::EmailTemplate do
|
6
4
|
describe "#mail" do
|
7
5
|
let(:content_type) do
|
8
|
-
Card::Auth.
|
6
|
+
Card::Auth.signin Card::WagnBotID
|
9
7
|
card = Card.create!(name: "content type test", type: :email_template,
|
10
8
|
subcards: @fields)
|
11
9
|
|
@@ -29,7 +29,7 @@ $.extend decko,
|
|
29
29
|
plugins: 'autoresize'
|
30
30
|
autoresize_max_height: 500
|
31
31
|
mobile: { theme: 'mobile' }
|
32
|
-
contextmenu: "
|
32
|
+
contextmenu: "deckolink nest"
|
33
33
|
}
|
34
34
|
user_conf = if decko.tinyMCEConfig? then decko.tinyMCEConfig else {}
|
35
35
|
hard_conf = {
|
@@ -54,5 +54,6 @@ $.extend decko,
|
|
54
54
|
addNestPlugin: (conf) ->
|
55
55
|
if conf.plugins? then conf.plugins += " nest" else conf.plugins = "nest"
|
56
56
|
# if conf.toolbar1? then conf.toolbar1 += " | nest" else conf.toolbar1 = "nest"
|
57
|
-
conf.menu = { insert: { title: "Insert", items: "nest image
|
57
|
+
conf.menu = { insert: { title: "Insert", items: "deckolink nest image | hr"}}
|
58
|
+
|
58
59
|
|
@@ -1 +1 @@
|
|
1
|
-
!function(){"use strict";var n=function(t){return function(){nest.
|
1
|
+
!function(){"use strict";var n=function(t){return function(){nest.openNestEditor(t)}},e=function(t){return function(){nest.openImageEditor(t)}},i=function(t){return function(){link.openLinkEditor(t)}},o=function(t){t.addCommand("mceNest",function(){n(t)()})},u=function(t){t.addShortcut("Meta+Z","",function(){t.execCommand("mceNest")})},c=function(t){t.ui.registry.addToggleButton("deckolink",{text:"[[]]",tooltip:"Insert/edit link",onAction:i(t)}),t.ui.registry.addToggleButton("nest",{text:"{{}}",tooltip:"Insert/edit nest",onAction:n(t)}),t.ui.registry.addToggleButton("image",{text:"image",tooltip:"insert image",onAction:e(t)})},r=function(t){t.ui.registry.addMenuItem("deckolink",{text:"Link...",context:"insert",icon:"deckolink",onAction:i(t)}),t.ui.registry.addMenuItem("nest",{icon:"nest",text:"Nest...",context:"insert",onAction:n(t)}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",context:"insert",onAction:e(t)})},d=function(t){t.ui.registry.addContextMenu("nest",{update:function(){return"nest"}})};return tinymce.PluginManager.add("nest",function(t){t.ui.registry.addIcon("deckolink","[[]]"),t.ui.registry.addIcon("nest","{{}}"),c(t),r(t),d(t),o(t),u(t)}),function(){}}()();
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# shared helper methods for link editor and nest editor
|
2
|
+
|
3
|
+
format :html do
|
4
|
+
def tinymce_id
|
5
|
+
params[:tinymce_id]
|
6
|
+
end
|
7
|
+
|
8
|
+
def apply_tm_snippet_data snippet
|
9
|
+
data = { "data-tinymce-id": tinymce_id }
|
10
|
+
data[:"data-tm-snippet-start"] = tm_param(:start) if tm_param(:start).present?
|
11
|
+
data[:"data-tm-snippet-size"] = snippet.raw.size if tm_param(:raw).present?
|
12
|
+
data["data-dismiss"] = "modal" if modal_tm_snippet_editor?
|
13
|
+
data
|
14
|
+
end
|
15
|
+
|
16
|
+
def tm_param key
|
17
|
+
params[:"tm_snippet_#{key}"]
|
18
|
+
end
|
19
|
+
|
20
|
+
def modal_tm_snippet_editor?
|
21
|
+
@tm_snippet_editor_mode != :overlay
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
.form-row.align-items-center.mb-4.ml-1
|
2
|
+
.col-9
|
3
|
+
.input-group{class: [snippet.field? ? "show-prefix" : "hide-prefix"]}
|
4
|
+
.input-group-prepend._field-indicator
|
5
|
+
.input-group-text.text-muted
|
6
|
+
+
|
7
|
+
= text_field_tag "link_name", snippet.name, class: "form-control _link-target", placeholder: "URL or Card name"
|
8
|
+
|
9
|
+
.col-3
|
10
|
+
= check_box_tag :field, "field", snippet.field?,
|
11
|
+
class: "_link-field-toggle", id: "link-editor-field"
|
12
|
+
%label.form-check-label{for: "link-editor-field"} field
|
13
|
+
|
14
|
+
.form-row.align-items-center.mb-4.ml-1.mr-1
|
15
|
+
.col-12
|
16
|
+
%label.form-check-label{for: "link_title"} Text to display
|
17
|
+
= text_field_tag "link_title", snippet.title, class: "form-control _link-title"
|
18
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
.form
|
2
|
+
.form-row.align-items-center.mb-4.ml-1
|
3
|
+
.col-9
|
4
|
+
.input-group{class: [snippet.field? ? "show-prefix" : "hide-prefix"]}
|
5
|
+
.input-group-prepend._field-indicator
|
6
|
+
.input-group-text.text-muted
|
7
|
+
+
|
8
|
+
= text_field_tag "nest_name", snippet.name, class: "form-control _nest-name",
|
9
|
+
"data-left-name" => card.name,
|
10
|
+
"data-left-type" => left_type_for_nest_editor_set_selection,
|
11
|
+
placeholder: "Card name"
|
12
|
+
.col-3
|
13
|
+
= check_box_tag :field, "field", snippet.field?,
|
14
|
+
class: "_nest-field-toggle", id: "nest-editor-field"
|
15
|
+
%label.form-check-label{for: "nest-editor-field"} field
|
16
|
+
|
17
|
+
= nest_editor_tabs
|