Sha256: 791ac2c4cb8ee8869f8458fc583bd43c94ec5790175e94b0beec545c172cccda

Contents?: true

Size: 1.43 KB

Versions: 387

Compression:

Stored size: 1.43 KB

Contents

<h1>Custom Fields</h1>
<% @page.page_custom_field_values.each do |fv| %>
  <p><div id='pagecustomfieldvalue_<%= fv.id %>_value'></div></p>
<% end %>

<p><input type='button' value='Close' onclick="modal.close();" /></p>

<% content_for :caboose_js do %>
<%= javascript_include_tag "caboose/model/all" %>
<script type='text/javascript'>

var modal = false;
$(window).load(function() {
  modal = new CabooseModal(800);
  setTimeout(function() { modal.autosize(); }, 1000);
});

$(document).ready(function() {  
  <% @page.page_custom_field_values.each do |fv| %>
    <% f = fv.page_custom_field %>
    new ModelBinder({
      name: 'PageCustomFieldValue',
      id: <%= fv.id %>,
      update_url: '/admin/page-custom-field-values/<%= fv.id %>',
      authenticity_token: '<%= form_authenticity_token %>',
      attributes: [
        {
          name:      'value',
          nice_name: <%= raw Caboose.json(f.name) %>,
          type:      <%= raw Caboose.json(f.field_type) %>,
          value:     <%= raw Caboose.json(fv.value) %>,
          width:     600,
          after_update: function() { parent.controller.render_blocks(); },
          after_cancel: function() { parent.controller.render_blocks(); }
          <% if f.field_type == 'select' %>, options_url: '/admin/page-custom-fields/<%= f.id %>/options'<% end %>
        }                    
      ],
      on_load: function() { if (modal) modal.autosize(); }
    });
  <% end %>
});

</script>
<% end %>

Version data entries

387 entries across 387 versions & 1 rubygems

Version Path
caboose-cms-0.9.229 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-1.0.2 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-1.0.1 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.228 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.227 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.226 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.225 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.224 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.223 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.222 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.221 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.220 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.219 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.218 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.217 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.216 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.215 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.214 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.213 app/views/caboose/pages/admin_edit_custom_fields.html.erb
caboose-cms-0.9.212 app/views/caboose/pages/admin_edit_custom_fields.html.erb