Commit 26a51795 authored by marcheing's avatar marcheing Committed by Diego de Araújo Martinez Camarinha

Convert profile templates to slim

parent eacf94ea
<div class="form-section">
<%= form_for(profile, 'data-abide' => true, novalidate: true) do |f| %>
<% if profile.errors.any? %>
<div id="error_explanation", data-abide-error class="alert callout">
<h2><p><i class="fa fa-exclamation-circle"></i><%= pluralize(profile.errors.count, 'error') %> prohibited this profile from being saved:</p></h2>
<ul>
<% profile.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<fieldset>
<div class="field-label-item">
<h3><%= t('complete_your_registration') %></h3>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<label for="user-email"><%= t('email') %> *</label>
</div>
<div class="field-item">
<%= f.email_field :email, id: 'user-email', required: true, disabled: true, value: current_user.email %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label "#{t('first_name')} *", for: 'user-first-name' %>
</div>
<div class="field-item">
<%= f.text_field :first_name, required: true, id: 'user-first-name' %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label "#{t('last_name')} *", for: 'user-last-name' %>
</div>
<div class="field-item">
<%= f.text_field :last_name, required: true, id: 'user-last-name' %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label "#{t('address')} *", for: 'user-address' %>
</div>
<div class="field-item">
<%= f.text_field :address, id: 'user-address' %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label "#{t('country')} *", for: 'profile_country' %>
</div>
<div class="field-item">
<%= f.select :country, country_select %>
</div>
</fieldset>
<div id="state_select">
</div>
<fieldset>
<div class="field-label">
<%= f.label "#{t('city')} *", for: 'user-city' %>
</div>
<div class="field-item">
<%= f.text_field :city, required: true, id: 'user-city' %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label "#{t('zip_code')} *", for: 'user-postal-code' %>
</div>
<div class="field-item">
<%= f.text_field :zip_code, required: true, id: 'user-postal-code', placeholder: '99999-999' %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label "#{t('birthdate')} *", for: 'user-birthdate' %>
</div>
<div class="field-item">
<%= select_date Date.today, prefix: 'profile', use_month_numbers: true, use_two_digit_numbers: true, start_year: Date.today.year - 100, end_year: Date.today.year - 10, order: [:day, :month, :year] %>
</div>
</fieldset>
<div id='responsible_fields' style='display:none'>
<fieldset class="user-responsible">
<div class="field-label">
<%= f.label "#{t('responsible_name')} *", for: 'user-responsible-name' %>
</div>
<div class="field-item">
<%= f.text_field :responsible_name, id: 'user-responsible-name', 'aria-describedby' => 'passwordHelpText' %>
</div>
</fieldset>
<fieldset class="user-responsible">
<div class="field-label">
<%= f.label "#{t('responsible_document')} *", for: 'user-responsible-id-number' %>
</div>
<div class="field-item">
<%= f.text_field :responsible_document, id: 'user-responsible-id-number', 'aria-describedby' => 'passwordHelpText' %>
</div>
</fieldset>
</div>
<fieldset>
<div class="field-label">
<%= f.label "#{t('gender')} *" %>
</div>
<div class="field-item">
<%= f.radio_button :gender, t('female'), checked: true %>
<%= f.label t('female') %>
<%= f.radio_button :gender, t('male') %>
<%= f.label t('male') %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label t('student') %>
</div>
<div class="field-item">
<%= radio_button_tag :student, t('affirmative') %>
<%= f.label t('affirmative') %>
<%= radio_button_tag :student, t('negative'), checked: true %>
<%= f.label t('negative') %>
</div>
</fieldset>
<div id="school_fields" style="display:none">
<fieldset class="user-school">
<div class="field-label">
<%= f.label "#{t('school_type')} *", for: 'user-school-type' %>
</div>
<div class="field-item">
<%= f.select :school_type, school_type_select, id: 'user-school-type' %>
</div>
</fieldset>
<fieldset class="user-school">
<div class="field-label">
<%= f.label I18n.t "#{t('school')} *", for: 'user-school-name' %>
</div>
<div class="field-item">
<%= f.text_field :school, id: 'user-school-name' %>
</div><br>
</fieldset>
</div>
<fieldset>
<div class="field-label">
<%= f.label "#{t('occupation')} *", for: 'profile_occupation' %>
</div>
<div class="field-item">
<%= f.select :occupation, occupation_select %>
</div>
</fieldset>
<fieldset>
<div class="field-label">
<%= f.label t('phone'), for: 'user-phone' %>
</div>
<div class="field-item">
<%= f.text_field :phone, id: 'user-phone', placeholder: '(11) 99999-9999' %>
</div>
</fieldset>
<fieldset>
<div class="field-label-item">
<%= f.check_box :receive_mass_email %>
<%= f.label t('receive_newsletter'), for: :receive_mass_email %>
</div>
</fieldset>
<fieldset>
<div class="field-label-item">
<%= f.check_box :terms_of_service, id: 'user-terms', required: true %>
<%= f.label t('terms_of_service'), for: :terms_of_service %>
</div>
<div class="field-label-item recaptcha">[inserir código reCAPTCHA]</div>
<div class="field-label-item">
<%= f.submit t('save'), class: 'button' %>
</div>
</fieldset>
<% end %>
<%= hidden_field_tag('locale', I18n.locale) %>
</div>
<% content_for :footer do %>
<%= javascript_include_tag 'profiles/responsible_fields.js' %>
<%= javascript_include_tag 'profiles/school_fields.js' %>
<%= javascript_include_tag 'profiles/state_select.js' %>
<% end %>
.form-section
= form_for(profile, 'data-abide' => true, novalidate: true) do |f|
- if profile.errors.any?
| <div id="error_explanation", data-abide-error class="alert callout">
h2
p
i.fa.fa-exclamation-circle
= pluralize(profile.errors.count, 'error')
| prohibited this profile from being saved:
ul
- profile.errors.full_messages.each do |message|
li
= message
fieldset
.field-label-item
h3
= t('complete_your_registration')
fieldset
.field-label
label[for="user-email"]
= t('email')
| *
.field-item
= f.email_field :email, id: 'user-email', required: true, disabled: true, value: current_user.email
fieldset
.field-label
= f.label "#{t('first_name')} *", for: 'user-first-name'
.field-item
= f.text_field :first_name, required: true, id: 'user-first-name'
fieldset
.field-label
= f.label "#{t('last_name')} *", for: 'user-last-name'
.field-item
= f.text_field :last_name, required: true, id: 'user-last-name'
fieldset
.field-label
= f.label "#{t('address')} *", for: 'user-address'
.field-item
= f.text_field :address, id: 'user-address'
fieldset
.field-label
= f.label "#{t('country')} *", for: 'profile_country'
.field-item
= f.select :country, country_select
#state_select
fieldset
.field-label
= f.label "#{t('city')} *", for: 'user-city'
.field-item
= f.text_field :city, required: true, id: 'user-city'
fieldset
.field-label
= f.label "#{t('zip_code')} *", for: 'user-postal-code'
.field-item
= f.text_field :zip_code, required: true, id: 'user-postal-code', placeholder: '99999-999'
fieldset
.field-label
= f.label "#{t('birthdate')} *", for: 'user-birthdate'
.field-item
= select_date Date.today, prefix: 'profile', use_month_numbers: true, use_two_digit_numbers: true, start_year: Date.today.year - 100, end_year: Date.today.year - 10, order: [:day, :month, :year]
#responsible_fields[style="display:none"]
fieldset.user-responsible
.field-label
= f.label "#{t('responsible_name')} *", for: 'user-responsible-name'
.field-item
= f.text_field :responsible_name, id: 'user-responsible-name', 'aria-describedby' => 'passwordHelpText'
fieldset.user-responsible
.field-label
= f.label "#{t('responsible_document')} *", for: 'user-responsible-id-number'
.field-item
= f.text_field :responsible_document, id: 'user-responsible-id-number', 'aria-describedby' => 'passwordHelpText'
fieldset
.field-label
= f.label "#{t('gender')} *"
.field-item
= f.radio_button :gender, t('female'), checked: true
= f.label t('female')
= f.radio_button :gender, t('male')
= f.label t('male')
fieldset
.field-label
= f.label t('student')
.field-item
= radio_button_tag :student, t('affirmative')
= f.label t('affirmative')
= radio_button_tag :student, t('negative'), checked: true
= f.label t('negative')
#school_fields[style="display:none"]
fieldset.user-school
.field-label
= f.label "#{t('school_type')} *", for: 'user-school-type'
.field-item
= f.select :school_type, school_type_select, id: 'user-school-type'
fieldset.user-school
.field-label
= f.label I18n.t "#{t('school')} *", for: 'user-school-name'
.field-item
= f.text_field :school, id: 'user-school-name'
br
fieldset
.field-label
= f.label "#{t('occupation')} *", for: 'profile_occupation'
.field-item
= f.select :occupation, occupation_select
fieldset
.field-label
= f.label t('phone'), for: 'user-phone'
.field-item
= f.text_field :phone, id: 'user-phone', placeholder: '(11) 99999-9999'
fieldset
.field-label-item
= f.check_box :receive_mass_email
= f.label t('receive_newsletter'), for: :receive_mass_email
fieldset
.field-label-item
= f.check_box :terms_of_service, id: 'user-terms', required: true
= f.label t('terms_of_service'), for: :terms_of_service
.field-label-item.recaptcha
| [inserir código reCAPTCHA]
.field-label-item
= f.submit t('save'), class: 'button'
= hidden_field_tag('locale', I18n.locale)
- content_for :footer do
= javascript_include_tag 'profiles/responsible_fields.js'
= javascript_include_tag 'profiles/school_fields.js'
= javascript_include_tag 'profiles/state_select.js'
<fieldset>
<div class="field-label">
<%= label_tag 'profile_state', "#{t('state')} *" %>
</div>
<div class="field-item">
<%= select_tag :state, state_select(states), name: 'profile[state]' %>
<span class="form-error">
Campo obrigatório.
</span>
</div>
</fieldset>
fieldset
.field-label
= label_tag 'profile_state', "#{t('state')} *"
.field-item
= select_tag :state, state_select(states), name: 'profile[state]'
span.form-error
| Campo obrigatório.
<h1>Editing Profile</h1>
<%= render 'form', profile: @profile %>
<%= link_to 'Show', @profile %> |
<%= link_to 'Back', profiles_path %>
h1
| Editing Profile
= render 'form', profile: @profile
= link_to 'Show', @profile
| |
= link_to 'Back', profiles_path
<main>
<%= render 'form', profile: @profile %>
</main>
main
= render 'form', profile: @profile
<p id="notice"><%= notice %></p>
<p>
<strong>First name:</strong>
<%= @profile.first_name %>
</p>
<p>
<strong>Last name:</strong>
<%= @profile.last_name %>
</p>
<p>
<strong>Birthdate:</strong>
<%= @profile.birthdate %>
</p>
<p>
<strong>Gender:</strong>
<%= @profile.gender %>
</p>
<p>
<strong>State:</strong>
<%= @profile.state %>
</p>
<p>
<strong>City:</strong>
<%= @profile.city %>
</p>
<p>
<strong>Country:</strong>
<%= @profile.country %>
</p>
<p>
<strong>School:</strong>
<%= @profile.school %>
</p>
<p>
<strong>Responsible document:</strong>
<%= @profile.responsible_document %>
</p>
<p>
<strong>Responsible name:</strong>
<%= @profile.responsible_name %>
</p>
<p>
<strong>Receive mass email:</strong>
<%= @profile.receive_mass_email %>
</p>
<p>
<strong>Phone:</strong>
<%= @profile.phone %>
</p>
<p>
<strong>User:</strong>
<%= @profile.user_id %>
</p>
<p>
<strong>Address:</strong>
<%= @profile.address %>
</p>
<p>
<strong>Zip code:</strong>
<%= @profile.zip_code %>
</p>
<p>
<strong>Occupation:</strong>
<%= @profile.occupation %>
</p>
<p>
<strong>School type:</strong>
<%= @profile.school_type %>
</p>
<%= link_to 'Edit', edit_profile_path(@profile) %> |
<%= link_to 'Back', profiles_path %>
p#notice
= notice
p
strong
| First name:
= @profile.first_name
p
strong
| Last name:
= @profile.last_name
p
strong
| Birthdate:
= @profile.birthdate
p
strong
| Gender:
= @profile.gender
p
strong
| State:
= @profile.state
p
strong
| City:
= @profile.city
p
strong
| Country:
= @profile.country
p
strong
| School:
= @profile.school
p
strong
| Responsible document:
= @profile.responsible_document
p
strong
| Responsible name:
= @profile.responsible_name
p
strong
| Receive mass email:
= @profile.receive_mass_email
p
strong
| Phone:
= @profile.phone
p
strong
| User:
= @profile.user_id
p
strong
| Address:
= @profile.address
p
strong
| Zip code:
= @profile.zip_code
p
strong
| Occupation:
= @profile.occupation
p
strong
| School type:
= @profile.school_type
= link_to 'Edit', edit_profile_path(@profile)
| |
= link_to 'Back', profiles_path
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment