From 9b9786fac64102035b6fcd9ba9148ec4b535a892 Mon Sep 17 00:00:00 2001 From: jwollert Date: Mon, 7 Nov 2011 11:14:25 +0100 Subject: [PATCH 1/2] [#667] title attribute for activity active checkbox --- app/views/projects/settings/_activities.rhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/settings/_activities.rhtml b/app/views/projects/settings/_activities.rhtml index 66be53008b..a085bc0108 100644 --- a/app/views/projects/settings/_activities.rhtml +++ b/app/views/projects/settings/_activities.rhtml @@ -24,7 +24,7 @@ <% end %> - <%= ff.check_box :active %> + <%= ff.check_box :active, :title => (enumeration.active? ? l(:general_text_Yes) : l(:general_text_No)) %> <% end %> From bb7434621f5359c59e88cea769237bbf7f0d2729 Mon Sep 17 00:00:00 2001 From: jwollert Date: Mon, 7 Nov 2011 12:18:16 +0100 Subject: [PATCH 2/2] [#667] correctly title member links and render the group image explicitly in its own tag, as it contains semantic information --- app/helpers/application_helper.rb | 24 +++++++++++++++++----- app/views/projects/settings/_members.rhtml | 2 +- public/stylesheets/application.css | 2 -- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 542d308682..3d024df77f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -45,15 +45,29 @@ module ApplicationHelper # Displays a link to user's account page if active def link_to_user(user, options={}) - if user.is_a?(User) - name = h(user.name(options[:format])) - if user.active? - link_to name, :controller => 'users', :action => 'show', :id => user + 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)) else name end else - h(user.to_s) + h(principal.to_s) end end diff --git a/app/views/projects/settings/_members.rhtml b/app/views/projects/settings/_members.rhtml index caabcebe92..9acc1fbece 100644 --- a/app/views/projects/settings/_members.rhtml +++ b/app/views/projects/settings/_members.rhtml @@ -15,7 +15,7 @@ <% members.each do |member| %> <% next if member.new_record? %> - <%= link_to_user member.principal %> + <%= link_to_principal(member.principal) %> <%=h member.roles.sort.collect(&:to_s).join(', ') %> <% if authorize_for('members', 'edit') %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 4baed60ef8..f1d834aebe 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -466,8 +466,6 @@ 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; }