diff options
author | Benjamin Neff <benjamin@coding4coffee.ch> | 2016-08-11 00:02:15 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2016-08-11 02:58:47 +0300 |
commit | 71ed7446c19c83bdbb542482285bc968d49f0520 (patch) | |
tree | eda7bd376d4967ef941a4c10fde9fcf97dcde0a7 /app/views | |
parent | be47c6bcd010f31bd2495aeec434681b38f68bfb (diff) |
Fix user settings style after submit
Fixed:
* wrong url
* broken navigation
* broken design
after saving the user settings
Fixes #5847
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/shared/_settings_nav.haml | 2 | ||||
-rw-r--r-- | app/views/users/_edit.haml | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/app/views/shared/_settings_nav.haml b/app/views/shared/_settings_nav.haml index 53794791e..e54f3e424 100644 --- a/app/views/shared/_settings_nav.haml +++ b/app/views/shared/_settings_nav.haml @@ -6,7 +6,7 @@ = link_to t("profile"), edit_profile_path, class: current_page?(edit_profile_path) ? "list-group-item active" : "list-group-item" = link_to t("account"), edit_user_path, - class: current_page?(edit_user_path) ? "list-group-item active" : "list-group-item" + class: request.path == edit_user_path ? "list-group-item active" : "list-group-item" = link_to t("privacy"), privacy_settings_path, class: current_page?(privacy_settings_path) ? "list-group-item active" : "list-group-item" = link_to t("_services"), services_path, diff --git a/app/views/users/_edit.haml b/app/views/users/_edit.haml index 2f7d0c001..aec5eccc7 100644 --- a/app/views/users/_edit.haml +++ b/app/views/users/_edit.haml @@ -19,7 +19,7 @@ %i.entypo-lock.gray.settings-visibility{title: t("users.edit.your_email_private")} - = form_for "user", url: user_path, + = form_for "user", url: edit_user_path, html: {method: :put, class: "form-horizontal col-md-12", id: "email-form"} do |f| = f.error_messages .form-group @@ -32,7 +32,7 @@ .row .col-md-12 %h3= t(".change_password") - = form_for @user, url: user_path, html: {method: :put, class: "form-horizontal"} do |f| + = form_for @user, url: edit_user_path, html: {method: :put, class: "form-horizontal"} do |f| - if (@user.errors.keys & %i(password password_confirmation current_password)).present? = f.error_messages .form-group @@ -59,7 +59,7 @@ .row .col-md-12 %h3= t(".change_language") - = form_for "user", url: user_path, html: {method: :put} do |f| + = form_for "user", url: edit_user_path, html: {method: :put} do |f| .form-inline.clearfix = f.select :language, available_language_options, {}, class: "form-control form-group" = f.submit t(".change_language"), class: "btn btn-primary pull-right" @@ -68,7 +68,7 @@ .row .col-md-12 %h3= t(".change_color_theme") - = form_for "user", url: user_path, html: {method: :put} do |f| + = form_for "user", url: edit_user_path, html: {method: :put} do |f| .form-inline.clearfix = f.select :color_theme, available_color_themes, {}, class: "form-control form-group" = f.submit t(".change_color_theme"), class: "btn btn-primary pull-right" @@ -78,7 +78,7 @@ .col-md-12 %h3#stream-preferences = t(".stream_preferences") - = form_for current_user, url: user_path, html: {method: :put} do |f| + = form_for current_user, url: edit_user_path, html: {method: :put} do |f| = f.fields_for :stream_preferences do #stream_prefs @@ -98,7 +98,7 @@ .col-md-12 %h3#auto-follow-back-preferences = t(".following") - = form_for current_user, url: user_path, html: {method: :put, class: "form-horizontal"} do |f| + = form_for current_user, url: edit_user_path, html: {method: :put, class: "form-horizontal"} do |f| = f.label :auto_follow_back, class: "checkbox-inline" do = f.check_box :auto_follow_back = t(".auto_follow_back") @@ -120,7 +120,7 @@ .col-md-12 %h3 = t(".receive_email_notifications") - = form_for "user", url: user_path, html: {method: :put} do |f| + = form_for "user", url: edit_user_path, html: {method: :put} do |f| = f.fields_for :email_preferences do |type| #email_prefs - if current_user.admin? |