Permalink
Browse files

reader and account-editing views properly sharded. various tidyings-up

  • Loading branch information...
1 parent 8bcf6d7 commit 45d9a26601c845447820ae0b7889e4de76fe7999 @will-r will-r committed Nov 22, 2011
@@ -2,68 +2,74 @@
- check_password ||= false
- form_for reader, :html => {:class => 'friendly'} do |f|
- %input{:type => :hidden, :name => :authentication_type, :value => :user}
+ - render_region :form do |form|
- = render :partial => 'edit_names', :locals => {:f => f}
+ - form.edit_name do
+ = render :partial => 'edit_names', :locals => {:f => f}
- - if reader.new_record?
- %p
- = f.label reader.email_field, t('activerecord.attributes.reader.email'), :class => 'required'
- %br
- = text_field_tag reader.email_field, params[reader.email_field] || reader.email, :id => "reader_#{reader.email_field}", :class => 'standard'
- %br
- %span.formnote= t('reader_extension.form_notes.account.email')
- .innocuous
- %p
- =f.label :email, nil, :class => 'required'
- %br
- = f.text_field :email, :class => 'standard', :value => ""
- %br
- %span.formnote= t('reader_extension.spam_trap')
+ - form.edit_email do
+ - if reader.new_record?
+ %p
+ = f.label reader.email_field, t('activerecord.attributes.reader.email'), :class => 'required'
+ %br
+ = text_field_tag reader.email_field, params[reader.email_field] || reader.email, :id => "reader_#{reader.email_field}", :class => 'standard'
+ %br
+ %span.formnote= t('reader_extension.form_notes.account.email')
+ .innocuous
+ %p
+ =f.label :email, nil, :class => 'required'
+ %br
+ = f.text_field :email, :class => 'standard', :value => ""
+ %br
+ %span.formnote= t('reader_extension.spam_trap')
- - else
- %p
- = f.label :email, nil, :class => 'required'
- %br
- = f.text_field :email, :class => 'standard'
- %br
- %span.formnote= t('reader_extension.form_notes.account.email')
+ - else
+ %p
+ = f.label :email, nil, :class => 'required'
+ %br
+ = f.text_field :email, :class => 'standard'
+ %br
+ %span.formnote= t('reader_extension.form_notes.account.email')
- - if reader.new_record?
- %p
- = f.label :password, nil, :class => 'required'
- %br
- = f.password_field :password, :class => 'standard', :autocomplete => 'off'
- %br
- %span.formnote= t('reader_extension.form_notes.account.new_password')
+ - form.edit_password do
+ - if reader.new_record?
+ %p
+ = f.label :password, nil, :class => 'required'
+ %br
+ = f.password_field :password, :class => 'standard', :autocomplete => 'off'
+ %br
+ %span.formnote= t('reader_extension.form_notes.account.new_password')
- %p
- = f.label :password_confirmation, nil, :class => 'required'
- %br
- = f.password_field :password_confirmation, :class => 'standard', :autocomplete => 'off'
+ %p
+ = f.label :password_confirmation, nil, :class => 'required'
+ %br
+ = f.password_field :password_confirmation, :class => 'standard', :autocomplete => 'off'
- - else
- .display_password
- %p
- = f.label :password, nil, :class => 'optional'
- %span.password
- •••••
- %span.formnote= link_to t('reader_extension.change_password'), '#', :class => 'toggle', :rel => ".display_password, .new_password"
+ - else
+ .display_password
+ %p
+ = f.label :password, nil, :class => 'optional'
+ %span.password
+ •••••
+ %span.formnote= link_to t('reader_extension.change_password'), '#', :class => 'toggle', :rel => ".display_password, .new_password"
- .new_password.hidden
- %p
- = f.label :password, t('reader_extension.new_password'), :class => 'required'
- %br
- = f.password_field :password, :class => 'standard', :autocomplete => 'off'
- %span.formnote= t('reader_extension.form_notes.account.new_password')
- %p
- = f.label :password_confirmation, t('reader_extension.confirm_new_password'), :class => 'required'
- %br
- = f.password_field :password_confirmation, :class => 'standard', :autocomplete => 'off'
+ .new_password.hidden
+ %p
+ = f.label :password, t('reader_extension.new_password'), :class => 'required'
+ %br
+ = f.password_field :password, :class => 'standard', :autocomplete => 'off'
+ %span.formnote= t('reader_extension.form_notes.account.new_password')
+ %p
+ = f.label :password_confirmation, t('reader_extension.confirm_new_password'), :class => 'required'
+ %br
+ = f.password_field :password_confirmation, :class => 'standard', :autocomplete => 'off'
- = render :partial => 'choose_memberships'
+ - form.edit_groups do
+ = render :partial => 'choose_memberships'
- %p
- = submit_tag reader.new_record? ? t('reader_extension.create_account') : t("reader_extension.update_account")
- or
- = link_to 'cancel', request.referer
+ - render_region :form_bottom, :locals => {:f => f} do |form_bottom|
+ - form_bottom.edit_buttons do
+ %p
+ = submit_tag reader.new_record? ? t('reader_extension.create_account') : t("reader_extension.update_account")
+ or
+ = link_to 'cancel', request.referer
@@ -2,72 +2,81 @@
- check_password ||= false
- form_for reader, :html => {:class => 'friendly'} do |f|
- %input{:type => :hidden, :name => :authentication_type, :value => :user}
+ - render_region :profile_form do |form|
- - if Radiant.config['reader.show_honorifics?']
- %p
- = f.label :honorific, nil, :class => 'optional'
- %br
- = f.text_field :honorific, :class => 'standard'
- %span.formnote= t('reader_extension.form_notes.account.honorific')
+ - form.edit_honorific do
+ - if Radiant.config['reader.show_honorifics?']
+ %p
+ = f.label :honorific, nil, :class => 'optional'
+ %br
+ = f.text_field :honorific, :class => 'standard'
+ %span.formnote= t('reader_extension.form_notes.account.honorific')
- = render :partial => 'edit_names', :locals => {:f => f}
+ - form.edit_name do
+ = render :partial => 'edit_names', :locals => {:f => f}
- %p
- = f.label :phone, nil, :class => 'optional'
- %br
- = f.text_field :phone, :class => 'standard'
- %span.formnote= t('reader_extension.form_notes.account.phone')
+ - form.edit_phone do
+ %p
+ = f.label :phone, nil, :class => 'optional'
+ %br
+ = f.text_field :phone, :class => 'standard'
+ %span.formnote= t('reader_extension.form_notes.account.phone')
- %p
- = f.label :mobile, nil, :class => 'optional'
- %br
- = f.text_field :mobile, :class => 'standard'
- %span.formnote= t('reader_extension.form_notes.account.mobile')
+ - form.edit_mobile do
+ %p
+ = f.label :mobile, nil, :class => 'optional'
+ %br
+ = f.text_field :mobile, :class => 'standard'
+ %span.formnote= t('reader_extension.form_notes.account.mobile')
- %p
- = f.label :post_country, nil, :class => 'optional'
- = f.select :post_country, country_options_for_select(reader.post_country)
- %br
- %span.formnote= t('reader_extension.form_notes.account.post_country')
+ - form.edit_address do
+ %p
+ = f.label :post_country, nil, :class => 'optional'
+ = f.select :post_country, country_options_for_select(reader.post_country)
+ %br
+ %span.formnote= t('reader_extension.form_notes.account.post_country')
- - if Radiant.config['reader.postal.use_organisation?']
- %p
- = f.label :post_organisation, nil, :class => 'optional'
- = f.text_field :post_organisation, :class => 'standard'
- %br
- %span.formnote= t('reader_extension.form_notes.account.post_organisation')
+ - if Radiant.config['reader.postal.use_organisation?']
+ %p
+ = f.label :post_organisation, nil, :class => 'optional'
+ = f.text_field :post_organisation, :class => 'standard'
+ %br
+ %span.formnote= t('reader_extension.form_notes.account.post_organisation')
- %p
- = f.label :post_line1, t('activerecord.attributes.reader.postal_address'), :class => 'optional'
- %br
- = f.text_field :post_line1, :class => 'standard'
- %br
- = f.text_field :post_line2, :class => 'standard'
- %br
- = f.label :post_city, nil, :class => 'optional'
- = f.text_field :post_city, :class => 'standard'
- %br
- = f.label :post_province, nil, :class => 'optional'
- = f.text_field :post_province, :class => 'standard'
- %br
- = f.label :postcode, nil, :class => 'optional'
- = f.text_field :postcode, :class => 'standard'
+ %p
+ = f.label :post_line1, t('activerecord.attributes.reader.postal_address'), :class => 'optional'
+ %br
+ = f.text_field :post_line1, :class => 'standard'
+ %br
+ = f.text_field :post_line2, :class => 'standard'
+ %br
+ = f.label :post_city, nil, :class => 'optional'
+ = f.text_field :post_city, :class => 'standard'
+ %br
+ = f.label :post_province, nil, :class => 'optional'
+ = f.text_field :post_province, :class => 'standard'
+ %br
+ = f.label :postcode, nil, :class => 'optional'
+ = f.text_field :postcode, :class => 'standard'
- - if Radiant.config['reader.show_descriptions?']
- %p
- = f.label :description, nil, :class => 'optional'
- %br
- = f.text_area :description, :class => Radiant.config['forum.toolbar?'] ? 'rte' : 'standard'
- %span.formnote= t('reader_extension.form_notes.account.description')
+ - form.edit_description do
+ - if Radiant.config['reader.show_descriptions?']
+ %p
+ = f.label :description, nil, :class => 'optional'
+ %br
+ = f.text_area :description, :class => Radiant.config['forum.toolbar?'] ? 'rte' : 'standard'
+ %span.formnote= t('reader_extension.form_notes.account.description')
- %p
- = f.check_box :unshareable, :class => 'reversed'
- = f.label :unshareable
- %br
- %span.formnote= t('reader_extension.form_notes.account.unshareable')
+ - form.edit_shareability do
+ %p
+ = f.check_box :unshareable, :class => 'reversed'
+ = f.label :unshareable
+ %br
+ %span.formnote= t('reader_extension.form_notes.account.unshareable')
- %p
- = submit_tag reader.new_record? ? t('reader_extension.create_account') : t("reader_extension.update_account")
- or
- = link_to 'cancel', request.referer
+ - render_region :form_bottom, :locals => {:f => f} do |form_bottom|
+ - form_bottom.edit_buttons do
+ %p
+ = submit_tag reader.new_record? ? t('reader_extension.create_account') : t("reader_extension.update_account")
+ or
+ = link_to 'cancel', request.referer
@@ -3,6 +3,6 @@
%h3
= t('reader_extension.dashboard.groups')
%ul.groups
- - current_reader.all_groups.each do |group|
+ - current_reader.groups.each do |group|
%li
= link_to_group(group)
@@ -4,6 +4,6 @@
%li
= link_to t("reader_extension.directory.link"), readers_url
%li
- = link_to t("reader_extension.directory.csv_link"), readers_url(:format => :csv)
+ = link_to t("reader_extension.directory.csv_link"), readers_url(:format => :csv), :class => 'csv'
%li
- = link_to t("reader_extension.directory.vcard_link"), readers_url(:format => :vcard)
+ = link_to t("reader_extension.directory.vcard_link"), readers_url(:format => :vcard), :class => 'vcards'
@@ -1,30 +1,30 @@
-- if Radiant.config['reader.share_details?']
- - reader ||= @reader
-
+- reader ||= @reader
+
+%div.contact
- if reader.unshareable?
- if reader == current_reader
%p.warning
= t('reader_extension.you_are_not_shared')
- else
- %div.contact
- %h3
- = link_to reader.preferred_name, reader_url(reader, :format => :vcard), :class => 'vcard', :title => t('reader_extension.directory.vcard_link')
- %ul
- - if email = reader.email
+ %h3
+ = link_to reader.name, reader_url(reader, :format => :vcard), :class => 'vcard', :title => t('reader_extension.directory.vcard_link')
+ - if reader == current_reader
+ %span.note
+ = link_to t("reader_extension.edit_profile"), reader_edit_profile_url, :class => 'edit'
+ %ul
+ - if email = reader.email
+ %li
+ = t("reader_extension.directory.email") + ': '
+ = email_link email
+ - %w{phone mobile}.each do |field|
+ - if value = reader.send(field.to_sym)
%li
- = t("reader_extension.directory.email") + ': '
- = email_link email
- - %w{phone mobile}.each do |field|
- - if value = reader.send(field.to_sym)
- %li
- = t("reader_extension.directory.#{field}") + ': '
- = value
- - if reader.postal_address?
- %li
- %span.indent
- = t("reader_extension.directory.postal_address") + ': '
- = reader.postal_address.to_html
- - if reader == current_reader
- %li.edit
- = link_to t("reader_extension.edit_profile"), reader_edit_profile_url, :class => 'edit'
+ = t("reader_extension.directory.#{field}") + ': '
+ = value
+ - if reader.postal_address?
+ %li
+ %span.indent
+ = t("reader_extension.directory.postal_address") + ': '
+ = reader.postal_address.to_html
+
@@ -18,3 +18,6 @@
- content_for :signals do
= render :partial => 'accounts/flasher'
+
+- content_for :welcome do
+ =t("reader_extension.welcome", :name => current_reader.name) if current_reader
View
@@ -95,7 +95,7 @@ en:
access_open: "Open"
access_restricted: "Restricted"
access_restricted_to: "only visible to %{groups}"
- account_settings: "Account settings"
+ account_settings: "Preferences"
account_updated: "Your account has been updated"
activate_account: "Activate your account"
activation_complete: "Thank you very much for persevering with the registration process. Your account is now active."
@@ -159,12 +159,12 @@ en:
directory: "Directory"
edit_profile: "Edit profile"
groups: "Your groups"
- introduction: "Hello %{name}. Welcome back. This page gathers together recent activity, useful links and bits of administration. You can always get back here by clicking on a 'dashboard' link."
+ introduction: "<strong>Hello %{name}.</strong> Welcome back. This page gathers together recent activity, useful links and bits of administration. You can always get back here by clicking on a 'dashboard' link."
listing: "Directory listing"
messages: "Messages for you"
profile: "Your page"
title: "Welcome"
- welcome: "Hello %{name}. Welcome to %{site} and thank you for persevering with the registration process. Your account is now active and this is your (empty) dashboard page."
+ welcome: "<strong>Hello %{name}.</strong> Welcome to %{site} and thank you for persevering with the registration process. Your account is now active and this is your (empty) dashboard page."
delete_group: "delete group"
delete_message: "Delete message"
delete_message: "delete message"
@@ -187,6 +187,7 @@ en:
download_as: "Download as"
download_group_as: "You can download the whole group as"
download_vcard: "Download vcard"
+ edit: "edit"
edit_group: "edit group"
edit_message: "Edit message"
edit_profile: "Edit your profile"
@@ -430,6 +431,7 @@ en:
your_groups: "Your groups"
your_group_members: "All your group members"
your_name: "Your name"
+ welcome: "Hello %{name}."
readers: "Readers"
settings: "Settings"
time:
Oops, something went wrong.

0 comments on commit 45d9a26

Please sign in to comment.