Merge branch 'pulls/667/label-elements' into feature/2.3.0/accessibility-master

pull/41/head
jwollert 13 years ago
commit df46236574
  1. 24
      app/helpers/application_helper.rb
  2. 2
      app/views/projects/settings/_members.rhtml
  3. 2
      public/stylesheets/application.css

@ -45,29 +45,15 @@ module ApplicationHelper
# Displays a link to user's account page if active
def link_to_user(user, options={})
link_to_principal(user, options)
end
def link_to_group(role, options={})
link_to_principal(role, options)
end
def link_to_principal(principal, options={})
if principal.is_a?(User)
type = "user"
elsif principal.is_a?(Group)
type = "group"
end
if type
name = h(principal.name(options.delete(:format)))
if (principal.respond_to?(:active?) ? principal.active? : true)
(type == "group" ? (image_tag "group.png", :title => l(:label_group)) : "") +
link_to(name, { :controller => type.downcase.pluralize, :action => 'show', :id => principal }, options.reverse_merge(:title => name))
if user.is_a?(User)
name = h(user.name(options[:format]))
if user.active?
link_to name, :controller => 'users', :action => 'show', :id => user
else
name
end
else
h(principal.to_s)
h(user.to_s)
end
end

@ -15,7 +15,7 @@
<% members.each do |member| %>
<% next if member.new_record? %>
<tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member">
<td class="<%= member.principal.class.name.downcase %>"><%= link_to_principal(member.principal) %></td>
<td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td>
<td class="roles">
<span id="member-<%= member.id %>-roles"><%=h member.roles.sort.collect(&:to_s).join(', ') %></span>
<% if authorize_for('members', 'edit') %>

@ -464,6 +464,8 @@ div#tab-content-members fieldset legend, div#tab-content-memberships fieldset le
div#tab-content-members fieldset label, div#tab-content-memberships fieldset label, div#tab-content-users fieldset label { display: block; }
div#tab-content-members fieldset div, div#tab-content-users fieldset div { max-height: 400px; overflow:auto; }
table.members td.group { padding-left: 20px; background: url(../images/group.png) no-repeat 0% 50%; }
input#principal_search, input#user_search {width:100%}
* html div#tab-content-members fieldset div { height: 450px; }

Loading…
Cancel
Save