Project

General

Profile

Feature #31348 » profile-and-my-account-tab.patch

Go MAEDA, 2019-05-12 15:37

View differences:

app/views/my/account.html.erb
1 1
<div class="contextual">
2
<%= additional_emails_link(@user) %>
3 2
<%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %>
4 3
<%= call_hook(:view_my_account_contextual, :user => @user)%>
4
<%= link_to(l(:button_edit), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? && @user.logged? %>
5 5
</div>
6 6

  
7 7
<h2>
8 8
  <%= avatar_edit_link(@user, :size => "50") %>
9
  <%=l(:label_my_account)%>
9
  <%= @user.name %>
10 10
</h2>
11 11

  
12
<%
13
tabs = []
14
tabs << {name: 'profile', label: :label_profile, url: user_path(@user)}
15
tabs << {name: 'account', label: :label_my_account, url: my_account_path}
16
%>
17
<%= render :partial => 'common/tabs', :locals => {:tabs => tabs, :selected_tab => 'account'} %>
18

  
12 19
<%= error_messages_for 'user' %>
13 20

  
14 21
<%= labelled_form_for :user, @user,
......
21 28
  <legend><%=l(:label_information_plural)%></legend>
22 29
  <p><%= f.text_field :firstname, :required => true %></p>
23 30
  <p><%= f.text_field :lastname, :required => true %></p>
24
  <p><%= f.text_field :mail, :required => true %></p>
31
  <p><%= f.text_field :mail, :required => true %><br><%= additional_emails_link(@user) %></p>
25 32
  <% unless @user.force_default_language? %>
26 33
  <p><%= f.select :language, lang_options_for_select %></p>
27 34
  <% end %>
app/views/users/_form.html.erb
9 9
  <p><%= f.text_field :login, :required => true, :size => 25  %></p>
10 10
  <p><%= f.text_field :firstname, :required => true %></p>
11 11
  <p><%= f.text_field :lastname, :required => true %></p>
12
  <p><%= f.text_field :mail, :required => true %></p>
12
  <p><%= f.text_field :mail, :required => true %><br><%= additional_emails_link(@user) %></p>
13 13
  <% unless @user.force_default_language? %>
14 14
  <p><%= f.select :language, lang_options_for_select %></p>
15 15
  <% end %>
app/views/users/edit.html.erb
1 1
<div class="contextual">
2 2
<%= link_to l(:label_profile), user_path(@user), :class => 'icon icon-user' %>
3
<%= additional_emails_link(@user) %>
4 3
<%= change_status_link(@user) %>
5 4
<%= delete_link user_path(@user) if User.current != @user %>
6 5
</div>
app/views/users/show.html.erb
1 1
<div class="contextual">
2
<% if User.current == @user %>
3
  <%= link_to(l(:button_change_password), {:controller => 'my', :action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %>
4
<% end %>
2 5
<%= link_to(l(:button_edit), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? && @user.logged? %>
3 6
</div>
4 7

  
5
<h2><%= avatar @user, :size => "50" %> <%= @user.name %></h2>
8
<h2>
9
  <%= User.current == @user ? avatar_edit_link(@user, :size => "50") : avatar(@user, :size => "50") %>
10
  <%= @user.name %>
11
</h2>
12

  
13
<%
14
tabs = []
15
tabs << {name: 'profile', label: :label_profile, url: user_path(@user)}
16
if @user == User.current
17
  tabs << {name: 'account', label: :label_my_account, url: my_account_path}
18
end
19
%>
20
<%= render :partial => 'common/tabs', :locals => {:tabs => tabs, :selected_tab => 'profile'} %>
6 21

  
7 22
<div class="splitcontent">
8 23
<div class="splitcontentleft">
(5-5/6)