-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
65 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module Faceless | ||
module ProfileCellOverride | ||
def description | ||
presented_profile.about = "" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,69 @@ | ||
<% add_decidim_page_title(t("profile", scope: "layouts.decidim.user_menu")) %> | ||
<% content_for(:subtitle) { t("profile", scope: "layouts.decidim.user_menu") } %> | ||
|
||
<div class="row"> | ||
<%= decidim_form_for(@account, url: account_path, method: :put, html: { autocomplete: "off" }) do |f| %> | ||
<input autocomplete="off" name="hidden" type="password" style="display:none;"> | ||
<%= render layout: "layouts/decidim/shared/layout_user_profile" do %> | ||
<% if current_user.unconfirmed_email.present? %> | ||
<%# NOTE: announcement cell clean_body method will purge the button %> | ||
<div id="email-change-pending" class="flash warning" data-announcement> | ||
<div class="flash__message flex-none block leading-relaxed"> | ||
<p> | ||
<strong><%= t("decidim.account.email_change.title") %></strong> | ||
</p> | ||
<p> | ||
<%= t("decidim.account.email_change.body1", unconfirmed_email: current_user.unconfirmed_email) %> | ||
</p> | ||
<p> | ||
<%== t( | ||
"decidim.account.email_change.body2", | ||
resend_link: link_to(t("decidim.account.email_change.send_again"), resend_confirmation_instructions_account_path, role: :button, method: :post, remote: true), | ||
cancel_link: link_to(t("decidim.account.email_change.cancel"), cancel_email_change_account_path, role: :button, method: :post, remote: true)) %> | ||
</p> | ||
</div> | ||
</div> | ||
<% end %> | ||
|
||
<%= decidim_form_for(@account, url: account_path, method: :put, html: { autocomplete: "on", class: "form-defaults edit_user" }) do |f| %> | ||
<div class="form__wrapper pt-0"> | ||
|
||
<div class="columns large-8 end"> | ||
<%= form_required_explanation %> | ||
|
||
<%= f.text_field :name %> | ||
<%= f.text_field :nickname %> | ||
<%= f.email_field :email %> | ||
<%= f.text_field :name, autocomplete: "name" %> | ||
<%= f.text_field :nickname, autocomplete: "nickname" %> | ||
<%= f.email_field :email, disabled: current_user.unconfirmed_email.present?, autocomplete: "email", data: { original: current_user.email } %> | ||
|
||
<%= f.collection_select( | ||
:locale, | ||
@account.organization.available_locales, | ||
:to_s, | ||
->(locale) {locale_name(locale) } | ||
->(locale) { locale_name(locale) }, | ||
help_text: t("available_locales_helper", scope:"decidim.account.show") | ||
) %> | ||
<p class="help-text"><%= t(".available_locales_helper") %></p> | ||
|
||
<% if @account.errors[:password].any? || @account.errors[:password_confirmation].any? %> | ||
<%= render partial: "password_fields", locals: { form: f } %> | ||
<% else %> | ||
<% if current_organization.sign_in_enabled? %> | ||
<p> | ||
<button type="button" data-toggle="passwordChange" class="link change-password"><%= t ".change_password" %></button> | ||
</p> | ||
<div id="passwordChange" class="toggle-show" data-toggler=".is-expanded"> | ||
<%= render partial: "password_fields", locals: { form: f } %> | ||
<% if @account.password.present? %> | ||
<%= render partial: "password_fields", locals: { form: f, user: current_user } %> | ||
<%= render partial: "old_password_field", locals: { form: f, show_help_text: true } %> | ||
<% elsif current_organization.sign_in_enabled? %> | ||
<div data-component="accordion" id="accordion-password"> | ||
<%= button_tag( | ||
class: "text-lg font-semibold text-secondary underline block cursor-pointer", | ||
id: "accordion-trigger-panel-password", | ||
type: "button", | ||
data: { controls: "panel-password" } | ||
) do %> | ||
<%= t("change_password", scope:"decidim.account.show") %> | ||
<% end %> | ||
<div id="panel-password" class="mt-6"> | ||
<%= render partial: "password_fields", locals: { form: f, user: current_user } %> | ||
</div> | ||
</div> | ||
|
||
<%= content_tag :div, id: "panel-old-password", class: @account.errors[:old_password].any? ? nil : "hidden" do %> | ||
<%= render partial: "old_password_field", locals: { form: f, show_help_text: true } %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= f.submit t(".update_account") %> | ||
<div class="form__wrapper-block flex-col-reverse md:flex-row justify-between"> | ||
<%= f.submit t("update_account", scope:"decidim.account.show"), class: "button button__sm md:button__lg button__secondary mr-auto !ml-0" %> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters