caboose-cms 0.5.112 → 0.5.113
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 +8 -8
 - data/app/controllers/caboose/block_types_controller.rb +1 -0
 - data/app/controllers/caboose/blocks_controller.rb +1 -0
 - data/app/models/caboose/block.rb +8 -0
 - data/app/models/caboose/schema.rb +2 -0
 - data/app/views/caboose/block_types/admin_edit.html.erb +4 -2
 - data/app/views/caboose/blocks/admin_edit.html.erb +1 -1
 - data/app/views/caboose/blocks/admin_edit_advanced.html.erb +11 -0
 - data/lib/caboose/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                MzAyYTgwZTFiYWRkY2ZlZmZhZTAyZmYwZGZlYzE0MWQ3ZmY0MjE2OA==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                OGU1OTZhNDljNzE4MTM3ZGI0NzZlNWMzZTg3MThkOGQ3ODAwOGY1ZA==
         
     | 
| 
       7 
7 
     | 
    
         
             
            SHA512:
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                YWFmM2FmN2JiY2E0N2JhNjBiNWRiNjhhMDY5NDQwMzdjZDEwMTIwMDg2ODNm
         
     | 
| 
      
 10 
     | 
    
         
            +
                MjNjNGI1NjU2NzRmYTllMzA0ZTUxMmIxZGUyMzQ5NjQ0YmRmMzUyNjBiNTMx
         
     | 
| 
      
 11 
     | 
    
         
            +
                MTI4NzY4NGVjY2Q3M2JiOWZkNGQyNzJjMjIxM2E0MzU3NzQ2YWQ=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                NTJkNjc3MGEzNmQ4ZDhlNmRjMzU4ZGZmYmRmOGYwNDBkY2NhNjE3YTE3NWM0
         
     | 
| 
      
 14 
     | 
    
         
            +
                YzEwMDkxNDUyODc3OWM0ZjUwNzZiODI1YTIzMTk3NjEzZWVjY2NjODM0MDE1
         
     | 
| 
      
 15 
     | 
    
         
            +
                YjQ2YmYwZjRlZTVjNmFkZWJmYTdhZGNiMDU1MjA0MTVlMzFjY2M=
         
     | 
| 
         @@ -125,6 +125,7 @@ module Caboose 
     | 
|
| 
       125 
125 
     | 
    
         
             
                      when 'options_function'                then bt.options_function               = v
         
     | 
| 
       126 
126 
     | 
    
         
             
                      when 'options_url'                     then bt.options_url                    = v
         
     | 
| 
       127 
127 
     | 
    
         
             
                      when 'default_constrain'               then bt.default_constrain              = v
         
     | 
| 
      
 128 
     | 
    
         
            +
                      when 'default_full_width'              then bt.default_full_width             = v
         
     | 
| 
       128 
129 
     | 
    
         
             
                      when 'site_id'                         then bt.toggle_site(v[0], v[1])
         
     | 
| 
       129 
130 
     | 
    
         
             
                    end
         
     | 
| 
       130 
131 
     | 
    
         
             
                  end
         
     | 
    
        data/app/models/caboose/block.rb
    CHANGED
    
    | 
         @@ -27,6 +27,7 @@ class Caboose::Block < ActiveRecord::Base 
     | 
|
| 
       27 
27 
     | 
    
         
             
                :block_type_id,
         
     | 
| 
       28 
28 
     | 
    
         
             
                :sort_order,
         
     | 
| 
       29 
29 
     | 
    
         
             
                :constrain,
         
     | 
| 
      
 30 
     | 
    
         
            +
                :full_width,
         
     | 
| 
       30 
31 
     | 
    
         
             
                :name,
         
     | 
| 
       31 
32 
     | 
    
         
             
                :value        
         
     | 
| 
       32 
33 
     | 
    
         | 
| 
         @@ -403,5 +404,12 @@ class Caboose::Block < ActiveRecord::Base 
     | 
|
| 
       403 
404 
     | 
    
         
             
                end
         
     | 
| 
       404 
405 
     | 
    
         
             
                return changed            
         
     | 
| 
       405 
406 
     | 
    
         
             
              end
         
     | 
| 
      
 407 
     | 
    
         
            +
              
         
     | 
| 
      
 408 
     | 
    
         
            +
              def constrain_all         
         
     | 
| 
      
 409 
     | 
    
         
            +
                self.children.each do |b|
         
     | 
| 
      
 410 
     | 
    
         
            +
                  return false if b.full_width == true
         
     | 
| 
      
 411 
     | 
    
         
            +
                end
         
     | 
| 
      
 412 
     | 
    
         
            +
                return true
         
     | 
| 
      
 413 
     | 
    
         
            +
              end
         
     | 
| 
       406 
414 
     | 
    
         | 
| 
       407 
415 
     | 
    
         
             
            end
         
     | 
| 
         @@ -145,6 +145,7 @@ class Caboose::Schema < Caboose::Utilities::Schema 
     | 
|
| 
       145 
145 
     | 
    
         
             
                    [ :block_type_id         , :integer ],
         
     | 
| 
       146 
146 
     | 
    
         
             
                    [ :sort_order            , :integer , { :default => 0 }],
         
     | 
| 
       147 
147 
     | 
    
         
             
                    [ :constrain             , :boolean , { :default => false }],
         
     | 
| 
      
 148 
     | 
    
         
            +
                    [ :full_width            , :boolean , { :default => false }],
         
     | 
| 
       148 
149 
     | 
    
         
             
                    [ :name                  , :string  ],
         
     | 
| 
       149 
150 
     | 
    
         
             
                    [ :value                 , :text    ],
         
     | 
| 
       150 
151 
     | 
    
         
             
                    [ :file                  , :attachment ],
         
     | 
| 
         @@ -171,6 +172,7 @@ class Caboose::Schema < Caboose::Utilities::Schema 
     | 
|
| 
       171 
172 
     | 
    
         
             
                    [ :options_function                , :text    ],
         
     | 
| 
       172 
173 
     | 
    
         
             
                    [ :options_url                     , :string  ],
         
     | 
| 
       173 
174 
     | 
    
         
             
                    [ :default_constrain               , :boolean , { :default => false }],
         
     | 
| 
      
 175 
     | 
    
         
            +
                    [ :default_full_width              , :boolean , { :default => false }],
         
     | 
| 
       174 
176 
     | 
    
         
             
                    [ :share                           , :boolean , { :default => true  }],
         
     | 
| 
       175 
177 
     | 
    
         
             
                    [ :downloaded                      , :boolean , { :default => false }]
         
     | 
| 
       176 
178 
     | 
    
         
             
                  ],
         
     | 
| 
         @@ -31,6 +31,7 @@ bt = @block_type 
     | 
|
| 
       31 
31 
     | 
    
         
             
            <p><div id='blocktype_<%= bt.id %>_allow_child_blocks'              ></div></p>
         
     | 
| 
       32 
32 
     | 
    
         
             
            <p><div id='blocktype_<%= bt.id %>_default_child_block_type_id'     ></div></p>
         
     | 
| 
       33 
33 
     | 
    
         
             
            <p><div id='blocktype_<%= bt.id %>_default_constrain'               ></div></p>
         
     | 
| 
      
 34 
     | 
    
         
            +
            <p><div id='blocktype_<%= bt.id %>_default_full_width'              ></div></p>
         
     | 
| 
       34 
35 
     | 
    
         
             
            <p><div id='blocktype_<%= bt.id %>_render_function'                 ></div></p>
         
     | 
| 
       35 
36 
     | 
    
         
             
            <p><div id='blocktype_<%= bt.id %>_options_function'                ></div></p>
         
     | 
| 
       36 
37 
     | 
    
         | 
| 
         @@ -101,8 +102,9 @@ $(document).ready(function() { 
     | 
|
| 
       101 
102 
     | 
    
         
             
                  { name: 'default'                        , sort: 'default'                        , show: false , bulk_edit: false, nice_name: 'Default value'                  , type: 'text'              , value: function(bt) { return bt.default;                         }, width: 400 },
         
     | 
| 
       102 
103 
     | 
    
         
             
                  { name: 'width'                          , sort: 'width'                          , show: false , bulk_edit: false, nice_name: 'Width'                          , type: 'text'              , value: function(bt) { return bt.width;                           }, width: 400 },
         
     | 
| 
       103 
104 
     | 
    
         
             
                  { name: 'height'                         , sort: 'height'                         , show: false , bulk_edit: false, nice_name: 'Height'                         , type: 'text'              , value: function(bt) { return bt.height;                          }, width: 400 },
         
     | 
| 
       104 
     | 
    
         
            -
                  { name: 'fixed_placeholder'              , sort: 'fixed_placeholder'              , show: false , bulk_edit: false, nice_name: 'Fixed placeholder'              , type: 'checkbox'          , value: function(bt) { return bt.fixed_placeholder;               }, text: function(bt) { return bt.fixed_placeholder 
     | 
| 
       105 
     | 
    
         
            -
                  { name: 'default_constrain'              , sort: 'default_constrain'              , show: false , bulk_edit: false, nice_name: 'Constrain by Default'           , type: 'checkbox'          , value: function(bt) { return bt.default_constrain;               }, text: function(bt) { return bt.default_constrain 
     | 
| 
      
 105 
     | 
    
         
            +
                  { name: 'fixed_placeholder'              , sort: 'fixed_placeholder'              , show: false , bulk_edit: false, nice_name: 'Fixed placeholder'              , type: 'checkbox'          , value: function(bt) { return bt.fixed_placeholder;               }, text: function(bt) { return bt.fixed_placeholder  ? 'Yes' : 'No' }, width: 400 },
         
     | 
| 
      
 106 
     | 
    
         
            +
                  { name: 'default_constrain'              , sort: 'default_constrain'              , show: false , bulk_edit: false, nice_name: 'Constrain by Default'           , type: 'checkbox'          , value: function(bt) { return bt.default_constrain;               }, text: function(bt) { return bt.default_constrain  ? 'Yes' : 'No' }, width: 400 },
         
     | 
| 
      
 107 
     | 
    
         
            +
                  { name: 'default_full_width'             , sort: 'default_full_width'             , show: false , bulk_edit: false, nice_name: 'Full Width by Default'          , type: 'checkbox'          , value: function(bt) { return bt.default_full_width;              }, text: function(bt) { return bt.default_full_width ? 'Yes' : 'No' }, width: 400 },
         
     | 
| 
       106 
108 
     | 
    
         
             
                  { name: 'options_url'                    , sort: 'options_url'                    , show: false , bulk_edit: false, nice_name: 'Options URL'                    , type: 'text'              , value: function(bt) { return bt.options_url;                     }, width: 400 },
         
     | 
| 
       107 
109 
     | 
    
         
             
                  { name: 'options_function'               , sort: 'options_function'               , show: false , bulk_edit: false, nice_name: 'Options Function'               , type: 'textarea'          , value: function(bt) { return bt.options_function;                }, width: 400, height: 100 },
         
     | 
| 
       108 
110 
     | 
    
         
             
                  { name: 'options'                        , sort: 'options'                        , show: false , bulk_edit: false, nice_name: 'Options'                        , type: 'textarea'          , value: function(bt) { return bt.options;                         }, width: 400, height: 100 }            
         
     | 
| 
         @@ -44,7 +44,7 @@ end 
     | 
|
| 
       44 
44 
     | 
    
         
             
              <p><div id='block_<%= @block.id %>_value'></div></p>
         
     | 
| 
       45 
45 
     | 
    
         
             
            <% else %>  
         
     | 
| 
       46 
46 
     | 
    
         
             
              <% if @block.children.count > 0 %>  
         
     | 
| 
       47 
     | 
    
         
            -
                <% @block.children.order(: 
     | 
| 
      
 47 
     | 
    
         
            +
                <% @block.children.order(:sort_order).each do |b| %>
         
     | 
| 
       48 
48 
     | 
    
         
             
                  <% if b.block_type.field_type != 'block' && b.block_type.field_type != 'richtext' %>
         
     | 
| 
       49 
49 
     | 
    
         
             
                    <div style='margin-bottom: 10px;'><div id='block_<%= b.id %>_value'></div></div>
         
     | 
| 
       50 
50 
     | 
    
         
             
                  <% else %>
         
     | 
| 
         @@ -21,6 +21,7 @@ end 
     | 
|
| 
       21 
21 
     | 
    
         
             
              <p><div id='block_<%= @block.id %>_block_type_id' ></div></p>
         
     | 
| 
       22 
22 
     | 
    
         
             
              <p><div id='block_<%= @block.id %>_parent_id'     ></div></p>
         
     | 
| 
       23 
23 
     | 
    
         
             
              <p><div id='block_<%= @block.id %>_constrain'     ></div></p>
         
     | 
| 
      
 24 
     | 
    
         
            +
              <p><div id='block_<%= @block.id %>_full_width'    ></div></p>
         
     | 
| 
       24 
25 
     | 
    
         
             
            </div>
         
     | 
| 
       25 
26 
     | 
    
         
             
            <div id='message'></div>
         
     | 
| 
       26 
27 
     | 
    
         
             
            <p>
         
     | 
| 
         @@ -81,6 +82,16 @@ $(document).ready(function() { 
     | 
|
| 
       81 
82 
     | 
    
         
             
                  after_update: function() { parent.controller.render_blocks(); },
         
     | 
| 
       82 
83 
     | 
    
         
             
                  after_cancel: function() { parent.controller.render_blocks(); },
         
     | 
| 
       83 
84 
     | 
    
         
             
                  on_load: function() { that.modal.autosize(); }
         
     | 
| 
      
 85 
     | 
    
         
            +
                },{ 
         
     | 
| 
      
 86 
     | 
    
         
            +
                  name: 'full_width', 
         
     | 
| 
      
 87 
     | 
    
         
            +
                  nice_name: 'Full Width', 
         
     | 
| 
      
 88 
     | 
    
         
            +
                  type: 'checkbox', 
         
     | 
| 
      
 89 
     | 
    
         
            +
                  value: <%= raw Caboose.json(b.full_width ? 1 : 0) %>, 
         
     | 
| 
      
 90 
     | 
    
         
            +
                  width: 400, 
         
     | 
| 
      
 91 
     | 
    
         
            +
                  fixed_placeholder: true, 
         
     | 
| 
      
 92 
     | 
    
         
            +
                  after_update: function() { parent.controller.render_blocks(); },
         
     | 
| 
      
 93 
     | 
    
         
            +
                  after_cancel: function() { parent.controller.render_blocks(); },
         
     | 
| 
      
 94 
     | 
    
         
            +
                  on_load: function() { that.modal.autosize(); }
         
     | 
| 
       84 
95 
     | 
    
         
             
                }]
         
     | 
| 
       85 
96 
     | 
    
         
             
              });
         
     | 
| 
       86 
97 
     | 
    
         
             
            });    
         
     | 
    
        data/lib/caboose/version.rb
    CHANGED