app/controllers/mixins/breadcrumbs_mixin.rb
# Main method which creates all breadcrumbs and returns them (to view page which will parse them into breadcrumbs nav)
Main method which creates all breadcrumbs and returns them (to view page which will parse them into breadcrumbs nav)
Main method which creates all breadcrumbs and returns them ( to view page which will parse them into breadcrumbs nav )
def data_for_breadcrumbs
      options = breadcrumbs_options || {}
      options[:record_info] ||= (@record || {})
      options[:record_title] ||= :name
      options[:show_header] ||= false
      breadcrumbs = options[:breadcrumbs] || []
      if !features?
        breadcrumbs.push(build_breadcrumbs_no_explorer(options[:record_info], options[:record_title])) if not_show_page?
        breadcrumbs.push(special_page_breadcrumb(@tagitems || @politems || @ownershipitems || @retireitems))
        if @title && @title != breadcrumbs.compact.last.try(:[], :title)
          breadcrumbs.push(:title => @title)
        end
      else
        breadcrumbs.push(:title => accord_title, :key => "#{accord_name}_accord", :action => "accordion_select") if accord_title
        breadcrumbs_from_tree = build_breadcrumbs_from_tree
        breadcrumbs.concat(breadcrumbs_from_tree)
        if (options[:include_record] || breadcrumbs_from_tree.blank?) && options[:record_info].present? && options[:record_info][options[:record_title]] &&
           !(@tagitems || @politems || @ownershipitems || @retireitems)
          breadcrumbs.concat(ancestry_parents(options[:ancestry], options[:record_info], options[:record_title])) if options[:ancestry]
          breadcrumbs.push(:title => options[:record_info][options[:record_title]], :key => x_node_right_cell)
          breadcrumbs.push(:title => @right_cell_text) if options[:show_header] && @right_cell_text
        else
          breadcrumbs.push(special_page_breadcrumb(@tagitems || @politems || @ownershipitems || @retireitems)) unless options[:hide_special_item]
          breadcrumbs.push(:title => @right_cell_text) if action_breadcrumb?
        end
      end
      breadcrumbs.compact
    end
def data_for_breadcrumbs options = breadcrumbs_options || { } options [ :record_info ] ||= ( @record || { } ) options [ :record_title ] ||= :name options [ :show_header ] ||= false breadcrumbs = options [ :breadcrumbs ] || [ ] if ! features? breadcrumbs . push ( build_breadcrumbs_no_explorer ( options [ :record_info ] , options [ :record_title ] ) ) if not_show_page? breadcrumbs . push ( special_page_breadcrumb ( @tagitems || @politems || @ownershipitems || @retireitems ) ) if @title && @title != breadcrumbs . compact . last . try ( :[] , :title ) breadcrumbs . push ( :title => @title ) end else breadcrumbs . push ( :title => accord_title , :key => "#{accord_name}_accord" , :action => "accordion_select" ) if accord_title breadcrumbs_from_tree = build_breadcrumbs_from_tree breadcrumbs . concat ( breadcrumbs_from_tree ) if ( options [ :include_record ] || breadcrumbs_from_tree . blank? ) && options [ :record_info ] . present? && options [ :record_info ] [ options [ :record_title ] ] && ! ( @tagitems || @politems || @ownershipitems || @retireitems ) breadcrumbs . concat ( ancestry_parents ( options [ :ancestry ] , options [ :record_info ] , options [ :record_title ] ) ) if options [ :ancestry ] breadcrumbs . push ( :title => options [ :record_info ] [ options [ :record_title ] ] , :key => x_node_right_cell ) breadcrumbs . push ( :title => @right_cell_text ) if options [ :show_header ] && @right_cell_text else breadcrumbs . push ( special_page_breadcrumb ( @tagitems || @politems || @ownershipitems || @retireitems ) ) unless options [ :hide_special_item ] breadcrumbs . push ( :title => @right_cell_text ) if action_breadcrumb? end end breadcrumbs . compact end
Main method which creates all breadcrumbs and returns them (to view page which will parse them into breadcrumbs nav)
Main method which creates all breadcrumbs and returns them ( to view page which will parse them into breadcrumbs nav )
# Different methods for controller with explorers and for non-explorers controllers # Append breadcrumb from @record item (eg "Openstack") when on some action page (not show, display) # Append tag and policy breadcrumb if they exist # Append title breadcrumb if they exist and not same as previous breadcrumb (eg "Editing name") # Append breadcrumb from title of the accordion (eg "Policies") # Append breadcrumbs created from the tree (eg "All policies > Red Hat policies > Policy 1") # Append breadcrumb created from record_info if included or if result from tree was empty (eg filters page) # Ancestry parents breadcrumbs # Append breadcrumb from the title of right cell