|
6 | 6 | .row
|
7 | 7 | .col-md-12
|
8 | 8 | = form_for(@user) do |f|
|
9 |
| - = render 'form', f: f |
| 9 | + %h2 Basic Information |
| 10 | + .form-group |
| 11 | + = f.label :name |
| 12 | + = f.text_field :name, class: 'form-control' |
| 13 | + %span.help-block |
| 14 | + This is your real name |
| 15 | + .form-group |
| 16 | + = f.label :nickname |
| 17 | + = f.text_field :nickname, class: 'form-control' |
| 18 | + .form-group |
| 19 | + = f.label :timezone |
| 20 | + %br |
| 21 | + = f.select :timezone, time_zone_options_for_select(selected: @user.timezone), include_blank: true |
| 22 | + %span.help-block |
| 23 | + The timezone setting will update the event schedules to show using the time you selected. |
| 24 | + Your browser is current set to |
| 25 | + %span.js-localTimezone |
| 26 | + .form-group |
| 27 | + = f.label :avatar |
| 28 | + %br |
| 29 | + = image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '', class: 'img-rounded') |
| 30 | + %span.help-block |
| 31 | + Change your avatar on |
| 32 | + = link_to 'gravatar.com', 'https://gravatar.com' |
| 33 | + %p |
| 34 | + Or upload a picture. |
| 35 | + = f.file_field :picture, hint: 'If you upload a picture, it will be used in place of Gravatar.' |
| 36 | + - if @user.picture? |
| 37 | + %p |
| 38 | + Current Picture |
| 39 | + %br |
| 40 | + = image_tag(@user.picture.thumb.url, width: '20%') |
| 41 | + .form-group |
| 42 | + = f.label :affiliation |
| 43 | + = f.text_field :affiliation, class: 'form-control' |
| 44 | + %span.help-block |
| 45 | + The company you work work, the user group you belong to, or nothing at all. |
| 46 | + .form-group |
| 47 | + = f.label :biography |
| 48 | + = f.text_area :biography, rows: 5, data: { provide: 'markdown' }, class: 'form-control' |
| 49 | + %span.help-block |
| 50 | + You have used |
| 51 | + %span#bio-length |
| 52 | + = @user.biography ? @user.biography.split.length : 0 |
| 53 | + words. Biographies are limited to 200 words. |
| 54 | + = markdown_hint |
| 55 | + .form-group |
| 56 | + .text-right |
| 57 | + = f.submit nil, class: 'btn btn-primary' |
| 58 | + |
| 59 | + :javascript |
| 60 | + $(document).ready(function() { |
| 61 | + $('#user_timezone').selectize({}) |
| 62 | + }); |
| 63 | + |
| 64 | + let localOffset = (new Date()).getTimezoneOffset()/60; |
| 65 | + // UTC JS offsets are "-1 *" of how they're displayed. |
| 66 | + let operator = localOffset < 0 ? '+' : '-'; |
| 67 | + $('.js-localTimezone').text(`(GMT ${operator}${Math.abs(localOffset)}).`); |
| 68 | + |
0 commit comments