Permalink
Browse files

Make only nicknames quoted.

  • Loading branch information...
1 parent 6ca0611 commit a15e41fd94285342fc52714455c913765cc7a300 @jrmehle committed Jan 18, 2011
Showing with 7 additions and 3 deletions.
  1. +2 −2 app/views/accounts/_account.html.erb
  2. +5 −1 app/views/accounts/_name.html.erb
View
4 app/views/accounts/_account.html.erb
@@ -14,8 +14,8 @@
<% unless account.names.empty? %>
<td>
<ul>
- <%= render :partial => 'name', :collection => account.names %>
- <%= render :partial => 'name', :collection => account.nicks unless account.nicks.empty? %>
+ <%= render :partial => 'name', :collection => account.names, :locals => { :is_nickname => false } %>
+ <%= render :partial => 'name', :collection => account.nicks, :locals => { :is_nickname => true } unless account.nicks.empty? %>
</ul>
</td>
<% end %>
View
6 app/views/accounts/_name.html.erb
@@ -1 +1,5 @@
-<li class="nickname"><%= '"' + name.value + '"' %></li>
+<%-
+ list_item_class = is_nickname ? 'nickname' : ''
+ formatted_name = is_nickname ? "\"#{name.value}\"" : name.value
+ %>
+<li class=""><%= formatted_name %></li>

0 comments on commit a15e41f

Please sign in to comment.