This way we can simplify the way we generate form fields. In some cases, we also use the human attribute in table headers, which IMHO makes sense. I haven't moved all of them: for example, sometimes a label is different depending on whether it's shown to administrators, valuators, or users. And I haven't touched the ones related to devise, since I wasn't sure about possible side effects. Note I've also removed placeholders when they had the same text as their labels, since they weren't helpful. On the contrary, the added redundant text to the form, potentially distracting users.
146 lines
5.0 KiB
Plaintext
146 lines
5.0 KiB
Plaintext
<div class="row account">
|
|
<div class="small-12 column">
|
|
<div class="float-right text-right">
|
|
<%= link_to t("account.show.change_credentials_link"), edit_user_registration_path, class: "button hollow" %>
|
|
<br>
|
|
<%= link_to t("account.show.erase_account_link"), users_registrations_delete_form_path, class: "delete" %>
|
|
</div>
|
|
|
|
<%= avatar_image(@account, seed: @account.id, size: 100, class: "margin-bottom") %>
|
|
|
|
<h1 class="inline-block"><%= t("account.show.title") %></h1>
|
|
|
|
<%= form_for @account, as: :account, url: account_path do |f| %>
|
|
<%= render "shared/errors", resource: @account %>
|
|
|
|
<div class="row">
|
|
<div class="small-12 medium-7 column">
|
|
|
|
<h2><%= t("account.show.personal") %></h2>
|
|
|
|
<div class="small-12 medium-10">
|
|
<% if @account.organization? %>
|
|
<%= f.fields_for :organization do |fo| %>
|
|
<%= fo.text_field :name, autofocus: true, maxlength: Organization.name_max_length, placeholder: t("account.show.organization_name_label") %>
|
|
<%= fo.text_field :responsible_name, autofocus: true, maxlength: Organization.responsible_name_max_length, placeholder: t("account.show.organization_responsible_name_placeholder") %>
|
|
<% end %>
|
|
<%= f.text_field :phone_number, placeholder: t("account.show.phone_number_label") %>
|
|
|
|
<% else %>
|
|
<%= f.text_field :username, maxlength: User.username_max_length, placeholder: t("account.show.username_label") %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div>
|
|
<%= f.check_box :public_activity %>
|
|
</div>
|
|
|
|
<div>
|
|
<%= f.check_box :public_interests %>
|
|
</div>
|
|
|
|
<% if @account.email.present? %>
|
|
<h2><%= t("account.show.notifications") %></h2>
|
|
|
|
<div>
|
|
<%= f.check_box :email_on_comment %>
|
|
</div>
|
|
|
|
<div>
|
|
<%= f.check_box :email_on_comment_reply %>
|
|
</div>
|
|
|
|
<div>
|
|
<%= f.check_box :newsletter %>
|
|
</div>
|
|
|
|
<div>
|
|
<%= f.check_box :email_digest %>
|
|
</div>
|
|
|
|
<div>
|
|
<%= f.check_box :email_on_direct_message %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if @account.official_level == 1 %>
|
|
<div>
|
|
<%= f.check_box :official_position_badge %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if feature?("user.recommendations") %>
|
|
<h2><%= t("account.show.recommendations") %></h2>
|
|
|
|
<% if feature?("user.recommendations_on_debates") %>
|
|
<div>
|
|
<%= f.check_box :recommended_debates %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if feature?("user.recommendations_on_proposals") %>
|
|
<div>
|
|
<%= f.check_box :recommended_proposals %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= f.submit t("account.show.save_changes_submit"), class: "button margin-top" %>
|
|
</div>
|
|
|
|
<div class="user-permissions small-12 medium-5 column">
|
|
<h2><%= t("account.show.user_permission_title") %></h2>
|
|
|
|
<p><%= t("account.show.user_permission_info") %></p>
|
|
|
|
<ul>
|
|
<li><span class="icon-check"></span> <%= t("account.show.user_permission_debates") %></li>
|
|
<li><span class="icon-check"></span> <%= t("account.show.user_permission_proposal") %></li>
|
|
<li>
|
|
<% if current_user.level_two_or_three_verified? %>
|
|
<span class="icon-check"></span>
|
|
<% else %>
|
|
<span class="icon-x"></span>
|
|
<% end %>
|
|
<%= t("account.show.user_permission_support_proposal") %>
|
|
</li>
|
|
<li>
|
|
<% if current_user.level_three_verified? %>
|
|
<span class="icon-check"></span>
|
|
<% else %>
|
|
<span class="icon-x"></span>
|
|
<% end %>
|
|
<%= t("account.show.user_permission_votes") %>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>
|
|
<span><%= t("account.show.user_permission_verify_info") %></span>
|
|
</p>
|
|
<p>
|
|
<%= t("account.show.user_permission_verify") %>
|
|
</p>
|
|
|
|
<% unless @account.organization? %>
|
|
<div>
|
|
<span class="verify-account">
|
|
<% if current_user.level_three_verified? %>
|
|
<p class="already-verified">
|
|
<span class="icon-check"></span>
|
|
<%= t("account.show.verified_account") %>
|
|
</p>
|
|
<% elsif current_user.level_two_verified? %>
|
|
<%= link_to t("account.show.finish_verification"), verification_path, class: "button success" %>
|
|
<% else %>
|
|
<%= link_to t("account.show.verify_my_account"), verification_path, class: "button success" %>
|
|
<% end %>
|
|
</span>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
|
|
</div>
|
|
</div>
|