|
| 1 | +<%= render 'spree/admin/shared/sub_menu/configuration' %> |
| 2 | + |
| 3 | +<% content_for :page_title do %> |
| 4 | + <%= Spree.t(:shapco_settings) %> |
| 5 | +<% end %> |
| 6 | + |
| 7 | +<div id="preferences" data-hook> |
| 8 | + <%- if @error %> |
| 9 | + <div class="alert alert-danger"> |
| 10 | + <%= Spree.t(:shapco_api_error, message: @error.message) %> |
| 11 | + </div> |
| 12 | + <%- end %> |
| 13 | + |
| 14 | + <h6>WSDL URL: <%=@savon[:wsdl] %></h6> |
| 15 | + <%= form_tag admin_shapco_settings_path, method: :put do %> |
| 16 | + <div class="row"> |
| 17 | + <div class="col-md-12"> |
| 18 | + <fieldset class="no-border-bottom"> |
| 19 | + <legend><%= Spree.t(:shapco_api_credentials)%></legend> |
| 20 | + <%- @credential_fields.each do |key| %> |
| 21 | + <%- type = Spree::Config.preference_type(key) %> |
| 22 | + <div class="form-group"> |
| 23 | + <%= label_tag(key, Spree.t(key)) + tag(:br) if type != :boolean %> |
| 24 | + <%= preference_field_tag(key, Spree::Config[key], type: type) %> |
| 25 | + <%= label_tag(key, Spree.t(key)) + tag(:br) if type == :boolean %> |
| 26 | + </div> |
| 27 | + <% end %> |
| 28 | + </fieldset> |
| 29 | + </div> |
| 30 | + </div> |
| 31 | + |
| 32 | + <div class="form-buttons" data-hook="buttons"> |
| 33 | + <%= button Spree.t('actions.update'), 'refresh' %> |
| 34 | + <span class="or"><%= Spree.t(:or) %></span> |
| 35 | + <%= button_link_to Spree.t('actions.cancel'), edit_admin_shapco_settings_url, icon: 'delete' %> |
| 36 | + </div> |
| 37 | + <% end %> |
| 38 | + |
| 39 | + <br /> |
| 40 | + <br /> |
| 41 | + <div class="row"> |
| 42 | + <div class="col-md-12"> |
| 43 | + <%- if @shipping_categories %> |
| 44 | + Shapco sync is enabled for the following shipping categories: |
| 45 | + <ul> |
| 46 | + <%- @shipping_categories.each do |cat| %> |
| 47 | + <li><%= link_to cat.name, edit_admin_shipping_category_path(cat) %></li> |
| 48 | + <%- end %> |
| 49 | + </ul> |
| 50 | + <%- else %> |
| 51 | + Shapco sync is not enabled for any shipping categories. |
| 52 | + <%- end %> |
| 53 | + Enable Shapco sync on the <%=link_to 'shipping categories admin page', admin_shipping_categories_path %>. |
| 54 | + </div> |
| 55 | + </div> |
| 56 | +</div> |
| 57 | + |
| 58 | + |
0 commit comments