diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index dab1fa6..24a8b80 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -49,6 +49,7 @@ class ApplicationController < ActionController::Base end end + set_breadcrumb end @@ -543,5 +544,26 @@ class ApplicationController < ActionController::Base @dropdown_title = "Parametrage" end + def set_breadcrumb + @result = {} + if @qi_menu_active.present? + current_menu = @qi_menus[@qi_menu_active] + current_controller = controller_name.to_sym + @action = action_name.to_sym + @result[:first] = {name: current_menu[:name], link: current_menu[:link]} + if current_menu[:elements][current_controller] + @result[:second] = current_menu[:elements][current_controller] + elsif current_menu[:elements][:p_preferences_products_menu] && current_menu[:elements][:p_preferences_products_menu][:sub_elements][current_controller] + @result[:second] = current_menu[:elements][:p_preferences_products_menu][:sub_elements][current_controller] + else + @result[:second] = nil + end + if @result[:second] + if @result[:first][:name] == @result[:second][:name] + @result[:second] = nil + end + end + end + end end diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb new file mode 100644 index 0000000..2e2800d --- /dev/null +++ b/app/helpers/breadcrumb_helper.rb @@ -0,0 +1,74 @@ +# DOC : +# ajouter =breadcrumb dans une vue +# pour personaliser le breadcrumb, il y a plusieurs options : +# passer un ou plusieurs parametre piur overrider l'existant par défaut +# :first_title premier element du breadcrumb +# :first_link premier path du breadcrumb +# +# :second_title second element du breadcrumb +# :second_link second path du breadcrumb +# +# :last_element le tout dernier element du breadcrumb +# +# :record est le nom du record pour un show ou un edit par exemple :record => @p_product.name +# +# :default_crud booléen qui active/neutralise la création du titre "Détail de .." ou "Modification .." + + +module BreadcrumbHelper + def breadcrumb(opts = {}) + default_opts = { + action: @action, + first_title: @result[:first][:name], + first_link: @result[:first][:link], + default_crud: true + } + + if @result[:second] + default_opts[:second_title] = @result[:second][:name] + default_opts[:second_link] = @result[:second][:link] + end + + options = default_opts.merge opts + + + capture_haml do + haml_tag :h1 do + unless @result.present? + haml_concat "Erreur dans le BreadcrumbHelper" + else + if options[:record].present? || options[:last_element].present? + haml_concat(link_to options[:first_title], options[:first_link]) + if options[:second_title].present? && options[:second_link].present? + haml_tag(:span) { haml_concat(link_to options[:second_title], options[:second_link]) } + elsif options[:second_title].present? + haml_tag(:span) {haml_concat( options[:second_title])} + end + else + if options[:second_title].present? + haml_concat(link_to options[:first_title], options[:first_link]) + haml_tag(:span) { haml_concat( options[:second_title]) } + else + haml_concat( options[:first_title]) + end + end + if options[:default_crud] + case options[:action] + when :new + haml_tag(:span) {haml_concat("Création #{options[:first_title].singularize.downcase}")} + when :edit + options[:record].present? ? haml_tag(:span) {haml_concat("Modification de : #{options[:record]}")} : haml_tag(:span) {haml_concat("Modification")} + when :index + haml_tag(:span) {haml_concat("Liste")} + when :show + options[:record].present? ? haml_tag(:span) {haml_concat("Détail de : #{options[:record]}")} : haml_tag(:span) {haml_concat("Détail")} + else + haml_tag(:span) {haml_concat(options[:record])} if options[:record].present? + end + end + haml_tag(:span) { haml_concat( options[:last_element]) } if options[:last_element].present? + end + end + end + end +end diff --git a/app/models/p_product_ref.rb b/app/models/p_product_ref.rb index a4ef1e7..6da7f5f 100644 --- a/app/models/p_product_ref.rb +++ b/app/models/p_product_ref.rb @@ -13,6 +13,8 @@ class PProductRef < ApplicationRecord belongs_to :p_product_color + has_many :line_stocks + has_many :p_articles has_many :p_article_serial_nums, through: :p_articles accepts_nested_attributes_for :p_article_serial_nums, allow_destroy: true diff --git a/app/views/admin/buy_lists/index.html.haml b/app/views/admin/buy_lists/index.html.haml index 99755ae..1b6896d 100644 --- a/app/views/admin/buy_lists/index.html.haml +++ b/app/views/admin/buy_lists/index.html.haml @@ -2,9 +2,7 @@ .qi_header .right =link_to ic(:plus)+" Demande de commande", admin_p_customers_path(:offre => true), :class => "btn btn-primary btn-ap-add" - - %h1 - Tableaux de bord achats + = breadcrumb .qi_search_row diff --git a/app/views/admin/line_stocks/index.html.haml b/app/views/admin/line_stocks/index.html.haml index 0658b45..7360c8e 100644 --- a/app/views/admin/line_stocks/index.html.haml +++ b/app/views/admin/line_stocks/index.html.haml @@ -4,8 +4,7 @@ = link_to ic(:minus)+' Sortie de stock', new_admin_stock_movement_path(:movement_type => "deb"), :class => "btn btn-primary bgbd-documents", :remote => true = link_to ic(:plus)+' Entrée de stock', new_admin_stock_movement_path(:movement_type => "cred"), :class => "btn btn-primary bgbd-documents", :remote => true - %h1 - Mouvements de stocks + = breadcrumb diff --git a/app/views/admin/p_article_serial_nums/index.html.haml b/app/views/admin/p_article_serial_nums/index.html.haml index 0c3ea96..e5f732a 100644 --- a/app/views/admin/p_article_serial_nums/index.html.haml +++ b/app/views/admin/p_article_serial_nums/index.html.haml @@ -1,7 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter', new_admin_p_article_serial_num_path(), :class => "btn btn-primary btn-ap-add", :remote => true - %h1 - =PArticleSerialNum.human rescue "" + =breadcrumb diff --git a/app/views/admin/p_articles/_p_article.html.haml b/app/views/admin/p_articles/_p_article.html.haml index be0c6ca..7368263 100644 --- a/app/views/admin/p_articles/_p_article.html.haml +++ b/app/views/admin/p_articles/_p_article.html.haml @@ -33,7 +33,7 @@ %td.actions = link_to i(:"trash-o"), [:admin, p_article], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true = link_to i(:pencil), edit_admin_p_article_path(p_article), :remote => true - = link_to i(:eye), admin_p_article_path(p_article), :remote => true + =# link_to i(:eye), admin_p_article_path(p_article), :remote => true diff --git a/app/views/admin/p_articles/index.html.haml b/app/views/admin/p_articles/index.html.haml index f889055..06a75be 100644 --- a/app/views/admin/p_articles/index.html.haml +++ b/app/views/admin/p_articles/index.html.haml @@ -1,7 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter', new_admin_p_article_path(), :class => "btn btn-primary btn-ap-add", :remote => true - %h1 - =PArticle.human rescue "" + =breadcrumb diff --git a/app/views/admin/p_compta_exports/index.html.haml b/app/views/admin/p_compta_exports/index.html.haml index 381dcf9..0371115 100644 --- a/app/views/admin/p_compta_exports/index.html.haml +++ b/app/views/admin/p_compta_exports/index.html.haml @@ -1,9 +1,6 @@ .qi_header .right= link_to 'Ajouter un export', new_admin_p_compta_export_path(), :class => "btn btn-primary", :remote => true - %h1 - Stats - %span - Exports comptable + = breadcrumb @@ -30,4 +27,4 @@ %tbody#p_compta_exports_rows =render @p_compta_exports - \ No newline at end of file + diff --git a/app/views/admin/p_customer_cats/index.html.haml b/app/views/admin/p_customer_cats/index.html.haml index a447feb..ae53751 100644 --- a/app/views/admin/p_customer_cats/index.html.haml +++ b/app/views/admin/p_customer_cats/index.html.haml @@ -1,9 +1,6 @@ .qi_header .right= link_to 'Ajouter une catégorie', new_admin_p_customer_cat_path(), :class => "btn btn-primary", :remote => true - %h1 - Produits - %span - Catégories + =breadcrumb .qi_row @@ -18,4 +15,4 @@ %tbody#p_customer_cats_rows =render @p_customer_cats - \ No newline at end of file + diff --git a/app/views/admin/p_customer_sheets/edit.html.haml b/app/views/admin/p_customer_sheets/edit.html.haml index 604e1fa..0f8df99 100644 --- a/app/views/admin/p_customer_sheets/edit.html.haml +++ b/app/views/admin/p_customer_sheets/edit.html.haml @@ -1,10 +1,5 @@ .qi_header - %h1 - Ventes - %span - =link_to "Demandes de commande", admin_p_customer_sheets_path() - %span - Modifier une demande + = breadcrumb diff --git a/app/views/admin/p_customer_sheets/index.html.haml b/app/views/admin/p_customer_sheets/index.html.haml index afbae90..b8341f9 100644 --- a/app/views/admin/p_customer_sheets/index.html.haml +++ b/app/views/admin/p_customer_sheets/index.html.haml @@ -1,10 +1,7 @@ .qi_header .right =link_to ic(:plus)+" Demande de commande", admin_p_customers_path(:offre => true), :class => "btn btn-primary btn-ap-add" - %h1 - Ventes - %span - Demandes de commande + = breadcrumb .qi_search_row diff --git a/app/views/admin/p_customer_sheets/show.html.haml b/app/views/admin/p_customer_sheets/show.html.haml index 57031b4..1b37292 100644 --- a/app/views/admin/p_customer_sheets/show.html.haml +++ b/app/views/admin/p_customer_sheets/show.html.haml @@ -12,12 +12,7 @@ = link_to i(:pencil), edit_admin_p_customer_sheet_path(@p_customer_sheet), :remote => false - %h1 - Ventes - %span - =link_to "Demande de commandes",admin_p_customer_sheets_path - %span - ="#{@p_customer_sheet.com_counter}" + = breadcrumb .qi_row @@ -114,4 +109,4 @@ =render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @price_documents} - \ No newline at end of file + diff --git a/app/views/admin/p_customers/edit.html.haml b/app/views/admin/p_customers/edit.html.haml index 4f29362..d2c283d 100644 --- a/app/views/admin/p_customers/edit.html.haml +++ b/app/views/admin/p_customers/edit.html.haml @@ -1,10 +1,5 @@ .qi_header - %h1 - Ventes - %span - =link_to "Clients", admin_p_customers_path - %span - Modifier un client + =breadcrumb record: @p_customer.name = render 'form' diff --git a/app/views/admin/p_customers/index.html.haml b/app/views/admin/p_customers/index.html.haml index af02f16..10ae05d 100644 --- a/app/views/admin/p_customers/index.html.haml +++ b/app/views/admin/p_customers/index.html.haml @@ -4,13 +4,13 @@ -if current_admin.has_permission?("customers-c") .right= link_to ic(:plus)+' Ajouter un client', new_admin_p_customer_path(), :class => "btn btn-primary btn-ap-add", :remote => false + =breadcrumb -else .right - =link_to "< Retour aux demandes de commande", admin_p_customer_sheets_path + =link_to "< Retour aux commandes", admin_p_customer_sheets_path + =breadcrumb first_title: "Commandes" , first_link: admin_p_customer_sheets_path ,second_title: "Demande de commande", last_element: 'Selectioner un client', default_crud: false - %h1 - Clients - + diff --git a/app/views/admin/p_customers/new.html.haml b/app/views/admin/p_customers/new.html.haml index a3ca07d..99210cb 100644 --- a/app/views/admin/p_customers/new.html.haml +++ b/app/views/admin/p_customers/new.html.haml @@ -1,10 +1,5 @@ .qi_header - %h1 - Ventes - %span - =link_to "Clients", admin_p_customers_path - %span - Créer un nouveau client + =breadcrumb = render 'form' diff --git a/app/views/admin/p_customers/show.html.haml b/app/views/admin/p_customers/show.html.haml index deab7df..ea0dbf2 100644 --- a/app/views/admin/p_customers/show.html.haml +++ b/app/views/admin/p_customers/show.html.haml @@ -3,15 +3,7 @@ = link_to i(:pencil), edit_admin_p_customer_path(@p_customer), :remote => false - - %h1 - Clients - %span - Détail d'un client - %span - =link_to [:admin, @p_customer] do - =@p_customer.code - =@p_customer.show_name + =breadcrumb record: @p_customer.name @@ -294,4 +286,4 @@ - \ No newline at end of file + diff --git a/app/views/admin/p_fournisseurs/index.html.haml b/app/views/admin/p_fournisseurs/index.html.haml index 3423253..ef18615 100644 --- a/app/views/admin/p_fournisseurs/index.html.haml +++ b/app/views/admin/p_fournisseurs/index.html.haml @@ -1,10 +1,8 @@ .qi_header .right = link_to 'Ajouter un fournisseur', new_admin_p_fournisseur_path(), :class => "btn btn-primary", :remote => true - %h1 - Achats - %span - Fournisseurs + + =breadcrumb .qi_row diff --git a/app/views/admin/p_payment_types/index.html.haml b/app/views/admin/p_payment_types/index.html.haml index 08213cf..f9e4779 100644 --- a/app/views/admin/p_payment_types/index.html.haml +++ b/app/views/admin/p_payment_types/index.html.haml @@ -1,9 +1,6 @@ .qi_header .right= link_to 'Ajouter un type de paiement', new_admin_p_payment_type_path(), :class => "btn btn-primary", :remote => true - %h1 - Paiements - %span - Types de paiement + = breadcrumb .qi_row @@ -19,4 +16,4 @@ %tbody#p_payment_types_rows =render @p_payment_types - \ No newline at end of file + diff --git a/app/views/admin/p_payments/index.html.haml b/app/views/admin/p_payments/index.html.haml index 9d5500c..f586b10 100644 --- a/app/views/admin/p_payments/index.html.haml +++ b/app/views/admin/p_payments/index.html.haml @@ -1,9 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter un paiement', new_admin_p_payment_path(), :class => "btn btn-primary btn-ap-add", :remote => true - %h1 - Paiements - %span - Liste des paiements + = breadcrumb .qi_search_row =form_tag "", :method => "get", :onsubmit => "" do @@ -117,4 +114,4 @@ - \ No newline at end of file + diff --git a/app/views/admin/p_product_cats/index.html.haml b/app/views/admin/p_product_cats/index.html.haml index 4df21f9..3ab0b4e 100644 --- a/app/views/admin/p_product_cats/index.html.haml +++ b/app/views/admin/p_product_cats/index.html.haml @@ -1,9 +1,6 @@ .qi_header .right= link_to 'Ajouter une catégorie', new_admin_p_product_cat_path(), :class => "btn btn-primary", :remote => true - %h1 - Achats - %span - Catégories produit + =breadcrumb .qi_row @@ -21,4 +18,4 @@ %tbody#p_product_cats_rows =render @p_product_cats - \ No newline at end of file + diff --git a/app/views/admin/p_product_colors/index.html.haml b/app/views/admin/p_product_colors/index.html.haml index 4da1f8e..68a3daa 100644 --- a/app/views/admin/p_product_colors/index.html.haml +++ b/app/views/admin/p_product_colors/index.html.haml @@ -1,7 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter', new_admin_p_product_color_path(), :class => "btn btn-primary btn-ap-add", :remote => true - %h1 - =PProductColor.human + =breadcrumb diff --git a/app/views/admin/p_product_powers/index.html.haml b/app/views/admin/p_product_powers/index.html.haml index 5a129d6..14211e1 100644 --- a/app/views/admin/p_product_powers/index.html.haml +++ b/app/views/admin/p_product_powers/index.html.haml @@ -1,7 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter', new_admin_p_product_power_path(), :class => "btn btn-primary btn-ap-add", :remote => true - %h1 - =PProductPower.human rescue "" + = breadcrumb diff --git a/app/views/admin/p_product_ref_specs/index.html.haml b/app/views/admin/p_product_ref_specs/index.html.haml index f486839..043b6c0 100644 --- a/app/views/admin/p_product_ref_specs/index.html.haml +++ b/app/views/admin/p_product_ref_specs/index.html.haml @@ -1,7 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter', new_admin_p_product_ref_spec_path(), :class => "btn btn-primary btn-ap-add", :remote => true - %h1 - =PProductRefSpec.human rescue "" + = breadcrumb diff --git a/app/views/admin/p_product_refs/index.html.haml b/app/views/admin/p_product_refs/index.html.haml index d186f00..b0ee023 100644 --- a/app/views/admin/p_product_refs/index.html.haml +++ b/app/views/admin/p_product_refs/index.html.haml @@ -1,10 +1,7 @@ -if !@manager .qi_header .right= link_to ic(:plus)+' Ajouter un produit', new_admin_p_product_path(), :class => "btn btn-primary btn-ap-add", :remote => false - %h1 - Achats - %span - Références + =breadcrumb @@ -71,4 +68,4 @@ :coffeescript $(".qi_search_row form").on "submit", -> - $("#p_product_refs_index_wrapper").html('recherche en cours ...') \ No newline at end of file + $("#p_product_refs_index_wrapper").html('recherche en cours ...') diff --git a/app/views/admin/p_product_refs/show.html.haml b/app/views/admin/p_product_refs/show.html.haml index d30bd50..879c29c 100644 --- a/app/views/admin/p_product_refs/show.html.haml +++ b/app/views/admin/p_product_refs/show.html.haml @@ -1,15 +1,7 @@ .qi_header .right = link_to i(:pencil), edit_admin_p_product_path(@p_product_ref.p_product), :remote => false if @p_product_ref.p_product - %h1 - Références produits - %span - Détail d'une référence - - %span - =@p_product_ref.p_product.name - ="-" - =@p_product_ref.ct_sub_name + =breadcrumb record: @p_product_ref.p_product.name + " - " + @p_product_ref.ct_sub_name .qi_row @@ -134,6 +126,10 @@ sortis .clear +-if false + .qi_row + .qi_pannel + %h3 Historique des prix d'achat -if false .qi_row diff --git a/app/views/admin/p_product_zones/index.html.haml b/app/views/admin/p_product_zones/index.html.haml index cf5e70a..8651c8d 100644 --- a/app/views/admin/p_product_zones/index.html.haml +++ b/app/views/admin/p_product_zones/index.html.haml @@ -1,7 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter', new_admin_p_product_zone_path(), :class => "btn btn-primary btn-ap-add", :remote => true - %h1 - =PProductZone.human + = breadcrumb diff --git a/app/views/admin/p_products/edit.html.haml b/app/views/admin/p_products/edit.html.haml index e0d5b2b..a70a9dc 100644 --- a/app/views/admin/p_products/edit.html.haml +++ b/app/views/admin/p_products/edit.html.haml @@ -1,11 +1,5 @@ .qi_header - %h1 - Achats - %span - =link_to "Produits", admin_p_products_path() - - %span - Modifier un produit + =breadcrumb record: @p_product.code + ' - ' + @p_product.name = render 'form' diff --git a/app/views/admin/p_products/index.html.haml b/app/views/admin/p_products/index.html.haml index 2c89729..ff94c46 100644 --- a/app/views/admin/p_products/index.html.haml +++ b/app/views/admin/p_products/index.html.haml @@ -1,9 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter un produit', new_admin_p_product_path(), :class => "btn btn-primary btn-ap-add", :remote => false - %h1 - Produits & Stocks - %span - Produits + =breadcrumb .qi_search_row diff --git a/app/views/admin/p_products/new.html.haml b/app/views/admin/p_products/new.html.haml index c9ff653..45f9916 100644 --- a/app/views/admin/p_products/new.html.haml +++ b/app/views/admin/p_products/new.html.haml @@ -1,11 +1,5 @@ .qi_header - %h1 - Achats - %span - =link_to "Produits", admin_p_products_path() - - %span - Ajouter un produit + =breadcrumb diff --git a/app/views/admin/p_serial_num_types/index.html.haml b/app/views/admin/p_serial_num_types/index.html.haml index 80034b4..456211f 100644 --- a/app/views/admin/p_serial_num_types/index.html.haml +++ b/app/views/admin/p_serial_num_types/index.html.haml @@ -1,7 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter', new_admin_p_serial_num_type_path(), :class => "btn btn-primary btn-ap-add", :remote => true - %h1 - =PSerialNumType.human rescue "" + = breadcrumb diff --git a/app/views/admin/p_spec_types/index.html.haml b/app/views/admin/p_spec_types/index.html.haml index 46d02ec..fb1e681 100644 --- a/app/views/admin/p_spec_types/index.html.haml +++ b/app/views/admin/p_spec_types/index.html.haml @@ -1,7 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter', new_admin_p_spec_type_path(), :class => "btn btn-primary btn-ap-add", :remote => true - %h1 - =PSpecType.human rescue "" + = breadcrumb diff --git a/app/views/admin/p_spec_values/index.html.haml b/app/views/admin/p_spec_values/index.html.haml index 8f34bd1..d629379 100644 --- a/app/views/admin/p_spec_values/index.html.haml +++ b/app/views/admin/p_spec_values/index.html.haml @@ -1,7 +1,6 @@ .qi_header .right= link_to ic(:plus)+' Ajouter', new_admin_p_spec_value_path(), :class => "btn btn-primary btn-ap-add", :remote => true - %h1 - =PSpecValue.human rescue "" + = breadcrumb diff --git a/app/views/admin/price_documents/analyse_reponses.html.haml b/app/views/admin/price_documents/analyse_reponses.html.haml index 8627aca..3766d31 100644 --- a/app/views/admin/price_documents/analyse_reponses.html.haml +++ b/app/views/admin/price_documents/analyse_reponses.html.haml @@ -1,11 +1,5 @@ .qi_header - %h1 - Achats - %span - Analyse des réponces à la demande de prix n° - = link_to @price_document.d_number, admin_price_document_path(@price_document) - \- - = @price_document.list_designaton + =breadcrumb second_title: "Demande de prix #{@price_document.d_number} - #{@price_document.list_designaton}", second_link: admin_price_document_path(@price_document) , last_element: "Analyse de des réponses" -unmatched_fournisseur = 0 =semantic_form_for [:admin, @price_document],url: analyse_reponses_save_admin_price_document_path, method: :post, :html => {:class => "qi_price_form"}, :remote => false do |form| diff --git a/app/views/admin/price_documents/edit.html.haml b/app/views/admin/price_documents/edit.html.haml index f652735..2193d72 100644 --- a/app/views/admin/price_documents/edit.html.haml +++ b/app/views/admin/price_documents/edit.html.haml @@ -1,13 +1,6 @@ .qi_header - - %h1 - Documents comptables - %span - Modifier un document - %span - =@price_document.label - ="-" - =@price_document.d_number + =breadcrumb second_title: @price_document.label, second_link: admin_price_documents_path(:price_document_type_id => @price_document.price_document_type_id), record: @price_document.d_number + .qi_row=render :partial => "form" diff --git a/app/views/admin/price_documents/index.html.haml b/app/views/admin/price_documents/index.html.haml index 014b9eb..ca45910 100644 --- a/app/views/admin/price_documents/index.html.haml +++ b/app/views/admin/price_documents/index.html.haml @@ -1,21 +1,16 @@ .qi_header .right - -if false # params[:price_document_type_id].to_s == "5" - =link_to ic(:plus)+" Ajouter un avoir", new_admin_price_document_path, :class => "btn btn-primary bgbd-ventes" - -elsif params[:price_document_type_id].to_i == 6 + -if params[:price_document_type_id].to_i == 6 # Facture Achat = link_to 'Ajouter une facture achat', new_admin_price_document_path(:document_type => "Facture d'achat"), :class => "btn btn-primary bgbd-documents", :remote => false - - -elsif params[:price_document_type_id].to_i == 7 + -elsif params[:price_document_type_id].to_i == 4 # Commande Achat = link_to 'Ajouter une commande achat', new_admin_price_document_path(:document_type => "Commande achat"), :class => "btn btn-primary bgbd-documents", :remote => false - - - + -elsif params[:price_document_type_id].to_i == 7 -else =link_to ic(:plus)+" Demande de commande", admin_p_customers_path(:offre => true), :class => "btn btn-primary bgbd-ventes" - %h1 - Documents - %span - Liste + + -if params[:price_document_type_id] + =breadcrumb second_title: PriceDocumentType.find(params[:price_document_type_id]).label + .qi_search_row diff --git a/app/views/admin/price_documents/show.html.haml b/app/views/admin/price_documents/show.html.haml index 1f7bc6a..c474220 100644 --- a/app/views/admin/price_documents/show.html.haml +++ b/app/views/admin/price_documents/show.html.haml @@ -13,16 +13,8 @@ = link_to i(:download), print_admin_price_document_path(@price_document.token), :remote => false, :target => "_blank" if !PriceLineBlock::PURCHASE_BLOCKS.include?(@price_document.block_type) - %h1 - Documents + =breadcrumb second_title: @price_document.label, second_link: admin_price_documents_path(:price_document_type_id => @price_document.price_document_type_id), record: @price_document.d_number - %span - =@price_document.price_document_type.label - - %span - ="##{@price_document.id}" - %span - =@price_document.d_number .qi_row diff --git a/app/views/admin/s_brands/index.html.haml b/app/views/admin/s_brands/index.html.haml index 164cd26..d74bcd7 100644 --- a/app/views/admin/s_brands/index.html.haml +++ b/app/views/admin/s_brands/index.html.haml @@ -1,9 +1,6 @@ .qi_header .right= link_to 'Ajouter une marque', new_admin_s_brand_path(), :class => "btn btn-primary", :remote => true - %h1 - Marques - %span - Liste + =breadcrumb .qi_row @@ -18,4 +15,4 @@ %tbody#s_brands_rows =render @s_brands - \ No newline at end of file + diff --git a/app/views/admin/stock_movements/index.html.haml b/app/views/admin/stock_movements/index.html.haml index 3dec3e9..6d44fd9 100644 --- a/app/views/admin/stock_movements/index.html.haml +++ b/app/views/admin/stock_movements/index.html.haml @@ -3,7 +3,7 @@ = link_to ic(:minus)+' Sortie de stock', new_admin_stock_movement_path(:movement_type => "deb"), :class => "btn btn-primary bgbd-documents", :remote => true = link_to ic(:plus)+' Entrée de stock', new_admin_stock_movement_path(:movement_type => "cred"), :class => "btn btn-primary bgbd-documents", :remote => true - %h1 Mouvements de stock manuels + = breadcrumb diff --git a/app/views/admin/stock_movements/show.html.haml b/app/views/admin/stock_movements/show.html.haml index d8210be..0c8b675 100644 --- a/app/views/admin/stock_movements/show.html.haml +++ b/app/views/admin/stock_movements/show.html.haml @@ -1,9 +1,6 @@ .qi_header - %h1 - Mouvements de stock manuels - %span - Détail du mouvement - ="##{@stock_movement.id}" + = breadcrumb record: "mouvement ##{@stock_movement.id}" +