card-mod-format 0.11.3 → 0.11.4

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: cf41a8349098a14faf81973f08b08c50c1ccdb8ba72beab71a5b0ca725c3142f
4
- data.tar.gz: 3ec14b698defebef260e6d5a66a3b9474e16ff946c31086c79c40803d51cbe6f
3
+ metadata.gz: c2f8f38464d708a80ec6d82de49efc7c016ded54fcd7e87268ce69bc4e8088bc
4
+ data.tar.gz: 587e9ed394e5dbbdf8069f1393f9099a3d58dc2af6688e8a7925dc763484933d
5
5
  SHA512:
6
- metadata.gz: d31cbbb09f58bf13185dc8a2c4d067bcdf791d23a90c422fad28c8adf8dcc3f1842ebfe6bfce0a67892055c8f85cff62febfcc4f7969a4066124b584662e5ce8
7
- data.tar.gz: 6625586795f03bbe727e83ed5556126a6f3a8f0022c23aa9d52804be59a595cd98e1edaba1b273448d1e33285b5d7cc1caba9225756ab666a459855e845b5fd3
6
+ metadata.gz: c2b52b883aaba30ee4b4a13acf5962eda386168681beff490ac225f055cfd0f7b0218555beb7b625bfcc199e2507413739a81dde3932788d8cfcc4055edea598
7
+ data.tar.gz: bfbd609e94133af311de8d05c05c15d662aeacde4b1e35a2b5594aa4a86529b1b4028485e133e6dff47236488aef8d81b2bac04a90d521c422387d2453741f28
data/set/all/error.rb CHANGED
@@ -8,21 +8,21 @@ format do
8
8
  end
9
9
 
10
10
  view :server_error, perms: :none do
11
- tr(:server_error)
11
+ t(:format_server_error)
12
12
  end
13
13
 
14
14
  view :denial, perms: :none do
15
- focal? ? tr(:denial) : ""
15
+ focal? ? t(:format_denial) : ""
16
16
  end
17
17
 
18
18
  view :not_found, perms: :none do
19
- error_name = card.name.present? ? safe_name : tr(:not_found_no_name)
20
- tr(:not_found_named, cardname: error_name)
19
+ error_name = card.name.present? ? safe_name : t(:format_not_found_no_name)
20
+ t(:format_not_found_named, cardname: error_name)
21
21
  end
22
22
 
23
23
  view :bad_address, perms: :none do
24
24
  root.error_status = 404
25
- tr(:bad_address)
25
+ t(:format_bad_address)
26
26
  end
27
27
 
28
28
  view :errors do
@@ -50,7 +50,7 @@ format do
50
50
  end
51
51
 
52
52
  def unsupported_view_error_message view
53
- tr(:unsupported_view, view: view, cardname: card.name)
53
+ t(:format_unsupported_view, view: view, cardname: card.name)
54
54
  end
55
55
  end
56
56
 
@@ -17,7 +17,7 @@ format :html do
17
17
  prepare_content_slot
18
18
  end
19
19
 
20
- view :content_with_edit_button do
20
+ view :content_with_edit_button, unknown: true do
21
21
  wrap do
22
22
  [_render_menu, _render_core, _render_edit_button(edit: :inline)]
23
23
  end
@@ -52,7 +52,7 @@ format :html do
52
52
  view :errors, perms: :none do
53
53
  return if card.errors.empty?
54
54
 
55
- voo.title = card.name.blank? ? "Problems" : tr(:problems_name, cardname: card.name)
55
+ voo.title = card.name.blank? ? "Problems" : t(:format_problems_name, cardname: card.name)
56
56
  voo.hide! :menu
57
57
  class_up "alert", "card-error-msg"
58
58
  standard_errors voo.title
@@ -133,21 +133,21 @@ format :html do
133
133
  def sign_in_or_up_links to_task
134
134
  return if Auth.signed_in?
135
135
 
136
- links = [signin_link, signup_link].compact.join " #{tr :or} "
136
+ links = [signin_link, signup_link].compact.join " #{t(:format_or)} "
137
137
  wrap_with(:div) do
138
- [tr(:please), links, to_task].join(" ") + "."
138
+ [t(:format_please), links, to_task].join(" ") + "."
139
139
  end
140
140
  end
141
141
 
142
142
  def signin_link
143
- link_to_card :signin, tr(:sign_in, mod: "card-mod-account"),
143
+ link_to_card :signin, t(:account_sign_in)&.downcase,
144
144
  class: "signin-link", slotter: true, path: { view: :open }
145
145
  end
146
146
 
147
147
  def signup_link
148
148
  return unless signup_ok?
149
149
 
150
- link_to_card :signup, tr(:sign_up),
150
+ link_to_card :signup, t(:account_sign_up)&.downcase,
151
151
  class: "signup-link", slotter: true, path: { action: :new }
152
152
  end
153
153
 
@@ -164,19 +164,19 @@ format :html do
164
164
  def loud_denial
165
165
  voo.hide :menu
166
166
  frame do
167
- [wrap_with(:h1, tr(:sorry)),
167
+ [wrap_with(:h1, t(:format_sorry)),
168
168
  wrap_with(:div, loud_denial_message)]
169
169
  end
170
170
  end
171
171
 
172
172
  def loud_denial_message
173
- to_task = @denied_task ? tr(:denied_task, denied_task: @denied_task) : tr(:to_do_that)
173
+ to_task = @denied_task ? t(:format_denied_task, denied_task: @denied_task) : t(:format_to_do_that)
174
174
 
175
175
  case
176
176
  when not_denied_task_read?
177
- tr(:read_only)
177
+ t(:format_read_only)
178
178
  when Auth.signed_in?
179
- tr(:need_permission_task, task: to_task)
179
+ t(:format_need_permission_task, task: to_task)
180
180
  else
181
181
  Env.save_interrupted_action request.env["REQUEST_URI"]
182
182
  sign_in_or_up_links to_do_unauthorized_task
@@ -188,6 +188,6 @@ format :html do
188
188
  end
189
189
 
190
190
  def to_do_unauthorized_task
191
- @denied_task ? tr(:denied_task, denied_task: @denied_task) : tr(:to_do_that)
191
+ @denied_task ? t(:format_denied_task, denied_task: @denied_task) : t(:format_to_do_that)
192
192
  end
193
193
  end
@@ -37,7 +37,12 @@ format :html do
37
37
 
38
38
  def wrap_data slot=true
39
39
  with_slot_data slot do
40
- { "card-id": card.id, "card-name": slot_cardname, "slot-id": SecureRandom.hex(10) }
40
+ {
41
+ "card-id": card.id,
42
+ "card-name": slot_cardname,
43
+ "card-link-name": card.name.url_key,
44
+ "slot-id": SecureRandom.hex(10)
45
+ }
41
46
  end
42
47
  end
43
48
 
data/set/type/cardtype.rb CHANGED
@@ -5,7 +5,7 @@ format :html do
5
5
 
6
6
  def type_formgroup args={}
7
7
  if card.cards_of_type_exist?
8
- wrap_with :div, tr(:cards_exist, scope: "core", cardname: safe_name)
8
+ wrap_with :div, t(:format_cards_exist, scope: "core", cardname: safe_name)
9
9
  else
10
10
  super
11
11
  end
@@ -20,7 +20,7 @@ format :html do
20
20
  end
21
21
 
22
22
  def add_link opts={}
23
- voo.title ||= tr(:add_card, cardname: safe_name)
23
+ voo.title ||= t(:format_add_card, cardname: safe_name)
24
24
  link_to render_title, add_link_opts(opts)
25
25
  end
26
26
 
@@ -67,7 +67,7 @@ format :html do
67
67
  def configure_link css_class=nil
68
68
  return "" unless Card.fetch(card, :type, :structure, new: {}).ok? :update
69
69
 
70
- voo.title ||= tr(:configure_card, cardname: safe_name.pluralize)
70
+ voo.title ||= t(:format_configure_card, cardname: safe_name.pluralize)
71
71
  title = _render_title
72
72
  link_to_card card, title,
73
73
  path: { view: :bridge,
data/set/type/json.rb CHANGED
@@ -7,7 +7,7 @@ end
7
7
  def check_json_syntax
8
8
  parse_content
9
9
  rescue JSON::ParserError => e
10
- errors.add tr(:invalid_json), e.message.sub(/^\d+: /, "").to_s
10
+ errors.add t(:format_invalid_json), e.message.sub(/^\d+: /, "").to_s
11
11
  end
12
12
 
13
13
  def parse_content
data/set/type/number.rb CHANGED
@@ -6,7 +6,7 @@ format :html do
6
6
  end
7
7
 
8
8
  event :validate_number, :validate, on: :save do
9
- errors.add :content, tr(:not_numeric, content: content) unless valid_number?(content)
9
+ errors.add :content, t(:format_not_numeric, content: content) unless valid_number?(content)
10
10
  end
11
11
 
12
12
  def valid_number? string
data/set/type/toggle.rb CHANGED
@@ -4,8 +4,8 @@ end
4
4
 
5
5
  view :core do
6
6
  case card.content.to_i
7
- when 1 then tr :toggle_yes
8
- when 0 then tr :toggle_no
7
+ when 1 then t(:format_toggle_yes)
8
+ when 0 then t(:format_toggle_no)
9
9
  else
10
10
  "?"
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
4
+ version: 0.11.4
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-04-01 00:00:00.000000000 Z
13
+ date: 2021-05-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.101.3
21
+ version: 1.101.4
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.3
28
+ version: 1.101.4
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-content
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.11.3
35
+ version: 0.11.4
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.11.3
42
+ version: 0.11.4
43
43
  description: ''
44
44
  email:
45
45
  - info@decko.org