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

View File

@ -1,5 +1,9 @@
// PUT custom styles here ONLY // PUT custom styles here ONLY
span.error {
display: none;
}
a#manage-labels { a#manage-labels {
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -379,3 +383,61 @@ table.tablesorter.bmargin5 {
th { padding: 5px; } th { padding: 5px; }
td p.block {margin-bottom: 0px;} 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 end
def layout_by_resource def layout_by_resource
if devise_controller? if devise_controller? && !(params[:controller] == 'devise/registrations' && params[:action] == 'edit')
"sessions" "sessions"
else else
"application" "application"

View File

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

View File

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

View File

@ -34,6 +34,7 @@ class Ability
if user.user? if user.user?
can [:show, :autocomplete_user_uname], User can [:show, :autocomplete_user_uname], User
can [:edit, :update, :private], User, :id => user.id
can [:show, :update], Settings::Notifier, :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_FOR_SELECT = [['Russian', 'ru'], ['English', 'en']]
LANGUAGES = LANGUAGES_FOR_SELECT.map(&:last) 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 devise :database_authenticatable, :registerable, #:omniauthable, # :token_authenticatable, :encryptable, :timeoutable
:recoverable, :rememberable, :validatable #, :trackable, :confirmable, :lockable :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_]+$/ } 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? } 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 :role, :inclusion => {:in => ROLES}, :allow_blank => true
validates :language, :inclusion => {:in => LANGUAGES}, :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, :own_projects_count
attr_readonly :uname attr_readonly :uname
attr_accessor :login attr_accessor :login
@ -82,17 +84,17 @@ class User < ActiveRecord::Base
end end
end end
def update_with_password(params={}) # def update_with_password(params={})
params.delete(:current_password) # params.delete(:current_password)
# self.update_without_password(params) # Don't allow password update # # self.update_without_password(params) # Don't allow password update
if params[:password].blank? # if params[:password].blank?
params.delete(:password) # params.delete(:password)
params.delete(:password_confirmation) if params[:password_confirmation].blank? # params.delete(:password_confirmation) if params[:password_confirmation].blank?
end # end
result = update_attributes(params) # result = update_attributes(params)
clean_up_passwords # clean_up_passwords
result # result
end # end
def commentor?(commentable) def commentor?(commentable)
comments.exists?(:commentable_type => commentable.class.name, :commentable_id => commentable.id.hex) 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 email.downcase == commit.committer.email.downcase
end end
def avatar(size) private
"https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.downcase)}?s=#{size}&r=pg"
def create_settings_notifier
self.create_notifier
end end
end end

View File

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

View File

@ -1,79 +1,12 @@
#block-signup.block %h3.fix.bpadding10= @user.uname
%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
.group.wat-cf = form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => "form" }) do |f|
.left = render :partial => "users/form", :locals => {:f => f}
= f.label :uname, :class => "label"
.right
= f.text_field :uname, :class => "text_field", :disabled => true
.group.wat-cf .notify
.left %p= t('layout.users.public_data_edit_warning')
= f.label :email, :class => "label"
.right
= f.text_field :email, :class => "text_field"
.group.wat-cf :javascript
.left $('article .right').addClass('middlepadding');
= f.label :name, :class => "label"
.right
= f.text_field :name, :class => "text_field"
.group.wat-cf - content_for :sidebar, render('users/sidebar')
.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"

View File

@ -14,7 +14,7 @@
- if @issue.persisted? && @issue.user - if @issue.persisted? && @issue.user
.bordered.nopadding .bordered.nopadding
.people.nopointer .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})" .name="#{@issue.user.uname} (#{@issue.user.name})"
=hidden_field_tag "user-0", @issue.user.id, :name => 'user_id' =hidden_field_tag "user-0", @issue.user.id, :name => 'user_id'
.both .both

View File

@ -15,9 +15,9 @@
.both .both
%td.td3 %td.td3
.avatar .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"} %a{:href => "#{project_issue_path @project, issue}#block-list"}
.answers .answers
.pic= image_tag 'answers.png' .pic= image_tag 'answers.png'
.count=issue.comments.count .count=issue.comments.count
.both .both

View File

@ -1,6 +1,6 @@
- (@users || []).each_with_index do |user, index| - (@users || []).each_with_index do |user, index|
.people.selected{:id => "user-#{index}", :class => 'add_executor'} .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})" .name="#{user.uname} (#{user.name})"
=hidden_field_tag "user-#{index}", user.id, :name => 'user_id' =hidden_field_tag "user-#{index}", user.id, :name => 'user_id'
.both .both

View File

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

View File

@ -6,7 +6,7 @@
.activity .activity
.top .top
.image .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 .text
%span.name=link_to(@issue.creator.uname, user_path(@issue.creator)) if @issue.creator %span.name=link_to(@issue.creator.uname, user_path(@issue.creator)) if @issue.creator
%br/ %br/
@ -31,4 +31,4 @@
= render :partial => "comments/list", :locals => {:list => @issue.comments, :project => @project, :commentable => @issue} = render :partial => "comments/list", :locals => {:list => @issue.comments, :project => @project, :commentable => @issue}
%br %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 .information
= render 'search/form' = render 'search/form'
.user .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 .profile
%a{:href => "#"} %a{:href => "#"}
= current_user.uname = current_user.uname

View File

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

View File

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

View File

@ -1,41 +1,90 @@
.group .leftside.w25
= f.label :can_notify, t('activerecord.attributes.settings.notifier.can_notify'), :class => :label = f.check_box :can_notify
= f.check_box :can_notify#, :class => 'text_field' .leftside
= f.label :can_notify, t('activerecord.attributes.settings.notifier.can_notify')
.group .both
= f.label :new_comment, t('activerecord.attributes.settings.notifier.new_comment'), :class => :label %h3= t("layout.settings.notifiers.code_header")
.leftside.w25
= f.check_box :new_comment, :class => 'notify_cbx' = f.check_box :new_comment, :class => 'notify_cbx'
.leftside
.group = f.label :new_comment, t('activerecord.attributes.settings.notifier.new_comment')
= f.label :new_comment_reply, t('activerecord.attributes.settings.notifier.new_comment_reply'), :class => :label .both
.leftside.w25
= f.check_box :new_comment_reply, :class => 'notify_cbx' = f.check_box :new_comment_reply, :class => 'notify_cbx'
.leftside
.group = f.label :new_comment_reply, t('activerecord.attributes.settings.notifier.new_comment_reply')
= f.label :new_issue, t('activerecord.attributes.settings.notifier.new_issue'), :class => :label .both
.leftside.w25
= f.check_box :new_issue, :class => 'notify_cbx' = f.check_box :new_issue, :class => 'notify_cbx'
.leftside
.group = f.label :new_issue, t('activerecord.attributes.settings.notifier.new_issue')
= f.label :issue_assign, t('activerecord.attributes.settings.notifier.issue_assign'), :class => :label .both
.leftside.w25
= f.check_box :issue_assign, :class => 'notify_cbx' = f.check_box :issue_assign, :class => 'notify_cbx'
.leftside
.group = f.label :issue_assign, t('activerecord.attributes.settings.notifier.issue_assign')
= f.label :new_comment_commit_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_owner'), :class => :label .both
.leftside.w25
= f.check_box :new_comment_commit_owner, :class => 'notify_cbx' = f.check_box :new_comment_commit_owner, :class => 'notify_cbx'
.leftside
.group = f.label :new_comment_commit_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_owner')
= f.label :new_comment_commit_repo_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_repo_owner'), :class => :label .both
.leftside.w25
= f.check_box :new_comment_commit_repo_owner, :class => 'notify_cbx' = f.check_box :new_comment_commit_repo_owner, :class => 'notify_cbx'
.leftside
.group = f.label :new_comment_commit_repo_owner, t('activerecord.attributes.settings.notifier.new_comment_commit_repo_owner')
= f.label :new_comment_commit_commentor, t('activerecord.attributes.settings.notifier.new_comment_commit_commentor'), :class => :label .both
.leftside.w25
= f.check_box :new_comment_commit_commentor, :class => 'notify_cbx' = f.check_box :new_comment_commit_commentor, :class => 'notify_cbx'
.leftside
.group.navform.wat-cf = f.label :new_comment_commit_commentor, t('activerecord.attributes.settings.notifier.new_comment_commit_commentor')
%button.button{:type => "submit"} .both
= image_tag("choose.png", :alt => t("layout.save")) %br
= t("layout.save") .leftside.w25
%span.text_button_padding= t("layout.or") \ 
= link_to t("layout.cancel"), user_settings_notifier_path(@user), :class => "text_button_padding link_button" .leftside.w420
= submit_tag t("layout.save")
.both
:javascript :javascript
disableNotifierCbx($('#settings_notifier_can_notify')); 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 %p
%h2= title t("layout.settings.notifiers.edit_header") = t("layout.settings.notifiers.notice_header", :email => @user.email)
.content %br
= form_for @notifier, :url => user_settings_notifier_path(@user), :html => { :class => :form } do |f| = link_to t("layout.settings.notifiers.change_email_link"), edit_user_path(@user)
= render :partial => "form", :locals => {:f => f} %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 .leftlist
= f.label :name, t("activerecord.attributes.user.name"), :class => :label = f.label :name, t("activerecord.attributes.user.name")
= f.text_field :name, :class => 'text_field' .rightlist
.group = f.text_field :name
= f.label :uname, t("activerecord.attributes.user.uname"), :class => :label .both
= f.text_field :uname, :class => 'text_field', :disabled => f.object.try(:persisted?) .leftlist
.group = f.label :email, t("activerecord.attributes.user.email")
= f.label :email, t("activerecord.attributes.user.email"), :class => :label .rightlist
= f.text_field :email, :class => 'text_field' = f.text_field :email
.group .both
= f.label :role, t("activerecord.attributes.user.role"), :class => :label .leftlist
= f.select :role, User::ROLES, :include_blank => 'user' = f.label :site, t("activerecord.attributes.user.site")
.group .rightlist
= f.label :ssh_key, t("activerecord.attributes.user.ssh_key"), :class => :label = f.text_field :site
= f.text_area :ssh_key, :class => 'text_area' .both
.leftlist
.group.navform.wat-cf = f.label :language, t("activerecord.attributes.user.language")
%button.button{:type => "submit"} .rightlist
= image_tag("choose.png", :alt => t("layout.save")) = f.select :language, User::LANGUAGES_FOR_SELECT
= t("layout.save") .both
%span.text_button_padding= t("layout.or") .leftlist
= link_to t("layout.cancel"), users_path, :class => "text_button_padding link_button" = 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 - act = action_name.to_sym
%h3= t("layout.users.groups") - contr = controller_name.to_sym
.content
- @user.groups.each do |group| %aside
%p= link_to group.name, group .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 %h3.fix.bpadding10= @user.uname
.secondary-navigation
%ul.wat-cf = form_for @user, :url => user_path(@user), :html => { :class => :form } do |f|
%li.first= link_to t("layout.users.list"), users_path - if current_user.admin?
%li= link_to t("layout.users.new"), new_user_path .leftlist
%li.active= link_to t("layout.users.edit"), edit_user_path = f.label :role, t("activerecord.attributes.user.role"), :class => :label
.content .rightlist
%h2.title= t("layout.users.edit_header") = f.select :role, User::ROLES, :include_blank => true
.inner = render :partial => "form", :locals => {:f => f}
= form_for @user, :url => user_path(@user), :html => { :class => :form } do |f|
= 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') - 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 .left
.secondary-navigation = image_tag avatar_url(current_user, :big)
%ul.wat-cf .left
%li.first= link_to t("layout.users.list"), users_path %h3= @user.uname
%li= link_to t("layout.users.new"), new_user_path = @user.name
%li.active= link_to t("layout.users.show"), user_path %br
.content = link_to @user.email, "mailto:#{ @user.email }"
.inner %br
%h4= t("activerecord.attributes.user.professional_experience") + ":"
%p= @user.professional_experience
%h4= t("layout.users.public_projects_list") + ":"
%p %p
%b - @user.projects.by_visibilities(['open']).each do |project|
Id = link_to project.name, project
\: %br
= @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 .left
%ul.wat-cf %br
%li.first.active= link_to t("layout.platforms.list"), platforms_path = link_to t("layout.users.edit"), edit_user_path(@user), :class => 'button' if can? :edit, @user
%li= link_to t("layout.platforms.new"), new_user_platform_path(@user)
.content :javascript
%h2.title $('article .all').addClass('verybigpadding');
= 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 -#.block
.secondary-navigation -# .secondary-navigation
%ul.wat-cf -# %ul.wat-cf
%li.first.active= link_to t("layout.repositories.list"), repositories_path -# %li.first= link_to t("layout.users.list"), users_path
%li= link_to t("layout.repositories.new"), new_user_repository_path(@user) -# %li= link_to t("layout.users.new"), new_user_path
.content -# %li.active= link_to t("layout.users.show"), user_path
%h2.title -# .content
= t("layout.repositories.list_header") -# .inner
.inner -# %p
= render :partial => 'shared/search_form' -# %b
= render :partial => 'repositories/list', :object => @repositories -# Id
.actions-bar.wat-cf -# \:
.actions -# = @user.id
= will_paginate @repositories, :param_name => :repository_page -# %p
-# %b
.block -# = t("activerecord.attributes.user.name")
.secondary-navigation -# \:
%ul.wat-cf -# = @user.name
%li.first.active= link_to t("layout.projects.list"), projects_path -# %p
%li= link_to t("layout.projects.new"), new_project_path -# %b
.content -# = t("activerecord.attributes.user.uname")
%h2.title -# \:
= t("layout.projects.list_header") -# = @user.uname
.inner -# %p
= render :partial => 'shared/search_form' -# %b
= render :partial => 'projects/list', :object => @projects -# = t("activerecord.attributes.user.email")
.actions-bar.wat-cf -# \:
.actions -# = @user.email
= will_paginate @projects, :param_name => :project_page -# %p
-# %b
- content_for :sidebar, render('sidebar') -# = 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 .avatar
%a{:href => "#"} %a{:href => "#"}
= link_to user_path_by_user(user) do = 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 %span.username= user.present? ? user.uname : v.author.name.encode_to_default
.name .name
= link_to user_path_by_user(user) do
%span.username= user.present? ? "#{user.uname} (#{user.name})" : v.author.name.encode_to_default
.both .both
%td.td3 %td.td3
%span.wiki-gray= "#{l v.committed_date.to_date, :format => :long}:" %span.wiki-gray= "#{l v.committed_date.to_date, :format => :long}:"

View File

@ -3,4 +3,5 @@
#gollum-searchbar-fauxtext #gollum-searchbar-fauxtext
= text_field_tag :q, t("wiki.search_and_hellip"), :id => "search-query", :autocomplete => "on" = 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 = 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 owner: Owner
confirm: Sure? confirm: Sure?
back: Back back: Back
processing: working ...
invalid_content_type: incorrect type
settings: settings:
label: Settings label: Settings
notifier: Notifier setting notifier: Notifier setting
notifiers: notifiers:
edit_header: Notifier setting edit_header: Notifier setting
processing: working ... notice_header: You can receive notifies from other collaborators about changes into code of your projects. Notifies will be sent to your email %{email}.
invalid_content_type: incorrect type change_email_link: Change email address
code_header: Code
devise: devise:
shared_links: shared_links:
@ -214,7 +218,7 @@ en:
attributes: attributes:
settings: settings:
notifier: notifier:
can_notify: Notifications by e-mail can_notify: Notifications by email
new_comment: New task comment notifications new_comment: New task comment notifications
new_comment_reply: New reply of comment notifications new_comment_reply: New reply of comment notifications
new_issue: New task notifications new_issue: New task notifications

View File

@ -41,13 +41,17 @@ ru:
owner: Владелец owner: Владелец
confirm: Уверены? confirm: Уверены?
back: Назад back: Назад
processing: Обрабатывается...
invalid_content_type: имеет неверный тип
settings: settings:
label: 'Настройки' label: 'Настройки'
notifier: Настройки оповещений notifier: Настройки оповещений
notifiers: notifiers:
edit_header: Настройки оповещений edit_header: Настройки оповещений
processing: Обрабатывается... notice_header: Вы можете получать уведомления об изменениях, которые вносят другие участники, в код ваших программ. Уведомления будут высылаться на указанный вами адрес электронной почты %{email}.
invalid_content_type: имеет неверный тип change_email_link: Изменить адрес электронной почты
code_header: Код
devise: devise:
shared_links: 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] resource :notifier, :only => [:show, :update]
end end
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 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. # 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| create_table "activity_feeds", :force => true do |t|
t.integer "user_id", :null => false t.integer "user_id", :null => false
@ -23,8 +23,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
create_table "arches", :force => true do |t| create_table "arches", :force => true do |t|
t.string "name", :null => false t.string "name", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "arches", ["name"], :name => "index_arches_on_name", :unique => true 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.integer "user_id"
t.string "provider" t.string "provider"
t.string "uid" t.string "uid"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "authentications", ["provider", "uid"], :name => "index_authentications_on_provider_and_uid", :unique => true 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 "arch_id"
t.integer "pl_id" t.integer "pl_id"
t.integer "bpl_id" t.integer "bpl_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "build_list_items", :force => true do |t| create_table "build_list_items", :force => true do |t|
@ -54,8 +54,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "level" t.integer "level"
t.integer "status" t.integer "status"
t.integer "build_list_id" t.integer "build_list_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "version" t.string "version"
end end
@ -69,8 +69,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "project_id" t.integer "project_id"
t.integer "arch_id" t.integer "arch_id"
t.datetime "notified_at" t.datetime "notified_at"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "is_circle", :default => false t.boolean "is_circle", :default => false
t.text "additional_repos" t.text "additional_repos"
t.string "name" t.string "name"
@ -93,16 +93,16 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "name" t.string "name"
t.string "ancestry" t.string "ancestry"
t.integer "projects_count", :default => 0, :null => false t.integer "projects_count", :default => 0, :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "comments", :force => true do |t| create_table "comments", :force => true do |t|
t.string "commentable_type" t.string "commentable_type"
t.integer "user_id" t.integer "user_id"
t.text "body" t.text "body"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.decimal "commentable_id", :precision => 50, :scale => 0 t.decimal "commentable_id", :precision => 50, :scale => 0
end end
@ -110,8 +110,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "name", :null => false t.string "name", :null => false
t.integer "project_id", :null => false t.integer "project_id", :null => false
t.integer "owner_id", :null => false t.integer "owner_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "delayed_jobs", :force => true do |t| create_table "delayed_jobs", :force => true do |t|
@ -123,8 +123,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.datetime "locked_at" t.datetime "locked_at"
t.datetime "failed_at" t.datetime "failed_at"
t.string "locked_by" t.string "locked_by"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "queue" t.string "queue"
end end
@ -136,8 +136,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "distro" t.string "distro"
t.string "platform" t.string "platform"
t.integer "counter", :default => 0 t.integer "counter", :default => 0
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "event_logs", :force => true do |t| create_table "event_logs", :force => true do |t|
@ -152,14 +152,14 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "controller" t.string "controller"
t.string "action" t.string "action"
t.text "message" t.text "message"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "groups", :force => true do |t| create_table "groups", :force => true do |t|
t.integer "owner_id" t.integer "owner_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "uname" t.string "uname"
t.integer "own_projects_count", :default => 0, :null => false t.integer "own_projects_count", :default => 0, :null => false
t.text "description" t.text "description"
@ -172,8 +172,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "title" t.string "title"
t.text "body" t.text "body"
t.string "status", :default => "open" t.string "status", :default => "open"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "creator_id" t.integer "creator_id"
t.datetime "closed_at" t.datetime "closed_at"
t.integer "closed_by" t.integer "closed_by"
@ -204,8 +204,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "description" t.string "description"
t.string "name" t.string "name"
t.integer "parent_platform_id" t.integer "parent_platform_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "released", :default => false t.boolean "released", :default => false
t.integer "owner_id" t.integer "owner_id"
t.string "owner_type" t.string "owner_type"
@ -218,8 +218,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "platform_id" t.integer "platform_id"
t.string "login" t.string "login"
t.string "password" t.string "password"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "user_id" t.integer "user_id"
end end
@ -227,8 +227,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.integer "product_id" t.integer "product_id"
t.integer "status", :default => 2, :null => false t.integer "status", :default => 2, :null => false
t.datetime "notified_at" t.datetime "notified_at"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "product_build_lists", ["product_id"], :name => "index_product_build_lists_on_product_id" 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 "platform_id", :null => false
t.integer "build_status", :default => 2, :null => false t.integer "build_status", :default => 2, :null => false
t.string "build_path" t.string "build_path"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.text "build_script" t.text "build_script"
t.text "counter" t.text "counter"
t.text "ks" t.text "ks"
@ -259,8 +259,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "name" t.string "name"
t.string "version" t.string "version"
t.datetime "file_mtime" t.datetime "file_mtime"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "platform_id" t.integer "platform_id"
end end
@ -269,14 +269,14 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
create_table "project_to_repositories", :force => true do |t| create_table "project_to_repositories", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.integer "repository_id" t.integer "repository_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
create_table "projects", :force => true do |t| create_table "projects", :force => true do |t|
t.string "name" t.string "name"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "owner_id" t.integer "owner_id"
t.string "owner_type" t.string "owner_type"
t.string "visibility", :default => "open" t.string "visibility", :default => "open"
@ -284,11 +284,11 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.text "description" t.text "description"
t.string "ancestry" t.string "ancestry"
t.boolean "has_issues", :default => true t.boolean "has_issues", :default => true
t.boolean "has_wiki", :default => false
t.string "srpm_file_name" t.string "srpm_file_name"
t.string "srpm_content_type" t.string "srpm_content_type"
t.integer "srpm_file_size" t.integer "srpm_file_size"
t.datetime "srpm_updated_at" t.datetime "srpm_updated_at"
t.boolean "has_wiki", :default => false
t.string "default_branch", :default => "master" t.string "default_branch", :default => "master"
t.boolean "is_rpm", :default => true t.boolean "is_rpm", :default => true
end end
@ -302,8 +302,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "token" t.string "token"
t.boolean "approved", :default => false t.boolean "approved", :default => false
t.boolean "rejected", :default => false t.boolean "rejected", :default => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "interest" t.string "interest"
t.text "more" t.text "more"
end end
@ -316,16 +316,16 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "object_type" t.string "object_type"
t.integer "target_id" t.integer "target_id"
t.string "target_type" t.string "target_type"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "role" t.string "role"
end end
create_table "repositories", :force => true do |t| create_table "repositories", :force => true do |t|
t.string "description", :null => false t.string "description", :null => false
t.integer "platform_id", :null => false t.integer "platform_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.string "name", :null => false t.string "name", :null => false
end end
@ -333,8 +333,8 @@ ActiveRecord::Schema.define(:version => 20120302102734) do
t.string "name", :null => false t.string "name", :null => false
t.integer "arch_id", :null => false t.integer "arch_id", :null => false
t.integer "project_id", :null => false t.integer "project_id", :null => false
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
end end
add_index "rpms", ["project_id", "arch_id"], :name => "index_rpms_on_project_id_and_arch_id" 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_comment_reply", :default => true
t.boolean "new_issue", :default => true t.boolean "new_issue", :default => true
t.boolean "issue_assign", :default => true t.boolean "issue_assign", :default => true
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "new_comment_commit_owner", :default => true t.boolean "new_comment_commit_owner", :default => true
t.boolean "new_comment_commit_repo_owner", :default => true t.boolean "new_comment_commit_repo_owner", :default => true
t.boolean "new_comment_commit_commentor", :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| create_table "subscribes", :force => true do |t|
t.string "subscribeable_type" t.string "subscribeable_type"
t.integer "user_id" t.integer "user_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.boolean "status", :default => true t.boolean "status", :default => true
t.integer "project_id" t.integer "project_id"
t.decimal "subscribeable_id", :precision => 50, :scale => 0 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| create_table "users", :force => true do |t|
t.string "name" t.string "name"
t.string "email", :default => "", :null => false t.string "email", :default => "", :null => false
t.string "encrypted_password", :default => "", :null => false t.string "encrypted_password", :limit => 128, :default => "", :null => false
t.string "reset_password_token" t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at" t.datetime "remember_created_at"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.text "ssh_key" t.text "ssh_key"
t.string "uname" t.string "uname"
t.string "role" t.string "role"
t.string "language", :default => "en" t.string "language", :default => "en"
t.integer "own_projects_count", :default => 0, :null => false 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 end
add_index "users", ["email"], :name => "index_users_on_email", :unique => true add_index "users", ["email"], :name => "index_users_on_email", :unique => true