Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
fixed some conflicts from a cherry-pick
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Adams committed Mar 12, 2009
1 parent e228cfe commit 7f6133d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion app/controllers/application.rb
Expand Up @@ -19,7 +19,6 @@ def set_layout_variables
@topNavChildren[sub] = temp if temp.length > 0
end
@topNav.unshift @root
@breadcrumb = []
end

def load_menu
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/page_controller.rb
Expand Up @@ -4,7 +4,7 @@ class PageController < ApplicationController
# Currently in need of some serious refactoring
def indexer
@page = Page.visible.find_page_by_path params['path']
@breadcrumb = @page.ancestors.reverse.to_a if @page
@breadcrumb = @page.ancestors.reverse.collect { |x| [x.name, x.title] } if @page
@top_page = params[:path][0] || 'root'
render :template => "404", :status => 404, :layout => false and return unless @page
if @page.is_published? || (logged_in? && current_user.can_view_drafts?)
Expand Down
16 changes: 7 additions & 9 deletions app/views/page/_breadcrumb.html.erb
@@ -1,10 +1,8 @@
<div id="breadcrumb">
<% url = ""
@breadcrumb.each do |crumb|
url = (url != "") ? url + crumb.name + "/" : url = "/" %>
<%= link_to crumb.title, ((url=='/')? '/pages/' + @root.name + '/' : url ) %> &gt;
<% end %>
<% if @page -%>
<b><%= (@pageNum!=nil)? link_to(@page.title, './') + " &gt; page " + @pageNum.to_s : @page.title %></b>
<% end -%>
<div id="breadcrumb">
<% @breadcrumb.each do |crumb| %>
<a href="/<%= crumb[0] -%>"><%= crumb[1] -%></a>&nbsp;&gt;&nbsp;
<% end %>
<% if @page -%>
<b><%= (@pageNum!=nil)? link_to(@page.title, './') + " &gt; page " + @pageNum.to_s : @page.title %></b>
<% end -%>
</div>

0 comments on commit 7f6133d

Please sign in to comment.