diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 63402c977..6983fe44e 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -1,14 +1,21 @@
-<%= additional_emails_link(@user) %> <%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %> <%= call_hook(:view_my_account_contextual, :user => @user)%> +<%= link_to(l(:button_edit), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? && @user.logged? %>

<%= avatar_edit_link(@user, :size => "50") %> - <%=l(:label_my_account)%> + <%= @user.name %>

+<% +tabs = [] +tabs << {name: 'profile', label: :label_profile, url: user_path(@user)} +tabs << {name: 'account', label: :label_my_account, url: my_account_path} +%> +<%= render :partial => 'common/tabs', :locals => {:tabs => tabs, :selected_tab => 'account'} %> + <%= error_messages_for 'user' %> <%= labelled_form_for :user, @user, @@ -21,7 +28,7 @@ <%=l(:label_information_plural)%>

<%= f.text_field :firstname, :required => true %>

<%= f.text_field :lastname, :required => true %>

-

<%= f.text_field :mail, :required => true %>

+

<%= f.text_field :mail, :required => true %>
<%= additional_emails_link(@user) %>

<% unless @user.force_default_language? %>

<%= f.select :language, lang_options_for_select %>

<% end %> diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index ce5b1f6c7..c43ff5666 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -9,7 +9,7 @@

<%= f.text_field :login, :required => true, :size => 25 %>

<%= f.text_field :firstname, :required => true %>

<%= f.text_field :lastname, :required => true %>

-

<%= f.text_field :mail, :required => true %>

+

<%= f.text_field :mail, :required => true %>
<%= additional_emails_link(@user) %>

<% unless @user.force_default_language? %>

<%= f.select :language, lang_options_for_select %>

<% end %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 67b57f802..d46521730 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,6 +1,5 @@
<%= link_to l(:label_profile), user_path(@user), :class => 'icon icon-user' %> -<%= additional_emails_link(@user) %> <%= change_status_link(@user) %> <%= delete_link user_path(@user) if User.current != @user %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e97119bab..4944f8e7a 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,8 +1,23 @@
+<% if User.current == @user %> + <%= link_to(l(:button_change_password), {:controller => 'my', :action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %> +<% end %> <%= link_to(l(:button_edit), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? && @user.logged? %>
-

<%= avatar @user, :size => "50" %> <%= @user.name %>

+

+ <%= User.current == @user ? avatar_edit_link(@user, :size => "50") : avatar(@user, :size => "50") %> + <%= @user.name %> +

+ +<% +tabs = [] +tabs << {name: 'profile', label: :label_profile, url: user_path(@user)} +if @user == User.current + tabs << {name: 'account', label: :label_my_account, url: my_account_path} +end +%> +<%= render :partial => 'common/tabs', :locals => {:tabs => tabs, :selected_tab => 'profile'} %>