caboose-cms 0.9.89 → 0.9.90

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
  SHA1:
3
- metadata.gz: 420a543a2ca1c9d7c9c08ed6adb1d374ba2348a5
4
- data.tar.gz: 8b1cad05af17a22e26079a63ca7b7839ee805721
3
+ metadata.gz: 8db1d5dd7b28bb3c07904747001fc0057bcbd240
4
+ data.tar.gz: 0441edec2da5b23eeb8791ae95412b5d67c3aed2
5
5
  SHA512:
6
- metadata.gz: 4ea861e40fdf395fc74c0180b69ea281926d9e92bf5e132665d92108f8d8af19fbfc72aff2871ecc8be8561e7f8ccb56c7a80d2dfe3baa182a21cd213956d5f4
7
- data.tar.gz: d8f04575ef719163e43ae6f4183899d73e80af3b9e359c19f9b007a46a4defb27c19e2e8f57125274bc43ae8d10f98ae3332d2249894e77ccb68b99ce4c61d91
6
+ metadata.gz: e6cab2ac89d12cceeb46d228c5390c4897769caea0eb5c550c7774047c373de126ac3c8521efea95966abfa89bc582bc2b7a59ec00f7e0e4c84bf23aaf426d62
7
+ data.tar.gz: 8a6895eb6dc5b837a80f52726d8cd9c8dad6fd82b4c0fe1ecf619138c68a7b88e53eaffc925e4f3ef57b908b9f9a32a6323f420346db9f2da153ebca52807b3d
@@ -21,7 +21,7 @@ module Caboose
21
21
  # @route GET /admin/pages/:page_id/blocks
22
22
  # @route GET /admin/posts/:post_id/blocks
23
23
  def admin_index
24
- return if !user_is_allowed('pages', 'view')
24
+ return if !user_is_allowed("#{page_or_post}s", 'view')
25
25
  #h = params[:post_id] ? { :post_id => params[:post_id] } : { :page_id => params[:page_id] }
26
26
  #blocks = Block.where(h).reorder(:sort_order)
27
27
  #render :json => blocks
@@ -33,7 +33,7 @@ module Caboose
33
33
  # @route GET /admin/posts/:post_id/blocks/:id/new
34
34
  # @route GET /admin/posts/:post_id/blocks/new
35
35
  def admin_new
36
- return unless user_is_allowed('pages', 'add')
36
+ return unless user_is_allowed("#{page_or_post}s", 'add')
37
37
 
38
38
  if params[:id]
39
39
  block_type_id = params[:block_type_id]
@@ -72,7 +72,7 @@ module Caboose
72
72
  # @route GET /admin/posts/:post_id/blocks/tree
73
73
  # @route GET /admin/posts/:post_id/blocks/:id/tree
74
74
  def admin_tree
75
- return unless user_is_allowed('pages', 'edit')
75
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
76
76
 
77
77
  blocks = []
78
78
  if params[:id]
@@ -163,7 +163,7 @@ module Caboose
163
163
  # @route PUT /admin/pages/:page_id/blocks/:id/remove-media
164
164
  # @route PUT /admin/posts/:post_id/blocks/:id/remove-media
165
165
  def admin_remove_media
166
- return unless user_is_allowed('pages', 'edit')
166
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
167
167
  resp = Caboose::StdClass.new
168
168
  b = Block.find(params[:id])
169
169
  b.media = nil
@@ -174,7 +174,7 @@ module Caboose
174
174
  # @route GET /admin/pages/:page_id/blocks/:id/render
175
175
  # @route GET /admin/posts/:post_id/blocks/:id/render
176
176
  def admin_render
177
- return unless user_is_allowed('pages', 'edit')
177
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
178
178
  b = Block.find(params[:id])
179
179
  bt = b.block_type
180
180
  if bt.nil?
@@ -204,7 +204,7 @@ module Caboose
204
204
  # @route GET /admin/pages/:page_id/blocks/render
205
205
  # @route GET /admin/posts/:post_id/blocks/render
206
206
  def admin_render_all
207
- return unless user_is_allowed('pages', 'edit')
207
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
208
208
  blocks = Block.where("#{page_or_post}_id = ? and parent_id is null", @p.id).reorder(:sort_order).collect do |b|
209
209
  {
210
210
  :id => b.id,
@@ -234,7 +234,7 @@ module Caboose
234
234
  # @route GET /admin/pages/:page_id/blocks/render-second-level
235
235
  # @route GET /admin/posts/:post_id/blocks/render-second-level
236
236
  def admin_render_second_level
237
- return unless user_is_allowed('pages', 'edit')
237
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
238
238
  view = ActionView::Base.new(ActionController::Base.view_paths)
239
239
  blocks = @p.block.children.collect do |b|
240
240
  {
@@ -266,7 +266,7 @@ module Caboose
266
266
  # @route GET /admin/pages/:page_id/blocks/:id/edit
267
267
  # @route GET /admin/posts/:post_id/blocks/:id/edit
268
268
  def admin_edit
269
- return unless user_is_allowed('pages', 'edit')
269
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
270
270
  @page = Page.find(params[:page_id]) if params[:page_id]
271
271
  @post = Post.find(params[:post_id]) if params[:post_id]
272
272
  @block = Block.find(params[:id])
@@ -296,7 +296,7 @@ module Caboose
296
296
  # @route GET /admin/pages/:page_id/blocks/:id/advanced
297
297
  # @route GET /admin/posts/:post_id/blocks/:id/advanced
298
298
  def admin_edit_advanced
299
- return unless user_is_allowed('pages', 'edit')
299
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
300
300
  @page = Page.find(params[:page_id]) if params[:page_id]
301
301
  @post = Post.find(params[:post_id]) if params[:post_id]
302
302
  @block = Block.find(params[:id])
@@ -307,7 +307,7 @@ module Caboose
307
307
  # @route GET /admin/pages/:page_id/blocks/:id
308
308
  # @route GET /admin/posts/:post_id/blocks/:id
309
309
  def admin_show
310
- return unless user_is_allowed('pages', 'edit')
310
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
311
311
  block = Block.find(params[:id])
312
312
  render :json => block
313
313
  end
@@ -317,7 +317,7 @@ module Caboose
317
317
  # @route POST /admin/posts/:post_id/blocks
318
318
  # @route POST /admin/posts/:post_id/blocks/:id
319
319
  def admin_create
320
- return unless user_is_allowed('pages', 'edit')
320
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
321
321
 
322
322
  resp = Caboose::StdClass.new
323
323
 
@@ -416,7 +416,7 @@ module Caboose
416
416
  # @route PUT /admin/pages/:page_id/blocks/:id
417
417
  # @route PUT /admin/posts/:post_id/blocks/:id
418
418
  def admin_update
419
- return unless user_is_allowed('pages', 'edit')
419
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
420
420
 
421
421
  resp = StdClass.new({'attributes' => {}})
422
422
  b = Block.find(params[:id])
@@ -477,7 +477,7 @@ module Caboose
477
477
  # @route POST /admin/pages/:page_id/blocks/:id/image
478
478
  # @route POST /admin/posts/:post_id/blocks/:id/image
479
479
  def admin_update_image
480
- return unless user_is_allowed('pages', 'edit')
480
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
481
481
 
482
482
  resp = StdClass.new({'attributes' => {}})
483
483
  b = Block.find(params[:id])
@@ -499,7 +499,7 @@ module Caboose
499
499
  # @route POST /admin/pages/:page_id/blocks/:id/file
500
500
  # @route POST /admin/posts/:post_id/blocks/:id/file
501
501
  def admin_update_file
502
- return unless user_is_allowed('pages', 'edit')
502
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
503
503
 
504
504
  resp = StdClass.new({'attributes' => {}})
505
505
  b = Block.find(params[:id])
@@ -521,7 +521,7 @@ module Caboose
521
521
  # @route DELETE /admin/pages/:page_id/blocks/:id
522
522
  # @route DELETE /admin/posts/:post_id/blocks/:id
523
523
  def admin_delete
524
- return unless user_is_allowed('pages', 'edit')
524
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
525
525
 
526
526
  resp = StdClass.new
527
527
  b = Block.find(params[:id])
@@ -552,7 +552,7 @@ module Caboose
552
552
  # @route PUT /admin/pages/:page_id/blocks/:id/duplicate
553
553
  # @route PUT /admin/posts/:post_id/blocks/:id/duplicate
554
554
  def admin_duplicate
555
- return unless user_is_allowed('pages', 'edit')
555
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
556
556
  resp = StdClass.new
557
557
  b = Block.find(params[:id])
558
558
  resp.new_id = b.duplicate_block(@site.id, params[:page_id], params[:post_id], b.block_type_id, b.parent_id)
@@ -563,7 +563,7 @@ module Caboose
563
563
  # @route GET /admin/pages/:page_id/blocks/:id/api-info
564
564
  # @route GET /admin/posts/:post_id/blocks/:id/api-info
565
565
  def admin_block_info
566
- return unless user_is_allowed('pages', 'edit')
566
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
567
567
  resp = StdClass.new
568
568
  b = Block.find(params[:id])
569
569
  bt = b.block_type if b
@@ -577,7 +577,7 @@ module Caboose
577
577
  # @route GET /admin/pages/:page_id/blocks/:id/parent-block
578
578
  # @route GET /admin/posts/:post_id/blocks/:id/parent-block
579
579
  def admin_parent_block
580
- return unless user_is_allowed('pages', 'edit')
580
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
581
581
  resp = StdClass.new
582
582
  b = Block.find(params[:id])
583
583
  resp.parent_id = b.parent_id if b && b.parent && b.parent.name.blank?
@@ -588,7 +588,7 @@ module Caboose
588
588
  # @route POST /admin/pages/:page_id/blocks/:id/move
589
589
  # @route POST /admin/posts/:post_id/blocks/:id/move
590
590
  def admin_move
591
- return unless user_is_allowed('pages', 'edit')
591
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
592
592
  resp = StdClass.new
593
593
  b = Block.find(params[:id])
594
594
  if params[:before_id] && !params[:before_id].blank?
@@ -621,7 +621,7 @@ module Caboose
621
621
  # @route PUT /admin/pages/:page_id/blocks/:id/move-up
622
622
  # @route PUT /admin/posts/:post_id/blocks/:id/move-up
623
623
  def admin_move_up
624
- return unless user_is_allowed('pages', 'edit')
624
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
625
625
 
626
626
  resp = StdClass.new
627
627
  b = Block.find(params[:id])
@@ -637,7 +637,7 @@ module Caboose
637
637
  # @route PUT /admin/pages/:page_id/blocks/:id/move-down
638
638
  # @route PUT /admin/posts/:post_id/blocks/:id/move-down
639
639
  def admin_move_down
640
- return unless user_is_allowed('pages', 'edit')
640
+ return unless user_is_allowed("#{page_or_post}s", 'edit')
641
641
 
642
642
  resp = StdClass.new
643
643
  b = Block.find(params[:id])
@@ -16,6 +16,15 @@
16
16
 
17
17
  <%= render :partial => 'caboose/posts/admin_footer' %>
18
18
 
19
+ <% content_for :caboose_css do %>
20
+ <style>
21
+ #content2 p input[type="checkbox"] {
22
+ top: 10px;
23
+ margin-right: 5px;
24
+ }
25
+ </style>
26
+ <% end %>
27
+
19
28
  <% content_for :caboose_js do %>
20
29
  <%= javascript_include_tag "caboose/model/all" %>
21
30
  <script type='text/javascript'>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.89'
2
+ VERSION = '0.9.90'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.89
4
+ version: 0.9.90
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-14 00:00:00.000000000 Z
11
+ date: 2017-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg