card-mod-edit 0.11.4 → 0.11.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4585a2392445ad135ba9d2ca3d5281ac157e60c985a13065ab40fe616833dd1
4
- data.tar.gz: 411c89a8efe8b6340e712265a7b57b2b4a32d97cb4a3ce767a06f647baa74891
3
+ metadata.gz: 4a54a9e3aa482aa83ddee3fbca1e2a2ffbbb733124cf681aab56a159e6a943e2
4
+ data.tar.gz: 7a719d423cb25de68e1974e4d73c87c6719398d0b7e1bb1d787256f93330d6a9
5
5
  SHA512:
6
- metadata.gz: 0b593eeb1dcd1c28e11154cf4a2d97708901d5fdaf087441e641767070c74061b9d39bc89368b5f37f82c9f0070070a33d88076ce2fb29d096a4998244769735
7
- data.tar.gz: ae37bbd8b63506434029f7acb2627070912a0bf2211ecc0e63140ff2941c8801516dcdc7c6a300ce6d1e9167b6f10b5d01d7f51daf2f580a64cde0269b3b6e51
6
+ metadata.gz: 9c879f60df6bce6723ba0d1d05f2dc423594a5ca02d661640d3d708ab8f66f00dc2b4ca05768166c1fcee10fdb304023ceb4cd6c3f1000159990f290fa7dacc8
7
+ data.tar.gz: 691b4cff469c27bc9d5e0d64e61074a7b709a00701ff9fce21c0705454407b3ae606b3fefe673991a0c9e564640fd524bdca85087d68e1f7155cd1614b2eef39
data/set/all/bridge.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  BRIDGE_TABS = { "Account" => :account_tab,
2
- "Guide" => :guide_tab,
3
- "Engage" => :engage_tab,
2
+ "Guide" => :guide_tab,
3
+ "Engage" => :engage_tab,
4
4
  "History" => :history_tab,
5
5
  "Related" => :related_tab,
6
- "Rules" => :rules_tab }.freeze
6
+ "Rules" => :rules_tab }.freeze
7
7
 
8
8
  format :html do
9
9
  wrapper :bridge do
@@ -17,7 +17,7 @@ format :html do
17
17
 
18
18
  def related_by_name_items
19
19
  pills = []
20
- if card.name.junction?
20
+ if card.name.compound?
21
21
  pills += card.name.ancestors.map { |a| [a, a, { mark: :absolute }] }
22
22
  end
23
23
  pills += RELATED_ITEMS["by name"]
@@ -29,6 +29,6 @@ format :html do
29
29
  end
30
30
 
31
31
  def related_by_type_items
32
- [["#{card.type} cards", [card.type, :type, :by_name], mark: :absolute]]
32
+ [["#{card.type} cards", [card.type, :type, :by_name], { mark: :absolute }]]
33
33
  end
34
34
  end
@@ -40,7 +40,7 @@ format :html do
40
40
  end
41
41
 
42
42
  def discussion_card?
43
- card.junction? && card.name.tag_name.key == :discussion.cardname.key
43
+ card.compound? && card.name.tag_name.key == :discussion.cardname.key
44
44
  end
45
45
 
46
46
  def discussion_card
data/set/all/edit_name.rb CHANGED
@@ -1,10 +1,8 @@
1
1
  format :html do
2
- # note: depends on js with selector ".edit_name-view .card-form"
3
2
  view :edit_name, perms: :update do
4
3
  frame { name_form }
5
4
  end
6
5
 
7
- # note: depends on js with selector ".name_form-view .card-form"
8
6
  view :name_form, perms: :update, wrap: :slot, cache: :never do
9
7
  name_form :edit_name_row
10
8
  end
@@ -13,10 +11,11 @@ format :html do
13
11
  card_form({ action: :update, id: card.id },
14
12
  "data-main-success": JSON(redirect: true, view: ""),
15
13
  "data-update-origin": "true",
14
+ class: "_rename-form",
16
15
  success: edit_name_success(success_view)) do
17
- [hidden_edit_name_fields,
16
+ [edit_name_hidden_fields,
18
17
  _render_name_formgroup,
19
- rename_confirmation_alert,
18
+ edit_name_confirmation,
20
19
  edit_name_buttons]
21
20
  end
22
21
  end
@@ -27,32 +26,31 @@ format :html do
27
26
  success
28
27
  end
29
28
 
30
- def hidden_edit_name_fields
29
+ def edit_name_hidden_fields
31
30
  hidden_tags old_name: card.name, card: { update_referers: false }
32
31
  end
33
32
 
34
33
  def edit_name_buttons
34
+ class_up "button-form-group", "rename-button-form-group"
35
35
  button_formgroup do
36
36
  [rename_and_update_button, rename_button, standard_cancel_button]
37
37
  end
38
38
  end
39
39
 
40
- # LOCALIZE
41
- def rename_and_update_button
42
- submit_button text: "Rename and Update", disable_with: "Renaming",
43
- class: "renamer-updater"
40
+ def edit_name_confirmation
41
+ alert "warning", false, false, class: "hidden-alert" do
42
+ haml :edit_name_confirmation, referer_count: card.references_in.count
43
+ end
44
44
  end
45
45
 
46
- def rename_button
47
- button_tag "Rename", data: { disable_with: "Renaming" }, class: "renamer"
46
+ def rename_and_update_button
47
+ submit_button text: t(:core_rename_and_update),
48
+ disable_with: t(:core_renaming),
49
+ class: "_renamer-updater"
48
50
  end
49
51
 
50
- # LOCALIZE
51
- def rename_confirmation_alert
52
- msg = "<h5>Are you sure you want to rename <em>#{safe_name}</em>?</h5>"
53
- msg << %(<h6>This may change names referred to by other cards.</h6>)
54
- msg << %(<p>You may choose to <em>update or ignore</em> the referers.</p>)
55
- msg << hidden_field_tag(:referers, 1)
56
- alert("warning", false, false, class: "hidden-alert") { msg }
52
+ def rename_button
53
+ button_tag t(:core_rename),
54
+ class: "renamer", data: { disable_with: t(:core_renaming) }
57
55
  end
58
56
  end
@@ -0,0 +1,7 @@
1
+ %h5
2
+ = t :core_rename_confirm
3
+ %em
4
+ = safe_name
5
+ ?
6
+ %p._rename-reference-confirm{ data: { referer_count: referer_count } }
7
+ = t :core_rename_reference_confirm, count: referer_count
data/set/all/edit_type.rb CHANGED
@@ -52,6 +52,7 @@ format :html do
52
52
 
53
53
  def raw_type_options
54
54
  return @raw_type_options if @raw_type_options
55
+
55
56
  options = Auth.createable_types
56
57
  if !@no_current_type && card.real? && !options.include?(card.type_name)
57
58
  # current type should be an option on existing cards,
data/set/all/editor.rb CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  Self::InputOptions.add_to_basket :options, "text area"
3
2
  Self::InputOptions.add_to_basket :options, "text field"
4
3
 
@@ -46,7 +45,7 @@ format :html do
46
45
 
47
46
  def text_area_input
48
47
  text_area :content, rows: 5, class: "d0-card-content",
49
- "data-card-type-code" => card.type_code
48
+ "data-card-type-code": card.type_code
50
49
  end
51
50
 
52
51
  def text_field_input
data/set/all/form.rb CHANGED
@@ -30,15 +30,13 @@ format :html do
30
30
  hidden_field :last_action_id_before_edit, class: "current_revision_id"
31
31
  end
32
32
 
33
- def wrap_content_formgroup
33
+ def wrap_content_formgroup &block
34
34
  formgroup("Content", input: :content, help: false,
35
- class: classy("card-editor")) { yield }
35
+ class: classy("card-editor"), &block)
36
36
  end
37
37
 
38
- def button_formgroup
39
- wrap_with :div, class: classy("form-group") do
40
- wrap_with :div, yield
41
- end
38
+ def button_formgroup &block
39
+ wrap_with :div, class: "form-group #{classy 'button-form-group'}", &block
42
40
  end
43
41
 
44
42
  def name_field
@@ -234,18 +232,16 @@ format :html do
234
232
  end
235
233
  end
236
234
 
237
- def editor_wrap type=nil
235
+ def editor_wrap type=nil, &block
238
236
  html_class = "editor"
239
237
  html_class << " #{type}-editor" if type
240
- wrap_with :div, class: html_class do
241
- yield
242
- end
238
+ wrap_with :div, class: html_class, &block
243
239
  end
244
240
 
245
241
  # FIELD VIEWS
246
242
 
247
243
  def add_junction_class
248
- return unless card.name.junction?
244
+ return unless card.name.compound?
249
245
 
250
246
  class_up "card-editor", "RIGHT-#{card.name.tag_name.safe_key}"
251
247
  end
@@ -5,6 +5,7 @@ format :html do
5
5
 
6
6
  def standard_save_button opts={}
7
7
  return if voo&.hide?(:save_button)
8
+
8
9
  add_class opts, "submit-button btn-sm mr-3 _update-history-pills"
9
10
  opts[:text] ||= "Save"
10
11
  opts["data-cy"] = "save"
@@ -52,6 +52,7 @@ format :html do
52
52
  # redirect to *previous if no :href is given
53
53
  def cancel_button args={}
54
54
  return unless voo.show? :cancel_button
55
+
55
56
  text = args.delete(:text) || "Cancel"
56
57
  add_class args, "btn btn-#{args.delete(:situation) || 'secondary'}"
57
58
  add_class args, cancel_strategy(args[:redirect], args[:href])
@@ -39,4 +39,4 @@ format do
39
39
 
40
40
  tmpl_set_name.left_name
41
41
  end
42
- end
42
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-edit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-05-05 00:00:00.000000000 Z
13
+ date: 2021-05-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.101.4
21
+ version: 1.101.5
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.101.4
28
+ version: 1.101.5
29
29
  description: ''
30
30
  email:
31
31
  - info@decko.org
@@ -43,6 +43,7 @@ files:
43
43
  - set/all/edit_content.rb
44
44
  - set/all/edit_inline.rb
45
45
  - set/all/edit_name.rb
46
+ - set/all/edit_name_confirmation.haml
46
47
  - set/all/edit_type.rb
47
48
  - set/all/editing.rb
48
49
  - set/all/editor.rb