trusty-cms 5.0.2 → 5.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 066d3a148afc8e9cf41df8cf74277edf610a1fb0428332ca1430678b1e54b0f2
4
- data.tar.gz: 7b6d84f5bb9225b1c9c42b7bf0bf0829c981817faf550a930126fe5651ef0063
3
+ metadata.gz: 18961c722bc28e643661f536be22bf286898e3c1992cd70dfdaf389828e05991
4
+ data.tar.gz: 24fcd6e768d804658d6a5be29f3ac9b637caf54610c564021865d592507a6c23
5
5
  SHA512:
6
- metadata.gz: 87e8b1b1a4fcc3c3a8e83157052a8c95c6673fbdecf9e51f280016f9d61375149410cd14746cffd0c7b809fcdd74459c48595ab59bef5ed5c8989316be241207
7
- data.tar.gz: f34ec3a815c86344e92963d7da50ebef35b62505ebd97fc9652b5d8d61b6c9261b453501bdecfca48f88ee099f2910bd1f6370316a558f64eec96f5d31e0d6da
6
+ metadata.gz: 359cb791d303fd26d99fc07591597ed7696f115a7f01fd9066407713083fd412e63feaebccfcd585dc668b0eabef16a41580c54663ae4e9007fa8eb27cf993a4
7
+ data.tar.gz: 2edfbce7ddd9b83b912110c2ca94ea985aff8562c2ce5dea59e8aaab2d1d2ef2bee66c91e11a064f5815464255eab0a16bd82127c200a6656b68552388fd781d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-cms (5.0.2)
4
+ trusty-cms (5.0.6)
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,13 +131,13 @@ 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)
138
138
  responders
139
139
  warden (~> 1.2.3)
140
- diff-lcs (1.4.4)
140
+ diff-lcs (1.5.0)
141
141
  docile (1.4.0)
142
142
  erubi (1.10.0)
143
143
  erubis (2.7.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,7 +171,7 @@ 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.9.1)
175
175
  concurrent-ruby (~> 1.0)
176
176
  image_processing (1.12.1)
177
177
  mini_magick (>= 4.9.5, < 5)
@@ -184,10 +184,9 @@ 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
+ loofah (2.13.0)
191
190
  crass (~> 1.0.2)
192
191
  nokogiri (>= 1.5.9)
193
192
  mail (2.7.1)
@@ -198,10 +197,10 @@ GEM
198
197
  mime-types-data (~> 3.2015)
199
198
  mime-types-data (3.2021.0225)
200
199
  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)
200
+ mini_mime (1.1.2)
201
+ mini_racer (0.6.2)
202
+ libv8-node (~> 16.10.0.0)
203
+ minitest (5.15.0)
205
204
  multi_xml (0.6.0)
206
205
  multipart-post (2.1.1)
207
206
  mysql2 (0.5.3)
@@ -221,28 +220,30 @@ GEM
221
220
  pry-byebug (3.9.0)
222
221
  byebug (~> 11.0)
223
222
  pry (~> 0.13.0)
223
+ psych (4.0.3)
224
+ stringio
224
225
  public_suffix (4.0.6)
225
- racc (1.5.2)
226
+ racc (1.6.0)
226
227
  rack (2.2.3)
227
228
  rack-cache (1.13.0)
228
229
  rack (>= 0.4)
229
230
  rack-test (1.1.0)
230
231
  rack (>= 1.0, < 3)
231
232
  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)
233
+ rails (6.1.4.4)
234
+ actioncable (= 6.1.4.4)
235
+ actionmailbox (= 6.1.4.4)
236
+ actionmailer (= 6.1.4.4)
237
+ actionpack (= 6.1.4.4)
238
+ actiontext (= 6.1.4.4)
239
+ actionview (= 6.1.4.4)
240
+ activejob (= 6.1.4.4)
241
+ activemodel (= 6.1.4.4)
242
+ activerecord (= 6.1.4.4)
243
+ activestorage (= 6.1.4.4)
244
+ activesupport (= 6.1.4.4)
244
245
  bundler (>= 1.15.0)
245
- railties (= 6.1.4.1)
246
+ railties (= 6.1.4.4)
246
247
  sprockets-rails (>= 2.0.0)
247
248
  rails-dom-testing (2.0.3)
248
249
  activesupport (>= 4.2.0)
@@ -251,14 +252,15 @@ GEM
251
252
  loofah (~> 2.3)
252
253
  rails-observers (0.1.5)
253
254
  activemodel (>= 4.0)
254
- railties (6.1.4.1)
255
- actionpack (= 6.1.4.1)
256
- activesupport (= 6.1.4.1)
255
+ railties (6.1.4.4)
256
+ actionpack (= 6.1.4.4)
257
+ activesupport (= 6.1.4.4)
257
258
  method_source
258
259
  rake (>= 0.13)
259
260
  thor (~> 1.0)
260
261
  rake (13.0.6)
261
- rdoc (6.3.2)
262
+ rdoc (6.4.0)
263
+ psych (>= 4.0.0)
262
264
  regexp_parser (2.1.1)
263
265
  responders (3.0.1)
264
266
  actionpack (>= 5.0)
@@ -266,18 +268,18 @@ GEM
266
268
  roadie (4.0.0)
267
269
  css_parser (~> 1.4)
268
270
  nokogiri (~> 1.8)
269
- roadie-rails (2.2.0)
270
- railties (>= 5.1, < 6.2)
271
+ roadie-rails (2.3.0)
272
+ railties (>= 5.1, < 7.1)
271
273
  roadie (>= 3.1, < 5.0)
272
- rspec-core (3.10.1)
274
+ rspec-core (3.10.2)
273
275
  rspec-support (~> 3.10.0)
274
- rspec-expectations (3.10.1)
276
+ rspec-expectations (3.10.2)
275
277
  diff-lcs (>= 1.2.0, < 2.0)
276
278
  rspec-support (~> 3.10.0)
277
- rspec-mocks (3.10.2)
279
+ rspec-mocks (3.10.3)
278
280
  diff-lcs (>= 1.2.0, < 2.0)
279
281
  rspec-support (~> 3.10.0)
280
- rspec-rails (5.0.2)
282
+ rspec-rails (5.1.0)
281
283
  actionpack (>= 5.2)
282
284
  activesupport (>= 5.2)
283
285
  railties (>= 5.2)
@@ -285,11 +287,11 @@ GEM
285
287
  rspec-expectations (~> 3.10)
286
288
  rspec-mocks (~> 3.10)
287
289
  rspec-support (~> 3.10)
288
- rspec-support (3.10.2)
289
- ruby-vips (2.1.3)
290
+ rspec-support (3.10.3)
291
+ ruby-vips (2.1.4)
290
292
  ffi (~> 1.12)
291
- ruby_parser (3.17.0)
292
- sexp_processor (~> 4.15, >= 4.15.1)
293
+ ruby_parser (3.18.1)
294
+ sexp_processor (~> 4.16)
293
295
  sass-rails (6.0.0)
294
296
  sassc-rails (~> 2.1, >= 2.1.1)
295
297
  sassc (2.4.0)
@@ -300,7 +302,7 @@ GEM
300
302
  sprockets (> 3.0)
301
303
  sprockets-rails
302
304
  tilt
303
- sexp_processor (4.15.3)
305
+ sexp_processor (4.16.0)
304
306
  simplecov (0.21.2)
305
307
  docile (~> 1.1)
306
308
  simplecov-html (~> 0.11)
@@ -310,15 +312,16 @@ GEM
310
312
  sprockets (4.0.2)
311
313
  concurrent-ruby (~> 1.0)
312
314
  rack (> 1, < 3)
313
- sprockets-rails (3.2.2)
314
- actionpack (>= 4.0)
315
- activesupport (>= 4.0)
315
+ sprockets-rails (3.4.2)
316
+ actionpack (>= 5.2)
317
+ activesupport (>= 5.2)
316
318
  sprockets (>= 3.0.0)
317
319
  stringex (2.8.5)
320
+ stringio (3.0.1)
318
321
  temple (0.8.2)
319
322
  terrapin (0.6.0)
320
323
  climate_control (>= 0.0.3, < 1.0)
321
- thor (1.1.0)
324
+ thor (1.2.1)
322
325
  tilt (2.0.10)
323
326
  trustygems (0.2.1)
324
327
  rake
@@ -335,7 +338,7 @@ GEM
335
338
  will_paginate (3.3.1)
336
339
  xpath (3.2.0)
337
340
  nokogiri (~> 1.8)
338
- zeitwerk (2.4.2)
341
+ zeitwerk (2.5.4)
339
342
 
340
343
  PLATFORMS
341
344
  x86_64-darwin-18
@@ -359,4 +362,4 @@ DEPENDENCIES
359
362
  trustygems (~> 0.2.0)
360
363
 
361
364
  BUNDLED WITH
362
- 2.2.27
365
+ 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)