mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-17 14:46:00 +08:00
184 lines
9.3 KiB
Text
184 lines
9.3 KiB
Text
<% provide(:head_title, t("users.registrations.edit.head_title")) %>
|
|
<% provide(:container_class, "no-second-nav-container") %>
|
|
|
|
<%= render partial: "users/settings/sidebar" %>
|
|
<div class="tab-content">
|
|
<div class="tab-pane content-pane active" role="tabpanel">
|
|
|
|
<div class="row">
|
|
<div class="col-xs-12 col-sm-12">
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<h2 style="margin-top: 10px;"><%=t "users.registrations.edit.title" %></h2>
|
|
|
|
<% if not resource.errors.empty? %>
|
|
<div class="alert alert-danger">
|
|
<%= devise_error_messages! %>
|
|
</div>
|
|
<% end %>
|
|
<div data-part="view">
|
|
<div class="form-group user-settings-edit-avatar">
|
|
<%= t("users.registrations.edit.avatar_label") %><br>
|
|
<% @user_avatar_url ||= avatar_path(current_user, :thumb) %>
|
|
<div class="avatar-container">
|
|
<div class="avatar-image">
|
|
<%= image_tag @user_avatar_url %>
|
|
</div>
|
|
<div class="avatar-edit"></div>
|
|
<div class="avatar-edit-text">
|
|
<span class="fas fa-pencil-alt"></span>
|
|
<span><%=t "users.registrations.edit.avatar_btn" %></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<span class="settings-page-full-name user-settings-block">
|
|
<label><%= t("users.registrations.edit.name_label") %></label>
|
|
<%= render partial: "shared/inline_editing",
|
|
locals: {
|
|
initial_value: @user.full_name,
|
|
config: {
|
|
params_group: 'user',
|
|
field_to_udpate: 'full_name',
|
|
path_to_update: registration_path(resource_name, format: :json)
|
|
}
|
|
} %>
|
|
</span>
|
|
|
|
<span class="settings-page-initials user-settings-block">
|
|
<label><%= t("users.registrations.edit.initials_label") %></label>
|
|
<%= render partial: "shared/inline_editing",
|
|
locals: {
|
|
initial_value: @user.initials,
|
|
config: {
|
|
params_group: 'user',
|
|
field_to_udpate: 'initials',
|
|
path_to_update: registration_path(resource_name, format: :json)
|
|
}
|
|
} %>
|
|
</span>
|
|
|
|
<%= form_for(resource,
|
|
as: resource_name,
|
|
url: registration_path(resource_name, format: :json),
|
|
remote: true,
|
|
html: { method: :put, "data-for" => "email", class: 'settings-page-email', id: 'user-email-field' }) do |f| %>
|
|
<div data-part="view">
|
|
<div class="form-group">
|
|
<%= f.label t("users.registrations.edit.email_label") %>
|
|
<div class="input-group">
|
|
<input data-role="src" class="form-control" disabled="disabled" type="text" value="<%= @user.email %>" name="fake_user[email]" id="fake_user_email">
|
|
<span class="input-group-btn">
|
|
<a href="#" class="btn btn-default" data-action="edit"><%=t "general.edit" %></a>
|
|
</span>
|
|
</div>
|
|
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
|
<div class="alert alert-info" style="margin-top: 15px;" role="alert">
|
|
<span class="fas fa-info-circle" aria-hidden="true"></span>
|
|
<%=t "users.registrations.edit.waiting_for_confirm", email: resource.unconfirmed_email %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<div data-part="edit" style="display: none;">
|
|
<div class="well">
|
|
<h4><%=t "users.registrations.edit.email_title" %></h4>
|
|
<div class="form-group">
|
|
<%= f.label :email, t("users.registrations.edit.new_email_label") %>
|
|
<%= f.email_field :email, class: "form-control", "data-role" => "edit" %>
|
|
</div>
|
|
<div class="form-group">
|
|
<%= f.label :current_password, t("users.registrations.edit.current_password_label") %> <i><%=t "users.registrations.edit.password_explanation" %></i>
|
|
<%= f.password_field :current_password, autocomplete: "off", class: "form-control", "data-role" => "clear", id: 'edit-email-current-password' %>
|
|
</div>
|
|
<div class="align-right">
|
|
<a href="#" class="btn btn-default" data-action="cancel"><%=t "general.cancel" %></a>
|
|
<%= f.submit t("general.save"), class: "btn btn-success" %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= form_for(resource,
|
|
as: resource_name,
|
|
url: registration_path(resource_name, format: :json),
|
|
remote: true,
|
|
html: { method: :put, "data-for" => "password", class: 'settings-page-change-password', id: 'user-password-field' }) do |f| %>
|
|
<%= hidden_field_tag "user[change_password]", "true" %>
|
|
<div data-part="view">
|
|
<div class="form-group">
|
|
<%= f.label t("users.registrations.edit.password_label") %>
|
|
<div class="input-group">
|
|
<input class="form-control" disabled="disabled" autocomplete="off" type="password" value="aaaaaaaaaa" name="fake_user[current_password]" id="fake_user_current_password">
|
|
<span class="input-group-btn">
|
|
<a href="#" class="btn btn-default" data-action="edit"><%=t "general.edit" %></a>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div data-part="edit" style="display: none;">
|
|
<div class="well">
|
|
<h4><%=t "users.registrations.edit.password_title" %></h4>
|
|
<div class="form-group">
|
|
<%= f.label :current_password, t("users.registrations.edit.current_password_label") %> <i><%=t "users.registrations.edit.password_explanation" %></i>
|
|
<%= f.password_field :current_password, autocomplete: "off", class: "form-control", "data-role" => "clear", id: 'edit-password-current-password' %>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<%= f.label :password, t("users.registrations.edit.new_password_label") %>
|
|
<%= f.password_field :password, autocomplete: "off", class: "form-control", "data-role" => "clear" %>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<%= f.label :password_confirmation, t("users.registrations.edit.new_password_2_label") %>
|
|
<%= f.password_field :password_confirmation, autocomplete: "off", class: "form-control", "data-role" => "clear" %>
|
|
</div>
|
|
|
|
<div class="align-right">
|
|
<a href="#" class="btn btn-default" data-action="cancel"><%=t "general.cancel" %></a>
|
|
<%= f.submit t("general.save"), class: "btn btn-success" %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
|
|
</div>
|
|
<div class="col-md-7 col-md-offset-1">
|
|
<div class="row user-statistics">
|
|
<div class="col-md-12">
|
|
<h2 style="margin-top: 10px;"><%=t "users.statistics.title" %></h2>
|
|
<ul class="list-inline">
|
|
<li class="label label-primary">
|
|
<h2><%= @user.statistics[:number_of_teams]%></h2>
|
|
<%= t("users.statistics.team").pluralize(@user.statistics[:number_of_teams]) %>
|
|
</li>
|
|
<li class="label label-primary">
|
|
<h2><%= @user.statistics[:number_of_projects] %></h2>
|
|
<%= t("users.statistics.project").pluralize(@user.statistics[:number_of_projects]) %>
|
|
</li>
|
|
<li class="label label-primary">
|
|
<h2><%= @user.statistics[:number_of_experiments] %></h2>
|
|
<%= t("users.statistics.experiment").pluralize(@user.statistics[:number_of_experiments]) %>
|
|
</li>
|
|
<li class="label label-primary">
|
|
<h2><%= @user.statistics[:number_of_protocols] %></h2>
|
|
<%= t("users.statistics.protocol").pluralize(@user.statistics[:number_of_protocols]) %>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<span style="display: none;" data-hook="profile-statistics"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<%= render partial: 'users/shared/user_avatars_modal' %>
|
|
|
|
<%= javascript_pack_tag 'custom/croppie' %>
|
|
<%= stylesheet_pack_tag 'custom/croppie_styles' %>
|
|
<%= javascript_include_tag("canvas-to-blob.min") %>
|
|
<%= javascript_include_tag "users/registrations/edit" %>
|