- @condition_is = Hash[ I18n.t('conditions.is'), "==" ] - @conditions_is = Hash[ I18n.t('conditions.is'), "==", I18n.t('conditions.is_not'), "not==" ] - @conditions = Hash[ I18n.t('conditions.is_not'), "not==", I18n.t('conditions.is_equals_or_greater_than'), ">=", I18n.t('conditions.is_equals_or_less_than'), "<=", I18n.t('conditions.is_greater_than'), ">", I18n.t('conditions.is_less_than'), "<" ] - @delivery_types = Hash[ I18n.t('shipping_method.rule.type.weight').capitalize, 'weight'] #I18n.t('shipping_method.rule.type.geographic_zone').capitalize, 'geo_zone', #I18n.t('shipping_method.rule.type.product_type').capitalize, 'product_type', #I18n.t('shipping_method.rule.type.product').capitalize, 'product' ] = render :partial => 'tabs' = form_for [forgeos_commerce, :admin, transporter], :html => { :id => 'wrap', "data-object_name" => transporter.class.model_name.singular } do |f| .backgrounds.big-header = f.text_field :name, :class => 'field_name' = Forgeos_save_buttons [forgeos_commerce, :admin, :transporter_rules] #content.grid_16.alpha.omega .grid_16.alpha #transporter.grid_12.alpha .inner-content = f.label :description, I18n.t(:description).capitalize = f.text_area :description, :rows => 2 .padding-wrap.grid_10.omega.alpha .type-of-delivery.grid_10 %span.type-delivery-title= "#{I18n.t('transporter.delivery_type').capitalize}:" %div= select_tag 'delivery_type', options_for_select(@delivery_types, ( @delivery_type.nil? ? 'weight' : @delivery_type)), {:onchange => "change_rule_for(this)"} .clear = render :partial => 'delivery_rules', :locals => { :transporter => transporter } = render :partial => 'sidebar', :locals => { :f => f, :transporter => transporter } .clear - id = 'undefined_id' %div.delivery-rule.weight.pattern{ :style => 'display: none' } .inner-delivery-rule %span.span-left= I18n.t('shipping_method.rule.when.weight').capitalize %div= select_tag "shipping_method[#{id}][conds][]", options_for_select(@condition_is.collect{|c| [c[0], c[1]] }+ @conditions.collect{|c| [c[0], c[1]] }) = text_field_tag "shipping_method[#{id}][values][]" %span.span-left.unit= t(:short, :scope => [:unit, :weight]) %span.span-left= I18n.t(:and) %div= select_tag "shipping_method[#{id}][conds][]", options_for_select(@condition_is.collect{|c| [c[0], c[1]] }+ @conditions.collect{|c| [c[0], c[1]] }) = text_field_tag "shipping_method[#{id}][values][]" %span.span-left.unit= t(:short, :scope => [:unit, :weight]) %span.span-left= I18n.t('shipping_method.rule.shipping_is').capitalize = text_field_tag "shipping_method[#{id}][price][]" %span.span-left.unit= current_currency.html .clear = link_to_function '', "remove_delivery_rule(this)", :class => 'small-icons red-minus' = link_to_function '', "add_delivery_rule('weight')", :class => 'small-icons add-green-plus' .clear //%div.delivery-rule.geo_zone.pattern{ :style => 'display: none' } // .inner-delivery-rule // %span.span-left= I18n.t('shipping_method.rule.when.geographic_zone').capitalize // %div= select_tag "shipping_method[#{id}][conds][]", options_for_select(@conditions_is.collect{|c| [c[0], c[1]] }) // %div= select_tag "shipping_method[#{id}][values][]", options_for_select(@geo_zones) // %span.span-left= I18n.t('shipping_method.rule.shipping_is').capitalize // = text_field_tag "shipping_method[#{id}][price][]" // %span.span-left.unit= current_currency.html // .clear // = link_to_function '', "remove_delivery_rule(this)", :class => 'small-icons red-minus' // = link_to_function '', "add_delivery_rule('geo_zone')", :class => 'small-icons add-green-plus' // .clear // // //%div.delivery-rule.product_type.pattern{ :style => 'display: none' } // .inner-delivery-rule // %span.span-left= I18n.t('shipping_method.rule.when.product_type').capitalize // %div= select_tag "shipping_method[#{id}][conds][]", options_for_select(@conditions_is.collect{|c| [c[0], c[1]] }) // %div= select_tag "shipping_method[#{id}][values][]", options_for_select(@product_types) // %span.span-left= I18n.t('shipping_method.rule.shipping_is').capitalize // = text_field_tag "shipping_method[#{id}][price][]" // %span.span-left.unit= current_currency.html // .clear // = link_to_function '', "remove_delivery_rule(this)", :class => 'small-icons red-minus' // = link_to_function '', "add_delivery_rule('product_type')", :class => 'small-icons add-green-plus' // .clear // // //%div.delivery-rule.product.pattern{ :style => 'display: none' } // .inner-delivery-rule // %span.span-left= I18n.t('shipping_method.rule.when.product').capitalize // %div= select_tag "shipping_method[#{id}][conds][]", options_for_select(@conditions_is.collect{|c| [c[0], c[1]] }) // //%div= select_tag "shipping_method[#{id}][values][]", options_from_collection_for_select(Product.all, :id, :name) // %span.span-left= I18n.t('shipping_method.rule.shipping_is').capitalize // = text_field_tag "shipping_method[#{id}][price][]" // %span.span-left.unit= current_currency.html // .clear // = link_to_function '', "remove_delivery_rule(this)", :class => 'small-icons red-minus' // = link_to_function '', "add_delivery_rule('product')", :class => 'small-icons add-green-plus' // .clear