Merge branch '3.2-master' into 255-search

Refactor avatars. Fix user bugs. Remove ssh_key delete migration

Conflicts:
	app/assets/stylesheets/design/custom.scss
	app/models/user.rb
This commit is contained in:
Pavel Chipiga 2012-03-06 20:59:29 +02:00
commit 7308c4a0d2
37 changed files with 689 additions and 375 deletions

View File

@ -7,35 +7,35 @@
//= require_tree ./extra
//= require_self
// function disableNotifierCbx(global_cbx) {
// if ($(global_cbx).attr('checked')) {
// $('.notify_cbx').removeAttr('disabled');
// $('.notify_cbx').each(function(i,el) { $(el).prev().removeAttr('disabled'); })
// } else {
// $('.notify_cbx').attr('disabled', 'disabled');
// $('.notify_cbx').each(function(i,el) { $(el).prev().attr('disabled', 'disabled'); })
// }
// }
//
// $(document).ready(function() {
// $('input.user_role_chbx').click(function() {
// var current = $(this);
// current.parent().find('input.user_role_chbx').each(function(i,el) {
// if ($(el).attr('id') != current.attr('id')) {
// $(el).removeAttr('checked');
// }
// });
// });
//
// $('#settings_notifier_can_notify').click(function() {
// disableNotifierCbx($(this));
// });
//
// $('div.information > div.user').live('click', function() {
// droplist();
// });
//
// $('div.information > div.profile > a').live('click', function(e) {
// e.preventDefault();
// });
// });
function disableNotifierCbx(global_cbx) {
if ($(global_cbx).attr('checked')) {
$('.notify_cbx').removeAttr('disabled');
$('.notify_cbx').each(function(i,el) { $(el).prev().removeAttr('disabled'); })
} else {
$('.notify_cbx').attr('disabled', 'disabled');
$('.notify_cbx').each(function(i,el) { $(el).prev().attr('disabled', 'disabled'); })
}
}
$(document).ready(function() {
$('input.user_role_chbx').click(function() {
var current = $(this);
current.parent().find('input.user_role_chbx').each(function(i,el) {
if ($(el).attr('id') != current.attr('id')) {
$(el).removeAttr('checked');
}
});
});
$('#settings_notifier_can_notify').click(function() {
disableNotifierCbx($(this));
});
$('div.information > div.user').live('click', function() {
droplist();
});
$('div.information > div.profile > a').live('click', function(e) {
e.preventDefault();
});
});

View File

@ -1,5 +1,9 @@
// PUT custom styles here ONLY
span.error {
display: none;
}
a#manage-labels {
margin-bottom: 10px;
}
@ -379,3 +383,61 @@ table.tablesorter.bmargin5 {
th { padding: 5px; }
td p.block {margin-bottom: 0px;}
}
div#gollum-searchbar-fauxtext {
padding-left: 10px;
}
div#gollum-searchbar-fauxtext input#search-query {
display: inline-block;
float: left;
width: 145px;
border: 1px solid #D3D3D3;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
border-bottom-right-radius: 0;
border-top-right-radius: 0;
font-size: 12px;
height: 24px;
margin: 0;
padding: 0 4px;
vertical-align: middle;
white-space: nowrap;
}
a#search-submit {
-moz-box-sizing: content-box;
border-left: medium none;
border-radius: 0 3px 3px 0;
height: 24px;
margin-left: 0;
padding: 0;
position: relative;
vertical-align: middle;
display: inline-block;
float: left;
}
a#search-submit span {
background: image-url("gollum/icon-sprite.png") no-repeat scroll 50% 4px transparent;
background-position: -430px -2px;
height: 24px;
text-indent: -9999px;
width: 16px;
display: block;
height: 21px;
line-height: 21px;
padding: 0 9px 0 7px;
}
a#search-submit:hover span {
background-position: -430px -29px;
}
table.wiki .history .td2 .name span.username {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 164px;
}

View File

@ -45,7 +45,7 @@ class ApplicationController < ActionController::Base
end
def layout_by_resource
if devise_controller?
if devise_controller? && !(params[:controller] == 'devise/registrations' && params[:action] == 'edit')
"sessions"
else
"application"

View File

@ -1,7 +1,5 @@
# -*- encoding : utf-8 -*-
class Settings::NotifiersController < ApplicationController
layout "sessions"
before_filter :authenticate_user!
load_and_authorize_resource :user

View File

@ -1,7 +1,6 @@
# -*- encoding : utf-8 -*-
class UsersController < ApplicationController
before_filter :authenticate_user!
before_filter :find_user, :only => [:show, :edit, :update, :destroy]
load_and_authorize_resource
autocomplete :user, :uname
@ -19,7 +18,6 @@ class UsersController < ApplicationController
def show
@groups = @user.groups.uniq
@platforms = @user.platforms.paginate(:page => params[:platform_page], :per_page => 10)
# @repositories = @user.repositories.paginate(:page => params[:repository_page], :per_page => 10)
@projects = @user.projects.paginate(:page => params[:project_page], :per_page => 10)
end
@ -42,13 +40,30 @@ class UsersController < ApplicationController
end
def update
@user.role = params[:user][:role]
if @user.update_attributes(params[:user])
if params[:user][:role] && current_user.admin?
@user.role = params[:user][:role]
params[:user].delete(:role)
end
if @user.update_without_password(params[:user])
flash[:notice] = t('flash.user.saved')
redirect_to users_path
redirect_to edit_user_path(@user)
else
flash[:error] = t('flash.user.save_error')
render :action => :edit
flash[:warning] = @user.errors.full_messages.join('. ')
render(:action => :edit)
end
end
def private
if request.put?
if @user.update_with_password(params[:user])
flash[:notice] = t('flash.user.saved')
redirect_to user_private_settings_path(@user)
else
flash[:error] = t('flash.user.save_error')
flash[:warning] = @user.errors.full_messages.join('. ')
render(:action => :private)
end
end
end
@ -58,9 +73,4 @@ class UsersController < ApplicationController
redirect_to users_path
end
protected
def find_user
@user = User.find(params[:id])
end
end

View File

@ -0,0 +1,14 @@
# -*- encoding : utf-8 -*-
module UsersHelper
def avatar_url(user, size = :small)
if user.avatar?
user.avatar.url(size)
else
gravatar_url(user.email, user.avatar.styles[size].geometry.split('x').first)
end
end
def gravatar_url(email, size = 30)
"https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.downcase)}?s=#{size}&r=pg"
end
end

View File

@ -17,10 +17,6 @@ module WikiHelper
end
end
def gravatar_url(email, size = 16)
"https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.downcase)}?s=#{size}&r=pg"
end
def escaped_name
CGI.escape(@name)
end

View File

@ -34,6 +34,7 @@ class Ability
if user.user?
can [:show, :autocomplete_user_uname], User
can [:edit, :update, :private], User, :id => user.id
can [:show, :update], Settings::Notifier, :user_id => user.id

View File

@ -4,6 +4,8 @@ class User < ActiveRecord::Base
LANGUAGES_FOR_SELECT = [['Russian', 'ru'], ['English', 'en']]
LANGUAGES = LANGUAGES_FOR_SELECT.map(&:last)
has_attached_file :avatar, :styles => { :micro => "16x16", :small => "30x30>", :medium => "40x40>", :big => "81x81" }
devise :database_authenticatable, :registerable, #:omniauthable, # :token_authenticatable, :encryptable, :timeoutable
:recoverable, :rememberable, :validatable #, :trackable, :confirmable, :lockable
@ -31,11 +33,11 @@ class User < ActiveRecord::Base
validates :uname, :presence => true, :uniqueness => {:case_sensitive => false}, :format => { :with => /^[a-z0-9_]+$/ }
validate { errors.add(:uname, :taken) if Group.where('uname LIKE ?', uname).present? }
validates :ssh_key, :uniqueness => true, :allow_blank => true
validates :role, :inclusion => {:in => ROLES}, :allow_blank => true
validates :language, :inclusion => {:in => LANGUAGES}, :allow_blank => true
attr_accessible :email, :password, :password_confirmation, :remember_me, :login, :name, :ssh_key, :uname, :language
attr_accessible :email, :password, :password_confirmation, :current_password, :remember_me, :login, :name, :ssh_key, :uname, :language,
:site, :company, :professional_experience, :location, :avatar
attr_readonly :uname, :own_projects_count
attr_readonly :uname
attr_accessor :login
@ -82,17 +84,17 @@ class User < ActiveRecord::Base
end
end
def update_with_password(params={})
params.delete(:current_password)
# self.update_without_password(params) # Don't allow password update
if params[:password].blank?
params.delete(:password)
params.delete(:password_confirmation) if params[:password_confirmation].blank?
end
result = update_attributes(params)
clean_up_passwords
result
end
# def update_with_password(params={})
# params.delete(:current_password)
# # self.update_without_password(params) # Don't allow password update
# if params[:password].blank?
# params.delete(:password)
# params.delete(:password_confirmation) if params[:password_confirmation].blank?
# end
# result = update_attributes(params)
# clean_up_passwords
# result
# end
def commentor?(commentable)
comments.exists?(:commentable_type => commentable.class.name, :commentable_id => commentable.id.hex)
@ -102,7 +104,9 @@ class User < ActiveRecord::Base
email.downcase == commit.committer.email.downcase
end
def avatar(size)
"https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.downcase)}?s=#{size}&r=pg"
private
def create_settings_notifier
self.create_notifier
end
end

View File

@ -19,7 +19,7 @@
= check_box_tag "user_remove[#{user.id}][]"
%td
.img
= image_tag(gravatar_url(user.email))
= image_tag avatar_url(user)
.forimg= link_to "#{user.uname} (#{user.name})", user_path(user)
- Relation::ROLES.each_with_index do |role, i|
%td

View File

@ -1,79 +1,12 @@
#block-signup.block
%h2= title (t("devise.registrations.edit") + ' ' + resource_name.to_s.humanize)
.content
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => "form" }) do |f|
- if resource.errors.present?
.flash
.message.error= resource.errors.full_messages.map { |msg| content_tag(:p, msg) }.join.html_safe
%h3.fix.bpadding10= @user.uname
.group.wat-cf
.left
= f.label :uname, :class => "label"
.right
= f.text_field :uname, :class => "text_field", :disabled => true
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => "form" }) do |f|
= render :partial => "users/form", :locals => {:f => f}
.group.wat-cf
.left
= f.label :email, :class => "label"
.right
= f.text_field :email, :class => "text_field"
.notify
%p= t('layout.users.public_data_edit_warning')
.group.wat-cf
.left
= f.label :name, :class => "label"
.right
= f.text_field :name, :class => "text_field"
:javascript
$('article .right').addClass('middlepadding');
.group.wat-cf
.left
= f.label :ssh_key, :class => "label"
.right
= f.text_area :ssh_key, :class => "text_area"
.group.wat-cf
.left
= f.label :role, t("activerecord.attributes.user.role"), :class => :label
.right
- if current_user.admin?
= f.select :role, User::ROLES.push(""), :selected => resource.role
- else
= resource.role
.group.wat-cf
.left
= f.label :language, :class => "label"
.right
= f.select :language, User::LANGUAGES_FOR_SELECT
/ .group.wat-cf
/ .left
/ = f.label :current_password, :class => "label"
/ .right
/ = f.password_field :current_password, :class => "text_field"
/ %span.description= t("devise.registrations.current_password_description")
.group.wat-cf
.left
= f.label :password, :class => "label"
.right
= f.password_field :password, :class => "text_field"
%span.description= t("devise.registrations.edit_password_description")
.group.wat-cf
.left
= f.label :password_confirmation, :class => "label"
.right
= f.password_field :password_confirmation, :class => "text_field"
.group.navform.wat-cf
%button.button{:type => "submit"}
= image_tag("choose.png", :alt => t("devise.registrations.signed_up"))
= t("layout.save")
= link_to image_tag("x.png", :alt => t("devise.registrations.cancel")) + " " + t("devise.registrations.cancel"), registration_path(resource_name), :method => :delete, :class => "button", :confirm => t("devise.registrations.cancel_confirmation")
%span.text_button_padding
= link_to t('layout.back'), :back, :class => "text_button_padding link_button"
.group.navform.wat-cf
= link_to t('layout.settings.notifier'), user_settings_notifier_path(current_user)#, :class => "text_button_padding link_button"
- content_for :sidebar, render('users/sidebar')

View File

@ -14,7 +14,7 @@
- if @issue.persisted? && @issue.user
.bordered.nopadding
.people.nopointer
.avatar=image_tag(@issue.user.avatar(25), :alt => 'avatar')
.avatar= image_tag avatar_url(@issue.user), :alt => 'avatar'
.name="#{@issue.user.uname} (#{@issue.user.name})"
=hidden_field_tag "user-0", @issue.user.id, :name => 'user_id'
.both

View File

@ -15,9 +15,9 @@
.both
%td.td3
.avatar
=link_to image_tag(issue.user.avatar(22), :alt => 'avatar'), user_path(issue.user) if issue.user
=link_to image_tag(avatar_url(issue.user), :alt => 'avatar'), user_path(issue.user) if issue.user
%a{:href => "#{project_issue_path @project, issue}#block-list"}
.answers
.pic= image_tag 'answers.png'
.count=issue.comments.count
.both
.both

View File

@ -1,6 +1,6 @@
- (@users || []).each_with_index do |user, index|
.people.selected{:id => "user-#{index}", :class => 'add_executor'}
.avatar=image_tag(user.avatar(25), :alt => 'avatar')
.avatar= image_tag(avatar_url(user), :alt => 'avatar')
.name="#{user.uname} (#{user.name})"
=hidden_field_tag "user-#{index}", user.id, :name => 'user_id'
.both

View File

@ -3,7 +3,7 @@
#closed-comment.comment-closed{:style => 'display: block;'}
.state=t('layout.issues.status.closed')
.text
.avatar=image_tag(@issue.closer.avatar(25), :alt => 'avatar')
.avatar= image_tag(avatar_url(@issue.closer), :alt => 'avatar')
.name="#{@issue.closer.uname} (#{@issue.closer.name}) #{t('layout.issues.at')} #{@issue.closed_at.to_s(:long)}"
.both
%br/
%br/

View File

@ -6,7 +6,7 @@
.activity
.top
.image
=image_tag(@issue.creator.avatar(42), :alt => 'avatar') if @issue.creator
=image_tag(avatar_url(@issue.creator, :medium), :alt => 'avatar') if @issue.creator
.text
%span.name=link_to(@issue.creator.uname, user_path(@issue.creator)) if @issue.creator
%br/
@ -31,4 +31,4 @@
= render :partial => "comments/list", :locals => {:list => @issue.comments, :project => @project, :commentable => @issue}
%br
= render :partial => "comments/add", :locals => {:project => @project, :commentable => @issue}
= render :partial => "comments/add", :locals => {:project => @project, :commentable => @issue}

View File

@ -19,7 +19,7 @@
.information
= render 'search/form'
.user
.avatar= image_tag gravatar_url(current_user.email, 30), :alt => 'avatar', :height => "30"
.avatar= image_tag avatar_url(current_user), :alt => 'avatar', :height => "30"
.profile
%a{:href => "#"}
= current_user.uname

View File

@ -17,7 +17,7 @@
= check_box_tag "user_remove[#{user.id}][]"
%td
.img
= image_tag(gravatar_url(user.email))
= image_tag avatar_url(user)
.forimg= link_to user.name, user_path(user)
- Relation::ROLES.each_with_index do |role, i|
%td

View File

@ -1,3 +1,3 @@
%p.block
.img= image_tag user.avatar(25)
.img= image_tag avatar_url(user)
.forimg= link_to user.fullname, user

View File

@ -1,41 +1,90 @@
.group
= f.label :can_notify, t('activerecord.attributes.settings.notifier.can_notify'), :class => :label
= f.check_box :can_notify#, :class => 'text_field'
.group
= f.label :new_comment, t('activerecord.attributes.settings.notifier.new_comment'), :class => :label
.leftside.w25
= f.check_box :can_notify
.leftside
= f.label :can_notify, t('activerecord.attributes.settings.notifier.can_notify')
.both
%h3= t("layout.settings.notifiers.code_header")
.leftside.w25
= f.check_box :new_comment, :class => 'notify_cbx'
.group
= f.label :new_comment_reply, t('activerecord.attributes.settings.notifier.new_comment_reply'), :class => :label
.leftside
= f.label :new_comment, t('activerecord.attributes.settings.notifier.new_comment')
.both
.leftside.w25
= f.check_box :new_comment_reply, :class => 'notify_cbx'
.group
= f.label :new_issue, t('activerecord.attributes.settings.notifier.new_issue'), :class => :label
.leftside
= f.label :new_comment_reply, t('activerecord.attributes.settings.notifier.new_comment_reply')
.both
.leftside.w25
= f.check_box :new_issue, :class => 'notify_cbx'
.group
= f.label :issue_assign, t('activerecord.attributes.settings.notifier.issue_assign'), :class => :label
.leftside
= f.label :new_issue, t('activerecord.attributes.settings.notifier.new_issue')
.both
.leftside.w25
= f.check_box :issue_assign, :class => 'notify_cbx'
.group
= f.label :new_comment_commit_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_owner'), :class => :label
.leftside
= f.label :issue_assign, t('activerecord.attributes.settings.notifier.issue_assign')
.both
.leftside.w25
= f.check_box :new_comment_commit_owner, :class => 'notify_cbx'
.group
= f.label :new_comment_commit_repo_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_repo_owner'), :class => :label
.leftside
= f.label :new_comment_commit_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_owner')
.both
.leftside.w25
= f.check_box :new_comment_commit_repo_owner, :class => 'notify_cbx'
.group
= f.label :new_comment_commit_commentor, t('activerecord.attributes.settings.notifier.new_comment_commit_commentor'), :class => :label
.leftside
= f.label :new_comment_commit_repo_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_repo_owner')
.both
.leftside.w25
= f.check_box :new_comment_commit_commentor, :class => 'notify_cbx'
.group.navform.wat-cf
%button.button{:type => "submit"}
= image_tag("choose.png", :alt => t("layout.save"))
= t("layout.save")
%span.text_button_padding= t("layout.or")
= link_to t("layout.cancel"), user_settings_notifier_path(@user), :class => "text_button_padding link_button"
.leftside
= f.label :new_comment_commit_commentor, t('activerecord.attributes.settings.notifier.new_comment_commit_commentor')
.both
%br
.leftside.w25
\ 
.leftside.w420
= submit_tag t("layout.save")
.both
:javascript
disableNotifierCbx($('#settings_notifier_can_notify'));
-#.group
-# = f.label :can_notify, t('activerecord.attributes.settings.notifier.can_notify'), :class => :label
-# = f.check_box :can_notify#, :class => 'text_field'
-#
-#.group
-# = f.label :new_comment, t('activerecord.attributes.settings.notifier.new_comment'), :class => :label
-# = f.check_box :new_comment, :class => 'notify_cbx'
-#
-#.group
-# = f.label :new_comment_reply, t('activerecord.attributes.settings.notifier.new_comment_reply'), :class => :label
-# = f.check_box :new_comment_reply, :class => 'notify_cbx'
-#
-#.group
-# = f.label :new_issue, t('activerecord.attributes.settings.notifier.new_issue'), :class => :label
-# = f.check_box :new_issue, :class => 'notify_cbx'
-#
-#.group
-# = f.label :issue_assign, t('activerecord.attributes.settings.notifier.issue_assign'), :class => :label
-# = f.check_box :issue_assign, :class => 'notify_cbx'
-#
-#.group
-# = f.label :new_comment_commit_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_owner'), :class => :label
-# = f.check_box :new_comment_commit_owner, :class => 'notify_cbx'
-#
-#.group
-# = f.label :new_comment_commit_repo_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_repo_owner'), :class => :label
-# = f.check_box :new_comment_commit_repo_owner, :class => 'notify_cbx'
-#
-#.group
-# = f.label :new_comment_commit_commentor, t('activerecord.attributes.settings.notifier.new_comment_commit_commentor'), :class => :label
-# = f.check_box :new_comment_commit_commentor, :class => 'notify_cbx'
-#
-#.group.navform.wat-cf
-# %button.button{:type => "submit"}
-# = image_tag("choose.png", :alt => t("layout.save"))
-# = t("layout.save")
-# %span.text_button_padding= t("layout.or")
-# = link_to t("layout.cancel"), user_settings_notifier_path(@user), :class => "text_button_padding link_button"
-#

View File

@ -1,5 +1,20 @@
#block-signup.block
%h2= title t("layout.settings.notifiers.edit_header")
.content
= form_for @notifier, :url => user_settings_notifier_path(@user), :html => { :class => :form } do |f|
= render :partial => "form", :locals => {:f => f}
%p
= t("layout.settings.notifiers.notice_header", :email => @user.email)
%br
= link_to t("layout.settings.notifiers.change_email_link"), edit_user_path(@user)
%br
%br/
= form_for @notifier, :url => user_settings_notifier_path(@user), :html => { :class => :form } do |f|
= render :partial => "form", :locals => {:f => f}
:javascript
$('article .right').addClass('bigpadding');
- content_for :sidebar, render('users/sidebar')
-##block-signup.block
-# %h2= title t("layout.settings.notifiers.edit_header")
-# .content
-# = form_for @notifier, :url => user_settings_notifier_path(@user), :html => { :class => :form } do |f|
-# = render :partial => "form", :locals => {:f => f}

View File

@ -1,22 +1,48 @@
.group
= f.label :name, t("activerecord.attributes.user.name"), :class => :label
= f.text_field :name, :class => 'text_field'
.group
= f.label :uname, t("activerecord.attributes.user.uname"), :class => :label
= f.text_field :uname, :class => 'text_field', :disabled => f.object.try(:persisted?)
.group
= f.label :email, t("activerecord.attributes.user.email"), :class => :label
= f.text_field :email, :class => 'text_field'
.group
= f.label :role, t("activerecord.attributes.user.role"), :class => :label
= f.select :role, User::ROLES, :include_blank => 'user'
.group
= f.label :ssh_key, t("activerecord.attributes.user.ssh_key"), :class => :label
= f.text_area :ssh_key, :class => 'text_area'
.group.navform.wat-cf
%button.button{:type => "submit"}
= image_tag("choose.png", :alt => t("layout.save"))
= t("layout.save")
%span.text_button_padding= t("layout.or")
= link_to t("layout.cancel"), users_path, :class => "text_button_padding link_button"
.leftlist
= f.label :name, t("activerecord.attributes.user.name")
.rightlist
= f.text_field :name
.both
.leftlist
= f.label :email, t("activerecord.attributes.user.email")
.rightlist
= f.text_field :email
.both
.leftlist
= f.label :site, t("activerecord.attributes.user.site")
.rightlist
= f.text_field :site
.both
.leftlist
= f.label :language, t("activerecord.attributes.user.language")
.rightlist
= f.select :language, User::LANGUAGES_FOR_SELECT
.both
.leftlist
= f.label :company, t("activerecord.attributes.user.company")
.rightlist
= f.text_field :company
.both
.leftlist
= f.label :location, t("activerecord.attributes.user.location")
.rightlist
= f.text_field :location
.both
.leftlist
= f.label :avatar, t("activerecord.attributes.user.avatar")
.rightlist
= image_tag(avatar_url(@user, :medium))
%br
%br
= f.file_field :avatar
.both
.leftlist
= f.label :professional_experience, t("activerecord.attributes.user.professional_experience")
.rightlist
= f.text_area :professional_experience
.both
.leftlist
\ 
.rightlist
= submit_tag t("layout.save")
.both

View File

@ -1,5 +1,15 @@
.block.notice
%h3= t("layout.users.groups")
.content
- @user.groups.each do |group|
%p= link_to group.name, group
- act = action_name.to_sym
- contr = controller_name.to_sym
%aside
.admin-preferences
%ul
- if can? :edit, @user
%li{:class => (act == :edit && :users == contr) ? 'active' : ''}
= link_to t("layout.users.edit"), edit_user_path(@user)
- if can? :private, @user
%li{:class => (act == :private && contr == :users) ? 'active' : ''}
= link_to t("layout.users.user_private_settings"), user_private_settings_path(@user)
- if can? :show, @user.notifier
%li{:class => (act == :show && contr == :notifiers) ? 'active' : ''}
= link_to t("layout.users.settings_notifier"), user_settings_notifier_path(@user)

View File

@ -1,13 +1,19 @@
.block
.secondary-navigation
%ul.wat-cf
%li.first= link_to t("layout.users.list"), users_path
%li= link_to t("layout.users.new"), new_user_path
%li.active= link_to t("layout.users.edit"), edit_user_path
.content
%h2.title= t("layout.users.edit_header")
.inner
= form_for @user, :url => user_path(@user), :html => { :class => :form } do |f|
= render :partial => "form", :locals => {:f => f}
%h3.fix.bpadding10= @user.uname
= form_for @user, :url => user_path(@user), :html => { :class => :form } do |f|
- if current_user.admin?
.leftlist
= f.label :role, t("activerecord.attributes.user.role"), :class => :label
.rightlist
= f.select :role, User::ROLES, :include_blank => true
= render :partial => "form", :locals => {:f => f}
.notify
%p= t('layout.users.public_data_edit_warning')
.notify
%p= t('layout.users.avatar_notice')
:javascript
$('article .right').addClass('middlepadding');
- content_for :sidebar, render('sidebar')

View File

@ -0,0 +1,28 @@
%h3.fix.bpadding10= t('layout.users.private_settings_header')
= form_for(@user, :url => user_private_settings_path(@user), :html => { :method => :put, :class => "form" }) do |f|
.leftlist
= f.label :current_password
.rightlist
= f.password_field :current_password
.both
.leftlist
= f.label :password
.rightlist
= f.password_field :password
.both
.leftlist
= f.label :password_confirmation
.rightlist
= f.password_field :password_confirmation
.both
.leftlist
\ 
.rightlist
= submit_tag t('layout.save')
.both
:javascript
$('article .right').addClass('middlepadding');
- content_for :sidebar, render('users/sidebar')

View File

@ -1,85 +1,109 @@
.block
.secondary-navigation
%ul.wat-cf
%li.first= link_to t("layout.users.list"), users_path
%li= link_to t("layout.users.new"), new_user_path
%li.active= link_to t("layout.users.show"), user_path
.content
.inner
.left
= image_tag avatar_url(current_user, :big)
.left
%h3= @user.uname
= @user.name
%br
= link_to @user.email, "mailto:#{ @user.email }"
%br
%h4= t("activerecord.attributes.user.professional_experience") + ":"
%p= @user.professional_experience
%h4= t("layout.users.public_projects_list") + ":"
%p
%b
Id
\:
= @user.id
%p
%b
= t("activerecord.attributes.user.name")
\:
= @user.name
%p
%b
= t("activerecord.attributes.user.uname")
\:
= @user.uname
%p
%b
= t("activerecord.attributes.user.email")
\:
= @user.email
%p
%b
= t("activerecord.attributes.user.created_at")
\:
= @user.created_at
.wat-cf
- if can? :edit, @user
= link_to image_tag("code.png", :alt => t("layout.edit")) + " " + t("layout.edit"), edit_user_path(@user), :class => "button"
- if can? :destroy, @user
= link_to image_tag("x.png", :alt => t("layout.delete")) + " " + t("layout.delete"), user_path(@user), :method => "delete", :class => "button", :confirm => t("layout.users.confirm_delete")
- @user.projects.by_visibilities(['open']).each do |project|
= link_to project.name, project
%br
.block
.secondary-navigation
%ul.wat-cf
%li.first.active= link_to t("layout.platforms.list"), platforms_path
%li= link_to t("layout.platforms.new"), new_user_platform_path(@user)
.content
%h2.title
= t("layout.platforms.list_header")
.inner
= render :partial => 'shared/search_form'
= render :partial => 'platforms/list', :object => @platforms
.actions-bar.wat-cf
.actions
= will_paginate @platforms, :param_name => :platform_page
.left
%br
= link_to t("layout.users.edit"), edit_user_path(@user), :class => 'button' if can? :edit, @user
:javascript
$('article .all').addClass('verybigpadding');
-#.block
.secondary-navigation
%ul.wat-cf
%li.first.active= link_to t("layout.repositories.list"), repositories_path
%li= link_to t("layout.repositories.new"), new_user_repository_path(@user)
.content
%h2.title
= t("layout.repositories.list_header")
.inner
= render :partial => 'shared/search_form'
= render :partial => 'repositories/list', :object => @repositories
.actions-bar.wat-cf
.actions
= will_paginate @repositories, :param_name => :repository_page
.block
.secondary-navigation
%ul.wat-cf
%li.first.active= link_to t("layout.projects.list"), projects_path
%li= link_to t("layout.projects.new"), new_project_path
.content
%h2.title
= t("layout.projects.list_header")
.inner
= render :partial => 'shared/search_form'
= render :partial => 'projects/list', :object => @projects
.actions-bar.wat-cf
.actions
= will_paginate @projects, :param_name => :project_page
- content_for :sidebar, render('sidebar')
-# .secondary-navigation
-# %ul.wat-cf
-# %li.first= link_to t("layout.users.list"), users_path
-# %li= link_to t("layout.users.new"), new_user_path
-# %li.active= link_to t("layout.users.show"), user_path
-# .content
-# .inner
-# %p
-# %b
-# Id
-# \:
-# = @user.id
-# %p
-# %b
-# = t("activerecord.attributes.user.name")
-# \:
-# = @user.name
-# %p
-# %b
-# = t("activerecord.attributes.user.uname")
-# \:
-# = @user.uname
-# %p
-# %b
-# = t("activerecord.attributes.user.email")
-# \:
-# = @user.email
-# %p
-# %b
-# = t("activerecord.attributes.user.created_at")
-# \:
-# = @user.created_at
-# .wat-cf
-# - if can? :edit, @user
-# = link_to image_tag("code.png", :alt => t("layout.edit")) + " " + t("layout.edit"), edit_user_path(@user), :class => "button"
-# - if can? :destroy, @user
-# = link_to image_tag("x.png", :alt => t("layout.delete")) + " " + t("layout.delete"), user_path(@user), :method => "delete", :class => "button", :confirm => t("layout.users.confirm_delete")
-#
-#.block
-# .secondary-navigation
-# %ul.wat-cf
-# %li.first.active= link_to t("layout.platforms.list"), platforms_path
-# %li= link_to t("layout.platforms.new"), new_user_platform_path(@user)
-# .content
-# %h2.title
-# = t("layout.platforms.list_header")
-# .inner
-# = render :partial => 'shared/search_form'
-# = render :partial => 'platforms/list', :object => @platforms
-# .actions-bar.wat-cf
-# .actions
-# = will_paginate @platforms, :param_name => :platform_page
-#
-#-#.block
-# .secondary-navigation
-# %ul.wat-cf
-# %li.first.active= link_to t("layout.repositories.list"), repositories_path
-# %li= link_to t("layout.repositories.new"), new_user_repository_path(@user)
-# .content
-# %h2.title
-# = t("layout.repositories.list_header")
-# .inner
-# = render :partial => 'shared/search_form'
-# = render :partial => 'repositories/list', :object => @repositories
-# .actions-bar.wat-cf
-# .actions
-# = will_paginate @repositories, :param_name => :repository_page
-#
-#.block
-# .secondary-navigation
-# %ul.wat-cf
-# %li.first.active= link_to t("layout.projects.list"), projects_path
-# %li= link_to t("layout.projects.new"), new_project_path
-# .content
-# %h2.title
-# = t("layout.projects.list_header")
-# .inner
-# = render :partial => 'shared/search_form'
-# = render :partial => 'projects/list', :object => @projects
-# .actions-bar.wat-cf
-# .actions
-# = will_paginate @projects, :param_name => :project_page
-#
-#- content_for :sidebar, render('sidebar')

View File

@ -11,9 +11,11 @@
.avatar
%a{:href => "#"}
= link_to user_path_by_user(user) do
%img.mini-gravatar{:src => gravatar_url(v.author.email), :alt => "avatar: #{v.author.name.encode_to_default}"}
%img.mini-gravatar{:src => avatar_url(v.author), :alt => "avatar: #{v.author.name.encode_to_default}"}
%span.username= user.present? ? user.uname : v.author.name.encode_to_default
.name
= link_to user_path_by_user(user) do
%span.username= user.present? ? "#{user.uname} (#{user.name})" : v.author.name.encode_to_default
.both
%td.td3
%span.wiki-gray= "#{l v.committed_date.to_date, :format => :long}:"

View File

@ -3,4 +3,5 @@
#gollum-searchbar-fauxtext
= text_field_tag :q, t("wiki.search_and_hellip"), :id => "search-query", :autocomplete => "on"
= link_to "#", :id => "search-submit", :title => t("wiki.search_popup") do
%span= t("wiki.search")
%span= t("wiki.search")
.both

View File

@ -41,13 +41,17 @@ en:
owner: Owner
confirm: Sure?
back: Back
processing: working ...
invalid_content_type: incorrect type
settings:
label: Settings
notifier: Notifier setting
notifiers:
edit_header: Notifier setting
processing: working ...
invalid_content_type: incorrect type
notice_header: You can receive notifies from other collaborators about changes into code of your projects. Notifies will be sent to your email %{email}.
change_email_link: Change email address
code_header: Code
devise:
shared_links:
@ -214,7 +218,7 @@ en:
attributes:
settings:
notifier:
can_notify: Notifications by e-mail
can_notify: Notifications by email
new_comment: New task comment notifications
new_comment_reply: New reply of comment notifications
new_issue: New task notifications

View File

@ -41,13 +41,17 @@ ru:
owner: Владелец
confirm: Уверены?
back: Назад
processing: Обрабатывается...
invalid_content_type: имеет неверный тип
settings:
label: 'Настройки'
notifier: Настройки оповещений
notifiers:
edit_header: Настройки оповещений
processing: Обрабатывается...
invalid_content_type: имеет неверный тип
notice_header: Вы можете получать уведомления об изменениях, которые вносят другие участники, в код ваших программ. Уведомления будут высылаться на указанный вами адрес электронной почты %{email}.
change_email_link: Изменить адрес электронной почты
code_header: Код
devise:
shared_links:

View File

@ -0,0 +1,47 @@
en:
layout:
users:
list: List
new: Create
edit: Edit
new_header: New user
edit_header: Edit
list_header: Users
groups: Groups
show: User
back_to_the_list: ⇐ List of users
confirm_delete: Are you sure to remove this user?
own_projects: My projects
part_projects: Participate projects
filter_header: Filter
public_projects_list: Public projects list
public_data_edit_warning: This data is able for public profile. If you don't want to show some data, just don't fill them.
user_private_settings: Settings
settings_notifier: Notification center
delete_header: Delete aacount
delete_warning: Warning! Deleted account can not be recovered.
private_settings_header: Password change
avatar_notice: Without uploaded avatar will be used avatar from gravar web service.
activerecord:
attributes:
user:
name: Name
login: Nickname or Email
email: Email
uname: Nickname
ssh_key: SSH key
current_password: Current password
role: Role
created_at: Created
updated_at: Updated
role: System role
language: Language
password: Password
password_confirm: Confirmation
professional_experience: Professional experience
site: Web-Site
location: Location
company: Company
avatar: Avatar

View File

@ -0,0 +1,47 @@
ru:
layout:
users:
list: Список
new: Создать
edit: Редактировать
new_header: Новый пользователь
edit_header: Редактировать
list_header: Пользователи
groups: Группы
show: Пользователь
back_to_the_list: К списку пользователей
confirm_delete: Вы уверены, что хотите удалить этого пользователя?
own_projects: Мои проекты
part_projects: Участвую в проектах
filter_header: Фильтр
public_projects_list: Список публичных проектов
public_data_edit_warning: Данные доступны для публичного профиля. Если вы не хотите показывать какие-либо данные, просто не заполняйте их.
user_private_settings: Настройки
settings_notifier: Центр подписки
delete_header: Удалить аккаунт
delete_warning: Внимание! Удаленный аккаунт восстановлению не подлежит.
private_settings_header: Изменение пароля
avatar_notice: При отсутствии загруженной аватарки будет использована Ваша аватарка на сервисе gravatar.
activerecord:
attributes:
user:
name: Имя
login: Псевдоним или Email
email: Email
uname: Никнейм
ssh_key: SSH ключ
current_password: Текущий пароль
role: Роль
created_at: Создан
updated_at: Обновлен
role: Роль в системе
language: Язык
password: Пароль
password_confirm: Повторите пароль
professional_experience: Профессиональный опыт
site: Вэб-сайт
location: Местонахождение
company: Компания
avatar: Аватар

View File

@ -24,6 +24,8 @@ Rosa::Application.routes.draw do
resource :notifier, :only => [:show, :update]
end
end
match 'users/:id/settings/private' => 'users#private', :as => :user_private_settings, :via => :get
match 'users/:id/settings/private' => 'users#private', :as => :user_private_settings, :via => :put
resources :event_logs, :only => :index

View File

@ -0,0 +1,5 @@
class AddProfessionalExperienceToUsers < ActiveRecord::Migration
def change
add_column :users, :professional_experience, :text
end
end

View File

@ -0,0 +1,7 @@
class AddSiteCompanyAndLocationToUsers < ActiveRecord::Migration
def change
add_column :users, :site, :string
add_column :users, :company, :string
add_column :users, :location, :string
end
end

View File

@ -0,0 +1,11 @@
class AddAvatarToUsers < ActiveRecord::Migration
def change
change_table :users do |t|
t.has_attached_file :avatar
end
end
def self.down
drop_attached_file :users, :avatar
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20120302102734) do
ActiveRecord::Schema.define(:version => 20120303171802) do
create_table "activity_feeds", :force => true do |t|
t.integer "user_id", :null => false
@ -23,8 +23,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
create_table "arches", :force => true do |t|
t.string "name", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "arches", ["name"], :name => "index_arches_on_name", :unique => true
@ -33,8 +33,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "user_id"
t.string "provider"
t.string "uid"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "authentications", ["provider", "uid"], :name => "index_authentications_on_provider_and_uid", :unique => true
@ -45,8 +45,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "arch_id"
t.integer "pl_id"
t.integer "bpl_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "build_list_items", :force => true do |t|
@ -54,8 +54,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "level"
t.integer "status"
t.integer "build_list_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.string "version"
end
@ -69,8 +69,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "project_id"
t.integer "arch_id"
t.datetime "notified_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "is_circle", :default => false
t.text "additional_repos"
t.string "name"
@ -93,16 +93,16 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "name"
t.string "ancestry"
t.integer "projects_count", :default => 0, :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "comments", :force => true do |t|
t.string "commentable_type"
t.integer "user_id"
t.text "body"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.decimal "commentable_id", :precision => 50, :scale => 0
end
@ -110,8 +110,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "name", :null => false
t.integer "project_id", :null => false
t.integer "owner_id", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "delayed_jobs", :force => true do |t|
@ -123,8 +123,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.datetime "locked_at"
t.datetime "failed_at"
t.string "locked_by"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.string "queue"
end
@ -136,8 +136,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "distro"
t.string "platform"
t.integer "counter", :default => 0
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "event_logs", :force => true do |t|
@ -152,14 +152,14 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "controller"
t.string "action"
t.text "message"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "groups", :force => true do |t|
t.integer "owner_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.string "uname"
t.integer "own_projects_count", :default => 0, :null => false
t.text "description"
@ -172,8 +172,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "title"
t.text "body"
t.string "status", :default => "open"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "creator_id"
t.datetime "closed_at"
t.integer "closed_by"
@ -204,8 +204,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "description"
t.string "name"
t.integer "parent_platform_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "released", :default => false
t.integer "owner_id"
t.string "owner_type"
@ -218,8 +218,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "platform_id"
t.string "login"
t.string "password"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "user_id"
end
@ -227,8 +227,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "product_id"
t.integer "status", :default => 2, :null => false
t.datetime "notified_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "product_build_lists", ["product_id"], :name => "index_product_build_lists_on_product_id"
@ -238,8 +238,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "platform_id", :null => false
t.integer "build_status", :default => 2, :null => false
t.string "build_path"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.text "build_script"
t.text "counter"
t.text "ks"
@ -259,8 +259,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "name"
t.string "version"
t.datetime "file_mtime"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "platform_id"
end
@ -269,14 +269,14 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
create_table "project_to_repositories", :force => true do |t|
t.integer "project_id"
t.integer "repository_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "projects", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "owner_id"
t.string "owner_type"
t.string "visibility", :default => "open"
@ -284,11 +284,11 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.text "description"
t.string "ancestry"
t.boolean "has_issues", :default => true
t.boolean "has_wiki", :default => false
t.string "srpm_file_name"
t.string "srpm_content_type"
t.integer "srpm_file_size"
t.datetime "srpm_updated_at"
t.boolean "has_wiki", :default => false
t.string "default_branch", :default => "master"
t.boolean "is_rpm", :default => true
end
@ -302,8 +302,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "token"
t.boolean "approved", :default => false
t.boolean "rejected", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.string "interest"
t.text "more"
end
@ -316,16 +316,16 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "object_type"
t.integer "target_id"
t.string "target_type"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.string "role"
end
create_table "repositories", :force => true do |t|
t.string "description", :null => false
t.integer "platform_id", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.string "name", :null => false
end
@ -333,8 +333,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "name", :null => false
t.integer "arch_id", :null => false
t.integer "project_id", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "rpms", ["project_id", "arch_id"], :name => "index_rpms_on_project_id_and_arch_id"
@ -347,8 +347,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.boolean "new_comment_reply", :default => true
t.boolean "new_issue", :default => true
t.boolean "issue_assign", :default => true
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "new_comment_commit_owner", :default => true
t.boolean "new_comment_commit_repo_owner", :default => true
t.boolean "new_comment_commit_commentor", :default => true
@ -357,8 +357,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
create_table "subscribes", :force => true do |t|
t.string "subscribeable_type"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "status", :default => true
t.integer "project_id"
t.decimal "subscribeable_id", :precision => 50, :scale => 0
@ -366,18 +366,26 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
create_table "users", :force => true do |t|
t.string "name"
t.string "email", :default => "", :null => false
t.string "encrypted_password", :default => "", :null => false
t.string "email", :default => "", :null => false
t.string "encrypted_password", :limit => 128, :default => "", :null => false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.text "ssh_key"
t.string "uname"
t.string "role"
t.string "language", :default => "en"
t.integer "own_projects_count", :default => 0, :null => false
t.string "language", :default => "en"
t.datetime "reset_password_sent_at"
t.integer "own_projects_count", :default => 0, :null => false
t.text "professional_experience"
t.string "site"
t.string "company"
t.string "location"
t.string "avatar_file_name"
t.string "avatar_content_type"
t.integer "avatar_file_size"
t.datetime "avatar_updated_at"
end
add_index "users", ["email"], :name => "index_users_on_email", :unique => true