trusty-cms 5.0.1 → 5.0.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: 577c76f690910024bfc10d3fbbd14b47eb8bc50358bca3bc2faacf3da06fc2e1
4
- data.tar.gz: 34ed2c1ec454af9df1cd6e0ef0eb1ef2421b1fd97efd5759a3353c3ea37f7677
3
+ metadata.gz: a1eddb811d02a4d5609cb0b5e555956f28ef83ac97bac1e2f0790b8b54b3ec14
4
+ data.tar.gz: bc2f62f77210b0ad503b370b6134b7e0fa1390b5f6ddee294678a3843e39713d
5
5
  SHA512:
6
- metadata.gz: 588a6a8325df522f2f2d58630f31d5652b41cadcf6a443e2210f6eac0fbea2bf53175052d4a3d4efa5afbd5fe668ec039e67853b771c604f8958bbbb734837ee
7
- data.tar.gz: 9e6a1248a186b875c587973ee609e9257d62c0adc9e0f26ae612bd3a647558c53319583a1342c1f8230bfac63588459986088c7b64caa0b1150e88d923b76cbc
6
+ metadata.gz: 9464ad322dd2164b577a086136a64063352d3f393058a2956f531a20908c6ac5b3ac96da439e775dcf856041d8d5b0add9da8f323b5d2bfb94f9220a175f568d
7
+ data.tar.gz: 4739d454d2897388d1a7b0251ff45e51c41013d26abb1bff9d93543dd37b27854a0f17fae302b8c79a3dbbb09722264d63d64edeb1e52e7b8ec23fa7fc816bc5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-cms (5.0.1)
4
+ trusty-cms (5.0.5)
5
5
  RedCloth (= 4.3.2)
6
6
  activestorage-validator
7
7
  acts_as_list (>= 0.9.5, < 1.1.0)
@@ -35,62 +35,62 @@ GEM
35
35
  remote: https://rubygems.org/
36
36
  specs:
37
37
  RedCloth (4.3.2)
38
- actioncable (6.1.4.1)
39
- actionpack (= 6.1.4.1)
40
- activesupport (= 6.1.4.1)
38
+ actioncable (6.1.4.4)
39
+ actionpack (= 6.1.4.4)
40
+ activesupport (= 6.1.4.4)
41
41
  nio4r (~> 2.0)
42
42
  websocket-driver (>= 0.6.1)
43
- actionmailbox (6.1.4.1)
44
- actionpack (= 6.1.4.1)
45
- activejob (= 6.1.4.1)
46
- activerecord (= 6.1.4.1)
47
- activestorage (= 6.1.4.1)
48
- activesupport (= 6.1.4.1)
43
+ actionmailbox (6.1.4.4)
44
+ actionpack (= 6.1.4.4)
45
+ activejob (= 6.1.4.4)
46
+ activerecord (= 6.1.4.4)
47
+ activestorage (= 6.1.4.4)
48
+ activesupport (= 6.1.4.4)
49
49
  mail (>= 2.7.1)
50
- actionmailer (6.1.4.1)
51
- actionpack (= 6.1.4.1)
52
- actionview (= 6.1.4.1)
53
- activejob (= 6.1.4.1)
54
- activesupport (= 6.1.4.1)
50
+ actionmailer (6.1.4.4)
51
+ actionpack (= 6.1.4.4)
52
+ actionview (= 6.1.4.4)
53
+ activejob (= 6.1.4.4)
54
+ activesupport (= 6.1.4.4)
55
55
  mail (~> 2.5, >= 2.5.4)
56
56
  rails-dom-testing (~> 2.0)
57
- actionpack (6.1.4.1)
58
- actionview (= 6.1.4.1)
59
- activesupport (= 6.1.4.1)
57
+ actionpack (6.1.4.4)
58
+ actionview (= 6.1.4.4)
59
+ activesupport (= 6.1.4.4)
60
60
  rack (~> 2.0, >= 2.0.9)
61
61
  rack-test (>= 0.6.3)
62
62
  rails-dom-testing (~> 2.0)
63
63
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
64
- actiontext (6.1.4.1)
65
- actionpack (= 6.1.4.1)
66
- activerecord (= 6.1.4.1)
67
- activestorage (= 6.1.4.1)
68
- activesupport (= 6.1.4.1)
64
+ actiontext (6.1.4.4)
65
+ actionpack (= 6.1.4.4)
66
+ activerecord (= 6.1.4.4)
67
+ activestorage (= 6.1.4.4)
68
+ activesupport (= 6.1.4.4)
69
69
  nokogiri (>= 1.8.5)
70
- actionview (6.1.4.1)
71
- activesupport (= 6.1.4.1)
70
+ actionview (6.1.4.4)
71
+ activesupport (= 6.1.4.4)
72
72
  builder (~> 3.1)
73
73
  erubi (~> 1.4)
74
74
  rails-dom-testing (~> 2.0)
75
75
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
76
- activejob (6.1.4.1)
77
- activesupport (= 6.1.4.1)
76
+ activejob (6.1.4.4)
77
+ activesupport (= 6.1.4.4)
78
78
  globalid (>= 0.3.6)
79
- activemodel (6.1.4.1)
80
- activesupport (= 6.1.4.1)
81
- activerecord (6.1.4.1)
82
- activemodel (= 6.1.4.1)
83
- activesupport (= 6.1.4.1)
84
- activestorage (6.1.4.1)
85
- actionpack (= 6.1.4.1)
86
- activejob (= 6.1.4.1)
87
- activerecord (= 6.1.4.1)
88
- activesupport (= 6.1.4.1)
79
+ activemodel (6.1.4.4)
80
+ activesupport (= 6.1.4.4)
81
+ activerecord (6.1.4.4)
82
+ activemodel (= 6.1.4.4)
83
+ activesupport (= 6.1.4.4)
84
+ activestorage (6.1.4.4)
85
+ actionpack (= 6.1.4.4)
86
+ activejob (= 6.1.4.4)
87
+ activerecord (= 6.1.4.4)
88
+ activesupport (= 6.1.4.4)
89
89
  marcel (~> 1.0.0)
90
90
  mini_mime (>= 1.1.0)
91
- activestorage-validator (0.1.4)
91
+ activestorage-validator (0.1.5)
92
92
  rails (>= 5.2.0)
93
- activesupport (6.1.4.1)
93
+ activesupport (6.1.4.4)
94
94
  concurrent-ruby (~> 1.0, >= 1.0.2)
95
95
  i18n (>= 1.6, < 2)
96
96
  minitest (>= 5.1)
@@ -121,7 +121,7 @@ GEM
121
121
  coderay (1.1.3)
122
122
  concurrent-ruby (1.1.9)
123
123
  crass (1.0.6)
124
- css_parser (1.10.0)
124
+ css_parser (1.11.0)
125
125
  addressable
126
126
  database_cleaner (2.0.1)
127
127
  database_cleaner-active_record (~> 2.0.0)
@@ -131,7 +131,7 @@ GEM
131
131
  database_cleaner-core (2.0.1)
132
132
  delocalize (1.2.0)
133
133
  rails (>= 2)
134
- devise (4.8.0)
134
+ devise (4.8.1)
135
135
  bcrypt (~> 3.0)
136
136
  orm_adapter (~> 0.1)
137
137
  railties (>= 4.1.0)
@@ -147,11 +147,11 @@ GEM
147
147
  factory_bot_rails (6.2.0)
148
148
  factory_bot (~> 6.2.0)
149
149
  railties (>= 5.0.0)
150
- ffi (1.15.4)
150
+ ffi (1.15.5)
151
151
  file_validators (3.0.0)
152
152
  activemodel (>= 3.2)
153
153
  mime-types (>= 1.0)
154
- globalid (0.5.2)
154
+ globalid (1.0.0)
155
155
  activesupport (>= 5.0)
156
156
  haml (5.2.2)
157
157
  temple (>= 0.8.0)
@@ -171,12 +171,12 @@ GEM
171
171
  httparty (0.20.0)
172
172
  mime-types (~> 3.0)
173
173
  multi_xml (>= 0.5.2)
174
- i18n (1.8.10)
174
+ i18n (1.8.11)
175
175
  concurrent-ruby (~> 1.0)
176
176
  image_processing (1.12.1)
177
177
  mini_magick (>= 4.9.5, < 5)
178
178
  ruby-vips (>= 2.0.17, < 3)
179
- json (2.5.1)
179
+ json (2.6.1)
180
180
  kraken-io (0.1.3)
181
181
  activesupport
182
182
  httparty
@@ -184,10 +184,10 @@ GEM
184
184
  multipart-post
185
185
  launchy (2.5.0)
186
186
  addressable (~> 2.7)
187
- libv8-node (15.14.0.1-x86_64-darwin-18)
188
- libv8-node (15.14.0.1-x86_64-darwin-20)
189
- libv8-node (15.14.0.1-x86_64-linux)
190
- loofah (2.12.0)
187
+ libv8-node (16.10.0.0-x86_64-darwin)
188
+ libv8-node (16.10.0.0-x86_64-linux)
189
+ libv8-node (16.10.0.0-x86_64-linux-musl)
190
+ loofah (2.13.0)
191
191
  crass (~> 1.0.2)
192
192
  nokogiri (>= 1.5.9)
193
193
  mail (2.7.1)
@@ -198,17 +198,17 @@ GEM
198
198
  mime-types-data (~> 3.2015)
199
199
  mime-types-data (3.2021.0225)
200
200
  mini_magick (4.11.0)
201
- mini_mime (1.1.1)
202
- mini_racer (0.4.0)
203
- libv8-node (~> 15.14.0.0)
204
- minitest (5.14.4)
201
+ mini_mime (1.1.2)
202
+ mini_racer (0.6.2)
203
+ libv8-node (~> 16.10.0.0)
204
+ minitest (5.15.0)
205
205
  multi_xml (0.6.0)
206
206
  multipart-post (2.1.1)
207
207
  mysql2 (0.5.3)
208
208
  nio4r (2.5.8)
209
- nokogiri (1.12.4-x86_64-darwin)
209
+ nokogiri (1.12.5-x86_64-darwin)
210
210
  racc (~> 1.4)
211
- nokogiri (1.12.4-x86_64-linux)
211
+ nokogiri (1.12.5-x86_64-linux)
212
212
  racc (~> 1.4)
213
213
  orm_adapter (0.5.0)
214
214
  poltergeist (1.18.1)
@@ -221,28 +221,30 @@ GEM
221
221
  pry-byebug (3.9.0)
222
222
  byebug (~> 11.0)
223
223
  pry (~> 0.13.0)
224
+ psych (4.0.3)
225
+ stringio
224
226
  public_suffix (4.0.6)
225
- racc (1.5.2)
227
+ racc (1.6.0)
226
228
  rack (2.2.3)
227
229
  rack-cache (1.13.0)
228
230
  rack (>= 0.4)
229
231
  rack-test (1.1.0)
230
232
  rack (>= 1.0, < 3)
231
233
  radius (0.7.5)
232
- rails (6.1.4.1)
233
- actioncable (= 6.1.4.1)
234
- actionmailbox (= 6.1.4.1)
235
- actionmailer (= 6.1.4.1)
236
- actionpack (= 6.1.4.1)
237
- actiontext (= 6.1.4.1)
238
- actionview (= 6.1.4.1)
239
- activejob (= 6.1.4.1)
240
- activemodel (= 6.1.4.1)
241
- activerecord (= 6.1.4.1)
242
- activestorage (= 6.1.4.1)
243
- activesupport (= 6.1.4.1)
234
+ rails (6.1.4.4)
235
+ actioncable (= 6.1.4.4)
236
+ actionmailbox (= 6.1.4.4)
237
+ actionmailer (= 6.1.4.4)
238
+ actionpack (= 6.1.4.4)
239
+ actiontext (= 6.1.4.4)
240
+ actionview (= 6.1.4.4)
241
+ activejob (= 6.1.4.4)
242
+ activemodel (= 6.1.4.4)
243
+ activerecord (= 6.1.4.4)
244
+ activestorage (= 6.1.4.4)
245
+ activesupport (= 6.1.4.4)
244
246
  bundler (>= 1.15.0)
245
- railties (= 6.1.4.1)
247
+ railties (= 6.1.4.4)
246
248
  sprockets-rails (>= 2.0.0)
247
249
  rails-dom-testing (2.0.3)
248
250
  activesupport (>= 4.2.0)
@@ -251,14 +253,15 @@ GEM
251
253
  loofah (~> 2.3)
252
254
  rails-observers (0.1.5)
253
255
  activemodel (>= 4.0)
254
- railties (6.1.4.1)
255
- actionpack (= 6.1.4.1)
256
- activesupport (= 6.1.4.1)
256
+ railties (6.1.4.4)
257
+ actionpack (= 6.1.4.4)
258
+ activesupport (= 6.1.4.4)
257
259
  method_source
258
260
  rake (>= 0.13)
259
261
  thor (~> 1.0)
260
262
  rake (13.0.6)
261
- rdoc (6.3.2)
263
+ rdoc (6.4.0)
264
+ psych (>= 4.0.0)
262
265
  regexp_parser (2.1.1)
263
266
  responders (3.0.1)
264
267
  actionpack (>= 5.0)
@@ -266,8 +269,8 @@ GEM
266
269
  roadie (4.0.0)
267
270
  css_parser (~> 1.4)
268
271
  nokogiri (~> 1.8)
269
- roadie-rails (2.2.0)
270
- railties (>= 5.1, < 6.2)
272
+ roadie-rails (2.3.0)
273
+ railties (>= 5.1, < 7.1)
271
274
  roadie (>= 3.1, < 5.0)
272
275
  rspec-core (3.10.1)
273
276
  rspec-support (~> 3.10.0)
@@ -286,10 +289,10 @@ GEM
286
289
  rspec-mocks (~> 3.10)
287
290
  rspec-support (~> 3.10)
288
291
  rspec-support (3.10.2)
289
- ruby-vips (2.1.3)
292
+ ruby-vips (2.1.4)
290
293
  ffi (~> 1.12)
291
- ruby_parser (3.17.0)
292
- sexp_processor (~> 4.15, >= 4.15.1)
294
+ ruby_parser (3.18.1)
295
+ sexp_processor (~> 4.16)
293
296
  sass-rails (6.0.0)
294
297
  sassc-rails (~> 2.1, >= 2.1.1)
295
298
  sassc (2.4.0)
@@ -300,7 +303,7 @@ GEM
300
303
  sprockets (> 3.0)
301
304
  sprockets-rails
302
305
  tilt
303
- sexp_processor (4.15.3)
306
+ sexp_processor (4.16.0)
304
307
  simplecov (0.21.2)
305
308
  docile (~> 1.1)
306
309
  simplecov-html (~> 0.11)
@@ -310,11 +313,12 @@ GEM
310
313
  sprockets (4.0.2)
311
314
  concurrent-ruby (~> 1.0)
312
315
  rack (> 1, < 3)
313
- sprockets-rails (3.2.2)
314
- actionpack (>= 4.0)
315
- activesupport (>= 4.0)
316
+ sprockets-rails (3.4.2)
317
+ actionpack (>= 5.2)
318
+ activesupport (>= 5.2)
316
319
  sprockets (>= 3.0.0)
317
320
  stringex (2.8.5)
321
+ stringio (3.0.1)
318
322
  temple (0.8.2)
319
323
  terrapin (0.6.0)
320
324
  climate_control (>= 0.0.3, < 1.0)
@@ -335,7 +339,7 @@ GEM
335
339
  will_paginate (3.3.1)
336
340
  xpath (3.2.0)
337
341
  nokogiri (~> 1.8)
338
- zeitwerk (2.4.2)
342
+ zeitwerk (2.5.3)
339
343
 
340
344
  PLATFORMS
341
345
  x86_64-darwin-18
@@ -359,4 +363,4 @@ DEPENDENCIES
359
363
  trustygems (~> 0.2.0)
360
364
 
361
365
  BUNDLED WITH
362
- 2.2.27
366
+ 2.2.31
data/app/models/asset.rb CHANGED
@@ -49,20 +49,21 @@ class Asset < ActiveRecord::Base
49
49
  to: :asset_type
50
50
 
51
51
  def thumbnail(style_name = 'original')
52
- return asset.url if style_name == :original
53
- return asset_variant(style_name).processed.url if asset.variable?
52
+ return asset.url if style_name.to_s == 'original' || asset.key.include?('culturaldistrict')
53
+ return asset_variant(style_name.to_s).processed.url if asset.variable?
54
54
 
55
- asset_type.icon(style_name)
55
+ asset_type.icon(style_name.to_s)
56
56
  end
57
57
 
58
+
58
59
  def asset_variant(style_name)
59
- case style_name.to_s
60
+ case style_name
60
61
  when 'thumbnail'
61
62
  asset.variant(gravity: 'Center', resize: '100x100^', crop: '100x100+0+0')
62
- when 'normal'
63
- asset.variant(gravity: 'Center', resize: '640x640^')
64
63
  when 'small'
65
64
  asset.variant(gravity: 'Center', resize: '320x320^')
65
+ when 'normal'
66
+ asset.variant(gravity: 'Center', resize_to_limit: [asset.metadata[:width], asset.metadata[:height]])
66
67
  when 'icon'
67
68
  asset.variant(gravity: 'Center', resize: '50x50^')
68
69
  end
@@ -25,13 +25,4 @@ class RailsPage < Page
25
25
  (part(k) || parts.build(name: k.to_s, filter_id: '')).content = v
26
26
  end
27
27
  end
28
-
29
- alias_method 'tag:old_breadcrumbs', 'tag:breadcrumbs'
30
- tag 'breadcrumbs' do |tag|
31
- if tag.locals.page.is_a?(RailsPage) && tag.locals.page.breadcrumbs
32
- tag.locals.page.breadcrumbs
33
- else
34
- render_tag('old_breadcrumbs', tag)
35
- end
36
- end
37
28
  end
@@ -466,47 +466,6 @@ module StandardTags
466
466
  end
467
467
  end
468
468
 
469
- desc %{
470
- Renders a counter value or one of the values given based on a global cycle counter.
471
-
472
- To get a numeric counter just use the tag, or specify a start value with @start@.
473
- Use the @reset@ attribute to reset the cycle to the beginning. Using @reset@ on a
474
- numbered cycle will begin at 0. Use the @name@ attribute to track multiple cycles;
475
- the default is @cycle@.
476
-
477
- *Usage:*
478
-
479
- <pre><code><r:cycle [values="first, second, third"] [reset="true|false"] [name="cycle"] [start="second"] /></code></pre>
480
- <pre><code><r:cycle start="3" /></code></pre>
481
- }
482
- tag 'cycle' do |tag|
483
- cycle = (tag.globals.cycle ||= {})
484
- if tag.attr['values']
485
- values = tag.attr['values'].split(',').collect(&:strip)
486
- end
487
- start = tag.attr['start']
488
- cycle_name = tag.attr['name'] || 'cycle'
489
- if values
490
- current_index = if start
491
- (cycle[cycle_name] ||= values.index(start))
492
- else
493
- (cycle[cycle_name] ||= 0)
494
- end
495
- current_index = 0 if tag.attr['reset'] == 'true'
496
- cycle[cycle_name] = (current_index + 1) % values.size
497
- values[current_index]
498
- else
499
- cycle[cycle_name] ||= (start.presence || 0).to_i
500
- output = cycle[cycle_name]
501
- cycle[cycle_name] += 1
502
- if tag.attr['reset'] == 'true'
503
- cycle[cycle_name] = 0
504
- output = cycle[cycle_name]
505
- end
506
- output
507
- end
508
- end
509
-
510
469
  desc %{
511
470
  Renders the main content of a page. Use the @part@ attribute to select a specific
512
471
  page part. By default the @part@ attribute is set to body. Use the @inherit@
@@ -660,21 +619,9 @@ module StandardTags
660
619
 
661
620
  *Usage:*
662
621
 
663
- <pre><code><r:if_ancestor_or_self>...</r:if_ancestor_or_self></code></pre>
622
+ <pre><code>...</code></pre>
664
623
  }
665
- tag 'if_ancestor_or_self' do |tag|
666
- tag.expand if (tag.globals.page.ancestors + [tag.globals.page]).include?(tag.locals.page)
667
- end
668
-
669
- desc %{
670
- Renders the contained elements unless the current contextual page is either the actual page or one of its parents.
671
624
 
672
- This is typically used inside another tag (like &lt;r:children:each&gt;) to add conditional mark-up unless the child element is or descends from the current page.
673
-
674
- *Usage:*
675
-
676
- <pre><code><r:unless_ancestor_or_self>...</r:unless_ancestor_or_self></code></pre>
677
- }
678
625
  tag 'unless_ancestor_or_self' do |tag|
679
626
  tag.expand unless (tag.globals.page.ancestors + [tag.globals.page]).include?(tag.locals.page)
680
627
  end
@@ -798,61 +745,6 @@ module StandardTags
798
745
  end
799
746
  end
800
747
 
801
- desc %{
802
- Renders a link to the page. When used as a single tag it uses the page's title
803
- for the link name. When used as a double tag the part in between both tags will
804
- be used as the link text. The link tag passes all attributes over to the HTML
805
- @a@ tag. This is very useful for passing attributes like the @class@ attribute
806
- or @id@ attribute. If the @anchor@ attribute is passed to the tag it will
807
- append a pound sign (<code>#</code>) followed by the value of the attribute to
808
- the @href@ attribute of the HTML @a@ tag--effectively making an HTML anchor.
809
-
810
- *Usage:*
811
-
812
- <pre><code><r:link [anchor="name"] [other attributes...] /></code></pre>
813
-
814
- or
815
-
816
- <pre><code><r:link [anchor="name"] [other attributes...]>link text here</r:link></code></pre>
817
- }
818
- tag 'link' do |tag|
819
- options = tag.attr.dup
820
- anchor = options['anchor'] ? "##{options.delete('anchor')}" : ''
821
- attributes = options.inject('') { |s, (k, v)| s << %{#{k.downcase}="#{v}" } }.strip
822
- attributes = " #{attributes}" unless attributes.empty?
823
- text = tag.double? ? tag.expand : tag.render('title')
824
- %{<a href="#{tag.render('path')}#{anchor}"#{attributes}>#{text}</a>}
825
- end
826
-
827
- desc %{
828
- Renders a trail of breadcrumbs to the current page. The separator attribute
829
- specifies the HTML fragment that is inserted between each of the breadcrumbs. By
830
- default it is set to @>@. The boolean @nolinks@ attribute can be specified to render
831
- breadcrumbs in plain text, without any links (useful when generating title tag).
832
- Set the boolean @noself@ attribute to omit the present page (useful in page headers).
833
-
834
- *Usage:*
835
-
836
- <pre><code><r:breadcrumbs [separator="separator_string"] [nolinks="true"] [noself="true"]/></code></pre>
837
- }
838
- tag 'breadcrumbs' do |tag|
839
- page = tag.locals.page
840
- nolinks = (tag.attr['nolinks'] == 'true')
841
- noself = (tag.attr['noself'] == 'true')
842
- breadcrumbs = []
843
- breadcrumbs.unshift page.breadcrumb unless noself
844
- page.ancestors.each do |ancestor|
845
- tag.locals.page = ancestor
846
- if nolinks
847
- breadcrumbs.unshift tag.render('breadcrumb')
848
- else
849
- breadcrumbs.unshift %{<a href="#{tag.render('path')}">#{tag.render('breadcrumb')}</a>}
850
- end
851
- end
852
- separator = tag.attr['separator'] || ' &gt; '
853
- breadcrumbs.join(separator)
854
- end
855
-
856
748
  desc %{
857
749
  Inside this tag all page related tags refer to the page found at the @path@ attribute.
858
750
  @path@s may be relative or absolute paths.
@@ -1041,97 +933,6 @@ module StandardTags
1041
933
  tag.expand if tag.locals.last_child
1042
934
  end
1043
935
 
1044
- desc %{
1045
- Renders the containing elements only if TrustyCms in is development mode.
1046
-
1047
- *Usage:*
1048
-
1049
- <pre><code><r:if_dev>...</r:if_dev></code></pre>
1050
- }
1051
- tag 'if_dev' do |tag|
1052
- tag.expand if dev?(tag.globals.page.request)
1053
- end
1054
-
1055
- desc %{
1056
- The opposite of the @if_dev@ tag.
1057
-
1058
- *Usage:*
1059
-
1060
- <pre><code><r:unless_dev>...</r:unless_dev></code></pre>
1061
- }
1062
- tag 'unless_dev' do |tag|
1063
- tag.expand unless dev?(tag.globals.page.request)
1064
- end
1065
-
1066
- desc %{
1067
- Prints the page's status as a string. Optional attribute 'downcase'
1068
- will cause the status to be all lowercase.
1069
-
1070
- *Usage:*
1071
-
1072
- <pre><code><r:status [downcase='true'] /></code></pre>
1073
- }
1074
- tag 'status' do |tag|
1075
- status = tag.globals.page.status.name
1076
- return status.downcase if tag.attr['downcase']
1077
-
1078
- status
1079
- end
1080
-
1081
- desc %(
1082
- Renders the content of the field given in the @name@ attribute.
1083
-
1084
- *Usage:*
1085
-
1086
- <pre><code><r:field name="Keywords" /></code></pre>
1087
- )
1088
- tag 'field' do |tag|
1089
- required_attr(tag, 'name')
1090
- tag.locals.page.field(tag.attr['name']).try(:content)
1091
- end
1092
-
1093
- desc %(
1094
- Renders the contained elements if the field given in the @name@ attribute
1095
- exists. The tag also takes an optional @equals@ or @matches@ attribute;
1096
- these will expand the tag if the field's content equals or matches the
1097
- given string or regex.
1098
-
1099
- *Usage:*
1100
-
1101
- <pre><code><r:if_field name="author" [equals|matches="John"] [ignore_case="true|false"]>...</r:if_field></code></pre>
1102
- )
1103
- tag 'if_field' do |tag|
1104
- required_attr(tag, 'name')
1105
- field = tag.locals.page.field(tag.attr['name'])
1106
- return '' if field.nil?
1107
-
1108
- tag.expand if if tag.attr['equals'] && (tag.attr['ignore_case'] == 'false') then field.content == tag.attr['equals']
1109
- elsif tag.attr['equals'] then field.content.downcase == tag.attr['equals'].downcase
1110
- elsif tag.attr['matches'] then field.content =~ build_regexp_for(tag, 'matches')
1111
- else field
1112
- end
1113
- end
1114
-
1115
- desc %(
1116
- The opposite of @if_field@. Renders the contained elements unless the field
1117
- given in the @name@ attribute exists. The tag also takes an optional
1118
- @equals@ or @matches@ attribute; these will expand the tag unless the
1119
- field's content equals or matches the given string or regex.
1120
-
1121
- *Usage:*
1122
-
1123
- <pre><code><r:unless_field name="author" [equals|matches="John"] [ignore_case="true|false"]>...</r:unless_field></code></pre>
1124
- )
1125
- tag 'unless_field' do |tag|
1126
- required_attr(tag, 'name')
1127
- field = tag.locals.page.field(tag.attr['name'])
1128
- tag.expand unless if field && (tag.attr['equals'] && (tag.attr['ignore_case'] == 'false')) then field.content == tag.attr['equals']
1129
- elsif field && tag.attr['equals'] then field.content.downcase == tag.attr['equals'].downcase
1130
- elsif field && tag.attr['matches'] then field.content =~ build_regexp_for(tag, 'matches')
1131
- else field
1132
- end
1133
- end
1134
-
1135
936
  tag 'site' do |tag|
1136
937
  tag.expand
1137
938
  end
@@ -1,4 +1,5 @@
1
1
  = stylesheet_link_tag 'admin/assets'
2
+ = javascript_include_tag 'admin/custom_file_upload'
2
3
  = render_region :top
3
4
 
4
5
  - render_region :main do |main|
@@ -19,7 +20,7 @@
19
20
  = "#{t("clipped_extension.asset_url")}: #{image_path @asset.asset.url unless @asset.new_record?}"
20
21
  %br
21
22
  %label.id
22
- = "#{t("clipped_extension.asset_id")}: #{@asset.asset.id unless @asset.new_record?}"
23
+ = "#{t("clipped_extension.asset_id")}: #{@asset.id unless @asset.new_record?}"
23
24
  %p.asset
24
25
  = image_tag @asset.thumbnail("normal"), :class => 'preview'
25
26
 
@@ -28,7 +29,8 @@
28
29
  %fieldset.upload
29
30
  %label.custom-file-upload.upload
30
31
  = t("clipped_extension.replace_file")
31
- = f.file_field :asset, :class => "", :style => "width: 100%"
32
+ = f.file_field :asset, :style => "width: 100%"
33
+ %span#file-chosen No file chosen
32
34
 
33
35
  .buttons
34
36
  = save_model_button(@asset)
@@ -55,15 +55,6 @@ en:
55
55
  <pre><code><r:aggregate paths=\"/section1; /section2; /section3\"> ... </r:aggregate></code></pre>"
56
56
  author: "Renders the name of the author of the current page."
57
57
  breadcrumb: "Renders the @breadcrumb@ attribute of the current page."
58
- breadcrumbs: "Renders a trail of breadcrumbs to the current page. The separator attribute
59
- specifies the HTML fragment that is inserted between each of the breadcrumbs. By
60
- default it is set to @>@. The boolean @nolinks@ attribute can be specified to render
61
- breadcrumbs in plain text, without any links (useful when generating title tag).
62
- Set the boolean @noself@ attribute to omit the present page (useful in page headers).
63
-
64
- *Usage:*
65
-
66
- <pre><code><r:breadcrumbs [separator=\"separator_string\"] [nolinks=\"true\"] [noself=\"true\"]/></code></pre>"
67
58
  children-count: "Renders the total number of children."
68
59
  children-each-child: "Page attribute tags inside of this tag refer to the current child. This is occasionally
69
60
  useful if you are inside of another tag (like &lt;r:find&gt;) and need to refer back to the
@@ -191,17 +182,6 @@ en:
191
182
  *Usage:*
192
183
 
193
184
  <pre><code><r:content [part=\"part_name\"] [inherit=\"true|false\"] [contextual=\"true|false\"] /></code></pre>"
194
- cycle: "Renders a counter value or one of the values given based on a global cycle counter.
195
-
196
- To get a numeric counter just use the tag, or specify a start value with @start@.
197
- Use the @reset@ attribute to reset the cycle to the beginning. Using @reset@ on a
198
- numbered cycle will begin at 0. Use the @name@ attribute to track multiple cycles;
199
- the default is @cycle@.
200
-
201
- *Usage:*
202
-
203
- <pre><code><r:cycle [values=\"first, second, third\"] [reset=\"true|false\"] [name=\"cycle\"] [start=\"second\"] /></code></pre>
204
- <pre><code><r:cycle start=\"3\" /></code></pre>"
205
185
  date: "Renders the date based on the current page (by default when it was published or created).
206
186
  The format attribute uses the same formating codes used by the Ruby @strftime@ function. By
207
187
  default it's set to @&#37;A, &#37;B &#37;d, &#37;Y@. The @for@ attribute selects which date to render. Valid
@@ -216,11 +196,7 @@ en:
216
196
  *Usage:*
217
197
 
218
198
  <pre><code><r:escape_html>...</r:escape_html></code></pre>"
219
- field: "Renders the content of the field given in the @name@ attribute.
220
-
221
- *Usage:*
222
199
 
223
- <pre><code><r:field name=\"Keywords\" /></code></pre>"
224
200
  find: "Inside this tag all page related tags refer to the page found at the @path@ attribute.
225
201
  @path@s may be relative or absolute paths.
226
202
 
@@ -243,13 +219,7 @@ en:
243
219
  *Usage:*
244
220
 
245
221
  <pre><code><r:hide>...</r:hide></code></pre>"
246
- if_ancestor_or_self: "Renders the contained elements if the current contextual page is either the actual page or one of its parents.
247
-
248
- This is typically used inside another tag (like &lt;r:children:each&gt;) to add conditional mark-up if the child element is or descends from the current page.
249
-
250
- *Usage:*
251
222
 
252
- <pre><code><r:if_ancestor_or_self>...</r:if_ancestor_or_self></code></pre>"
253
223
  if_children: "Renders the contained elements only if the current contextual page has one or
254
224
  more child pages. The @status@ attribute limits the status of found child pages
255
225
  to the given status, the default is @\"published\"@. @status=\"all\"@ includes all
@@ -270,19 +240,7 @@ en:
270
240
  *Usage:*
271
241
 
272
242
  <pre><code><r:if_content [part=\"part_name, other_part\"] [inherit=\"true\"] [find=\"any\"]>...</r:if_content></code></pre>"
273
- if_dev: "Renders the containing elements only if TrustyCms in is development mode.
274
-
275
- *Usage:*
276
-
277
- <pre><code><r:if_dev>...</r:if_dev></code></pre>"
278
- if_field: "Renders the contained elements if the field given in the @name@ attribute
279
- exists. The tag also takes an optional @equals@ or @matches@ attribute;
280
- these will expand the tag if the field's content equals or matches the
281
- given string or regex.
282
-
283
- *Usage:*
284
243
 
285
- <pre><code><r:if_field name=\"author\" [equals|matches=\"John\"] [ignore_case=\"true|false\"]>...</r:if_field></code></pre>"
286
244
  if_parent: "Renders the contained elements only if the current contextual page has a parent, i.e.
287
245
  is not the root page.
288
246
 
@@ -332,21 +290,6 @@ The above example will produce the following:
332
290
  //]]>
333
291
  </script>
334
292
  <script type=\"text/javascript\" src=\"/js/other.js\"></script></code></pre>"
335
- link: "Renders a link to the page. When used as a single tag it uses the page's title
336
- for the link name. When used as a double tag the part in between both tags will
337
- be used as the link text. The link tag passes all attributes over to the HTML
338
- @a@ tag. This is very useful for passing attributes like the @class@ attribute
339
- or @id@ attribute. If the @anchor@ attribute is passed to the tag it will
340
- append a pound sign (<code>#</code>) followed by the value of the attribute to
341
- the @href@ attribute of the HTML @a@ tag--effectively making an HTML anchor.
342
-
343
- *Usage:*
344
-
345
- <pre><code><r:link [anchor=\"name\"] [other attributes...] /></code></pre>
346
-
347
- or
348
-
349
- <pre><code><r:link [anchor=\"name\"] [other attributes...]>link text here</r:link></code></pre>"
350
293
  markdown: "Filters its contents with the Markdown filter.
351
294
 
352
295
  *Usage:*
@@ -484,12 +427,6 @@ The above example will produce the following:
484
427
  *Usage:*
485
428
 
486
429
  <pre><code><r:snippet name=\"snippet_name\">Lorem ipsum dolor...</r:snippet></code></pre>"
487
- status: "Prints the page's status as a string. Optional attribute 'downcase'
488
- will cause the status to be all lowercase.
489
-
490
- *Usage:*
491
-
492
- <pre><code><r:status [downcase='true'] /></code></pre>"
493
430
  stylesheet: "Renders the content from or a reference to the stylesheet specified in the @slug@
494
431
  attribute. Additionally, the @as@ attribute can be used to make the tag render
495
432
  as one of the following:
@@ -563,19 +500,6 @@ The above example will produce the following:
563
500
  *Usage:*
564
501
 
565
502
  <pre><code><r:unless_content [part=\"part_name, other_part\"] [inherit=\"false\"] [find=\"any\"]>...</r:unless_content></code></pre>"
566
- unless_dev: "The opposite of the @if_dev@ tag.
567
-
568
- *Usage:*
569
-
570
- <pre><code><r:unless_dev>...</r:unless_dev></code></pre>"
571
- unless_field: "The opposite of @if_field@. Renders the contained elements unless the field
572
- given in the @name@ attribute exists. The tag also takes an optional
573
- @equals@ or @matches@ attribute; these will expand the tag unless the
574
- field's content equals or matches the given string or regex.
575
-
576
- *Usage:*
577
-
578
- <pre><code><r:unless_field name=\"author\" [equals|matches=\"John\"] [ignore_case=\"true|false\"]>...</r:unless_field></code></pre>"
579
503
  unless_parent: "Renders the contained elements only if the current contextual page has no parent, i.e.
580
504
  is the root page.
581
505
 
@@ -7,16 +7,6 @@
7
7
  breadcrumb:
8
8
  Renders the @breadcrumb@ attribute of the current page.
9
9
 
10
- breadcrumbs:
11
- Renders a trail of breadcrumbs to the current page. The separator attribute
12
- specifies the HTML fragment that is inserted between each of the breadcrumbs. By
13
- default it is set to @>@. The boolean nolinks attribute can be specified to render
14
- breadcrumbs in plain text, without any links (useful when generating title tag).
15
-
16
- *Usage&#58;*
17
-
18
- <pre><code><r&#58;breadcrumbs [separator="separator_string"] [nolinks="true"] /></code></pre>
19
-
20
10
  children-count:
21
11
  Renders the total number of children.
22
12
 
@@ -165,15 +155,6 @@
165
155
 
166
156
  <pre><code><r&#58;content [part="part_name"] [inherit="true|false"] [contextual="true|false"] /></code></pre>
167
157
 
168
- cycle:
169
- Renders one of the passed values based on a global cycle counter. Use the @reset@
170
- attribute to reset the cycle to the beginning. Use the @name@ attribute to track
171
- multiple cycles; the default is @cycle@.
172
-
173
- *Usage&#58;*
174
-
175
- <pre><code><r&#58;cycle values="first, second, third" [reset="true|false"] [name="cycle"] /></code></pre>
176
-
177
158
  date:
178
159
  Renders the date based on the current page (by default when it was published or created).
179
160
  The format attribute uses the same formating codes used by the Ruby @strftime@ function. By
@@ -200,15 +181,6 @@
200
181
 
201
182
  <pre><code><r&#58;find url="value_to_find">...</r&#58;find></code></pre>
202
183
 
203
- if_ancestor_or_self:
204
- Renders the contained elements if the current contextual page is either the actual page or one of its parents.
205
-
206
- This is typically used inside another tag (like &lt;r&#58;children&#58;each&gt;) to add conditional mark-up if the child element is or descends from the current page.
207
-
208
- *Usage&#58;*
209
-
210
- <pre><code><r&#58;if_ancestor_or_self>...</r&#58;if_ancestor_or_self></code></pre>
211
-
212
184
  if_children:
213
185
  Renders the contained elements only if the current contextual page has one or
214
186
  more child pages. The @status@ attribute limits the status of found child pages
@@ -233,13 +205,6 @@
233
205
 
234
206
  <pre><code><r&#58;if_content [part="part_name, other_part"] [inherit="true"] [find="any"]>...</r&#58;if_content></code></pre>
235
207
 
236
- if_dev:
237
- Renders the containing elements only if TrustyCms in is development mode.
238
-
239
- *Usage&#58;*
240
-
241
- <pre><code><r&#58;if_dev>...</r&#58;if_dev></code></pre>
242
-
243
208
  if_parent:
244
209
  Renders the contained elements only if the current contextual page has a parent, i.e.
245
210
  is not the root page.
@@ -266,23 +231,6 @@
266
231
 
267
232
  <pre><code><r&#58;if_url matches="regexp" [ignore_case="true|false"]>...</r&#58;if_url></code></pre>
268
233
 
269
- link:
270
- Renders a link to the page. When used as a single tag it uses the page's title
271
- for the link name. When used as a double tag the part in between both tags will
272
- be used as the link text. The link tag passes all attributes over to the HTML
273
- @a@ tag. This is very useful for passing attributes like the @class@ attribute
274
- or @id@ attribute. If the @anchor@ attribute is passed to the tag it will
275
- append a pound sign (<code>#</code>) followed by the value of the attribute to
276
- the @href@ attribute of the HTML @a@ tag--effectively making an HTML anchor.
277
-
278
- *Usage&#58;*
279
-
280
- <pre><code><r&#58;link [anchor="name"] [other attributes...] /></code></pre>
281
-
282
- or
283
-
284
- <pre><code><r&#58;link [anchor="name"] [other attributes...]>link text here</r&#58;link></code></pre>
285
-
286
234
  markdown:
287
235
  Filters its contents with the Markdown filter.
288
236
 
@@ -426,14 +374,6 @@
426
374
 
427
375
  <pre><code><r&#58;snippet name="snippet_name">Lorem ipsum dolor...</r&#58;snippet></code></pre>
428
376
 
429
- status:
430
- Prints the page's status as a string. Optional attribute 'downcase'
431
- will cause the status to be all lowercase.
432
-
433
- *Usage&#58;*
434
-
435
- <pre><code><r&#58;status [downcase='true'] /></code></pre>
436
-
437
377
  textile:
438
378
  Filters its contents with the Textile filter.
439
379
 
@@ -486,13 +426,6 @@
486
426
 
487
427
  <pre><code><r&#58;unless_content [part="part_name, other_part"] [inherit="false"] [find="any"]>...</r&#58;unless_content></code></pre>
488
428
 
489
- unless_dev:
490
- The opposite of the @if_dev@ tag.
491
-
492
- *Usage&#58;*
493
-
494
- <pre><code><r&#58;unless_dev>...</r&#58;unless_dev></code></pre>
495
-
496
429
  unless_parent:
497
430
  Renders the contained elements only if the current contextual page has no parent, i.e.
498
431
  is the root page.
data/lib/trusty_cms.rb CHANGED
@@ -2,6 +2,6 @@ TRUSTY_CMS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) unle
2
2
 
3
3
  unless defined? TrustyCms::VERSION
4
4
  module TrustyCms
5
- VERSION = '5.0.1'.freeze
5
+ VERSION = '5.0.5'.freeze
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trusty-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - TrustyCms CMS dev team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-05 00:00:00.000000000 Z
11
+ date: 2022-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activestorage-validator
@@ -8663,61 +8663,61 @@ required_rubygems_version: !ruby/object:Gem::Requirement
8663
8663
  - !ruby/object:Gem::Version
8664
8664
  version: 1.3.1
8665
8665
  requirements: []
8666
- rubygems_version: 3.2.15
8666
+ rubygems_version: 3.0.3
8667
8667
  signing_key:
8668
8668
  specification_version: 4
8669
8669
  summary: A no-fluff content management system designed for small teams.
8670
8670
  test_files:
8671
- - spec/ci/database.mysql.yml
8672
- - spec/controllers/application_controller_spec.rb
8673
- - spec/controllers/users_controller_spec.rb
8674
- - spec/dummy/README.rdoc
8675
- - spec/dummy/Rakefile
8671
+ - spec/spec_helper.rb
8676
8672
  - spec/dummy/app/assets/config/manifest.js
8677
- - spec/dummy/bin/bundle
8678
- - spec/dummy/bin/rails
8679
8673
  - spec/dummy/bin/rake
8680
8674
  - spec/dummy/bin/setup
8681
- - spec/dummy/config/application.rb
8682
- - spec/dummy/config/boot.rb
8683
- - spec/dummy/config/database.yml
8684
- - spec/dummy/config/environment.rb
8685
- - spec/dummy/config/environments/development.rb
8675
+ - spec/dummy/bin/bundle
8676
+ - spec/dummy/bin/rails
8677
+ - spec/dummy/config/secrets.yml
8678
+ - spec/dummy/config/routes.rb
8679
+ - spec/dummy/config/locales/en.yml
8686
8680
  - spec/dummy/config/environments/production.rb
8681
+ - spec/dummy/config/environments/development.rb
8687
8682
  - spec/dummy/config/environments/test.rb
8688
- - spec/dummy/config/initializers/assets.rb
8683
+ - spec/dummy/config/environment.rb
8684
+ - spec/dummy/config/application.rb
8685
+ - spec/dummy/config/database.yml
8686
+ - spec/dummy/config/boot.rb
8687
+ - spec/dummy/config/initializers/trusty_cms_config.rb
8689
8688
  - spec/dummy/config/initializers/backtrace_silencers.rb
8690
- - spec/dummy/config/initializers/cookies_serializer.rb
8691
- - spec/dummy/config/initializers/filter_parameter_logging.rb
8692
- - spec/dummy/config/initializers/inflections.rb
8693
8689
  - spec/dummy/config/initializers/mime_types.rb
8690
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
8694
8691
  - spec/dummy/config/initializers/session_store.rb
8695
- - spec/dummy/config/initializers/trusty_cms_config.rb
8696
8692
  - spec/dummy/config/initializers/wrap_parameters.rb
8697
- - spec/dummy/config/locales/en.yml
8698
- - spec/dummy/config/routes.rb
8699
- - spec/dummy/config/secrets.yml
8693
+ - spec/dummy/config/initializers/assets.rb
8694
+ - spec/dummy/config/initializers/cookies_serializer.rb
8695
+ - spec/dummy/config/initializers/inflections.rb
8700
8696
  - spec/dummy/config.ru
8701
- - spec/dummy/db/schema.rb
8702
- - spec/dummy/log/test.log
8703
- - spec/dummy/package.json
8704
- - spec/dummy/public/404.html
8697
+ - spec/dummy/Rakefile
8698
+ - spec/dummy/yarn.lock
8699
+ - spec/dummy/public/favicon.ico
8705
8700
  - spec/dummy/public/422.html
8706
8701
  - spec/dummy/public/500.html
8707
- - spec/dummy/public/favicon.ico
8702
+ - spec/dummy/public/404.html
8703
+ - spec/dummy/package.json
8704
+ - spec/dummy/db/schema.rb
8705
+ - spec/dummy/log/test.log
8708
8706
  - spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig
8709
8707
  - spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime
8710
8708
  - spec/dummy/tmp/trusty_config_cache.txt
8711
- - spec/dummy/yarn.lock
8712
- - spec/factories/layout.rb
8709
+ - spec/dummy/README.rdoc
8710
+ - spec/ci/database.mysql.yml
8711
+ - spec/features/config_spec.rb
8712
+ - spec/features/pages_spec.rb
8713
+ - spec/features/layouts_spec.rb
8714
+ - spec/models/layout_spec.rb
8715
+ - spec/support/custom_actions.rb
8713
8716
  - spec/factories/page.rb
8717
+ - spec/factories/layout.rb
8714
8718
  - spec/factories/page_part.rb
8715
8719
  - spec/factories/user.rb
8716
- - spec/features/config_spec.rb
8717
- - spec/features/layouts_spec.rb
8718
- - spec/features/pages_spec.rb
8719
8720
  - spec/fixtures/users.yml
8720
- - spec/models/layout_spec.rb
8721
+ - spec/controllers/users_controller_spec.rb
8722
+ - spec/controllers/application_controller_spec.rb
8721
8723
  - spec/rails_helper.rb
8722
- - spec/spec_helper.rb
8723
- - spec/support/custom_actions.rb