summaryrefslogtreecommitdiff
path: root/users/app/views/email_settings/edit.html.haml
blob: 7757a3157de622795c1c566f72f7046a8bfe9519 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
- form_options = {:url => user_email_settings_path(@user), :html => {:class => 'form-horizontal'}, :validate => true}
- alias_error_class = @email_alias.username && !@email_alias.valid? ? 'error' : ''

- content_for :head do
  :css
    table.aliases tr:first-child td {
      border-top: none;
    }

= simple_form_for @user, form_options.dup do |f|
  %legend= t(:email_aliases)
  .control-group
    %label.control-label= t(:current_aliases)
    .controls
      %table.table.table-condensed.no-header.slim.aliases
        - if @user.email_aliases.any?
          - @user.email_aliases.each do |email|
            %tr
              %td= email
              %td= link_to(icon(:remove) + t(:remove), user_email_alias_path(@user, email), :method => :delete)
        - else
          %tr
            %td{:colspan=>2}= t(:none)
  .control-group{:class => alias_error_class}
    %label.control-label= t(:add_email_alias)
    .controls
      = f.simple_fields_for :email_aliases, @email_alias do |e|
        .input-append
          = e.input_field :username
          = e.submit t(:add), :class => 'btn'
        = e.error :username

= simple_form_for @user, form_options do |f|
  %legend= t(:advanced_options)
  = f.input :email_forward
  = f.input :public_key, :as => :text, :hint => t(:use_ascii_key), :input_html => {:class => "full-width", :rows => 4}
  .form-actions
    = f.submit t(:save), :class => 'btn btn-primary'