Unify settings ui

This commit is contained in:
Steffen van Bergerem 2016-02-06 13:53:42 +01:00
parent 03ef5bd064
commit ada0ad6eb5
10 changed files with 102 additions and 94 deletions

View file

@ -3,10 +3,9 @@
.container-fluid.applications-page .container-fluid.applications-page
.row .row
.col-md-12 .col-md-3
= render "shared/settings_nav" = render "shared/settings_nav"
.row .col-md-9
.col-md-12
%h3= t(".title") %h3= t(".title")
.row .row
.col-md-12 .col-md-12

View file

@ -4,11 +4,9 @@
.container-fluid .container-fluid
.row .row
.col-md-12 .col-md-3
= render "shared/settings_nav" = render "shared/settings_nav"
.col-md-9
.row
.col-md-12
- content_for :submit_block do - content_for :submit_block do
= link_to t("cancel"), local_or_remote_person_path(current_user.person), class: "btn btn-default" = link_to t("cancel"), local_or_remote_person_path(current_user.person), class: "btn btn-default"
= submit_tag t(".update_profile"), class: "btn btn-primary pull-right", id: "update_profile" = submit_tag t(".update_profile"), class: "btn btn-primary pull-right", id: "update_profile"

View file

@ -7,16 +7,15 @@
.container-fluid .container-fluid
.row .row
.col-md-12 .col-md-3
= render "shared/settings_nav" = render "shared/settings_nav"
.col-md-9
.row
.col-md-12
%h3= t(".title") %h3= t(".title")
.row .row
.col-md-7 .col-md-12
= render "add_remove_services" = render "add_remove_services"
.col-md-5 .row
%p .col-md-12
= t(".services_explanation") %p
= t(".services_explanation")

View file

@ -1,10 +1,14 @@
#section_header #section_header
%h2 %h2
= t("settings") = t("settings")
%ul.nav.nav-tabs#settings_nav .list-group#settings_nav
%li{class: current_page?(edit_profile_path) && "active"}= link_to t("profile"), edit_profile_path = link_to t("profile"), edit_profile_path,
%li{class: current_page?(edit_user_path) && "active"}= link_to t("account"), edit_user_path class: current_page?(edit_profile_path) ? "list-group-item active" : "list-group-item"
%li{class: current_page?(privacy_settings_path) && "active"}= link_to t("privacy"), privacy_settings_path = link_to t("account"), edit_user_path,
%li{class: current_page?(services_path) && "active"}= link_to t("_services"), services_path class: current_page?(edit_user_path) ? "list-group-item active" : "list-group-item"
%li{class: current_page?(api_openid_connect_user_applications_path) && "active"} = link_to t("privacy"), privacy_settings_path,
= link_to t("_applications"), api_openid_connect_user_applications_path class: current_page?(privacy_settings_path) ? "list-group-item active" : "list-group-item"
= link_to t("_services"), services_path,
class: current_page?(services_path) ? "list-group-item active" : "list-group-item"
= link_to t("_applications"), api_openid_connect_user_applications_path,
class: current_page?(api_openid_connect_user_applications_path) ? "list-group-item active" : "list-group-item"

View file

@ -5,10 +5,6 @@
- content_for :page_title do - content_for :page_title do
= t(".edit_account") = t(".edit_account")
.row
.col-md-12
= render "shared/settings_nav"
.row .row
.col-md-12 .col-md-12
.row .row
@ -173,42 +169,40 @@
%hr %hr
.row .row
.col-md-12#account_data .col-md-6#account_data
.row %h3= t(".export_data")
.col-md-6 .form-group
%h3= t(".export_data") - if current_user.exporting
.form-group .export-in-progress= t(".export_in_progress")
- if current_user.exporting - elsif current_user.export.present?
.export-in-progress= t(".export_in_progress") = link_to t(".request_export_update"), export_profile_user_path, method: :post,
- elsif current_user.export.present? class: "btn btn-default"
= link_to t(".request_export_update"), export_profile_user_path, method: :post, .small-horizontal-spacer
class: "btn btn-default btn-block" = link_to t(".download_export"), download_profile_user_path,
.small-horizontal-spacer class: "btn btn-success"
= link_to t(".download_export"), download_profile_user_path, .small-horizontal-spacer
class: "btn btn-success btn-block" %h6
.small-horizontal-spacer = t(".last_exported_at", timestamp: current_user.exported_at)
%h6 - else
= t(".last_exported_at", timestamp: current_user.exported_at) = link_to t(".request_export"), export_profile_user_path, method: :post,
- else class: "btn btn-default"
= link_to t(".request_export"), export_profile_user_path, method: :post,
class: "btn btn-default btn-block"
.form-group .form-group
- if current_user.exporting_photos - if current_user.exporting_photos
.export-in-progress= t(".export_photos_in_progress") .export-in-progress= t(".export_photos_in_progress")
- elsif current_user.exported_photos_file.present? - elsif current_user.exported_photos_file.present?
= link_to t(".request_export_photos_update"), export_photos_user_path, method: :post, = link_to t(".request_export_photos_update"), export_photos_user_path, method: :post,
class: "btn btn-default btn-block" class: "btn btn-default"
.small-horizontal-spacer .small-horizontal-spacer
= link_to t(".download_export_photos"), download_photos_user_path, class: "btn btn-success btn-block" = link_to t(".download_export_photos"), download_photos_user_path, class: "btn btn-success"
.small-horizontal-spacer .small-horizontal-spacer
%h6 %h6
= t(".last_exported_at", timestamp: current_user.exported_photos_at) = t(".last_exported_at", timestamp: current_user.exported_photos_at)
- else - else
= link_to t(".request_export_photos"), export_photos_user_path, method: :post, = link_to t(".request_export_photos"), export_photos_user_path, method: :post,
class: "btn btn-default btn-block" class: "btn btn-default"
.col-md-12 .col-md-6
%h3 %h3
= t(".close_account_text") = t(".close_account_text")
.form-group .form-group

View file

@ -1,34 +1,28 @@
.row .row
.col-md-12 .col-md-12
= render "shared/settings_nav" %h3
= t(".title")
= form_for current_user, url: user_path, html: {method: :put} do |f|
= f.error_messages
= f.fields_for :stream_preferences do
.checkbox#stream_prefs
= f.label :strip_exif do
= f.check_box :strip_exif
= t(".strip_exif")
= f.submit t("users.edit.change"), class: "btn btn-primary pull-right"
%hr
.row .row
.col-md-12 .col-md-12
.row %h3
.col-md-12 = t(".ignored_users")
%h3
= t(".title")
= form_for current_user, url: user_path, html: {method: :put} do |f| - if @blocks.length.zero?
= f.error_messages %p
= t(".no_user_ignored_message")
= f.fields_for :stream_preferences do - else
.checkbox#stream_prefs #blocked_people
= f.label :strip_exif do - @blocks.each do |block|
= f.check_box :strip_exif = render partial: "blocked_person", locals: {block: block, person: block.person}
= t(".strip_exif")
= f.submit t("users.edit.change"), class: "btn btn-primary pull-right"
%hr
.row
.col-md-12
%h3
= t(".ignored_users")
- if @blocks.length.zero?
%p
= t(".no_user_ignored_message")
- else
#blocked_people
- @blocks.each do |block|
= render partial: "blocked_person", locals: {block: block, person: block.person}

View file

@ -1,2 +1,6 @@
.container-fluid .container-fluid
= render "edit" .row
.col-md-3
= render "shared/settings_nav"
.col-md-9
= render "edit"

View file

@ -1,2 +1,8 @@
.settings_container.container-fluid .settings_container.container-fluid
= render "edit" .row
.col-md-12
= render "shared/settings_nav"
.row
.col-md-12
= render "edit"

View file

@ -6,4 +6,8 @@
= t('.title') = t('.title')
.container-fluid .container-fluid
= render "privacy_settings" .row
.col-md-3
= render "shared/settings_nav"
.col-md-9
= render "privacy_settings"

View file

@ -6,4 +6,10 @@
= t(".title") = t(".title")
.settings_container.container-fluid .settings_container.container-fluid
= render "privacy_settings" .row
.col-md-12
= render "shared/settings_nav"
.row
.col-md-12
= render "privacy_settings"