@@ -1,37 +1,37 | |||||
1 | <h2><%=l(:label_enumerations)%></h2> |
|
1 | <h2><%=l(:label_enumerations)%></h2> | |
2 |
|
2 | |||
3 | <% Enumeration.get_subclasses.each do |klass| %> |
|
3 | <% Enumeration.get_subclasses.each do |klass| %> | |
4 | <h3><%= l(klass::OptionName) %></h3> |
|
4 | <h3><%= l(klass::OptionName) %></h3> | |
5 |
|
5 | |||
6 | <% enumerations = klass.shared %> |
|
6 | <% enumerations = klass.shared %> | |
7 | <% if enumerations.any? %> |
|
7 | <% if enumerations.any? %> | |
8 | <table class="list"> |
|
8 | <table class="list"><thead> | |
9 | <tr> |
|
9 | <tr> | |
10 | <th><%= l(:field_name) %></th> |
|
10 | <th><%= l(:field_name) %></th> | |
11 | <th style="width:15%;"><%= l(:field_is_default) %></th> |
|
11 | <th style="width:15%;"><%= l(:field_is_default) %></th> | |
12 | <th style="width:15%;"><%= l(:field_active) %></th> |
|
12 | <th style="width:15%;"><%= l(:field_active) %></th> | |
13 | <th style="width:15%;"></th> |
|
13 | <th style="width:15%;"></th> | |
14 | <th align="center" style="width:10%;"> </th> |
|
14 | <th align="center" style="width:10%;"> </th> | |
15 | </tr> |
|
15 | </tr></thead> | |
16 | <% enumerations.each do |enumeration| %> |
|
16 | <% enumerations.each do |enumeration| %> | |
17 | <tr class="<%= cycle('odd', 'even') %>"> |
|
17 | <tr class="<%= cycle('odd', 'even') %>"> | |
18 | <td><%= link_to h(enumeration), :action => 'edit', :id => enumeration %></td> |
|
18 | <td><%= link_to h(enumeration), :action => 'edit', :id => enumeration %></td> | |
19 | <td class="center" style="width:15%;"><%= checked_image enumeration.is_default? %></td> |
|
19 | <td class="center" style="width:15%;"><%= checked_image enumeration.is_default? %></td> | |
20 | <td class="center" style="width:15%;"><%= checked_image enumeration.active? %></td> |
|
20 | <td class="center" style="width:15%;"><%= checked_image enumeration.active? %></td> | |
21 | <td style="width:15%;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}) %></td> |
|
21 | <td style="width:15%;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}) %></td> | |
22 | <td class="buttons"> |
|
22 | <td class="buttons"> | |
23 | <%= link_to l(:button_delete), { :action => 'destroy', :id => enumeration }, |
|
23 | <%= link_to l(:button_delete), { :action => 'destroy', :id => enumeration }, | |
24 | :method => :post, |
|
24 | :method => :post, | |
25 | :confirm => l(:text_are_you_sure), |
|
25 | :confirm => l(:text_are_you_sure), | |
26 | :class => 'icon icon-del' %> |
|
26 | :class => 'icon icon-del' %> | |
27 | </td> |
|
27 | </td> | |
28 | </tr> |
|
28 | </tr> | |
29 | <% end %> |
|
29 | <% end %> | |
30 | </table> |
|
30 | </table> | |
31 | <% reset_cycle %> |
|
31 | <% reset_cycle %> | |
32 | <% end %> |
|
32 | <% end %> | |
33 |
|
33 | |||
34 | <p><%= link_to l(:label_enumeration_new), { :action => 'new', :type => klass.name } %></p> |
|
34 | <p><%= link_to l(:label_enumeration_new), { :action => 'new', :type => klass.name } %></p> | |
35 | <% end %> |
|
35 | <% end %> | |
36 |
|
36 | |||
37 | <% html_title(l(:label_enumerations)) -%> |
|
37 | <% html_title(l(:label_enumerations)) -%> |
@@ -1,56 +1,56 | |||||
1 | <% roles = Role.find_all_givable %> |
|
1 | <% roles = Role.find_all_givable %> | |
2 | <% projects = Project.active.find(:all, :order => 'lft') %> |
|
2 | <% projects = Project.active.find(:all, :order => 'lft') %> | |
3 |
|
3 | |||
4 | <div class="splitcontentleft"> |
|
4 | <div class="splitcontentleft"> | |
5 | <% if @group.memberships.any? %> |
|
5 | <% if @group.memberships.any? %> | |
6 | <table class="list memberships"> |
|
6 | <table class="list memberships"> | |
7 | <thead> |
|
7 | <thead><tr> | |
8 | <th><%= l(:label_project) %></th> |
|
8 | <th><%= l(:label_project) %></th> | |
9 | <th><%= l(:label_role_plural) %></th> |
|
9 | <th><%= l(:label_role_plural) %></th> | |
10 | <th style="width:15%"></th> |
|
10 | <th style="width:15%"></th> | |
11 | </thead> |
|
11 | </tr></thead> | |
12 | <tbody> |
|
12 | <tbody> | |
13 | <% @group.memberships.each do |membership| %> |
|
13 | <% @group.memberships.each do |membership| %> | |
14 | <% next if membership.new_record? %> |
|
14 | <% next if membership.new_record? %> | |
15 | <tr id="member-<%= membership.id %>" class="<%= cycle 'odd', 'even' %> class"> |
|
15 | <tr id="member-<%= membership.id %>" class="<%= cycle 'odd', 'even' %> class"> | |
16 | <td class="project"><%=h membership.project %></td> |
|
16 | <td class="project"><%=h membership.project %></td> | |
17 | <td class="roles"> |
|
17 | <td class="roles"> | |
18 | <span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span> |
|
18 | <span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span> | |
19 | <% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @group, :membership_id => membership }, |
|
19 | <% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @group, :membership_id => membership }, | |
20 | :html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %> |
|
20 | :html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %> | |
21 | <p><% roles.each do |role| %> |
|
21 | <p><% roles.each do |role| %> | |
22 | <label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role) %> <%=h role %></label><br /> |
|
22 | <label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role) %> <%=h role %></label><br /> | |
23 | <% end %></p> |
|
23 | <% end %></p> | |
24 | <p><%= submit_tag l(:button_change) %> |
|
24 | <p><%= submit_tag l(:button_change) %> | |
25 | <%= link_to_function l(:button_cancel), "$('member-#{membership.id}-roles').show(); $('member-#{membership.id}-roles-form').hide(); return false;" %></p> |
|
25 | <%= link_to_function l(:button_cancel), "$('member-#{membership.id}-roles').show(); $('member-#{membership.id}-roles-form').hide(); return false;" %></p> | |
26 | <% end %> |
|
26 | <% end %> | |
27 | </td> |
|
27 | </td> | |
28 | <td class="buttons"> |
|
28 | <td class="buttons"> | |
29 | <%= link_to_function l(:button_edit), "$('member-#{membership.id}-roles').hide(); $('member-#{membership.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %> |
|
29 | <%= link_to_function l(:button_edit), "$('member-#{membership.id}-roles').hide(); $('member-#{membership.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %> | |
30 | <%= link_to_remote l(:button_delete), { :url => { :controller => 'groups', :action => 'destroy_membership', :id => @group, :membership_id => membership }, |
|
30 | <%= link_to_remote l(:button_delete), { :url => { :controller => 'groups', :action => 'destroy_membership', :id => @group, :membership_id => membership }, | |
31 | :method => :post }, |
|
31 | :method => :post }, | |
32 | :class => 'icon icon-del' %> |
|
32 | :class => 'icon icon-del' %> | |
33 | </td> |
|
33 | </td> | |
34 | </tr> |
|
34 | </tr> | |
35 | </tbody> |
|
35 | </tbody> | |
36 | <% end; reset_cycle %> |
|
36 | <% end; reset_cycle %> | |
37 | </table> |
|
37 | </table> | |
38 | <% else %> |
|
38 | <% else %> | |
39 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
39 | <p class="nodata"><%= l(:label_no_data) %></p> | |
40 | <% end %> |
|
40 | <% end %> | |
41 | </div> |
|
41 | </div> | |
42 |
|
42 | |||
43 | <div class="splitcontentright"> |
|
43 | <div class="splitcontentright"> | |
44 | <% if projects.any? %> |
|
44 | <% if projects.any? %> | |
45 | <fieldset><legend><%=l(:label_project_new)%></legend> |
|
45 | <fieldset><legend><%=l(:label_project_new)%></legend> | |
46 | <% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @group }) do %> |
|
46 | <% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @group }) do %> | |
47 | <%= select_tag 'membership[project_id]', options_for_membership_project_select(@group, projects) %> |
|
47 | <%= select_tag 'membership[project_id]', options_for_membership_project_select(@group, projects) %> | |
48 | <p><%= l(:label_role_plural) %>: |
|
48 | <p><%= l(:label_role_plural) %>: | |
49 | <% roles.each do |role| %> |
|
49 | <% roles.each do |role| %> | |
50 | <label><%= check_box_tag 'membership[role_ids][]', role.id %> <%=h role %></label> |
|
50 | <label><%= check_box_tag 'membership[role_ids][]', role.id %> <%=h role %></label> | |
51 | <% end %></p> |
|
51 | <% end %></p> | |
52 | <p><%= submit_tag l(:button_add) %></p> |
|
52 | <p><%= submit_tag l(:button_add) %></p> | |
53 | <% end %> |
|
53 | <% end %> | |
54 | </fieldset> |
|
54 | </fieldset> | |
55 | <% end %> |
|
55 | <% end %> | |
56 | </div> |
|
56 | </div> |
@@ -1,49 +1,49 | |||||
1 | <div class="splitcontentleft"> |
|
1 | <div class="splitcontentleft"> | |
2 | <% if @group.users.any? %> |
|
2 | <% if @group.users.any? %> | |
3 | <table class="list users"> |
|
3 | <table class="list users"> | |
4 | <thead> |
|
4 | <thead><tr> | |
5 | <th><%= l(:label_user) %></th> |
|
5 | <th><%= l(:label_user) %></th> | |
6 | <th style="width:15%"></th> |
|
6 | <th style="width:15%"></th> | |
7 | </thead> |
|
7 | </tr></thead> | |
8 | <tbody> |
|
8 | <tbody> | |
9 | <% @group.users.sort.each do |user| %> |
|
9 | <% @group.users.sort.each do |user| %> | |
10 | <tr id="user-<%= user.id %>" class="<%= cycle 'odd', 'even' %>"> |
|
10 | <tr id="user-<%= user.id %>" class="<%= cycle 'odd', 'even' %>"> | |
11 | <td class="user"><%= link_to_user user %></td> |
|
11 | <td class="user"><%= link_to_user user %></td> | |
12 | <td class="buttons"> |
|
12 | <td class="buttons"> | |
13 | <%= link_to_remote l(:button_delete), { :url => { :controller => 'groups', :action => 'remove_user', :id => @group, :user_id => user }, |
|
13 | <%= link_to_remote l(:button_delete), { :url => { :controller => 'groups', :action => 'remove_user', :id => @group, :user_id => user }, | |
14 | :method => :post }, |
|
14 | :method => :post }, | |
15 | :class => 'icon icon-del' %> |
|
15 | :class => 'icon icon-del' %> | |
16 | </td> |
|
16 | </td> | |
17 | </tr> |
|
17 | </tr> | |
18 | <% end %> |
|
18 | <% end %> | |
19 | </tbody> |
|
19 | </tbody> | |
20 | </table> |
|
20 | </table> | |
21 | <% else %> |
|
21 | <% else %> | |
22 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
22 | <p class="nodata"><%= l(:label_no_data) %></p> | |
23 | <% end %> |
|
23 | <% end %> | |
24 | </div> |
|
24 | </div> | |
25 |
|
25 | |||
26 | <div class="splitcontentright"> |
|
26 | <div class="splitcontentright"> | |
27 | <% users = User.active.find(:all, :limit => 100) - @group.users %> |
|
27 | <% users = User.active.find(:all, :limit => 100) - @group.users %> | |
28 | <% if users.any? %> |
|
28 | <% if users.any? %> | |
29 | <% remote_form_for(:group, @group, :url => {:controller => 'groups', :action => 'add_users', :id => @group}, :method => :post) do |f| %> |
|
29 | <% remote_form_for(:group, @group, :url => {:controller => 'groups', :action => 'add_users', :id => @group}, :method => :post) do |f| %> | |
30 | <fieldset><legend><%=l(:label_user_new)%></legend> |
|
30 | <fieldset><legend><%=l(:label_user_new)%></legend> | |
31 |
|
31 | |||
32 | <p><%= text_field_tag 'user_search', nil %></p> |
|
32 | <p><%= text_field_tag 'user_search', nil %></p> | |
33 | <%= observe_field(:user_search, |
|
33 | <%= observe_field(:user_search, | |
34 | :frequency => 0.5, |
|
34 | :frequency => 0.5, | |
35 | :update => :users, |
|
35 | :update => :users, | |
36 | :url => { :controller => 'groups', :action => 'autocomplete_for_user', :id => @group }, |
|
36 | :url => { :controller => 'groups', :action => 'autocomplete_for_user', :id => @group }, | |
37 | :with => 'q') |
|
37 | :with => 'q') | |
38 | %> |
|
38 | %> | |
39 |
|
39 | |||
40 | <div id="users"> |
|
40 | <div id="users"> | |
41 | <%= principals_check_box_tags 'user_ids[]', users %> |
|
41 | <%= principals_check_box_tags 'user_ids[]', users %> | |
42 | </div> |
|
42 | </div> | |
43 |
|
43 | |||
44 | <p><%= submit_tag l(:button_add) %></p> |
|
44 | <p><%= submit_tag l(:button_add) %></p> | |
45 | </fieldset> |
|
45 | </fieldset> | |
46 | <% end %> |
|
46 | <% end %> | |
47 | <% end %> |
|
47 | <% end %> | |
48 |
|
48 | |||
49 | </div> |
|
49 | </div> |
@@ -1,52 +1,52 | |||||
1 | <h3><%=l(:label_spent_time)%> (<%= l(:label_last_n_days, 7) %>)</h3> |
|
1 | <h3><%=l(:label_spent_time)%> (<%= l(:label_last_n_days, 7) %>)</h3> | |
2 | <% |
|
2 | <% | |
3 | entries = TimeEntry.find(:all, |
|
3 | entries = TimeEntry.find(:all, | |
4 | :conditions => ["#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", @user.id, Date.today - 6, Date.today], |
|
4 | :conditions => ["#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", @user.id, Date.today - 6, Date.today], | |
5 | :include => [:activity, :project, {:issue => [:tracker, :status]}], |
|
5 | :include => [:activity, :project, {:issue => [:tracker, :status]}], | |
6 | :order => "#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC") |
|
6 | :order => "#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC") | |
7 | entries_by_day = entries.group_by(&:spent_on) |
|
7 | entries_by_day = entries.group_by(&:spent_on) | |
8 | %> |
|
8 | %> | |
9 |
|
9 | |||
10 | <div class="total-hours"> |
|
10 | <div class="total-hours"> | |
11 | <p><%= l(:label_total) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %></p> |
|
11 | <p><%= l(:label_total) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %></p> | |
12 | </div> |
|
12 | </div> | |
13 |
|
13 | |||
14 | <% if entries.any? %> |
|
14 | <% if entries.any? %> | |
15 | <table class="list time-entries"> |
|
15 | <table class="list time-entries"> | |
16 | <thead> |
|
16 | <thead><tr> | |
17 | <th><%= l(:label_activity) %></th> |
|
17 | <th><%= l(:label_activity) %></th> | |
18 | <th><%= l(:label_project) %></th> |
|
18 | <th><%= l(:label_project) %></th> | |
19 | <th><%= l(:field_comments) %></th> |
|
19 | <th><%= l(:field_comments) %></th> | |
20 | <th><%= l(:field_hours) %></th> |
|
20 | <th><%= l(:field_hours) %></th> | |
21 | <th></th> |
|
21 | <th></th> | |
22 | </thead> |
|
22 | </tr></thead> | |
23 | <tbody> |
|
23 | <tbody> | |
24 | <% entries_by_day.keys.sort.reverse.each do |day| %> |
|
24 | <% entries_by_day.keys.sort.reverse.each do |day| %> | |
25 | <tr class="odd"> |
|
25 | <tr class="odd"> | |
26 | <td><strong><%= day == Date.today ? l(:label_today).titleize : format_date(day) %></strong></td> |
|
26 | <td><strong><%= day == Date.today ? l(:label_today).titleize : format_date(day) %></strong></td> | |
27 | <td colspan="2"></td> |
|
27 | <td colspan="2"></td> | |
28 | <td class="hours"><em><%= html_hours("%.2f" % entries_by_day[day].sum(&:hours).to_f) %></em></td> |
|
28 | <td class="hours"><em><%= html_hours("%.2f" % entries_by_day[day].sum(&:hours).to_f) %></em></td> | |
29 | <td></td> |
|
29 | <td></td> | |
30 | </tr> |
|
30 | </tr> | |
31 | <% entries_by_day[day].each do |entry| -%> |
|
31 | <% entries_by_day[day].each do |entry| -%> | |
32 | <tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;"> |
|
32 | <tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;"> | |
33 | <td class="activity"><%=h entry.activity %></td> |
|
33 | <td class="activity"><%=h entry.activity %></td> | |
34 | <td class="subject"><%=h entry.project %> <%= ' - ' + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td> |
|
34 | <td class="subject"><%=h entry.project %> <%= ' - ' + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td> | |
35 | <td class="comments"><%=h entry.comments %></td> |
|
35 | <td class="comments"><%=h entry.comments %></td> | |
36 | <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td> |
|
36 | <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td> | |
37 | <td align="center"> |
|
37 | <td align="center"> | |
38 | <% if entry.editable_by?(@user) -%> |
|
38 | <% if entry.editable_by?(@user) -%> | |
39 | <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry}, |
|
39 | <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry}, | |
40 | :title => l(:button_edit) %> |
|
40 | :title => l(:button_edit) %> | |
41 | <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry}, |
|
41 | <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry}, | |
42 | :confirm => l(:text_are_you_sure), |
|
42 | :confirm => l(:text_are_you_sure), | |
43 | :method => :post, |
|
43 | :method => :post, | |
44 | :title => l(:button_delete) %> |
|
44 | :title => l(:button_delete) %> | |
45 | <% end -%> |
|
45 | <% end -%> | |
46 | </td> |
|
46 | </td> | |
47 | </tr> |
|
47 | </tr> | |
48 | <% end -%> |
|
48 | <% end -%> | |
49 | <% end -%> |
|
49 | <% end -%> | |
50 | </tbody> |
|
50 | </tbody> | |
51 | </table> |
|
51 | </table> | |
52 | <% end %> |
|
52 | <% end %> |
@@ -1,42 +1,42 | |||||
1 | <% form_tag({:controller => 'projects', :action => 'save_activities', :id => @project}, :class => "tabular") do %> |
|
1 | <% form_tag({:controller => 'projects', :action => 'save_activities', :id => @project}, :class => "tabular") do %> | |
2 |
|
2 | |||
3 | <table class="list"> |
|
3 | <table class="list"> | |
4 | <tr> |
|
4 | <thead><tr> | |
5 | <th><%= l(:field_name) %></th> |
|
5 | <th><%= l(:field_name) %></th> | |
6 | <th><%= l(:enumeration_system_activity) %></th> |
|
6 | <th><%= l(:enumeration_system_activity) %></th> | |
7 | <% TimeEntryActivity.new.available_custom_fields.each do |value| %> |
|
7 | <% TimeEntryActivity.new.available_custom_fields.each do |value| %> | |
8 | <th><%= h value.name %></th> |
|
8 | <th><%= h value.name %></th> | |
9 | <% end %> |
|
9 | <% end %> | |
10 | <th style="width:15%;"><%= l(:field_active) %></th> |
|
10 | <th style="width:15%;"><%= l(:field_active) %></th> | |
11 | </tr> |
|
11 | </tr></thead> | |
12 |
|
12 | |||
13 | <% @project.activities(true).each do |enumeration| %> |
|
13 | <% @project.activities(true).each do |enumeration| %> | |
14 | <% fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %> |
|
14 | <% fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %> | |
15 | <tr class="<%= cycle('odd', 'even') %>"> |
|
15 | <tr class="<%= cycle('odd', 'even') %>"> | |
16 | <td> |
|
16 | <td> | |
17 | <%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %> |
|
17 | <%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %> | |
18 | <%= h(enumeration) %> |
|
18 | <%= h(enumeration) %> | |
19 | </td> |
|
19 | </td> | |
20 | <td align="center" style="width:15%;"><%= checked_image !enumeration.project %></td> |
|
20 | <td align="center" style="width:15%;"><%= checked_image !enumeration.project %></td> | |
21 | <% enumeration.custom_field_values.each do |value| %> |
|
21 | <% enumeration.custom_field_values.each do |value| %> | |
22 | <td align="center"> |
|
22 | <td align="center"> | |
23 | <%= custom_field_tag "enumerations[#{enumeration.id}]", value %> |
|
23 | <%= custom_field_tag "enumerations[#{enumeration.id}]", value %> | |
24 | </td> |
|
24 | </td> | |
25 | <% end %> |
|
25 | <% end %> | |
26 | <td align="center" style="width:15%;"> |
|
26 | <td align="center" style="width:15%;"> | |
27 | <%= ff.check_box :active %> |
|
27 | <%= ff.check_box :active %> | |
28 | </td> |
|
28 | </td> | |
29 | </tr> |
|
29 | </tr> | |
30 | <% end %> |
|
30 | <% end %> | |
31 | <% end %> |
|
31 | <% end %> | |
32 | </table> |
|
32 | </table> | |
33 |
|
33 | |||
34 | <div class="contextual"> |
|
34 | <div class="contextual"> | |
35 | <%= link_to(l(:button_reset), {:controller => 'projects', :action => 'reset_activities', :id => @project}, |
|
35 | <%= link_to(l(:button_reset), {:controller => 'projects', :action => 'reset_activities', :id => @project}, | |
36 | :method => :delete, |
|
36 | :method => :delete, | |
37 | :confirm => l(:text_are_you_sure), |
|
37 | :confirm => l(:text_are_you_sure), | |
38 | :class => 'icon icon-del') %> |
|
38 | :class => 'icon icon-del') %> | |
39 | </div> |
|
39 | </div> | |
40 |
|
40 | |||
41 | <%= submit_tag l(:button_save) %> |
|
41 | <%= submit_tag l(:button_save) %> | |
42 | <% end %> |
|
42 | <% end %> |
@@ -1,32 +1,32 | |||||
1 | <% if @project.boards.any? %> |
|
1 | <% if @project.boards.any? %> | |
2 | <table class="list"> |
|
2 | <table class="list"> | |
3 | <thead> |
|
3 | <thead><tr> | |
4 | <th><%= l(:label_board) %></th> |
|
4 | <th><%= l(:label_board) %></th> | |
5 | <th><%= l(:field_description) %></th> |
|
5 | <th><%= l(:field_description) %></th> | |
6 | <th></th> |
|
6 | <th></th> | |
7 | <th></th> |
|
7 | <th></th> | |
8 | </thead> |
|
8 | </tr></thead> | |
9 | <tbody> |
|
9 | <tbody> | |
10 | <% @project.boards.each do |board| |
|
10 | <% @project.boards.each do |board| | |
11 | next if board.new_record? %> |
|
11 | next if board.new_record? %> | |
12 | <tr class="<%= cycle 'odd', 'even' %>"> |
|
12 | <tr class="<%= cycle 'odd', 'even' %>"> | |
13 | <td><%=h board.name %></td> |
|
13 | <td><%=h board.name %></td> | |
14 | <td><%=h board.description %></td> |
|
14 | <td><%=h board.description %></td> | |
15 | <td align="center"> |
|
15 | <td align="center"> | |
16 | <% if authorize_for("boards", "edit") %> |
|
16 | <% if authorize_for("boards", "edit") %> | |
17 | <%= reorder_links('board', {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board}) %> |
|
17 | <%= reorder_links('board', {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board}) %> | |
18 | <% end %> |
|
18 | <% end %> | |
19 | </td> |
|
19 | </td> | |
20 | <td class="buttons"> |
|
20 | <td class="buttons"> | |
21 | <%= link_to_if_authorized l(:button_edit), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board}, :class => 'icon icon-edit' %> |
|
21 | <%= link_to_if_authorized l(:button_edit), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board}, :class => 'icon icon-edit' %> | |
22 | <%= link_to_if_authorized l(:button_delete), {:controller => 'boards', :action => 'destroy', :project_id => @project, :id => board}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> |
|
22 | <%= link_to_if_authorized l(:button_delete), {:controller => 'boards', :action => 'destroy', :project_id => @project, :id => board}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> | |
23 | </td> |
|
23 | </td> | |
24 | </tr> |
|
24 | </tr> | |
25 | <% end %> |
|
25 | <% end %> | |
26 | </tbody> |
|
26 | </tbody> | |
27 | </table> |
|
27 | </table> | |
28 | <% else %> |
|
28 | <% else %> | |
29 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
29 | <p class="nodata"><%= l(:label_no_data) %></p> | |
30 | <% end %> |
|
30 | <% end %> | |
31 |
|
31 | |||
32 | <p><%= link_to_if_authorized l(:label_board_new), {:controller => 'boards', :action => 'new', :project_id => @project} %></p> |
|
32 | <p><%= link_to_if_authorized l(:label_board_new), {:controller => 'boards', :action => 'new', :project_id => @project} %></p> |
@@ -1,27 +1,27 | |||||
1 | <% if @project.issue_categories.any? %> |
|
1 | <% if @project.issue_categories.any? %> | |
2 | <table class="list"> |
|
2 | <table class="list"> | |
3 | <thead> |
|
3 | <thead><tr> | |
4 | <th><%= l(:label_issue_category) %></th> |
|
4 | <th><%= l(:label_issue_category) %></th> | |
5 | <th><%= l(:field_assigned_to) %></th> |
|
5 | <th><%= l(:field_assigned_to) %></th> | |
6 | <th></th> |
|
6 | <th></th> | |
7 | </thead> |
|
7 | </tr></thead> | |
8 | <tbody> |
|
8 | <tbody> | |
9 | <% for category in @project.issue_categories %> |
|
9 | <% for category in @project.issue_categories %> | |
10 | <% unless category.new_record? %> |
|
10 | <% unless category.new_record? %> | |
11 | <tr class="<%= cycle 'odd', 'even' %>"> |
|
11 | <tr class="<%= cycle 'odd', 'even' %>"> | |
12 | <td><%=h(category.name) %></td> |
|
12 | <td><%=h(category.name) %></td> | |
13 | <td><%=h(category.assigned_to.name) if category.assigned_to %></td> |
|
13 | <td><%=h(category.assigned_to.name) if category.assigned_to %></td> | |
14 | <td class="buttons"> |
|
14 | <td class="buttons"> | |
15 | <%= link_to_if_authorized l(:button_edit), { :controller => 'issue_categories', :action => 'edit', :id => category }, :class => 'icon icon-edit' %> |
|
15 | <%= link_to_if_authorized l(:button_edit), { :controller => 'issue_categories', :action => 'edit', :id => category }, :class => 'icon icon-edit' %> | |
16 | <%= link_to_if_authorized l(:button_delete), {:controller => 'issue_categories', :action => 'destroy', :id => category}, :method => :post, :class => 'icon icon-del' %> |
|
16 | <%= link_to_if_authorized l(:button_delete), {:controller => 'issue_categories', :action => 'destroy', :id => category}, :method => :post, :class => 'icon icon-del' %> | |
17 | </td> |
|
17 | </td> | |
18 | </tr> |
|
18 | </tr> | |
19 | <% end %> |
|
19 | <% end %> | |
20 | <% end %> |
|
20 | <% end %> | |
21 | </tbody> |
|
21 | </tbody> | |
22 | </table> |
|
22 | </table> | |
23 | <% else %> |
|
23 | <% else %> | |
24 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
24 | <p class="nodata"><%= l(:label_no_data) %></p> | |
25 | <% end %> |
|
25 | <% end %> | |
26 |
|
26 | |||
27 | <p><%= link_to_if_authorized l(:label_issue_category_new), :controller => 'issue_categories', :action => 'new', :project_id => @project %></p> |
|
27 | <p><%= link_to_if_authorized l(:label_issue_category_new), :controller => 'issue_categories', :action => 'new', :project_id => @project %></p> |
@@ -1,82 +1,82 | |||||
1 | <%= error_messages_for 'member' %> |
|
1 | <%= error_messages_for 'member' %> | |
2 | <% roles = Role.find_all_givable |
|
2 | <% roles = Role.find_all_givable | |
3 | members = @project.member_principals.find(:all, :include => [:roles, :principal]).sort %> |
|
3 | members = @project.member_principals.find(:all, :include => [:roles, :principal]).sort %> | |
4 |
|
4 | |||
5 | <div class="splitcontentleft"> |
|
5 | <div class="splitcontentleft"> | |
6 | <% if members.any? %> |
|
6 | <% if members.any? %> | |
7 | <table class="list members"> |
|
7 | <table class="list members"> | |
8 | <thead> |
|
8 | <thead><tr> | |
9 | <th><%= l(:label_user) %> / <%= l(:label_group) %></th> |
|
9 | <th><%= l(:label_user) %> / <%= l(:label_group) %></th> | |
10 | <th><%= l(:label_role_plural) %></th> |
|
10 | <th><%= l(:label_role_plural) %></th> | |
11 | <th style="width:15%"></th> |
|
11 | <th style="width:15%"></th> | |
12 | <%= call_hook(:view_projects_settings_members_table_header, :project => @project) %> |
|
12 | <%= call_hook(:view_projects_settings_members_table_header, :project => @project) %> | |
13 | </thead> |
|
13 | </tr></thead> | |
14 | <tbody> |
|
14 | <tbody> | |
15 | <% members.each do |member| %> |
|
15 | <% members.each do |member| %> | |
16 | <% next if member.new_record? %> |
|
16 | <% next if member.new_record? %> | |
17 | <tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member"> |
|
17 | <tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member"> | |
18 | <td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td> |
|
18 | <td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td> | |
19 | <td class="roles"> |
|
19 | <td class="roles"> | |
20 | <span id="member-<%= member.id %>-roles"><%=h member.roles.sort.collect(&:to_s).join(', ') %></span> |
|
20 | <span id="member-<%= member.id %>-roles"><%=h member.roles.sort.collect(&:to_s).join(', ') %></span> | |
21 | <% if authorize_for('members', 'edit') %> |
|
21 | <% if authorize_for('members', 'edit') %> | |
22 | <% remote_form_for(:member, member, :url => {:controller => 'members', :action => 'edit', :id => member}, |
|
22 | <% remote_form_for(:member, member, :url => {:controller => 'members', :action => 'edit', :id => member}, | |
23 | :method => :post, |
|
23 | :method => :post, | |
24 | :html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }) do |f| %> |
|
24 | :html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }) do |f| %> | |
25 | <p><% roles.each do |role| %> |
|
25 | <p><% roles.each do |role| %> | |
26 | <label><%= check_box_tag 'member[role_ids][]', role.id, member.roles.include?(role), |
|
26 | <label><%= check_box_tag 'member[role_ids][]', role.id, member.roles.include?(role), | |
27 | :disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br /> |
|
27 | :disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br /> | |
28 | <% end %></p> |
|
28 | <% end %></p> | |
29 | <%= hidden_field_tag 'member[role_ids][]', '' %> |
|
29 | <%= hidden_field_tag 'member[role_ids][]', '' %> | |
30 | <p><%= submit_tag l(:button_change), :class => "small" %> |
|
30 | <p><%= submit_tag l(:button_change), :class => "small" %> | |
31 | <%= link_to_function l(:button_cancel), "$('member-#{member.id}-roles').show(); $('member-#{member.id}-roles-form').hide(); return false;" %></p> |
|
31 | <%= link_to_function l(:button_cancel), "$('member-#{member.id}-roles').show(); $('member-#{member.id}-roles-form').hide(); return false;" %></p> | |
32 | <% end %> |
|
32 | <% end %> | |
33 | <% end %> |
|
33 | <% end %> | |
34 | </td> |
|
34 | </td> | |
35 | <td class="buttons"> |
|
35 | <td class="buttons"> | |
36 | <%= link_to_function l(:button_edit), "$('member-#{member.id}-roles').hide(); $('member-#{member.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %> |
|
36 | <%= link_to_function l(:button_edit), "$('member-#{member.id}-roles').hide(); $('member-#{member.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %> | |
37 | <%= link_to_remote(l(:button_delete), { :url => {:controller => 'members', :action => 'destroy', :id => member}, |
|
37 | <%= link_to_remote(l(:button_delete), { :url => {:controller => 'members', :action => 'destroy', :id => member}, | |
38 | :method => :post, |
|
38 | :method => :post, | |
39 | :confirm => (!User.current.admin? && member.include?(User.current) ? l(:text_own_membership_delete_confirmation) : nil) |
|
39 | :confirm => (!User.current.admin? && member.include?(User.current) ? l(:text_own_membership_delete_confirmation) : nil) | |
40 | }, :title => l(:button_delete), |
|
40 | }, :title => l(:button_delete), | |
41 | :class => 'icon icon-del') if member.deletable? %> |
|
41 | :class => 'icon icon-del') if member.deletable? %> | |
42 | </td> |
|
42 | </td> | |
43 | <%= call_hook(:view_projects_settings_members_table_row, { :project => @project, :member => member}) %> |
|
43 | <%= call_hook(:view_projects_settings_members_table_row, { :project => @project, :member => member}) %> | |
44 | </tr> |
|
44 | </tr> | |
45 | </tbody> |
|
45 | </tbody> | |
46 | <% end; reset_cycle %> |
|
46 | <% end; reset_cycle %> | |
47 | </table> |
|
47 | </table> | |
48 | <% else %> |
|
48 | <% else %> | |
49 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
49 | <p class="nodata"><%= l(:label_no_data) %></p> | |
50 | <% end %> |
|
50 | <% end %> | |
51 | </div> |
|
51 | </div> | |
52 |
|
52 | |||
53 |
|
53 | |||
54 | <% principals = Principal.active.find(:all, :limit => 100, :order => 'type, login, lastname ASC') - @project.principals %> |
|
54 | <% principals = Principal.active.find(:all, :limit => 100, :order => 'type, login, lastname ASC') - @project.principals %> | |
55 |
|
55 | |||
56 | <div class="splitcontentright"> |
|
56 | <div class="splitcontentright"> | |
57 | <% if roles.any? && principals.any? %> |
|
57 | <% if roles.any? && principals.any? %> | |
58 | <% remote_form_for(:member, @member, :url => {:controller => 'members', :action => 'new', :id => @project}, :method => :post) do |f| %> |
|
58 | <% remote_form_for(:member, @member, :url => {:controller => 'members', :action => 'new', :id => @project}, :method => :post) do |f| %> | |
59 | <fieldset><legend><%=l(:label_member_new)%></legend> |
|
59 | <fieldset><legend><%=l(:label_member_new)%></legend> | |
60 |
|
60 | |||
61 | <p><%= text_field_tag 'principal_search', nil %></p> |
|
61 | <p><%= text_field_tag 'principal_search', nil %></p> | |
62 | <%= observe_field(:principal_search, |
|
62 | <%= observe_field(:principal_search, | |
63 | :frequency => 0.5, |
|
63 | :frequency => 0.5, | |
64 | :update => :principals, |
|
64 | :update => :principals, | |
65 | :url => { :controller => 'members', :action => 'autocomplete_for_member', :id => @project }, |
|
65 | :url => { :controller => 'members', :action => 'autocomplete_for_member', :id => @project }, | |
66 | :with => 'q') |
|
66 | :with => 'q') | |
67 | %> |
|
67 | %> | |
68 |
|
68 | |||
69 | <div id="principals"> |
|
69 | <div id="principals"> | |
70 | <%= principals_check_box_tags 'member[user_ids][]', principals %> |
|
70 | <%= principals_check_box_tags 'member[user_ids][]', principals %> | |
71 | </div> |
|
71 | </div> | |
72 |
|
72 | |||
73 | <p><%= l(:label_role_plural) %>: |
|
73 | <p><%= l(:label_role_plural) %>: | |
74 | <% roles.each do |role| %> |
|
74 | <% roles.each do |role| %> | |
75 | <label><%= check_box_tag 'member[role_ids][]', role.id %> <%=h role %></label> |
|
75 | <label><%= check_box_tag 'member[role_ids][]', role.id %> <%=h role %></label> | |
76 | <% end %></p> |
|
76 | <% end %></p> | |
77 |
|
77 | |||
78 | <p><%= submit_tag l(:button_add) %></p> |
|
78 | <p><%= submit_tag l(:button_add) %></p> | |
79 | </fieldset> |
|
79 | </fieldset> | |
80 | <% end %> |
|
80 | <% end %> | |
81 | <% end %> |
|
81 | <% end %> | |
82 | </div> |
|
82 | </div> |
@@ -1,41 +1,41 | |||||
1 | <% if @project.shared_versions.any? %> |
|
1 | <% if @project.shared_versions.any? %> | |
2 | <table class="list versions"> |
|
2 | <table class="list versions"> | |
3 | <thead> |
|
3 | <thead><tr> | |
4 | <th><%= l(:label_version) %></th> |
|
4 | <th><%= l(:label_version) %></th> | |
5 | <th><%= l(:field_effective_date) %></th> |
|
5 | <th><%= l(:field_effective_date) %></th> | |
6 | <th><%= l(:field_description) %></th> |
|
6 | <th><%= l(:field_description) %></th> | |
7 | <th><%= l(:field_status) %></th> |
|
7 | <th><%= l(:field_status) %></th> | |
8 | <th><%= l(:field_sharing) %></th> |
|
8 | <th><%= l(:field_sharing) %></th> | |
9 | <th><%= l(:label_wiki_page) unless @project.wiki.nil? %></th> |
|
9 | <th><%= l(:label_wiki_page) unless @project.wiki.nil? %></th> | |
10 | <th style="width:15%"></th> |
|
10 | <th style="width:15%"></th> | |
11 | </thead> |
|
11 | </tr></thead> | |
12 | <tbody> |
|
12 | <tbody> | |
13 | <% for version in @project.shared_versions.sort %> |
|
13 | <% for version in @project.shared_versions.sort %> | |
14 | <tr class="version <%= cycle 'odd', 'even' %> <%=h version.status %> <%= 'shared' if version.project != @project %>"> |
|
14 | <tr class="version <%= cycle 'odd', 'even' %> <%=h version.status %> <%= 'shared' if version.project != @project %>"> | |
15 | <td class="name"><%= link_to_version version %></td> |
|
15 | <td class="name"><%= link_to_version version %></td> | |
16 | <td class="date"><%= format_date(version.effective_date) %></td> |
|
16 | <td class="date"><%= format_date(version.effective_date) %></td> | |
17 | <td class="description"><%=h version.description %></td> |
|
17 | <td class="description"><%=h version.description %></td> | |
18 | <td class="status"><%= l("version_status_#{version.status}") %></td> |
|
18 | <td class="status"><%= l("version_status_#{version.status}") %></td> | |
19 | <td class="sharing"><%=h format_version_sharing(version.sharing) %></td> |
|
19 | <td class="sharing"><%=h format_version_sharing(version.sharing) %></td> | |
20 | <td><%= link_to(h(version.wiki_page_title), :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td> |
|
20 | <td><%= link_to(h(version.wiki_page_title), :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td> | |
21 | <td class="buttons"> |
|
21 | <td class="buttons"> | |
22 | <% if version.project == @project %> |
|
22 | <% if version.project == @project %> | |
23 | <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %> |
|
23 | <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %> | |
24 | <%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => version}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> |
|
24 | <%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => version}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> | |
25 | <% end %> |
|
25 | <% end %> | |
26 | </td> |
|
26 | </td> | |
27 | </tr> |
|
27 | </tr> | |
28 | <% end; reset_cycle %> |
|
28 | <% end; reset_cycle %> | |
29 | </tbody> |
|
29 | </tbody> | |
30 | </table> |
|
30 | </table> | |
31 | <% else %> |
|
31 | <% else %> | |
32 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
32 | <p class="nodata"><%= l(:label_no_data) %></p> | |
33 | <% end %> |
|
33 | <% end %> | |
34 |
|
34 | |||
35 | <div class="contextual"> |
|
35 | <div class="contextual"> | |
36 | <% if @project.versions.any? %> |
|
36 | <% if @project.versions.any? %> | |
37 | <%= link_to l(:label_close_versions), {:controller => 'versions', :action => 'close_completed', :project_id => @project}, :method => :post %> |
|
37 | <%= link_to l(:label_close_versions), {:controller => 'versions', :action => 'close_completed', :project_id => @project}, :method => :post %> | |
38 | <% end %> |
|
38 | <% end %> | |
39 | </div> |
|
39 | </div> | |
40 |
|
40 | |||
41 | <p><%= link_to_if_authorized l(:label_version_new), :controller => 'versions', :action => 'new', :project_id => @project %></p> |
|
41 | <p><%= link_to_if_authorized l(:label_version_new), :controller => 'versions', :action => 'new', :project_id => @project %></p> |
@@ -1,60 +1,60 | |||||
1 | <% roles = Role.find_all_givable %> |
|
1 | <% roles = Role.find_all_givable %> | |
2 | <% projects = Project.active.find(:all, :order => 'lft') %> |
|
2 | <% projects = Project.active.find(:all, :order => 'lft') %> | |
3 |
|
3 | |||
4 | <div class="splitcontentleft"> |
|
4 | <div class="splitcontentleft"> | |
5 | <% if @user.memberships.any? %> |
|
5 | <% if @user.memberships.any? %> | |
6 | <table class="list memberships"> |
|
6 | <table class="list memberships"> | |
7 | <thead> |
|
7 | <thead><tr> | |
8 | <th><%= l(:label_project) %></th> |
|
8 | <th><%= l(:label_project) %></th> | |
9 | <th><%= l(:label_role_plural) %></th> |
|
9 | <th><%= l(:label_role_plural) %></th> | |
10 | <th style="width:15%"></th> |
|
10 | <th style="width:15%"></th> | |
11 | <%= call_hook(:view_users_memberships_table_header, :user => @user )%> |
|
11 | <%= call_hook(:view_users_memberships_table_header, :user => @user )%> | |
12 | </thead> |
|
12 | </tr></thead> | |
13 | <tbody> |
|
13 | <tbody> | |
14 | <% @user.memberships.each do |membership| %> |
|
14 | <% @user.memberships.each do |membership| %> | |
15 | <% next if membership.new_record? %> |
|
15 | <% next if membership.new_record? %> | |
16 | <tr id="member-<%= membership.id %>" class="<%= cycle 'odd', 'even' %> class"> |
|
16 | <tr id="member-<%= membership.id %>" class="<%= cycle 'odd', 'even' %> class"> | |
17 | <td class="project"><%=h membership.project %></td> |
|
17 | <td class="project"><%=h membership.project %></td> | |
18 | <td class="roles"> |
|
18 | <td class="roles"> | |
19 | <span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span> |
|
19 | <span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span> | |
20 | <% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @user, :membership_id => membership }, |
|
20 | <% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @user, :membership_id => membership }, | |
21 | :html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %> |
|
21 | :html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %> | |
22 | <p><% roles.each do |role| %> |
|
22 | <p><% roles.each do |role| %> | |
23 | <label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role), |
|
23 | <label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role), | |
24 | :disabled => membership.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br /> |
|
24 | :disabled => membership.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br /> | |
25 | <% end %></p> |
|
25 | <% end %></p> | |
26 | <%= hidden_field_tag 'membership[role_ids][]', '' %> |
|
26 | <%= hidden_field_tag 'membership[role_ids][]', '' %> | |
27 | <p><%= submit_tag l(:button_change) %> |
|
27 | <p><%= submit_tag l(:button_change) %> | |
28 | <%= link_to_function l(:button_cancel), "$('member-#{membership.id}-roles').show(); $('member-#{membership.id}-roles-form').hide(); return false;" %></p> |
|
28 | <%= link_to_function l(:button_cancel), "$('member-#{membership.id}-roles').show(); $('member-#{membership.id}-roles-form').hide(); return false;" %></p> | |
29 | <% end %> |
|
29 | <% end %> | |
30 | </td> |
|
30 | </td> | |
31 | <td class="buttons"> |
|
31 | <td class="buttons"> | |
32 | <%= link_to_function l(:button_edit), "$('member-#{membership.id}-roles').hide(); $('member-#{membership.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %> |
|
32 | <%= link_to_function l(:button_edit), "$('member-#{membership.id}-roles').hide(); $('member-#{membership.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %> | |
33 | <%= link_to_remote(l(:button_delete), { :url => { :controller => 'users', :action => 'destroy_membership', :id => @user, :membership_id => membership }, |
|
33 | <%= link_to_remote(l(:button_delete), { :url => { :controller => 'users', :action => 'destroy_membership', :id => @user, :membership_id => membership }, | |
34 | :method => :post }, |
|
34 | :method => :post }, | |
35 | :class => 'icon icon-del') if membership.deletable? %> |
|
35 | :class => 'icon icon-del') if membership.deletable? %> | |
36 | </td> |
|
36 | </td> | |
37 | <%= call_hook(:view_users_memberships_table_row, :user => @user, :membership => membership, :roles => roles, :projects => projects )%> |
|
37 | <%= call_hook(:view_users_memberships_table_row, :user => @user, :membership => membership, :roles => roles, :projects => projects )%> | |
38 | </tr> |
|
38 | </tr> | |
39 | </tbody> |
|
39 | </tbody> | |
40 | <% end; reset_cycle %> |
|
40 | <% end; reset_cycle %> | |
41 | </table> |
|
41 | </table> | |
42 | <% else %> |
|
42 | <% else %> | |
43 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
43 | <p class="nodata"><%= l(:label_no_data) %></p> | |
44 | <% end %> |
|
44 | <% end %> | |
45 | </div> |
|
45 | </div> | |
46 |
|
46 | |||
47 | <div class="splitcontentright"> |
|
47 | <div class="splitcontentright"> | |
48 | <% if projects.any? %> |
|
48 | <% if projects.any? %> | |
49 | <fieldset><legend><%=l(:label_project_new)%></legend> |
|
49 | <fieldset><legend><%=l(:label_project_new)%></legend> | |
50 | <% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @user }) do %> |
|
50 | <% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @user }) do %> | |
51 | <%= select_tag 'membership[project_id]', options_for_membership_project_select(@user, projects) %> |
|
51 | <%= select_tag 'membership[project_id]', options_for_membership_project_select(@user, projects) %> | |
52 | <p><%= l(:label_role_plural) %>: |
|
52 | <p><%= l(:label_role_plural) %>: | |
53 | <% roles.each do |role| %> |
|
53 | <% roles.each do |role| %> | |
54 | <label><%= check_box_tag 'membership[role_ids][]', role.id %> <%=h role %></label> |
|
54 | <label><%= check_box_tag 'membership[role_ids][]', role.id %> <%=h role %></label> | |
55 | <% end %></p> |
|
55 | <% end %></p> | |
56 | <p><%= submit_tag l(:button_add) %></p> |
|
56 | <p><%= submit_tag l(:button_add) %></p> | |
57 | <% end %> |
|
57 | <% end %> | |
58 | </fieldset> |
|
58 | </fieldset> | |
59 | <% end %> |
|
59 | <% end %> | |
60 | </div> |
|
60 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now