diff options
author | Jonne Haß <me@jhass.eu> | 2016-08-11 03:29:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-11 03:29:34 +0300 |
commit | 1d2132ebbad943471cd1dfd4416aa9164d45396e (patch) | |
tree | aa0b7112221453c0e8686482851252be3b8b1433 /app/views | |
parent | bd74eea140f91187c416f7f03d9013961b87fc7e (diff) | |
parent | 71ed7446c19c83bdbb542482285bc968d49f0520 (diff) |
Merge pull request #6965 from SuperTux88/5847-fix-settings-page
Fix settings page after submit
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/layouts/_drawer.mobile.haml | 2 | ||||
-rw-r--r-- | app/views/shared/_settings_nav.haml | 2 | ||||
-rw-r--r-- | app/views/users/_edit.haml | 14 | ||||
-rw-r--r-- | app/views/users/_privacy_settings.haml | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/app/views/layouts/_drawer.mobile.haml b/app/views/layouts/_drawer.mobile.haml index 97e9f6d89..d676a2084 100644 --- a/app/views/layouts/_drawer.mobile.haml +++ b/app/views/layouts/_drawer.mobile.haml @@ -30,6 +30,6 @@ = t("layouts.header.profile") = person_image_tag(current_user, size: :thumb_small) %li= link_to t("_contacts"), contacts_path - %li= link_to t("layouts.header.settings"), users_edit_path + %li= link_to t("layouts.header.settings"), edit_user_path %li= link_to t("layouts.application.toggle"), toggle_mobile_path %li= link_to t("layouts.header.logout"), destroy_user_session_path, method: :delete 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? diff --git a/app/views/users/_privacy_settings.haml b/app/views/users/_privacy_settings.haml index 86038417b..9a881bc51 100644 --- a/app/views/users/_privacy_settings.haml +++ b/app/views/users/_privacy_settings.haml @@ -3,7 +3,7 @@ %h3 = t(".title") - = form_for current_user, url: user_path, html: {method: :put} do |f| + = form_for current_user, url: update_privacy_settings_path, html: {method: :put} do |f| = f.error_messages = f.fields_for :stream_preferences do |