_edit.haml 9.62 KB
Newer Older
1 2 3 4 5
-#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
-#   licensed under the Affero General Public License version 3 or later.  See
-#   the COPYRIGHT file.

- content_for :page_title do
6
  = t(".edit_account")
7

8
.row
9
  .col-md-12
10 11 12
    .row
      .col-md-6
        %h3= t(".your_handle")
13

14 15 16 17 18
        %p
          %b= current_user.diaspora_handle
      .col-md-6
        %h3
          = t(".your_email")
19
          %i.entypo-lock.gray.settings-visibility{title: t("users.edit.your_email_private")}
20 21


22
        = form_for "user", url: edit_user_path,
23 24 25 26 27 28 29 30 31 32 33 34
          html: {method: :put, class: "form-horizontal col-md-12", id: "email-form"} do |f|
          = f.error_messages
          .form-group
            = f.text_field :email, value: @user.unconfirmed_email || @user.email, class: "col-md-7 form-control"
          .clearfix= f.submit t(".change_email"), class: "btn btn-primary pull-right"
        - if @user.unconfirmed_email.present?
          %div= t(".email_awaiting_confirmation", email: @user.email, unconfirmed_email: @user.unconfirmed_email)
    %hr

    .row
      .col-md-12
        %h3= t(".change_password")
35
        = form_for @user, url: edit_user_path, html: {method: :put, class: "form-horizontal"} do |f|
36
          - if (@user.errors.keys & %i(password password_confirmation current_password)).present?
37
            = f.error_messages
38 39 40 41
          .form-group
            = f.label :current_password, t(".current_password"), class: "col-sm-6 control-label"
            .col-sm-6
              = f.password_field :current_password, placeholder: t(".current_password_expl"),
42
                class: "form-control", autocomplete: "current-password"
43 44 45 46
          .form-group
            = f.label :password, t(".new_password"), class: "col-sm-6 control-label"
            .col-sm-6
              = f.password_field :password, placeholder: t(".character_minimum_expl"),
47
                class: "form-control", autocomplete: "new-password"
48
          .form-group
49 50
            = f.label :password_confirmation, t("registrations.new.password_confirmation"),
              class: "col-sm-6 control-label"
51 52
            .col-sm-6
              = f.password_field :password_confirmation, placeholder: t(".character_minimum_expl"),
53
                class: "form-control", autocomplete: "new-password"
54 55 56 57 58 59 60 61

          .clearfix
            = f.submit t(".change_password"), class: "btn btn-primary pull-right", name: "change_password"
    %hr

    .row
      .col-md-12
        %h3= t(".change_language")
62
        = form_for "user", url: edit_user_path, html: {method: :put} do |f|
63 64 65 66 67 68 69 70
          .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"
    %hr

    .row
      .col-md-12
        %h3= t(".change_color_theme")
71
        = form_for "user", url: edit_user_path, html: {method: :put} do |f|
72 73 74 75 76 77 78 79 80
          .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"
    %hr

    .row
      .col-md-12
        %h3#stream-preferences
          = t(".stream_preferences")
81
        = form_for current_user, url: edit_user_path, html: {method: :put} do |f|
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

          = f.fields_for :stream_preferences do
            #stream_prefs
              - if AppConfig.settings.community_spotlight.enable?
                = f.label :show_community_spotlight_in_stream, class: "checkbox-inline" do
                  = f.check_box :show_community_spotlight_in_stream
                  = t(".show_community_spotlight")

              = f.label :getting_started, class: "checkbox-inline" do
                = f.check_box :getting_started
                = t(".show_getting_started")

            .clearfix= f.submit t(".change"), class: "btn btn-primary pull-right"
    %hr

    .row
      .col-md-12
        %h3#auto-follow-back-preferences
          = t(".following")
101
        = form_for current_user, url: edit_user_path, html: {method: :put, class: "form-horizontal"} do |f|
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
          = f.label :auto_follow_back, class: "checkbox-inline" do
            = f.check_box :auto_follow_back
            = t(".auto_follow_back")
          .small-horizontal-spacer
          .form-group.row
            %label.col-sm-6.control-label= t(".auto_follow_aspect")
            .col-sm-6
              = f.select :auto_follow_back_aspect_id,
                aspect_options_for_select(current_user.aspects),
                {},
                class: "form-control"

          .small-horizontal-spacer
          .clearfix= f.submit t(".change"), class: "btn btn-primary pull-right"
    %hr

118
    = render partial: "post_default"
119

120 121 122 123 124 125 126 127 128 129
    - if AppConfig.mail.enable?
      .row
        .col-md-12
          %h3
            = t(".receive_email_notifications")
          = 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?
                  = type.label :someone_reported, class: "checkbox-inline" do
130
                    = type.check_box :someone_reported, {checked: email_prefs["someone_reported"]}, false, true
131 132 133 134 135
                    = t(".someone_reported")

                .small-horizontal-spacer

                = type.label :started_sharing, class: "checkbox-inline" do
136
                  = type.check_box :started_sharing, {checked: email_prefs["started_sharing"]}, false, true
137 138 139 140
                  = t(".started_sharing")
                .small-horizontal-spacer

                = type.label :mentioned, class: "checkbox-inline" do
141
                  = type.check_box :mentioned, {checked: email_prefs["mentioned"]}, false, true
142 143 144
                  = t(".mentioned")
                .small-horizontal-spacer

145
                = type.label :mentioned_in_comment, class: "checkbox-inline" do
146
                  = type.check_box :mentioned_in_comment, {checked: email_prefs["mentioned_in_comment"]}, false, true
147 148 149
                  = t(".mentioned_in_comment")
                .small-horizontal-spacer

150
                = type.label :liked, class: "checkbox-inline" do
151
                  = type.check_box :liked, {checked: email_prefs["liked"]}, false, true
152 153 154 155
                  = t(".liked")
                .small-horizontal-spacer

                = type.label :reshared, class: "checkbox-inline" do
156
                  = type.check_box :reshared, {checked: email_prefs["reshared"]}, false, true
157 158 159 160
                  = t(".reshared")
                .small-horizontal-spacer

                = type.label :comment_on_post, class: "checkbox-inline" do
161
                  = type.check_box :comment_on_post, {checked: email_prefs["comment_on_post"]}, false, true
162 163 164 165
                  = t(".comment_on_post")
                .small-horizontal-spacer

                = type.label :also_commented, class: "checkbox-inline" do
166
                  = type.check_box :also_commented, {checked: email_prefs["also_commented"]}, false, true
167 168 169 170
                  = t(".also_commented")
                .small-horizontal-spacer

                = type.label :private_message, class: "checkbox-inline" do
171
                  = type.check_box :private_message, {checked: email_prefs["private_message"]}, false, true
172
                  = t(".private_message")
173
                .small-horizontal-spacer
174

175 176 177 178
                = type.label :contacts_birthday, class: "checkbox-inline" do
                  = type.check_box :contacts_birthday, {checked: email_prefs["contacts_birthday"]}, false, true
                  = t(".birthday")
                .small-horizontal-spacer
179

180 181
            .clearfix= f.submit t(".change"), class: "btn btn-primary pull-right", id: "change_email_preferences"
      %hr
182

183 184 185 186 187 188 189 190 191 192
    .row
      .col-md-12
        %h3#protocol-handler
          = t(".protocol_handler.title")
        %p= t(".protocol_handler.description")
        .form-group
          %button.btn.btn-default#register-protocol-handler
            = t(".protocol_handler.register")
    %hr

193
    .row
194
      .col-md-6.account-data
Steffen van Bergerem's avatar
Steffen van Bergerem committed
195
        %h3= t(".export_data")
196
        %h4= t("profile")
Steffen van Bergerem's avatar
Steffen van Bergerem committed
197 198 199 200 201 202
        .form-group
          - if current_user.exporting
            .export-in-progress= t(".export_in_progress")
          - elsif current_user.export.present?
            = link_to t(".download_export"), download_profile_user_path,
              class: "btn btn-success"
203 204
            = link_to t(".request_export_update"), export_profile_user_path, method: :post,
              class: "btn btn-default"
Steffen van Bergerem's avatar
Steffen van Bergerem committed
205
            %h6
206
              = t(".last_exported_html", timeago: timeago(current_user.exported_at))
Steffen van Bergerem's avatar
Steffen van Bergerem committed
207 208 209
          - else
            = link_to t(".request_export"), export_profile_user_path, method: :post,
              class: "btn btn-default"
210

211
        %h4= t("javascripts.profile.photos")
Steffen van Bergerem's avatar
Steffen van Bergerem committed
212 213 214 215
        .form-group
          - if current_user.exporting_photos
            .export-in-progress= t(".export_photos_in_progress")
          - elsif current_user.exported_photos_file.present?
216
            = link_to t(".download_export_photos"), download_photos_user_path, class: "btn btn-success"
Steffen van Bergerem's avatar
Steffen van Bergerem committed
217 218 219
            = link_to t(".request_export_photos_update"), export_photos_user_path, method: :post,
              class: "btn btn-default"
            %h6
220
              = t(".last_exported_html", timeago: timeago(current_user.exported_photos_at))
Steffen van Bergerem's avatar
Steffen van Bergerem committed
221 222 223 224 225
          - else
            = link_to t(".request_export_photos"), export_photos_user_path, method: :post,
              class: "btn btn-default"

      .col-md-6
226 227 228 229 230 231
        %h3
          = t(".close_account_text")
        .form-group
          .btn.btn-danger{id: "close_account", data: {toggle: "modal", target: "#closeAccountModal"}}
            = t(".close_account_text")
          = render "close_account_modal"