Merge pull request #5764 from giniouxe/#5670-refactor-registration

Refactor registrations #5670 - Partial form
This commit is contained in:
Steffen van Bergerem 2015-03-13 18:29:35 +01:00
commit fb8bc7b99e
3 changed files with 35 additions and 30 deletions

View file

@ -100,6 +100,7 @@ diaspora.yml file**. The existing settings from 0.4.x and before will not work a
* Port remaining stream pages to Bootstrap [#5715](https://github.com/diaspora/diaspora/pull/5715)
* Partial Backbone port of the notification dropdown [#5707](https://github.com/diaspora/diaspora/pull/5707)
* Add rounded corners for avatars [#5733](https://github.com/diaspora/diaspora/pull/5733)
* Move registration form to a partial [#5764](https://github.com/diaspora/diaspora/pull/5764)
## Bug fixes
* orca cannot see 'Add Contact' button [#5158](https://github.com/diaspora/diaspora/pull/5158)

View file

@ -0,0 +1,33 @@
= form_for(resource, url: registration_path(resource_name), html: {class: "form-horizontal block-form", autocomplete: "off"}) do |f|
%fieldset
%label
= f.label :user_email, t('registrations.new.email'), class: 'control-label'
%i.entypo.mail
= f.email_field :email, class: "input-block-level form-control", placeholder: t('registrations.new.email'), title: t('registrations.new.enter_email'), required: true
%label.control-label{for: "user_username"}
= t('registrations.new.username')
%i.entypo.user
= f.text_field :username, class: "input-block-level form-control", placeholder: t('registrations.new.username'), title: t('registrations.new.enter_username'), required: true, pattern: "[A-Za-z0-9_]+"
%label.control-label{for: "user_password"}
= t('registrations.new.password')
%i.entypo.lock
= f.password_field :password, class: "input-block-level form-control", placeholder: t('registrations.new.password'), title: t('registrations.new.enter_password'), required: true, pattern: "......+"
%label.control-label{for: "user_password_confirmation"}
= t('registrations.new.password_confirmation')
%i.entypo.lock
= f.password_field :password_confirmation, class: "input-block-level form-control", placeholder: t('registrations.new.password_confirmation'), title: t('registrations.new.enter_password_again'), required: true, pattern: "......+"
- if AppConfig.settings.captcha.enable?
= show_simple_captcha :object => 'user', :code_type => 'numeric'
= invite_hidden_tag(invite)
- if AppConfig.settings.terms.enable?
%p#terms.text-center
= t('registrations.new.terms', terms_link: link_to(t('registrations.new.terms_link'), terms_path, target: "_blank")).html_safe
= f.submit t('registrations.new.sign_up'), class: "btn btn-block btn-large", data: {disable_with: t('registrations.new.submitting')}

View file

@ -11,34 +11,5 @@
.text-center
%h2#pod-name
= AppConfig.settings.pod_name
= form_for(resource, url: registration_path(resource_name), html: {class: "form-horizontal block-form", autocomplete: "off"}) do |f|
%fieldset
%label.control-label{for: "user_email"}
= t('.email')
%i.entypo.mail
= f.email_field :email, class: "input-block-level form-control", placeholder: t('.email'), title: t('registrations.new.enter_email'), required: true
%label.control-label{for: "user_username"}
= t('.username')
%i.entypo.user
= f.text_field :username, class: "input-block-level form-control", placeholder: t('.username'), title: t('registrations.new.enter_username'), required: true, pattern: "[A-Za-z0-9_]+"
%label.control-label{for: "user_password"}
= t('.password')
%i.entypo.lock
= f.password_field :password, class: "input-block-level form-control", placeholder: t('.password'), title: t('registrations.new.enter_password'), required: true, pattern: "......+"
%label.control-label{for: "user_password_confirmation"}
= t('.password_confirmation')
%i.entypo.lock
= f.password_field :password_confirmation, class: "input-block-level form-control", placeholder: t('.password_confirmation'), title: t('registrations.new.enter_password_again'), required: true, pattern: "......+"
- if AppConfig.settings.captcha.enable?
= show_simple_captcha :object => 'user', :code_type => 'numeric'
= invite_hidden_tag(invite)
- if AppConfig.settings.terms.enable?
%p#terms.text-center
= t('.terms', terms_link: link_to(t('.terms_link'), terms_path, target: "_blank")).html_safe
= f.submit t('.sign_up'), class: "btn btn-block btn-large", data: {disable_with: t('.submitting')}
= render partial: 'form'