localize user profile, settings, modals

This commit is contained in:
pixeldesu 2015-06-07 15:10:17 +02:00
parent ce2323d675
commit e006dfde53
15 changed files with 152 additions and 82 deletions

View File

@ -13,34 +13,33 @@
.modal-header
%button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%span.sr-only Close
%h4#modal-passwd-label.modal-title Save account changes
%span.sr-only= t 'views.actions.close'
%h4#modal-passwd-label.modal-title= t 'views.settings.account.modal.title'
.modal-body
= f.password_field :current_password, autocomplete: "off", label: "Current password", help: "We need your current password to confirm your changes"
= f.password_field :current_password, autocomplete: "off", label: t('views.settings.account.password_current'), help: t('views.settings.account.password_current_help')
.modal-footer
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Cancel
%button.btn.btn-primary{:type => "submit"} Save changes
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"}= t 'views.actions.cancel'
%button.btn.btn-primary{:type => "submit"}= t 'views.actions.save'
= devise_error_messages!
= f.text_field :screen_name, autofocus: true, label: "User name"
= f.text_field :screen_name, autofocus: true, label: t('views.settings.account.username')
= f.email_field :email, label: "Email address"
= f.email_field :email, label: t('views.settings.account.email')
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
%div
Currently waiting confirmation for: #{resource.unconfirmed_email}
%div= raw t('views.settings.account.email_confirm', resource: resource.unconfirmed_email)
= f.password_field :password, autocomplete: "off", label: "Password", help: "Leave this blank if you don't want to change it"
= f.password_field :password_confirmation, autocomplete: "off", label: "Confirm password"
= f.password_field :password, autocomplete: "off", label: t('views.settings.account.password'), help: t('views.settings.account.password_help')
= f.password_field :password_confirmation, autocomplete: "off", label: t('views.settings.account.password_confirm')
%button.btn.btn-primary{"data-target" => "#modal-passwd", "data-toggle" => "modal", :type => "button"}
Save changes
= t 'views.actions.save'
%hr/
%p
Unsatisfied?
=button_to "Delete my account", '/settings/account', data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-danger btn-xs"
= t 'views.settings.account.unsatisfied'
=button_to t('views.settings.account.delete'), '/settings/account', data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-danger btn-xs"
= link_to "Back", :back
= link_to t('views.settings.account.back'), :back
.visible-xs= render "shared/links"

View File

@ -5,14 +5,14 @@
- else
- if current_user.following? user
%button#editprofile.btn.btn-default.btn-block.profile--follow-btn{type: :button, name: 'user-action', data: { action: :unfollow, type: type, target: user.screen_name }}
Unfollow
= t 'views.actions.unfollow'
- else
%button#editprofile.btn.btn-primary.btn-block.profile--follow-btn{type: :button, name: 'user-action', data: { action: :follow, type: type, target: user.screen_name }}
Follow
= t 'views.actions.follow'
- unless user == current_user
.btn-group.btn-block
%button.btn.btn-default.btn-block.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }}
Actions
= t 'views.actions.title'
%span.caret
%ul.dropdown-menu
/
@ -23,21 +23,18 @@
%li.visible-xs
%a{href: '#', data: { target: "#modal-group-memberships", toggle: :modal }}
%i.fa.fa-users
Manage group memberships
= t 'views.actions.group'
%li
%a{href: '#', data: { action: 'report-user', target: user.screen_name }}
%i.fa.fa-exclamation-triangle
Report
= t 'views.actions.report'
- if current_user.mod?
%li
%a{href: '#', data: { target: "#modal-privileges", toggle: :modal }}
%i.fa.fa-wrench
Check
= succeed "'s" do
= user.screen_name
privileges
= raw t('views.actions.privilege', user: user.screen_name)
- unless user.admin?
%li
%a{href: '#', data: { target: "#modal-ban", toggle: :modal }}
%i.fa.fa-ban
Ban Control
= t 'views.actions.ban'

View File

@ -6,16 +6,16 @@
%span{"aria-hidden" => "true"} ×
%span.sr-only Close
%h4#modal-ban-label.modal-title
Ban Control Center
= t 'views.modal.bancontrol.title'
= bootstrap_form_tag(url: '/mod/ban', html: { method: :post, novalidate: "novalidate" }) do |f|
= f.hidden_field :user, value: @user.screen_name
#ban-control-super.modal-body
= f.check_box :ban, label: "Ban?", checked: @user.banned?
= f.check_box :ban, label: t('views.modal.bancontrol.ban'), checked: @user.banned?
#ban-controls{style: "#{"display: none" unless @user.banned?}"}
= f.check_box :permaban, label: "Permanently?", checked: @user.permanently_banned?
= f.check_box :permaban, label: t('views.modal.bancontrol.permanent'), checked: @user.permanently_banned?
#ban-controls-time{style: "#{"display: none" unless not @user.permanently_banned?}"}
= f.text_field :until, label: "", required: true, value: (@user.banned_until || DateTime.current).strftime("%m/%d/%Y %I:%M %p")
= f.text_field :reason, placeholder: "Reason", value: @user.ban_reason
= f.text_field :reason, placeholder: t('views.modal.bancontrol.reason'), value: @user.ban_reason
.modal-footer
%button.btn.btn-default{name: 'stop-time', type: :button, data: { dismiss: :modal }} Close
= f.submit "Hammer Time", class: "btn btn-primary", name: 'hammer-time'
%button.btn.btn-default{name: 'stop-time', type: :button, data: { dismiss: :modal }}= t 'views.actions.close'
= f.submit t('views.modal.bancontrol.hammertime'), class: "btn btn-primary", name: 'hammer-time'

View File

@ -6,7 +6,8 @@
.list-group-item-heading= group.display_name
.list-group-item-text.text-muted.j2-up
%span{id: "#{group.name}-members"}= group.members.count
members ·
= t 'views.modal.group.members'
·
%a.j2-delete#delete-group{href: "#", data: { group: group.name }}
%i.fa.fa-close
Delete
= t 'views.actions.delete'

View File

@ -4,16 +4,16 @@
.modal-header
%button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%span.sr-only Close
%h4#modal-group-memberships-label.modal-title Manage group memberships
%span.sr-only= t 'views.actions.close'
%h4#modal-group-memberships-label.modal-title= t 'views.modal.group.title'
%div{role: "tabpanel"}
%ul.nav.nav-tabs{role: "tablist"}
%li.active{role: "presentation"}
%a{href: "#grouplist", aria: {controls: "grouplist"}, data: {toggle: "tab"}, role: "tab"}
Groups
= t 'views.modal.group.tabs.main'
%li{role: "presentation"}
%a{href: "#create", aria: {controls: "create"}, data: {toggle: "tab"}, role: "tab"}
Create new group
= t 'views.modal.group.tabs.create'
.tab-content
.tab-pane.active{role:"tabpanel", id: "grouplist"}
@ -22,7 +22,7 @@
= render 'user/modal_group_item', group: group, user: @user
.tab-pane{role:"tabpanel", id: "create"}
.modal-body
%input#new-group-name.form-control{type: :text, placeholder: 'Group name'}
%button#create-group.btn.btn-primary{type: :button, data: { user: @user.screen_name }} Create group
%input#new-group-name.form-control{type: :text, placeholder: t('views.modal.group.name')}
%button#create-group.btn.btn-primary{type: :button, data: { user: @user.screen_name }}= t('views.modal.group.create')
.modal-footer
%button.btn.btn-primary{name: 'gm-save', type: :button, data: { dismiss: :modal }} Done
%button.btn.btn-primary{name: 'gm-save', type: :button, data: { dismiss: :modal }}= t 'views.actions.done'

View File

@ -4,18 +4,15 @@
.modal-header
%button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} ×
%span.sr-only Close
%span.sr-only= t 'views.actions.close'
%h4#modal-privileges-label.modal-title
Check
= succeed "'s" do
= @user.screen_name
privileges
= raw t('views.actions.privilege', user: @user.screen_name)
%ul.list-group.groups--list
= render 'user/modal_privileges_item', privilege: 'blogger', description: 'The user gets that privilege if they blogged something (nice) about Retrospring.', user: @user
= render 'user/modal_privileges_item', privilege: 'contributor', description: "This user has contributed to justask#{" (the software behind #{APP_CONFIG['site_name']})" unless APP_CONFIG['site_name'] == 'justask'}.", user: @user
= render 'user/modal_privileges_item', privilege: 'blogger', description: t('views.modal.privilege.blogger'), user: @user
= render 'user/modal_privileges_item', privilege: 'contributor', description: t('views.modal.privilege.contributor'), user: @user
- if current_user.admin?
= render 'user/modal_privileges_item', privilege: 'supporter', description: 'This user monetarily supports the site', user: @user
= render 'user/modal_privileges_item', privilege: 'moderator', description: 'Someone trustworthy enough to help managing reports',user: @user
= render 'user/modal_privileges_item', privilege: 'admin', description: 'This user is part of the core team', user: @user
= render 'user/modal_privileges_item', privilege: 'supporter', description: t('views.modal.privilege.supporter'), user: @user
= render 'user/modal_privileges_item', privilege: 'moderator', description: t('views.modal.privilege.moderator'),user: @user
= render 'user/modal_privileges_item', privilege: 'admin', description: t('views.modal.privilege.admin'), user: @user
.modal-footer
%button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }} Done
%button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }}= t 'views.actions.done'

View File

@ -3,30 +3,30 @@
- if @user.admin?
.profile--panel-badge.panel-badge-danger
%i.fa.fa-flask
Admin
= t 'views.user.title.admin'
- if @user.moderator?
.profile--panel-badge.panel-badge-success
%i.fa.fa-users
Mod
= t 'views.user.title.moderator'
- if @user.supporter?
.profile--panel-badge.panel-badge-warning
%i.fa.fa-star
Supporter
= t 'views.user.title.supporter'
- if @user.contributor?
.profile--panel-badge.panel-badge-primary
%i.fa.fa-github
Contributor
= t 'views.user.title.contributor'
- if @user.blogger?
.profile--panel-badge.panel-badge-info
%i.fa.fa-pencil
Blogger
= t 'views.user.title.blogger'
- if @user.banned?
.profile--panel-badge.panel-badge-default
%i.fa.fa-ban
Banned
= t 'views.user.title.banned'
- if @user.following? current_user
.profile--panel-badge.panel-badge-default
Follows you
= t 'views.user.follows_you'
.panel-body
.profile--panel-name
- if @user.display_name.blank?

View File

@ -1,10 +1,10 @@
.col-md-3.col-xs-12.col-sm-3
.panel.panel-default
.list-group
= list_group_item "Account", edit_user_registration_path
= list_group_item "Profile", edit_user_profile_path
= list_group_item "Privacy", edit_user_privacy_path
= list_group_item "Sharing", services_path
= list_group_item t('views.settings.tabs.account'), edit_user_registration_path
= list_group_item t('views.settings.tabs.profile'), edit_user_profile_path
= list_group_item t('views.settings.tabs.privacy'), edit_user_privacy_path
= list_group_item t('views.settings.tabs.sharing'), services_path
.hidden-xs= render "shared/links"
.hidden-xs= render "shared/links"

View File

@ -6,17 +6,17 @@
%a{href: show_user_followers_path(@user.screen_name)}
.col-md-6.col-sm-6.col-xs-6
%h4.entry-text#follower-count= @user.follower_count
%h6.entry-subtext Followers
%h6.entry-subtext= t('views.general.follower').pluralize(@user.follower_count)
%a{href: show_user_friends_path(@user.screen_name)}
.col-md-6.col-sm-6.col-xs-6
%h4.entry-text#friend-count= @user.friend_count
%h6.entry-subtext Following
%h6.entry-subtext= t('views.general.following')
.row
%a{href: show_user_questions_path(@user.screen_name)}
.col-md-6.col-sm-6.col-xs-6
%h4.entry-text#asked-count= @user.asked_count
%h6.entry-subtext Questions
%h6.entry-subtext= t('views.general.question').pluralize(@user.asked_count)
%a{href: show_user_profile_path(@user.screen_name)}
.col-md-6.col-sm-6.col-xs-6
%h4.entry-text#answered-count= @user.answered_count
%h6.entry-subtext Answers
%h6.entry-subtext= t('views.general.question').pluralize(@user.answered_count)

View File

@ -7,7 +7,7 @@
.panel-body
= bootstrap_form_for(current_user, url: {action: "edit"}, :html => { :multipart => true }, method: "patch") do |f|
= f.text_field :display_name, label: "Your name"
= f.text_field :display_name, label: t('views.settings.profile.displayname')
.media#profile-picture-media
.pull-left
@ -17,7 +17,7 @@
.row#profile-picture-crop-controls{style: 'display: none;'}
.col-sm-10.col-md-8
%strong Adjust your new avatar
%strong= t('views.settings.profile.avatar_adjust')
%img#profile-picture-cropper{src: current_user.profile_picture.url(:medium)}
.col-sm-2.col-md-4
.btn-group
@ -34,7 +34,7 @@
.row#profile-header-crop-controls{style: 'display: none;'}
.col-sm-10.col-md-8
%strong Adjust your new header
%strong= t('views.settings.profile.header_adjust')
%img#profile-header-cropper{src: current_user.profile_header.url(:web)}
.col-sm-2.col-md-4
.btn-group
@ -43,13 +43,13 @@
%button#cropper-header-zoom-in.btn.btn-inverse{type: :button}
%i.fa.fa-search-plus
= f.text_field :motivation_header, label: "Motivation header", placeholder: 'Ask me anything!'
= f.text_field :motivation_header, label: t('views.settings.profile.motivation'), placeholder: t('views.settings.profile.placeholder.motivation')
= f.text_field :website, label: "Website", placeholder: 'http://example.com'
= f.text_field :website, label: t('views.settings.profile.website'), placeholder: 'http://example.com'
= f.text_field :location, label: "Location", placeholder: 'Where are you?'
= f.text_field :location, label: t('views.settings.profile.location'), placeholder: t('views.settings.profile.placeholder.location')
= f.text_area :bio, label: "Bio", placeholder: 'Tell us something nice about you!'
= f.text_area :bio, label: t('views.settings.profile.bio'), placeholder: t('views.settings.profile.placeholder.bio')
- for attrib in %i(crop_x crop_y crop_w crop_h)
= f.hidden_field attrib, id: attrib
@ -57,4 +57,4 @@
- for attrib in %i(crop_h_x crop_h_y crop_h_w crop_h_h)
= f.hidden_field attrib, id: attrib
= f.submit "Save settings", class: 'btn btn-primary'
= f.submit t('views.actions.save'), class: 'btn btn-primary'

View File

@ -7,8 +7,8 @@
.panel-body
= bootstrap_form_for(current_user, url: {action: "edit_privacy"}, method: "patch") do |f|
= f.check_box :privacy_allow_anonymous_questions, label: "Allow anonymous questions"
= f.check_box :privacy_allow_public_timeline, label: "Show your answers in the public timeline"
= f.check_box :privacy_allow_stranger_answers, label: "Allow other people to answer your questions"
= f.check_box :privacy_allow_anonymous_questions, label: t('views.settings.privacy.anonymous')
= f.check_box :privacy_allow_public_timeline, label: t('views.settings.privacy.public')
= f.check_box :privacy_allow_stranger_answers, label: t('views.settings.privacy.stranger')
= f.submit "Save settings", class: 'btn btn-primary'
= f.submit t('views.actions.save'), class: 'btn btn-primary'

View File

@ -15,5 +15,5 @@
- if @questions.next_page
%button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @questions.current_page }}
Load more
= t 'views.actions.load'
.visible-xs= render 'shared/links'

View File

@ -18,7 +18,7 @@
- if @answers.next_page
%button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @answers.current_page }}
Load more
= t 'views.actions.load'
.visible-xs= render 'shared/links'
- if user_signed_in?
= render 'user/modal_group_memberships'

View File

@ -16,7 +16,7 @@
- if @users.next_page
%button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @users.current_page }}
Load more
= t 'views.actions.load'
.visible-xs= render 'shared/links'
- if user_signed_in?
= render 'user/modal_group_memberships'

View File

@ -76,6 +76,7 @@ en:
follower: "follower"
following: "following"
actions:
title: "Actions"
answer: "Answer"
options: "Options"
anonymous: "Hide your name"
@ -86,6 +87,15 @@ en:
unsubscribe: "Unsubscribe"
view: "View comment smiles"
load: "Load more"
follow: "Follow"
unfollow: "Unfollow"
group: "Manage group memberships"
ban: "Ban Control"
privilege: "Check %{user}'s privileges"
save: "Save changes"
cancel: "Cancel"
close: "Close"
done: "Done"
sessions:
destroy: "Logout"
create: "Sign in"
@ -181,4 +191,70 @@ en:
create: "Create an account"
another: "Ask another question"
join: "Join %{app_title} today! You'll be able to follow and ask people you know and a lot more."
settings:
tabs:
account: "Account"
profile: "Profile"
privacy: "Privacy"
sharing: "Sharing"
account:
modal:
title: "Save account changes"
username: "User name"
email: "Email address"
email_confirm: "Currently awaiting confirmation for %{resource}"
password: "Password"
password_confirm: "Confirm password"
password_help: "Leave this blank if you don't want to change it"
password_current: "Current password"
password_current_help:
delete: "Delete my account"
unsatisfied: "Unsatisfied?"
back: "Back"
profile:
displayname: "Your name"
avatar_adjust: "Adjust your new avatar"
header_adjust: "Adjust your new header"
motivation: "Motivation header"
website: "Website"
location: "Location"
bio: "Bio"
placeholder:
motivation: "Ask me anything!"
location: "Where are you?"
bio: "Tell us something nice about you!"
privacy:
anonymous: "Allow anonymous questions"
public: "Show your answers in the public timeline"
stranger: "Allow other people to answer your questions"
modal:
bancontrol:
title: "Ban Control Center"
ban: "Ban?"
permanent: "Permanently?"
reason: "Reason"
hammertime: "Hammer Time"
group:
title: "Manage group memberships"
tabs:
main: "Groups"
create: "Create new group"
create: "Create group"
name: "Group name"
members: "members"
privilege:
blogger: "The user gets that privilege if they blogged something (nice) about Retrospring."
contributor: "This user has contributed to justask (the software behind Retrospring)."
supporter: "This user monetarily supports the site."
moderator: "Someone trustworthy enough to help managing reports."
admin: "This user is part of the core team."
user:
follows_you: "Follows you"
title:
admin: "Admin"
moderator: "Moderator"
supporter: "Supporter"
contributor: "Contributor"
blogger: "Blogger"
banned: "Banned"
hello: "Hello world"