Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
fixed userbox options
Browse files Browse the repository at this point in the history
  • Loading branch information
jlapier committed Sep 27, 2011
1 parent dfff0e7 commit 2aeddb5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
16 changes: 7 additions & 9 deletions app/helpers/application_helper.rb
Expand Up @@ -91,17 +91,10 @@ def user_box(my_options={})
out += "Welcome, #{current_user.first_name}! "
if(options[:line_breaks])
out += "<br />"
else
out += options[:link_seperator]
end
out += link_to("My Account", account_path) + options[:link_seperator] +
out += link_to("My Account", account_path) + options[:link_seperator].html_safe +
link_to("Logout", user_session_path, :method => :delete,
:confirm => "Are you sure you want to logout?")
if(options[:line_breaks])
out += "<br/>"
else
out += options[:link_seperator]
end
other_links << link_to('Site Admin', admin_site_settings_path) if current_user.is_admin?
if current_user.has_access_to_any_wikis?
if current_user.wikis.size == 1
Expand All @@ -128,7 +121,12 @@ def user_box(my_options={})
other_links << link_to_events({:no_wrapper => true}, {:link_text => 'Events'})
end
unless other_links.empty?
out += options[:link_seperator] + other_links.join(options[:link_seperator])
if(options[:line_breaks])
out += "<br/>"
else
out += options[:link_seperator]
end
out += other_links.join(options[:link_seperator])
end
out.html_safe
end
Expand Down
5 changes: 4 additions & 1 deletion themes/layouts/default.html.erb
Expand Up @@ -13,7 +13,10 @@
<%= side_menu %>
</div>
<div class="user_box">
<%= user_box :include_line_breaks => false %>
<%# defaults:
user_box :include_line_breaks => true, :include_blog_link => true,
:include_events_link => true, :link_seperator => ' | ' %>
<%= user_box %>
</div>
</div>
</div>
Expand Down

0 comments on commit 2aeddb5

Please sign in to comment.