Refactor supplier settings

This commit is contained in:
2014-07-16 17:41:43 +02:00
parent a302123c6b
commit 2fec0b3bb6
31 changed files with 311 additions and 49 deletions
+3
View File
@@ -15,6 +15,9 @@ html lang="en"
= render 'suppliers/application/head'
= javascript_include_tag "supplier/foundation1/application"
= yield :head
= javascript_include_tag "https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places&language=#{I18n.locale}"
javascript:
supplier_id="#{current_supplier.id}";
body
= render 'suppliers/application/top_menu'
+2 -2
View File
@@ -1,7 +1,7 @@
- content_for :head do
= javascript_include_tag "https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places&language=#{I18n.locale}"
= javascript_include_tag 'supplier/app/application'
= form_for @supplier, url: supplier_update_settings_path, html: {class: 'form-horizontal'} do |f|
/= form_for @supplier, url: supplier_update_settings_path, html: {class: 'form-horizontal'} do |f|
= render 'suppliers/application/error_messages', target: current_supplier
.control-group class=(@supplier.errors[:name].any? ? 'error' : nil)
= f.label :name, class: 'control-label'
@@ -5,12 +5,12 @@ header.top-menu
section.main-buttons
//li= link_to t('supplier.menu.active_orders', orders: Order.model_name.human_plural), supplier_active_orders_path
//li= link_to t('supplier.menu.active_lists', lists: List.model_name.human_plural), supplier_active_lists_path
= link_to image_tag('icons/logo-small.png'), supplier_root_path
= link_to ProductCategory.model_name.human_plural, suppliers_product_categories_path, data: {t: 'models.plural.product_category'}
= link_to Product.model_name.human_plural, suppliers_products_path, data: {t: 'models.plural.product'}
= link_to Section.model_name.human_plural, suppliers_sections_path, data: {t: 'models.plural.section'}
= link_to Table.model_name.human_plural, suppliers_tables_path, data: {t: 'models.plural.table'}
= link_to List.model_name.human_plural, suppliers_lists_path, data: {t: 'models.plural.list'}
= link_to image_tag('icons/logo-small.png'), supplier_root_path, class: 'top-menu-root'
= link_to ProductCategory.model_name.human_plural, suppliers_product_categories_path, data: {t: 'models.plural.product_category'}, class: 'top-menu-product_categories'
= link_to Product.model_name.human_plural, suppliers_products_path, data: {t: 'models.plural.product'}, class: 'top-menu-products'
= link_to Section.model_name.human_plural, suppliers_sections_path, data: {t: 'models.plural.section'}, class: 'top-menu-sections'
= link_to Table.model_name.human_plural, suppliers_tables_path, data: {t: 'models.plural.table'}, class: 'top-menu-tables'
= link_to List.model_name.human_plural, suppliers_lists_path, data: {t: 'models.plural.list'}, class: 'top-menu-lists'
section.extra-info
.supplier-info-row
.supplier-name= current_supplier.name.presence || current_supplier.email
@@ -29,9 +29,9 @@ aside.side-menu
- if current_supplier.open?
li
= form_tag supplier_mark_as_closed_path do
= submit_tag t('supplier.close'), class: [:btn, 'btn-danger'], onClick: %|$(this).parents('form').submit()|
li= link_to 'Settings', supplier_settings_path
li= link_to 'Logout', destroy_supplier_session_path, method: :delete
= submit_tag t('supplier.close'), class: 'supplier-close-shop', onClick: %|$(this).parents('form').submit()|
li= link_to 'Settings', supplier_settings_path, class: 'supplier-settings-link'
li= link_to 'Logout', destroy_supplier_session_path, method: :delete, class: 'supplier-sign-out-link'
/.navbar.navbar-fixed-top.navbar-inverse
.navbar-inner
.container
@@ -4,6 +4,9 @@ h2= t('devise.sessions.title')
= f.row :email do
.form-label= f.label :email
.form-field= f.email_field :email
= f.row :email do
.form-label= f.label :password, class: 'control-label'
.form-field= f.password_field :password
.form-row
= f.label :remember_me do
= f.check_box :remember_me