diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-05-02 15:21:21 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-05-02 15:21:21 +0000 |
commit | 63951812a1ed56e61cd6e5ee8439c772f800521c (patch) | |
tree | 651df799afc4220f1be012d916cc844cab1d7232 /app/views | |
parent | 7a969dafacf06f9079a925f69b62dbad81c3aba4 (diff) | |
download | redmine-63951812a1ed56e61cd6e5ee8439c772f800521c.tar.gz redmine-63951812a1ed56e61cd6e5ee8439c772f800521c.zip |
Split user edit screen into tabs.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1404 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/users/_form.rhtml | 1 | ||||
-rw-r--r-- | app/views/users/_general.rhtml | 4 | ||||
-rw-r--r-- | app/views/users/_memberships.rhtml | 43 | ||||
-rw-r--r-- | app/views/users/edit.rhtml | 27 |
4 files changed, 52 insertions, 23 deletions
diff --git a/app/views/users/_form.rhtml b/app/views/users/_form.rhtml index ff4278c1f..6ca167a59 100644 --- a/app/views/users/_form.rhtml +++ b/app/views/users/_form.rhtml @@ -2,7 +2,6 @@ <!--[form:user]--> <div class="box"> -<h3><%=l(:label_information_plural)%></h3> <p><%= f.text_field :login, :required => true, :size => 25 %></p> <p><%= f.text_field :firstname, :required => true %></p> <p><%= f.text_field :lastname, :required => true %></p> diff --git a/app/views/users/_general.rhtml b/app/views/users/_general.rhtml new file mode 100644 index 000000000..80615ff6c --- /dev/null +++ b/app/views/users/_general.rhtml @@ -0,0 +1,4 @@ +<% labelled_tabular_form_for :user, @user, :url => { :action => "edit" } do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> +<%= submit_tag l(:button_save) %> +<% end %> diff --git a/app/views/users/_memberships.rhtml b/app/views/users/_memberships.rhtml index 44d74ef7b..94b49159e 100644 --- a/app/views/users/_memberships.rhtml +++ b/app/views/users/_memberships.rhtml @@ -1,21 +1,33 @@ -<div class="box" style="margin-top: 16px;"> -<h3><%= l(:label_project_plural) %></h3> - -<% @user.memberships.each do |membership| %> -<% form_tag({ :action => 'edit_membership', :id => @user, :membership_id => membership }, :class => "tabular") do %> -<p style="margin:0;padding-top:0;"> - <label><%= membership.project.name %></label> - <select name="membership[role_id]"> - <%= options_from_collection_for_select @roles, "id", "name", membership.role_id %> - </select> - <%= submit_tag l(:button_change), :class => "button-small" %> - <%= link_to l(:button_delete), {:action => 'destroy_membership', :id => @user, :membership_id => membership }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> -</p> -<% end %> +<% if @memberships.any? %> +<table class="list memberships"> + <thead> + <th><%= l(:label_project) %></th> + <th><%= l(:label_role) %></th> + <th style="width:15%"></th> + </thead> + <tbody> + <% @memberships.each do |membership| %> + <% next if membership.new_record? %> + <tr class="<%= cycle 'odd', 'even' %>"> + <td><%=h membership.project %></td> + <td align="center"> + <% form_tag({ :action => 'edit_membership', :id => @user, :membership_id => membership }) do %> + <%= select_tag 'membership[role_id]', options_from_collection_for_select(@roles, "id", "name", membership.role_id) %> + <%= submit_tag l(:button_change), :class => "small" %> + <% end %> + </td> + <td align="center"> + <%= link_to l(:button_delete), {:action => 'destroy_membership', :id => @user, :membership_id => membership }, :method => :post, :class => 'icon icon-del' %> + </td> + </tr> + </tbody> +<% end; reset_cycle %> +</table> +<% else %> +<p class="nodata"><%= l(:label_no_data) %></p> <% end %> <% if @projects.any? %> -<hr /> <p> <label><%=l(:label_project_new)%></label><br/> <% form_tag({ :action => 'edit_membership', :id => @user }) do %> @@ -26,4 +38,3 @@ <% end %> </p> <% end %> -</div>
\ No newline at end of file diff --git a/app/views/users/edit.rhtml b/app/views/users/edit.rhtml index 0da99d0d2..a4d0b2e5b 100644 --- a/app/views/users/edit.rhtml +++ b/app/views/users/edit.rhtml @@ -1,8 +1,23 @@ -<h2><%=l(:label_user)%></h2> +<h2><%=l(:label_user)%>: <%=h @user.login %></h2> -<% labelled_tabular_form_for :user, @user, :url => { :action => "edit" } do |f| %> -<%= render :partial => 'form', :locals => { :f => f } %> -<%= submit_tag l(:button_save) %> -<% end %> +<% selected_tab = params[:tab] ? params[:tab].to_s : user_settings_tabs.first[:name] %> -<%= render :partial => 'memberships' %>
\ No newline at end of file +<div class="tabs"> +<ul> +<% user_settings_tabs.each do |tab| -%> + <li><%= link_to l(tab[:label]), { :tab => tab[:name] }, + :id => "tab-#{tab[:name]}", + :class => (tab[:name] != selected_tab ? nil : 'selected'), + :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li> +<% end -%> +</ul> +</div> + +<% user_settings_tabs.each do |tab| -%> +<%= content_tag('div', render(:partial => tab[:partial]), + :id => "tab-content-#{tab[:name]}", + :style => (tab[:name] != selected_tab ? 'display:none' : nil), + :class => 'tab-content') %> +<% end -%> + +<% html_title(l(:label_user), @user.login, l(:label_administration)) -%> |