Sha256: b902d0a6a0b0d55e1cbe293985c080158e334dafc00b9376385aeecda222f5c9
Contents?: true
Size: 1.91 KB
Versions: 221
Compression:
Stored size: 1.91 KB
Contents
<% sc = @store_config %> <%= render :partial => 'caboose/store/admin_header' %> <p>If calculating order packages automatically, all shippable variants must have dimensions and weights populated. Otherwise, a custom order packages function is required.</p> <p><div id='storeconfig_<%= sc.id %>_auto_calculate_packages' ></div></p> <div id='custom_packages_container' <% if sc.auto_calculate_packages %>style='display: none;'<% end %>> <h3>Custom Order Packages Function</h3> <p><code>def custom_order_packages_function(order) {</code></p> <p><div id='storeconfig_<%= sc.id %>_custom_packages_function' ></div></p> <p><code># This function does not return anything, but creates the Caboose::OrderPackage objects for the given order<br />}</code></p> </div> <%= render :partial => 'caboose/store/admin_footer' %> <% content_for :caboose_js do %> <script type="text/javascript"> $(document).ready(function() { new ModelBinder({ name: 'StoreConfig', id: <%= sc.id %>, update_url: '/admin/store', authenticity_token: '<%= form_authenticity_token %>', attributes: [ { name: 'auto_calculate_packages' , nice_name: 'Automatically Calculate Packages' , type: 'checkbox' , value: <%= raw Caboose.json(sc.auto_calculate_packages ? 1 : 0 ) %>, width: 400 , after_update: function() { toggleCustomPackages(this.value); }}, { name: 'custom_packages_function' , nice_name: 'Custom Packages Function' , type: 'textarea' , value: <%= raw Caboose.json(sc.custom_packages_function ) %>, width: 800, height: 200, fixed_placeholder: false } ] }); }); function toggleCustomPackages(checked) { var el = $('#custom_packages_container'); if (checked) el.slideUp() else el.slideDown(); } </script> <% end %>
Version data entries
221 entries across 221 versions & 1 rubygems