Revision 912:5e80956cc792 app/views/users
| app/views/users/_form.html.erb | ||
|---|---|---|
| 1 |
<%= javascript_include_tag "ssamr_institutions" %> |
|
| 2 |
|
|
| 3 |
|
|
| 4 |
<%= error_messages_for 'user' %> |
|
| 5 |
|
|
| 6 |
<div id="user_form"> |
|
| 7 |
<!--[form:user]--> |
|
| 8 |
<div class="splitcontentleft"> |
|
| 9 |
<fieldset class="box tabular"> |
|
| 10 |
<legend><%=l(:label_information_plural)%></legend> |
|
| 11 |
<p><%= f.text_field :login, :required => true, :size => 25 %></p> |
|
| 12 |
<p><%= f.text_field :firstname, :required => true %></p> |
|
| 13 |
<p><%= f.text_field :lastname, :required => true %></p> |
|
| 14 |
<p><%= f.text_field :mail, :required => true %></p> |
|
| 15 |
<p><%= f.select :language, lang_options_for_select %></p> |
|
| 16 |
<% if Setting.openid? %> |
|
| 17 |
<p><%= f.text_field :identity_url %></p> |
|
| 18 |
<% end %> |
|
| 19 |
|
|
| 20 |
<% @user.custom_field_values.each do |value| %> |
|
| 21 |
<p><%= custom_field_tag_with_label :user, value %></p> |
|
| 22 |
<% end %> |
|
| 23 |
|
|
| 24 |
<p><%= f.check_box :admin, :disabled => (@user == User.current) %></p> |
|
| 25 |
<%= call_hook(:view_users_form, :user => @user, :form => f) %> |
|
| 26 |
</fieldset> |
|
| 27 |
|
|
| 28 |
<div class="box tabular"> |
|
| 29 |
<h3><%=l(:label_ssamr_details)%></h3> |
|
| 30 |
<% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %> |
|
| 31 |
<p> |
|
| 32 |
<%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %> |
|
| 33 |
</p> |
|
| 34 |
|
|
| 35 |
<p><label for="institution"><%=l("field_ssamr_user_detail.institution")%> <span class="required">*</span></label>
|
|
| 36 |
<nobr> |
|
| 37 |
<%= ssamr_user_detail.radio_button :institution_type, true %> |
|
| 38 |
<%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true} ).gsub('&', '&') %>
|
|
| 39 |
</nobr> |
|
| 40 |
</p> |
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
<p> |
|
| 45 |
<nobr> |
|
| 46 |
<%= ssamr_user_detail.radio_button :institution_type, false %> Other: |
|
| 47 |
<%= ssamr_user_detail.text_field :other_institution %> |
|
| 48 |
</nobr> |
|
| 49 |
</p> |
|
| 50 |
<% end %> |
|
| 51 |
</div> |
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
<fieldset class="box tabular"> |
|
| 56 |
<legend><%=l(:label_authentication)%></legend> |
|
| 57 |
<% unless @auth_sources.empty? %> |
|
| 58 |
<p><%= f.select :auth_source_id, ([[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='') {Element.show('password_fields');} else {Element.hide('password_fields');}" %></p>
|
|
| 59 |
<% end %> |
|
| 60 |
<div id="password_fields" style="<%= 'display:none;' if @user.auth_source %>"> |
|
| 61 |
<p><%= f.password_field :password, :required => true, :size => 25 %><br /> |
|
| 62 |
<em><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p> |
|
| 63 |
<p><%= f.password_field :password_confirmation, :required => true, :size => 25 %></p> |
|
| 64 |
</div> |
|
| 65 |
</fieldset> |
|
| 66 |
</div> |
|
| 67 |
|
|
| 68 |
<div class="splitcontentright"> |
|
| 69 |
<fieldset class="box"> |
|
| 70 |
<legend><%=l(:field_mail_notification)%></legend> |
|
| 71 |
<%= render :partial => 'users/mail_notifications' %> |
|
| 72 |
</fieldset> |
|
| 73 |
|
|
| 74 |
<fieldset class="box tabular"> |
|
| 75 |
<legend><%=l(:label_preferences)%></legend> |
|
| 76 |
<%= render :partial => 'users/preferences' %> |
|
| 77 |
</fieldset> |
|
| 78 |
</div> |
|
| 79 |
</div> |
|
| 80 |
<div style="clear:left;"></div> |
|
| 81 |
<!--[eoform:user]--> |
|
| app/views/users/_form.rhtml | ||
|---|---|---|
| 1 |
<%= javascript_include_tag "ssamr_institutions" %> |
|
| 2 |
|
|
| 3 |
|
|
| 4 |
<%= error_messages_for 'user' %> |
|
| 5 |
|
|
| 6 |
<div id="user_form"> |
|
| 7 |
<!--[form:user]--> |
|
| 8 |
<div class="splitcontentleft"> |
|
| 9 |
<h3><%=l(:label_information_plural)%></h3> |
|
| 10 |
<div class="box tabular"> |
|
| 11 |
<p><%= f.text_field :login, :required => true, :size => 25 %></p> |
|
| 12 |
<p><%= f.text_field :firstname, :required => true %></p> |
|
| 13 |
<p><%= f.text_field :lastname, :required => true %></p> |
|
| 14 |
<p><%= f.text_field :mail, :required => true %></p> |
|
| 15 |
<p><%= f.select :language, lang_options_for_select %></p> |
|
| 16 |
<% if Setting.openid? %> |
|
| 17 |
<p><%= f.text_field :identity_url %></p> |
|
| 18 |
<% end %> |
|
| 19 |
|
|
| 20 |
<% @user.custom_field_values.each do |value| %> |
|
| 21 |
<p><%= custom_field_tag_with_label :user, value %></p> |
|
| 22 |
<% end %> |
|
| 23 |
|
|
| 24 |
<p><%= f.check_box :admin, :disabled => (@user == User.current) %></p> |
|
| 25 |
<%= call_hook(:view_users_form, :user => @user, :form => f) %> |
|
| 26 |
</div> |
|
| 27 |
|
|
| 28 |
<div class="box tabular"> |
|
| 29 |
<h3><%=l(:label_ssamr_details)%></h3> |
|
| 30 |
<% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %> |
|
| 31 |
<p> |
|
| 32 |
<%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %> |
|
| 33 |
</p> |
|
| 34 |
|
|
| 35 |
<p><label for="institution"><%=l("field_ssamr_user_detail.institution")%> <span class="required">*</span></label>
|
|
| 36 |
<nobr> |
|
| 37 |
<%= ssamr_user_detail.radio_button :institution_type, true %> |
|
| 38 |
<%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true} ).gsub('&', '&') %>
|
|
| 39 |
</nobr> |
|
| 40 |
</p> |
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
<p> |
|
| 45 |
<nobr> |
|
| 46 |
<%= ssamr_user_detail.radio_button :institution_type, false %> Other: |
|
| 47 |
<%= ssamr_user_detail.text_field :other_institution %> |
|
| 48 |
</nobr> |
|
| 49 |
</p> |
|
| 50 |
<% end %> |
|
| 51 |
</div> |
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
<h3><%=l(:label_authentication)%></h3> |
|
| 56 |
<div class="box tabular"> |
|
| 57 |
<% unless @auth_sources.empty? %> |
|
| 58 |
<p><%= f.select :auth_source_id, ([[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='') {Element.show('password_fields');} else {Element.hide('password_fields');}" %></p>
|
|
| 59 |
<% end %> |
|
| 60 |
<div id="password_fields" style="<%= 'display:none;' if @user.auth_source %>"> |
|
| 61 |
<p><%= f.password_field :password, :required => true, :size => 25 %><br /> |
|
| 62 |
<em><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p> |
|
| 63 |
<p><%= f.password_field :password_confirmation, :required => true, :size => 25 %></p> |
|
| 64 |
</div> |
|
| 65 |
</div> |
|
| 66 |
</div> |
|
| 67 |
|
|
| 68 |
<div class="splitcontentright"> |
|
| 69 |
<h3><%=l(:field_mail_notification)%></h3> |
|
| 70 |
<div class="box"> |
|
| 71 |
<%= render :partial => 'users/mail_notifications' %> |
|
| 72 |
</div> |
|
| 73 |
|
|
| 74 |
<h3><%=l(:label_preferences)%></h3> |
|
| 75 |
<div class="box tabular"> |
|
| 76 |
<%= render :partial => 'users/preferences' %> |
|
| 77 |
</div> |
|
| 78 |
</div> |
|
| 79 |
</div> |
|
| 80 |
<div style="clear:left;"></div> |
|
| 81 |
<!--[eoform:user]--> |
|
| app/views/users/_general.html.erb | ||
|---|---|---|
| 1 |
<% form_for @user, :builder => TabularFormBuilder do |f| %> |
|
| 2 |
<%= render :partial => 'form', :locals => { :f => f } %>
|
|
| 3 |
<% if @user.active? && email_delivery_enabled? -%> |
|
| 4 |
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p> |
|
| 5 |
<% end -%> |
|
| 6 |
<p><%= submit_tag l(:button_save) %></p> |
|
| 7 |
<% end %> |
|
| app/views/users/_general.rhtml | ||
|---|---|---|
| 1 |
<% labelled_tabular_form_for :user, @user, :url => { :controller => 'users', :action => "update", :tab => nil }, :html => { :method => :put, :class => nil } do |f| %>
|
|
| 2 |
<%= render :partial => 'form', :locals => { :f => f } %>
|
|
| 3 |
<% if @user.active? -%> |
|
| 4 |
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p> |
|
| 5 |
<% end -%> |
|
| 6 |
<p><%= submit_tag l(:button_save) %></p> |
|
| 7 |
<% end %> |
|
| app/views/users/_groups.html.erb | ||
|---|---|---|
| 1 |
<% form_for(:user, :url => { :action => 'update' }, :html => {:method => :put}) do %>
|
|
| 2 |
<div class="box"> |
|
| 3 |
<% Group.all.sort.each do |group| %> |
|
| 4 |
<label><%= check_box_tag 'user[group_ids][]', group.id, @user.groups.include?(group) %> <%=h group %></label><br /> |
|
| 5 |
<% end %> |
|
| 6 |
<%= hidden_field_tag 'user[group_ids][]', '' %> |
|
| 7 |
</div> |
|
| 8 |
<%= submit_tag l(:button_save) %> |
|
| 9 |
<% end %> |
|
| app/views/users/_groups.rhtml | ||
|---|---|---|
| 1 |
<% form_for(:user, :url => { :action => 'update' }, :html => {:method => :put}) do %>
|
|
| 2 |
<div class="box"> |
|
| 3 |
<% Group.all.sort.each do |group| %> |
|
| 4 |
<label><%= check_box_tag 'user[group_ids][]', group.id, @user.groups.include?(group) %> <%=h group %></label><br /> |
|
| 5 |
<% end %> |
|
| 6 |
<%= hidden_field_tag 'user[group_ids][]', '' %> |
|
| 7 |
</div> |
|
| 8 |
<%= submit_tag l(:button_save) %> |
|
| 9 |
<% end %> |
|
| app/views/users/_mail_notifications.html.erb | ||
|---|---|---|
| 1 | 1 |
<p> |
| 2 |
<%= label_tag "user_mail_notification", l(:description_user_mail_notification), :class => "hidden-for-sighted" %> |
|
| 2 | 3 |
<%= select_tag 'user[mail_notification]', options_for_select(user_mail_notification_options(@user), @user.mail_notification), |
| 3 | 4 |
:onchange => 'if (this.value == "selected") {Element.show("notified-projects")} else {Element.hide("notified-projects")}' %>
|
| 4 | 5 |
</p> |
| ... | ... | |
| 8 | 9 |
<% end %></p> |
| 9 | 10 |
<p><em><%= l(:text_user_mail_option) %></em></p> |
| 10 | 11 |
<% end %> |
| 11 |
<p><label><%= l(:label_user_mail_no_self_notified) %></label><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified] %></p>
|
|
| 12 |
<p><label><%= l(:label_user_mail_no_self_notified) %><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified] %></label></p>
|
|
| 12 | 13 |
|
| app/views/users/_memberships.html.erb | ||
|---|---|---|
| 1 |
<% roles = Role.find_all_givable %> |
|
| 2 |
<% projects = Project.active.find(:all, :order => 'lft') %> |
|
| 3 |
|
|
| 4 |
<div class="splitcontentleft"> |
|
| 5 |
<% if @user.memberships.any? %> |
|
| 6 |
<table class="list memberships"> |
|
| 7 |
<thead><tr> |
|
| 8 |
<th><%= l(:label_project) %></th> |
|
| 9 |
<th><%= l(:label_role_plural) %></th> |
|
| 10 |
<th style="width:15%"></th> |
|
| 11 |
<%= call_hook(:view_users_memberships_table_header, :user => @user )%> |
|
| 12 |
</tr></thead> |
|
| 13 |
<tbody> |
|
| 14 |
<% @user.memberships.each do |membership| %> |
|
| 15 |
<% next if membership.new_record? %> |
|
| 16 |
<tr id="member-<%= membership.id %>" class="<%= cycle 'odd', 'even' %> class"> |
|
| 17 |
<td class="project"> |
|
| 18 |
<%= link_to_project membership.project %> |
|
| 19 |
</td> |
|
| 20 |
<td class="roles"> |
|
| 21 |
<span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span>
|
|
| 22 |
<% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @user, :membership_id => membership },
|
|
| 23 |
:html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %>
|
|
| 24 |
<p><% roles.each do |role| %> |
|
| 25 |
<label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role), |
|
| 26 |
:disabled => membership.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br />
|
|
| 27 |
<% end %></p> |
|
| 28 |
<%= hidden_field_tag 'membership[role_ids][]', '' %> |
|
| 29 |
<p><%= submit_tag l(:button_change) %> |
|
| 30 |
<%= link_to_function l(:button_cancel), "$('member-#{membership.id}-roles').show(); $('member-#{membership.id}-roles-form').hide(); return false;" %></p>
|
|
| 31 |
<% end %> |
|
| 32 |
</td> |
|
| 33 |
<td class="buttons"> |
|
| 34 |
<%= link_to_function l(:button_edit), "$('member-#{membership.id}-roles').hide(); $('member-#{membership.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %>
|
|
| 35 |
<%= link_to_remote(l(:button_delete), { :url => { :controller => 'users', :action => 'destroy_membership', :id => @user, :membership_id => membership },
|
|
| 36 |
:method => :post }, |
|
| 37 |
:class => 'icon icon-del') if membership.deletable? %> |
|
| 38 |
</td> |
|
| 39 |
<%= call_hook(:view_users_memberships_table_row, :user => @user, :membership => membership, :roles => roles, :projects => projects )%> |
|
| 40 |
</tr> |
|
| 41 |
<% end; reset_cycle %> |
|
| 42 |
</tbody> |
|
| 43 |
</table> |
|
| 44 |
<% else %> |
|
| 45 |
<p class="nodata"><%= l(:label_no_data) %></p> |
|
| 46 |
<% end %> |
|
| 47 |
</div> |
|
| 48 |
|
|
| 49 |
<div class="splitcontentright"> |
|
| 50 |
<% if projects.any? %> |
|
| 51 |
<fieldset><legend><%=l(:label_project_new)%></legend> |
|
| 52 |
<% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @user }) do %>
|
|
| 53 |
<%= select_tag 'membership[project_id]', options_for_membership_project_select(@user, projects) %> |
|
| 54 |
<p><%= l(:label_role_plural) %>: |
|
| 55 |
<% roles.each do |role| %> |
|
| 56 |
<label><%= check_box_tag 'membership[role_ids][]', role.id %> <%=h role %></label> |
|
| 57 |
<% end %></p> |
|
| 58 |
<p><%= submit_tag l(:button_add) %></p> |
|
| 59 |
<% end %> |
|
| 60 |
</fieldset> |
|
| 61 |
<% end %> |
|
| 62 |
</div> |
|
| app/views/users/_memberships.rhtml | ||
|---|---|---|
| 1 |
<% roles = Role.find_all_givable %> |
|
| 2 |
<% projects = Project.active.find(:all, :order => 'lft') %> |
|
| 3 |
|
|
| 4 |
<div class="splitcontentleft"> |
|
| 5 |
<% if @user.memberships.any? %> |
|
| 6 |
<table class="list memberships"> |
|
| 7 |
<thead><tr> |
|
| 8 |
<th><%= l(:label_project) %></th> |
|
| 9 |
<th><%= l(:label_role_plural) %></th> |
|
| 10 |
<th style="width:15%"></th> |
|
| 11 |
<%= call_hook(:view_users_memberships_table_header, :user => @user )%> |
|
| 12 |
</tr></thead> |
|
| 13 |
<tbody> |
|
| 14 |
<% @user.memberships.each do |membership| %> |
|
| 15 |
<% next if membership.new_record? %> |
|
| 16 |
<tr id="member-<%= membership.id %>" class="<%= cycle 'odd', 'even' %> class"> |
|
| 17 |
<td class="project"> |
|
| 18 |
<%= link_to_project membership.project %> |
|
| 19 |
</td> |
|
| 20 |
<td class="roles"> |
|
| 21 |
<span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span>
|
|
| 22 |
<% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @user, :membership_id => membership },
|
|
| 23 |
:html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %>
|
|
| 24 |
<p><% roles.each do |role| %> |
|
| 25 |
<label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role), |
|
| 26 |
:disabled => membership.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br />
|
|
| 27 |
<% end %></p> |
|
| 28 |
<%= hidden_field_tag 'membership[role_ids][]', '' %> |
|
| 29 |
<p><%= submit_tag l(:button_change) %> |
|
| 30 |
<%= link_to_function l(:button_cancel), "$('member-#{membership.id}-roles').show(); $('member-#{membership.id}-roles-form').hide(); return false;" %></p>
|
|
| 31 |
<% end %> |
|
| 32 |
</td> |
|
| 33 |
<td class="buttons"> |
|
| 34 |
<%= link_to_function l(:button_edit), "$('member-#{membership.id}-roles').hide(); $('member-#{membership.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %>
|
|
| 35 |
<%= link_to_remote(l(:button_delete), { :url => { :controller => 'users', :action => 'destroy_membership', :id => @user, :membership_id => membership },
|
|
| 36 |
:method => :post }, |
|
| 37 |
:class => 'icon icon-del') if membership.deletable? %> |
|
| 38 |
</td> |
|
| 39 |
<%= call_hook(:view_users_memberships_table_row, :user => @user, :membership => membership, :roles => roles, :projects => projects )%> |
|
| 40 |
</tr> |
|
| 41 |
<% end; reset_cycle %> |
|
| 42 |
</tbody> |
|
| 43 |
</table> |
|
| 44 |
<% else %> |
|
| 45 |
<p class="nodata"><%= l(:label_no_data) %></p> |
|
| 46 |
<% end %> |
|
| 47 |
</div> |
|
| 48 |
|
|
| 49 |
<div class="splitcontentright"> |
|
| 50 |
<% if projects.any? %> |
|
| 51 |
<fieldset><legend><%=l(:label_project_new)%></legend> |
|
| 52 |
<% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @user }) do %>
|
|
| 53 |
<%= select_tag 'membership[project_id]', options_for_membership_project_select(@user, projects) %> |
|
| 54 |
<p><%= l(:label_role_plural) %>: |
|
| 55 |
<% roles.each do |role| %> |
|
| 56 |
<label><%= check_box_tag 'membership[role_ids][]', role.id %> <%=h role %></label> |
|
| 57 |
<% end %></p> |
|
| 58 |
<p><%= submit_tag l(:button_add) %></p> |
|
| 59 |
<% end %> |
|
| 60 |
</fieldset> |
|
| 61 |
<% end %> |
|
| 62 |
</div> |
|
| app/views/users/edit.html.erb | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to l(:label_profile), user_path(@user), :class => 'icon icon-user' %> |
|
| 3 |
<%= change_status_link(@user) %> |
|
| 4 |
<%= link_to(l(:button_delete), @user, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del') if User.current != @user %> |
|
| 5 |
</div> |
|
| 6 |
|
|
| 7 |
<h2><%= link_to l(:label_user_plural), users_path %> » <%=h @user.login %></h2> |
|
| 8 |
|
|
| 9 |
<%= render_tabs user_settings_tabs %> |
|
| 10 |
|
|
| 11 |
<% html_title(l(:label_user), @user.login, l(:label_administration)) -%> |
|
| 12 |
|
|
| app/views/users/edit.rhtml | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to l(:label_profile), user_path(@user), :class => 'icon icon-user' %> |
|
| 3 |
<%= change_status_link(@user) %> |
|
| 4 |
<%= link_to(l(:button_delete), @user, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del') if User.current != @user %> |
|
| 5 |
</div> |
|
| 6 |
|
|
| 7 |
<h2><%= link_to l(:label_user_plural), :controller => 'users', :action => 'index' %> » <%=h @user.login %></h2> |
|
| 8 |
|
|
| 9 |
<%= render_tabs user_settings_tabs %> |
|
| 10 |
|
|
| 11 |
<% html_title(l(:label_user), @user.login, l(:label_administration)) -%> |
|
| 12 |
|
|
| app/views/users/index.html.erb | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %> |
|
| 3 |
</div> |
|
| 4 |
|
|
| 5 |
<h2><%=l(:label_user_plural)%></h2> |
|
| 6 |
|
|
| 7 |
<% form_tag({}, :method => :get) do %>
|
|
| 8 |
<fieldset><legend><%= l(:label_filter_plural) %></legend> |
|
| 9 |
<label for='status'><%= l(:field_status) %>:</label> |
|
| 10 |
<%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> |
|
| 11 |
|
|
| 12 |
<% if @groups.present? %> |
|
| 13 |
<label for='group_id'><%= l(:label_group) %>:</label> |
|
| 14 |
<%= select_tag 'group_id', '<option></option>' + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %> |
|
| 15 |
<% end %> |
|
| 16 |
|
|
| 17 |
<label for='name'><%= l(:label_user) %>:</label> |
|
| 18 |
<%= text_field_tag 'name', params[:name], :size => 30 %> |
|
| 19 |
<%= submit_tag l(:button_apply), :class => "small", :name => nil %> |
|
| 20 |
<%= link_to l(:button_clear), users_path, :class => 'icon icon-reload' %> |
|
| 21 |
</fieldset> |
|
| 22 |
<% end %> |
|
| 23 |
|
|
| 24 |
|
|
| 25 |
<div class="autoscroll"> |
|
| 26 |
<table class="list"> |
|
| 27 |
<thead><tr> |
|
| 28 |
<%= sort_header_tag('login', :caption => l(:field_login)) %>
|
|
| 29 |
<%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
|
|
| 30 |
<%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
|
|
| 31 |
<%= sort_header_tag('mail', :caption => l(:field_mail)) %>
|
|
| 32 |
<%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %>
|
|
| 33 |
<%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %>
|
|
| 34 |
<%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %>
|
|
| 35 |
<th></th> |
|
| 36 |
</tr></thead> |
|
| 37 |
<tbody> |
|
| 38 |
<% for user in @users -%> |
|
| 39 |
<tr class="user <%= cycle("odd", "even") %> <%= %w(anon active registered locked)[user.status] %>">
|
|
| 40 |
<td class="username"><%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %></td> |
|
| 41 |
<td class="firstname"><%= h(user.firstname) %></td> |
|
| 42 |
<td class="lastname"><%= h(user.lastname) %></td> |
|
| 43 |
<td class="email"><%= mail_to(h(user.mail)) %></td> |
|
| 44 |
<td align="center"><%= checked_image user.admin? %></td> |
|
| 45 |
<td class="created_on" align="center"><%= format_time(user.created_on) %></td> |
|
| 46 |
<td class="last_login_on" align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td> |
|
| 47 |
<td class="buttons"> |
|
| 48 |
<%= change_status_link(user) %> |
|
| 49 |
<%= link_to(l(:button_delete), user, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del') unless User.current == user %> |
|
| 50 |
</td> |
|
| 51 |
</tr> |
|
| 52 |
<% end -%> |
|
| 53 |
</tbody> |
|
| 54 |
</table> |
|
| 55 |
</div> |
|
| 56 |
<p class="pagination"><%= pagination_links_full @user_pages, @user_count %></p> |
|
| 57 |
|
|
| 58 |
<% html_title(l(:label_user_plural)) -%> |
|
| app/views/users/index.rhtml | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to l(:label_user_new), {:action => 'new'}, :class => 'icon icon-add' %>
|
|
| 3 |
</div> |
|
| 4 |
|
|
| 5 |
<h2><%=l(:label_user_plural)%></h2> |
|
| 6 |
|
|
| 7 |
<% form_tag({}, :method => :get) do %>
|
|
| 8 |
<fieldset><legend><%= l(:label_filter_plural) %></legend> |
|
| 9 |
<label><%= l(:field_status) %>:</label> |
|
| 10 |
<%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> |
|
| 11 |
|
|
| 12 |
<% if @groups.present? %> |
|
| 13 |
<label><%= l(:label_group) %>:</label> |
|
| 14 |
<%= select_tag 'group_id', '<option></option>' + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %> |
|
| 15 |
<% end %> |
|
| 16 |
|
|
| 17 |
<label><%= l(:label_user) %>:</label> |
|
| 18 |
<%= text_field_tag 'name', params[:name], :size => 30 %> |
|
| 19 |
<%= submit_tag l(:button_apply), :class => "small", :name => nil %> |
|
| 20 |
<%= link_to l(:button_clear), users_path, :class => 'icon icon-reload' %> |
|
| 21 |
</fieldset> |
|
| 22 |
<% end %> |
|
| 23 |
|
|
| 24 |
|
|
| 25 |
<div class="autoscroll"> |
|
| 26 |
<table class="list"> |
|
| 27 |
<thead><tr> |
|
| 28 |
<%= sort_header_tag('login', :caption => l(:field_login)) %>
|
|
| 29 |
<%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
|
|
| 30 |
<%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
|
|
| 31 |
<%= sort_header_tag('mail', :caption => l(:field_mail)) %>
|
|
| 32 |
<%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %>
|
|
| 33 |
<%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %>
|
|
| 34 |
<%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %>
|
|
| 35 |
<th></th> |
|
| 36 |
</tr></thead> |
|
| 37 |
<tbody> |
|
| 38 |
<% for user in @users -%> |
|
| 39 |
<tr class="user <%= cycle("odd", "even") %> <%= %w(anon active registered locked)[user.status] %>">
|
|
| 40 |
<td class="username"><%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %></td> |
|
| 41 |
<td class="firstname"><%= h(user.firstname) %></td> |
|
| 42 |
<td class="lastname"><%= h(user.lastname) %></td> |
|
| 43 |
<td class="email"><%= mail_to(h(user.mail)) %></td> |
|
| 44 |
<td align="center"><%= checked_image user.admin? %></td> |
|
| 45 |
<td class="created_on" align="center"><%= format_time(user.created_on) %></td> |
|
| 46 |
<td class="last_login_on" align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td> |
|
| 47 |
<td class="buttons"> |
|
| 48 |
<%= change_status_link(user) %> |
|
| 49 |
<%= link_to(l(:button_delete), user, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del') unless User.current == user %> |
|
| 50 |
</td> |
|
| 51 |
</tr> |
|
| 52 |
<% end -%> |
|
| 53 |
</tbody> |
|
| 54 |
</table> |
|
| 55 |
</div> |
|
| 56 |
<p class="pagination"><%= pagination_links_full @user_pages, @user_count %></p> |
|
| 57 |
|
|
| 58 |
<% html_title(l(:label_user_plural)) -%> |
|
| app/views/users/new.html.erb | ||
|---|---|---|
| 1 |
<h2><%= link_to l(:label_user_plural), :controller => 'users', :action => 'index' %> » <%=l(:label_user_new)%></h2>
|
|
| 1 |
<h2><%= link_to l(:label_user_plural), users_path %> » <%=l(:label_user_new)%></h2>
|
|
| 2 | 2 |
|
| 3 |
<% labelled_tabular_form_for :user, @user, :url => { :action => "create" }, :html => { :class => nil } do |f| %>
|
|
| 4 |
<%= render :partial => 'form', :locals => { :f => f } %>
|
|
| 5 |
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p> |
|
| 6 |
<p> |
|
| 7 |
<%= submit_tag l(:button_create) %> |
|
| 8 |
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %> |
|
| 9 |
</p> |
|
| 3 |
<% form_for @user, :builder => TabularFormBuilder do |f| %> |
|
| 4 |
<%= render :partial => 'form', :locals => { :f => f } %>
|
|
| 5 |
<% if email_delivery_enabled? %> |
|
| 6 |
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p> |
|
| 7 |
<% end %> |
|
| 8 |
<p> |
|
| 9 |
<%= submit_tag l(:button_create) %> |
|
| 10 |
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %> |
|
| 11 |
</p> |
|
| 10 | 12 |
<% end %> |
| app/views/users/show.api.rsb | ||
|---|---|---|
| 6 | 6 |
api.mail @user.mail if User.current.admin? || !@user.pref.hide_mail |
| 7 | 7 |
api.created_on @user.created_on |
| 8 | 8 |
api.last_login_on @user.last_login_on |
| 9 |
|
|
| 9 |
|
|
| 10 | 10 |
render_api_custom_values @user.visible_custom_field_values, api |
| 11 |
|
|
| 11 |
|
|
| 12 | 12 |
api.array :memberships do |
| 13 | 13 |
@memberships.each do |membership| |
| 14 | 14 |
api.membership do |
| app/views/users/show.html.erb | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to(l(:button_edit), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? %> |
|
| 3 |
</div> |
|
| 4 |
|
|
| 5 |
<h2><%= avatar @user, :size => "50" %> <%=h @user.name %></h2> |
|
| 6 |
|
|
| 7 |
<div class="splitcontentleft"> |
|
| 8 |
<ul> |
|
| 9 |
<% unless @user.pref.hide_mail %> |
|
| 10 |
<li><%=l(:field_mail)%>: <%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></li> |
|
| 11 |
<% end %> |
|
| 12 |
<% @user.visible_custom_field_values.each do |custom_value| %> |
|
| 13 |
<% if !custom_value.value.blank? %> |
|
| 14 |
<li><%=h custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> |
|
| 15 |
<% end %> |
|
| 16 |
<% end %> |
|
| 17 |
<li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li> |
|
| 18 |
<% unless @user.last_login_on.nil? %> |
|
| 19 |
<li><%=l(:field_last_login_on)%>: <%= format_date(@user.last_login_on) %></li> |
|
| 20 |
<% end %> |
|
| 21 |
</ul> |
|
| 22 |
|
|
| 23 |
<h3><%=l(:label_ssamr_description)%></h3> |
|
| 24 |
<%= textilizable @description %> |
|
| 25 |
|
|
| 26 |
<h3><%=l(:label_ssamr_institution)%></h3> |
|
| 27 |
<p><%= h @institution_name %></p> |
|
| 28 |
|
|
| 29 |
|
|
| 30 |
<% unless @memberships.empty? %> |
|
| 31 |
<h3><%=l(:label_project_plural)%></h3> |
|
| 32 |
<ul> |
|
| 33 |
<% for membership in @memberships %> |
|
| 34 |
<li><%= link_to_project(membership.project) %> |
|
| 35 |
(<%=h membership.roles.sort.collect(&:to_s).join(', ') %>, <%= format_date(membership.created_on) %>)</li>
|
|
| 36 |
<% end %> |
|
| 37 |
</ul> |
|
| 38 |
<% end %> |
|
| 39 |
<%= call_hook :view_account_left_bottom, :user => @user %> |
|
| 40 |
</div> |
|
| 41 |
|
|
| 42 |
<div class="splitcontentright"> |
|
| 43 |
|
|
| 44 |
<% unless @events_by_day.empty? %> |
|
| 45 |
<h3><%= link_to l(:label_activity), :controller => 'activities', :action => 'index', :id => nil, :user_id => @user, :from => @events_by_day.keys.first %></h3> |
|
| 46 |
|
|
| 47 |
<p> |
|
| 48 |
<%=l(:label_reported_issues)%>: <%= Issue.count(:conditions => ["author_id=?", @user.id]) %> |
|
| 49 |
</p> |
|
| 50 |
|
|
| 51 |
<div id="activity"> |
|
| 52 |
<% @events_by_day.keys.sort.reverse.each do |day| %> |
|
| 53 |
<h4><%= format_activity_day(day) %></h4> |
|
| 54 |
<dl> |
|
| 55 |
<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
|
|
| 56 |
<dt class="<%= e.event_type %>"> |
|
| 57 |
<span class="time"><%= format_time(e.event_datetime, false) %></span> |
|
| 58 |
<%= content_tag('span', h(e.project), :class => 'project') %>
|
|
| 59 |
<%= link_to format_activity_title(e.event_title), e.event_url %></dt> |
|
| 60 |
<dd><span class="description"><%= format_activity_description(e.event_description) %></span></dd> |
|
| 61 |
<% end -%> |
|
| 62 |
</dl> |
|
| 63 |
<% end -%> |
|
| 64 |
</div> |
|
| 65 |
|
|
| 66 |
<% other_formats_links do |f| %> |
|
| 67 |
<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => nil, :user_id => @user, :key => User.current.rss_key} %>
|
|
| 68 |
<% end %> |
|
| 69 |
|
|
| 70 |
<% content_for :header_tags do %> |
|
| 71 |
<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :user_id => @user, :format => :atom, :key => User.current.rss_key) %> |
|
| 72 |
<% end %> |
|
| 73 |
<% end %> |
|
| 74 |
<%= call_hook :view_account_right_bottom, :user => @user %> |
|
| 75 |
</div> |
|
| 76 |
|
|
| 77 |
<% html_title @user.name %> |
|
| app/views/users/show.rhtml | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to(l(:button_edit), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? %> |
|
| 3 |
</div> |
|
| 4 |
|
|
| 5 |
<h2><%= avatar @user, :size => "50" %> <%=h @user.name %></h2> |
|
| 6 |
|
|
| 7 |
<div class="splitcontentleft"> |
|
| 8 |
<ul> |
|
| 9 |
<% unless @user.pref.hide_mail %> |
|
| 10 |
<li><%=l(:field_mail)%>: <%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></li> |
|
| 11 |
<% end %> |
|
| 12 |
<% @user.visible_custom_field_values.each do |custom_value| %> |
|
| 13 |
<% if !custom_value.value.blank? %> |
|
| 14 |
<li><%=h custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> |
|
| 15 |
<% end %> |
|
| 16 |
<% end %> |
|
| 17 |
<li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li> |
|
| 18 |
<% unless @user.last_login_on.nil? %> |
|
| 19 |
<li><%=l(:field_last_login_on)%>: <%= format_date(@user.last_login_on) %></li> |
|
| 20 |
<% end %> |
|
| 21 |
</ul> |
|
| 22 |
|
|
| 23 |
<h3><%=l(:label_ssamr_description)%></h3> |
|
| 24 |
<%= textilizable @description %> |
|
| 25 |
|
|
| 26 |
<h3><%=l(:label_ssamr_institution)%></h3> |
|
| 27 |
<p><%= h @institution_name %></p> |
|
| 28 |
|
|
| 29 |
|
|
| 30 |
<% unless @memberships.empty? %> |
|
| 31 |
<h3><%=l(:label_project_plural)%></h3> |
|
| 32 |
<ul> |
|
| 33 |
<% for membership in @memberships %> |
|
| 34 |
<li><%= link_to_project(membership.project) %> |
|
| 35 |
(<%=h membership.roles.sort.collect(&:to_s).join(', ') %>, <%= format_date(membership.created_on) %>)</li>
|
|
| 36 |
<% end %> |
|
| 37 |
</ul> |
|
| 38 |
<% end %> |
|
| 39 |
<%= call_hook :view_account_left_bottom, :user => @user %> |
|
| 40 |
</div> |
|
| 41 |
|
|
| 42 |
<div class="splitcontentright"> |
|
| 43 |
|
|
| 44 |
<% unless @events_by_day.empty? %> |
|
| 45 |
<h3><%= link_to l(:label_activity), :controller => 'activities', :action => 'index', :id => nil, :user_id => @user, :from => @events_by_day.keys.first %></h3> |
|
| 46 |
|
|
| 47 |
<p> |
|
| 48 |
<%=l(:label_reported_issues)%>: <%= Issue.count(:conditions => ["author_id=?", @user.id]) %> |
|
| 49 |
</p> |
|
| 50 |
|
|
| 51 |
<div id="activity"> |
|
| 52 |
<% @events_by_day.keys.sort.reverse.each do |day| %> |
|
| 53 |
<h4><%= format_activity_day(day) %></h4> |
|
| 54 |
<dl> |
|
| 55 |
<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
|
|
| 56 |
<dt class="<%= e.event_type %>"> |
|
| 57 |
<span class="time"><%= format_time(e.event_datetime, false) %></span> |
|
| 58 |
<%= content_tag('span', h(e.project), :class => 'project') %>
|
|
| 59 |
<%= link_to format_activity_title(e.event_title), e.event_url %></dt> |
|
| 60 |
<dd><span class="description"><%= format_activity_description(e.event_description) %></span></dd> |
|
| 61 |
<% end -%> |
|
| 62 |
</dl> |
|
| 63 |
<% end -%> |
|
| 64 |
</div> |
|
| 65 |
|
|
| 66 |
<% other_formats_links do |f| %> |
|
| 67 |
<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => nil, :user_id => @user, :key => User.current.rss_key} %>
|
|
| 68 |
<% end %> |
|
| 69 |
|
|
| 70 |
<% content_for :header_tags do %> |
|
| 71 |
<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :user_id => @user, :format => :atom, :key => User.current.rss_key) %> |
|
| 72 |
<% end %> |
|
| 73 |
<% end %> |
|
| 74 |
<%= call_hook :view_account_right_bottom, :user => @user %> |
|
| 75 |
</div> |
|
| 76 |
|
|
| 77 |
<% html_title @user.name %> |
|
Also available in: Unified diff