bugfix breadcrumn

This commit is contained in:
Barnabé 2021-09-28 11:23:02 +02:00
parent f1ed7e4ff5
commit 973182221e

View File

@ -40,7 +40,7 @@ module BreadcrumbHelper
if options[:record].present? || options[:last_element].present? if options[:record].present? || options[:last_element].present?
haml_concat(link_to options[:first_title], options[:first_link]) haml_concat(link_to options[:first_title], options[:first_link])
if options[:second_title].present? && options[:second_link].present? if options[:second_title].present? && options[:second_link].present?
haml_tag(:span) { haml_concat(link_to options[:second_title], options[:second_title]) } haml_tag(:span) { haml_concat(link_to options[:second_title], options[:second_link]) }
elsif options[:second_title].present? elsif options[:second_title].present?
haml_tag(:span) {haml_concat( options[:second_title])} haml_tag(:span) {haml_concat( options[:second_title])}
end end
@ -57,11 +57,11 @@ module BreadcrumbHelper
when :new when :new
haml_tag(:span) {haml_concat("Création #{options[:first_title].singularize.downcase}")} haml_tag(:span) {haml_concat("Création #{options[:first_title].singularize.downcase}")}
when :edit when :edit
haml_tag(:span) {haml_concat("Modification #{options[:record]}")} options[:record].present? ? haml_tag(:span) {haml_concat("Modification de : #{options[:record]}")} : haml_tag(:span) {haml_concat("Modification")}
when :index when :index
haml_tag(:span) {haml_concat("Liste")} haml_tag(:span) {haml_concat("Liste")}
when :show when :show
options[:record].present? ? haml_tag(:span) {haml_concat("Détail de #{options[:record]}")} : haml_tag(:span) {haml_concat("Détail")} options[:record].present? ? haml_tag(:span) {haml_concat("Détail de : #{options[:record]}")} : haml_tag(:span) {haml_concat("Détail")}
else else
haml_tag(:span) {haml_concat(options[:record])} if options[:record].present? haml_tag(:span) {haml_concat(options[:record])} if options[:record].present?
end end