OpenFest: Add Devise views from v1

This commit is contained in:
Petko Bordjukov 2015-07-19 20:50:49 +03:00 committed by Andrew Radev
parent 0deb17e00b
commit 33d1260713
22 changed files with 166 additions and 212 deletions

View File

@ -1,16 +0,0 @@
<h2>Resend confirmation instructions</h2>
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
</div>
<div class="actions">
<%= f.submit "Resend confirmation instructions" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@ -0,0 +1,15 @@
- content_for(:title) { ":: #{t :resend_instructions_header}" }
h2.entry-title = t :resend_instructions_header
= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
= f.error_notification
= f.full_error :confirmation_token
.form-inputs
= f.input :email, required: true, autofocus: true, hint: false
.form-actions
= f.button :submit, t(:resend_instructions_btn)
== render 'devise/shared/links'

View File

@ -1,5 +0,0 @@
<p>Welcome <%= @email %>!</p>
<p>You can confirm your account email through the link below:</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>

View File

@ -0,0 +1,5 @@
<%= t(:welcome, name: @email) %>!
<%= t(:confirm_by_clicking) %>
<%= confirmation_url(@resource, confirmation_token: @token) %>

View File

@ -1,8 +0,0 @@
<p>Hello <%= @resource.email %>!</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>

View File

@ -0,0 +1,8 @@
<%= t(:hello, name: @resource.email) %>!
<%= t(:someone_requested_passreset) %>
<%= edit_password_url(@resource, reset_password_token: @token) %>
<%= t(:do_not_want_pass_reset1) %>
<%= t(:do_not_want_pass_reset2) %>

View File

@ -1,7 +0,0 @@
<p>Hello <%= @resource.email %>!</p>
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
<p>Click the link below to unlock your account:</p>
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>

View File

@ -0,0 +1,7 @@
<%= t(:hello, name: @resource.email) %>!
<%= t(:account_locked) %>
<%= t(:click_to_unlock) %>
<%= unlock_url(@resource, unlock_token: @token) %>

View File

@ -1,25 +0,0 @@
<h2>Change your password</h2>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %>
<%= f.hidden_field :reset_password_token %>
<div class="field">
<%= f.label :password, "New password" %><br />
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password, autofocus: true, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :password_confirmation, "Confirm new password" %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Change my password" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@ -0,0 +1,18 @@
- content_for(:title) { ":: #{t :change_pass}" }
h2.entry-title = t :change_pass
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
= f.error_notification
= f.input :reset_password_token, as: :hidden
= f.full_error :reset_password_token
.form-inputs
= f.input :password, required: true, autofocus: true
= f.input :password_confirmation, required: true
.form-actions
= f.button :submit, t(:change_pass)
= render 'devise/shared/links'

View File

@ -1,16 +0,0 @@
<h2>Forgot your password?</h2>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<div class="actions">
<%= f.submit "Send me reset password instructions" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@ -0,0 +1,14 @@
- content_for(:title) { ":: #{t :lostpass}" }
h2.entry-title = t :lostpass
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
= f.error_notification
.form-inputs
= f.input :email, required: true, autofocus: true, hint: false
.form-actions
= f.button :submit, t(:send_lostpass_instructions)
== render 'devise/shared/links'

View File

@ -1,39 +0,0 @@
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>
<div class="field">
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
<%= f.password_field :password, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Update" %>
</div>
<% end %>
<h3>Cancel my account</h3>
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
<%= link_to "Back", :back %>

View File

@ -0,0 +1,31 @@
- content_for(:title) { ":: #{t :edit_speaker_profile}" }
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, multipart: true }) do |f|
.form_inputs
h2.entry-title = t :speaker_profile
= f.error_notification
= f.simple_fields_for :speaker_profile do |ff|
= ff.input :picture, as: :image_preview, input_html: {preview_version: :thumb}, required: true
= ff.input :first_name, autofocus: true
= ff.input :last_name
= ff.input :public_email
= ff.input :organisation
= ff.input :github
= ff.input :twitter
= ff.input :mobile_phone, input_html: {value: resource.speaker_profile.mobile_phone.try(:phony_formatted, format: :international)}
= ff.input :biography
.form-inputs
h3.entry-title = t :login_data
= f.input :email, required: true
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
p
= t :expected_validation, email: resource.unconfirmed_email
= f.input :password, autocomplete: "off", hint: t(:pass_update_hint1), required: false
= f.input :password_confirmation, required: false
= f.input :current_password, hint: t(:pass_update_hint2), required: true
.form-actions
= f.button :submit, t(:update)

View File

@ -1,29 +0,0 @@
<h2>Sign up</h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<div class="field">
<%= f.label :password %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Sign up" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@ -0,0 +1,16 @@
- content_for(:title) { ":: #{t :registration}" }
h2.entry-title = t :registration
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= f.error_notification
.form-inputs
= f.input :email, required: true, autofocus: true
= f.input :password, required: true
= f.input :password_confirmation, required: true
.form-actions
= f.button :submit
== render 'devise/shared/links'

View File

@ -1,26 +0,0 @@
<h2>Log in</h2>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<div class="field">
<%= f.label :password %><br />
<%= f.password_field :password, autocomplete: "off" %>
</div>
<% if devise_mapping.rememberable? -%>
<div class="field">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
</div>
<% end -%>
<div class="actions">
<%= f.submit "Log in" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@ -0,0 +1,14 @@
- content_for(:title) { "#{t :login}" }
h2.entry-title = t :login
= simple_form_for(resource, wrapper: :default, as: resource_name, url: session_path(resource_name), ) do |f|
.form-inputs
= f.input :email, required: false, autofocus: true, hint: false
= f.input :password, required: false, hint: false
= f.input :remember_me, as: :boolean, wrapper: :default if devise_mapping.rememberable?
.form-actions
= f.button :submit, t(:login)
== render 'open_fest/users/shared/links'

View File

@ -1,25 +0,0 @@
<%- if controller_name != 'sessions' %>
<%= link_to "Log in", new_session_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
<% end -%>
<% end -%>

View File

@ -0,0 +1,23 @@
- if controller_name != 'sessions'
= link_to t(:enter), new_session_path(resource_name)
br
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to t(:registration), new_registration_path(resource_name)
br
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
= link_to t(:lostpass), new_password_path(resource_name)
br
- if devise_mapping.confirmable? && controller_name != 'confirmations'
= link_to t(:did_not_get_confirmation), new_confirmation_path(resource_name)
br
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
= link_to t(:did_not_get_unlock), new_unlock_path(resource_name)
br
- if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider|
= link_to t(:login_with, with: @provider.to_s.titleize), omniauth_authorize_path(resource_name, provider)

View File

@ -1,16 +0,0 @@
<h2>Resend unlock instructions</h2>
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<div class="actions">
<%= f.submit "Resend unlock instructions" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@ -0,0 +1,15 @@
- content_for(:title) { ":: #{t :resend_unlock_instructions_title}" }
h2 =t :resend_unlock_instructions_title
= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f|
= f.error_notification
= f.full_error :unlock_token
.form-inputs
= f.input :email, required: true, autofocus: true, hint: false
.form-actions
= f.button :submit, t(:resend_instructions_btn)
== render 'devise/shared/links'