summaryrefslogtreecommitdiff
path: root/app/views/my/settings/index.html.erb
blob: 8e11308c7838da97f72f82593004837190ed32d7 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<% provide(:title, "My Settings") -%>
<% content_for :javascript do %>
<script type="text/javascript" charset="utf-8">
  $(function(){
    $('#edit_user').validate();
  });
</script>
<% end %>

<div class="row">
  <div class="col-3">
    <%= render partial: "my/shared/my_nav" %>
  </div>
  <div class="col-9">
    <%= form_for(@user, :url => my_setting_path(@user), :html => { :method => :put, :class => "form-horizontal" }) do |f| %>
      <fieldset>
        <div class="form-group">
          <%= f.label :name %>
          <%= f.text_field :name, class: "form-control", required: :required %>
        </div>
        <div class="form-group">
          <%= f.label :email %>
          <%= f.email_field :email, class: "form-control", required: :required %>
        </div>
        <div class="form-group">
          <%= f.label :city %>
          <%= f.text_field :city, class: "form-control" %>
        </div>
        <div class="form-group">
          <%= f.label :website %>
          <%= f.url_field :website, class: "form-control url", placeholder: "http://cakeside.com" %>
        </div>
        <div class="form-group">
          <%= f.label :twitter, "Twitter username @" %>
          <%= f.text_field :twitter, class: "form-control", placeholder: "without the @ sign", maxlength: "255" %>
        </div>
        <div class="form-group">
          <%= f.label :facebook %>
          <%= f.text_field :facebook, class: "form-control", placeholder: "http://www.facebook.com/your_profile", maxlength: "255" %>
        </div>
        <p class="help-block"><strong>Note:</strong> Help us better serve you by checking off what best describes you?</p>
        <div class="form-check">
          <label class="">About me:</label>
          <% for interest in Interest.all %>
            <label class="form-check-label">
              <%= check_box_tag "user[interest_ids][]", interest.id, current_user.interests.include?(interest), class: 'form-check-input' %>
              <%= interest.name %>
            </label>
          <% end %>
        </div>
        <input type="submit" class="btn btn-primary" value="Save changes" />
        <button type="reset" class="btn btn-secondary">Cancel</button>
      </fieldset>
    <% end %>
  </div>
</div>