[issue #279] Merge branch '3.2-master' into 279-new_design_for_platforms

Conflicts:
	db/schema.rb
This commit is contained in:
George Vinogradov 2012-03-14 21:43:08 +04:00
commit 747edb73a5
44 changed files with 299 additions and 171 deletions

View File

@ -33,6 +33,7 @@ gem 'wikicloth'
gem 'unicorn', '~> 4.2.0'
gem 'newrelic_rpm', '~> 3.3.2'
gem 'whenever', '~> 0.7.3', :require => false
gem 'rails3-jquery-autocomplete', '~> 1.0.6'
gem 'will_paginate', '~> 3.0.3'
@ -60,7 +61,6 @@ group :development do
gem 'hirb'
gem 'shotgun'
# deploy
gem 'whenever', :require => false
gem 'capistrano', :require => false
gem 'cape', :require => false
gem 'capistrano_colors', :require => false

View File

@ -341,6 +341,6 @@ DEPENDENCIES
therubyracer (~> 0.9.10)
uglifier (~> 1.2.1)
unicorn (~> 4.2.0)
whenever
whenever (~> 0.7.3)
wikicloth
will_paginate (~> 3.0.3)

View File

@ -1413,8 +1413,8 @@ div.description-top input.name {
height: 21px;
width: auto;
color: #575756;
font-size: 12px;
width: 215px;
font-size: 11px;
width: 415px;
padding: 2px 5px 3px;
}
@ -1941,6 +1941,13 @@ img.delete-row {
cursor: pointer;
}
table tbody tr.error td {
background: #fedede;
}
table tbody tr.success td {
background: #e3edb7;
}
/* Create group */

View File

@ -2,6 +2,6 @@ class ActivityFeedsController < ApplicationController
before_filter :authenticate_user!
def index
@activity_feeds = current_user.activity_feeds.order('created_at DESC')
@activity_feeds = current_user.activity_feeds.order('created_at DESC').limit(10)
end
end

View File

@ -15,8 +15,8 @@ class CommentsController < ApplicationController
@comment = @commentable.comments.build(params[:comment]) if @commentable.class == Issue
if @commentable.class == Grit::Commit
@comment = Comment.new(params[:comment].merge(:commentable_id => @commentable.id.hex, :commentable_type => @commentable.class.name))
@comment.project = @project
end
@comment.project = @project
@comment.user_id = current_user.id
if @comment.save
flash[:notice] = I18n.t("flash.comment.saved")

View File

@ -4,8 +4,8 @@ class ProjectsController < ApplicationController
load_and_authorize_resource
def index
@projects = current_user.projects.paginate(:page => params[:project_page])
@projects = @projects.search(params[:query]).search_order if params[:query]
@projects = current_user.projects.paginate(:page => params[:page])
#@projects = @projects.search(params[:query]).search_order if params[:query]
end
def new

View File

@ -25,7 +25,8 @@ class UsersController < ApplicationController
@user = User.new
end
def edit
def profile
@user ||= current_user
end
def create
@ -46,12 +47,16 @@ class UsersController < ApplicationController
end
@user ||= current_user
if @user.update_without_password(params[:user])
if @user.avatar && params[:delete_avatar] == '1'
@user.avatar = nil
@user.save
end
flash[:notice] = t('flash.user.saved')
redirect_to edit_user_path(@user)
redirect_to @user == current_user ? edit_profile_path : edit_user_path(@user)
else
flash[:error] = t('flash.user.save_error')
flash[:warning] = @user.errors.full_messages.join('. ')
render(:action => :edit)
render(:action => :profile)
end
end

View File

@ -0,0 +1,13 @@
# -*- encoding : utf-8 -*-
module BuildListsHelper
def build_list_status(build_list)
if [BuildList::BUILD_PUBLISHED, BuildServer::SUCCESS].include? build_list.status
"success"
elsif [BuildServer::BUILD_ERROR, BuildServer::PLATFORM_NOT_FOUND, BuildServer::PROJECT_NOT_FOUND,
BuildServer::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH].include? build_list.status
"error"
end
end
end

View File

@ -2,7 +2,7 @@
module UsersHelper
def avatar_url_by_email(email, size = :small)
avatar_url(User.where(:email => email).first, size)
avatar_url(User.where(:email => email).first || User.new(:email => email), size)
end
def avatar_url(user, size = :small)

View File

@ -34,7 +34,7 @@ class Ability
if user.user?
can [:show, :autocomplete_user_uname], User
can [:edit, :update, :private], User, :id => user.id
can [:profile, :update, :private], User, :id => user.id
can [:show, :update], Settings::Notifier, :user_id => user.id
@ -59,6 +59,7 @@ class Ability
#can :create, AutoBuildList
#can [:index, :destroy], AutoBuildList, :project_id => user.own_project_ids
can :search, BuildList
can [:read, :owned], BuildList, :user_id => user.id
can :read, BuildList, :project => {:visibility => 'open'}
can [:read, :related], BuildList, :project => {:owner_type => 'User', :owner_id => user.id}
@ -106,7 +107,6 @@ class Ability
can(:create, Comment) {|comment| can? :read, comment.project}
can(:update, Comment) {|comment| comment.user_id == user.id or local_admin?(comment.project || comment.commentable.project)}
cannot :manage, Comment, :commentable_type => 'Issue', :commentable => {:project => {:has_issues => false}} # switch off issues
cannot :manage, RegisterRequest
end
# Shared cannot rights for all users (registered, admin)

View File

@ -18,30 +18,33 @@ class ActivityFeedObserver < ActiveRecord::Observer
ActivityFeed.create(
:user => recipient,
:kind => 'new_issue_notification',
:data => {:user_name => record.creator.name, :user_email => record.creator.email, :user_id => record.creator_id, :issue_serial_id => record.serial_id, :issue_title => record.title, :project_id => record.project.id, :project_name => record.project.name}
:data => {:user_name => record.creator.name, :user_email => record.creator.email, :user_id => record.creator_id,:issue_serial_id => record.serial_id,
:issue_title => record.title, :project_id => record.project.id, :project_name => record.project.name, :project_owner => record.project.owner.uname}
)
end
if record.user_id_was != record.user_id
if record.user_id_changed?
UserMailer.delay.issue_assign_notification(record, record.user) if record.user.notifier.issue_assign && record.user.notifier.can_notify
ActivityFeed.create(
:user => record.user,
:kind => 'issue_assign_notification',
:data => {:user_name => record.creator.name, :user_email => record.creator.email, :user_id => record.creator_id, :issue_serial_id => record.serial_id, :project_id => record.project.id, :issue_title => record.title}
:data => {:user_name => record.creator.name, :user_email => record.creator.email, :user_id => record.creator_id, :issue_serial_id => record.serial_id,
:project_id => record.project.id, :issue_title => record.title, :project_name => record.project.name, :project_owner => record.project.owner.uname}
)
end
when 'Comment'
if record.commentable.class == Issue
subscribes = record.commentable.subscribes.finder_hack
subscribes = record.commentable.subscribes
subscribes.each do |subscribe|
if record.user_id != subscribe.user_id
UserMailer.delay.new_comment_notification(record, subscribe.user) if record.can_notify_on_new_comment?(subscribe)
ActivityFeed.create(
:user => subscribe.user,
:kind => 'new_comment_notification',
:data => {:user_name => record.user.name, :user_email => record.user.email, :user_id => record.user_id, :comment_body => record.body, :issue_title => record.commentable.title,
:issue_serial_id => record.commentable.serial_id, :project_id => record.commentable.project.id}
:data => {:user_name => record.user.name, :user_email => record.user.email, :user_id => record.user_id, :comment_body => record.body,
:issue_title => record.commentable.title, :issue_serial_id => record.commentable.serial_id, :project_id => record.commentable.project.id,
:comment_id => record.id, :project_name => record.project.name, :project_owner => record.project.owner.uname}
)
end
end
@ -49,12 +52,18 @@ class ActivityFeedObserver < ActiveRecord::Observer
subscribes = Subscribe.comment_subscribes(record).where(:status => true)
subscribes.each do |subscribe|
next if record.own_comment?(subscribe.user)
UserMailer.delay.new_comment_notification(record, subscribe.user) if subscribe.user.notifier.can_notify
if subscribe.user.notifier.can_notify and
( (subscribe.project.owner?(subscribe.user) && subscribe.user.notifier.new_comment_commit_repo_owner) or
(subscribe.user.commentor?(record.commentable) && subscribe.user.notifier.new_comment_commit_commentor) or
(subscribe.user.committer?(record.commentable) && subscribe.user.notifier.new_comment_commit_owner) )
UserMailer.delay.new_comment_notification(record, subscribe.user)
end
ActivityFeed.create(
:user => subscribe.user,
:kind => 'new_comment_commit_notification',
:data => {:user_name => record.user.name, :user_email => record.user.email, :user_id => record.user_id, :comment_body => record.body, :commit_message => record.commentable.message.encode_to_default,
:commit_id => record.commentable.id, :project_id => record.project.id}
:data => {:user_name => record.user.name, :user_email => record.user.email, :user_id => record.user_id, :comment_body => record.body,
:commit_message => record.commentable.message.encode_to_default, :commit_id => record.commentable.id,
:project_id => record.project.id, :comment_id => record.id, :project_name => record.project.name, :project_owner => record.project.owner.uname}
)
end
end
@ -71,11 +80,14 @@ class ActivityFeedObserver < ActiveRecord::Observer
if change_type == 'delete'
kind = 'git_delete_branch_notification'
options = {:project_id => record.project.id, :project_name => record.project.name, :branch_name => branch_name, :change_type => change_type}
options = {:project_id => record.project.id, :project_name => record.project.name, :branch_name => branch_name,
:change_type => change_type, :project_owner => record.project.owner.uname}
else
kind = 'git_new_push_notification'
options = {:project_id => record.project.id, :project_name => record.project.name, :last_commits => last_commits, :branch_name => branch_name, :change_type => change_type}
options.merge!({:user_id => first_commiter.id, :user_name => first_commiter.name, :user_email => first_commiter.email}) if first_commiter
options = {:project_id => record.project.id, :project_name => record.project.name, :last_commits => last_commits, :branch_name => branch_name,
:change_type => change_type, :user_email => record.project.git_repository.repo.log(branch_name, nil).first.author.email,
:project_owner => record.project.owner.uname}
options.merge!({:user_id => first_commiter.id, :user_name => first_commiter.name}) if first_commiter
end
record.project.owner_and_admin_ids.each do |recipient|
@ -97,7 +109,8 @@ class ActivityFeedObserver < ActiveRecord::Observer
ActivityFeed.create(
:user => User.find(recipient),#record.user,
:kind => 'wiki_new_commit_notification',
:data => {:user_id => actor.id, :user_name => actor.name, :user_email => actor.email, :project_id => project.id, :project_name => project_name, :commit_sha => commit_sha}
:data => {:user_id => actor.id, :user_name => actor.name, :user_email => actor.email, :project_id => project.id,
:project_name => project_name, :commit_sha => commit_sha, :project_owner => project.owner.uname}
)
end
end
@ -106,12 +119,13 @@ class ActivityFeedObserver < ActiveRecord::Observer
def after_update(record)
case record.class.to_s
when 'Issue'
if record.user_id_was != record.user_id
if record.user_id && record.user_id_changed?
UserMailer.delay.issue_assign_notification(record, record.user) if record.user.notifier.issue_assign && record.user.notifier.can_notify
ActivityFeed.create(
:user => record.user,
:kind => 'issue_assign_notification',
:data => {:user_name => record.user.name, :user_email => record.user.email, :issue_serial_id => record.serial_id, :project_id => record.project.id, :issue_title => record.title}
:data => {:user_name => record.user.name, :user_email => record.user.email, :issue_serial_id => record.serial_id, :issue_title => record.title,
:project_id => record.project.id, :project_name => record.project.name, :project_owner => record.project.owner.uname}
)
end
end

View File

@ -73,13 +73,14 @@ class Issue < ActiveRecord::Base
def subscribe_users
recipients = collect_recipient_ids
recipients.each do |recipient_id|
ss = self.subscribes.build(:user_id => recipient_id)
ss.save!
if User.find(recipient_id).notifier.new_comment && !self.subscribes.exists?(:user_id => recipient_id)
ss = self.subscribes.create(:user_id => recipient_id)
end
end
end
def subscribe_issue_assigned_user
if self.user_id_was != self.user_id
if self.user_id && self.user_id_changed?
self.subscribes.where(:user_id => self.user_id_was).first.destroy unless self.user_id_was.blank?
if self.user.notifier.issue_assign && !self.subscribes.exists?(:user_id => self.user_id)
self.subscribes.create(:user_id => self.user_id)

View File

@ -65,12 +65,13 @@ class Project < ActiveRecord::Base
end
end
def build_for(platform, user)
def build_for(platform, user, arch = 'x86_64') # Return i586 after mass rebuild
arch = Arch.find_by_name(arch) if arch.acts_like?(:string)
build_lists.create do |bl|
bl.pl = platform
bl.bpl = platform
bl.update_type = 'newpackage'
bl.arch = Arch.find_by_name('x86_64') # Return i586 after mass rebuild
bl.arch = arch
bl.project_version = "latest_#{platform.name}" # "latest_import_mandriva2011"
bl.build_requires = false # already set as db default
bl.user = user

View File

@ -4,8 +4,6 @@ class Subscribe < ActiveRecord::Base
belongs_to :user
belongs_to :project
scope :finder_hack, order('') # FIXME .subscribes - error; .subscribes.finder_hack - success Oo
def commit_subscribe?
subscribeable_type == 'Grit::Commit'
end
@ -21,10 +19,7 @@ class Subscribe < ActiveRecord::Base
def self.subscribed_to_commit?(project, user, commit)
subscribe = user.subscribes.where(:subscribeable_id => commit.id.hex, :subscribeable_type => commit.class.name, :project_id => project.id).first
return subscribe.subscribed? if subscribe # return status if already subscribe present
# return status by settings
(project.owner?(user) && user.notifier.new_comment_commit_repo_owner) or
(user.commentor?(commit) && user.notifier.new_comment_commit_commentor) or
(user.committer?(commit) && user.notifier.new_comment_commit_owner)
true
end
def self.subscribe_to_commit(options)

View File

@ -3,8 +3,15 @@ class User < ActiveRecord::Base
ROLES = ['admin']
LANGUAGES_FOR_SELECT = [['Russian', 'ru'], ['English', 'en']]
LANGUAGES = LANGUAGES_FOR_SELECT.map(&:last)
MAX_AVATAR_SIZE = 5.megabyte
has_attached_file :avatar, :styles => { :micro => "16x16", :small => "30x30>", :medium => "40x40>", :big => "81x81" }
has_attached_file :avatar, :styles =>
{ :micro => { :geometry => "16x16#", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'},
:small => { :geometry => "30x30#", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'},
:medium => { :geometry => "40x40#", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'},
:big => { :geometry => "81x81#", :format => :jpg, :convert_options => '-strip -background white -flatten -quality 70'}
}
validates_inclusion_of :avatar_file_size, :in => (0..MAX_AVATAR_SIZE), :allow_nil => true
devise :database_authenticatable, :registerable, #:omniauthable, # :token_authenticatable, :encryptable, :timeoutable
:recoverable, :rememberable, :validatable #, :trackable, :confirmable, :lockable

View File

@ -62,4 +62,11 @@ class CommentPresenter < ApplicationPresenter
@date ||= I18n.l(@comment.updated_at, :format => :long)
end
def comment_id?
true
end
def comment_id
@comment.id
end
end

View File

@ -45,6 +45,10 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
true
end
def comment_id?
false
end
protected
def committer

View File

@ -18,29 +18,30 @@
%td
= link_to t("layout.activity_feed.all_my_projects"), projects_path
.block
- midnight = Time.new.midnight
%h3= t("layout.activity_feed.my_builds_by_day")
%table{:cellpadding => "0", :cellspacing => "0"}
%tbody
%tr
%td.first
= link_to t("layout.build_lists.statuses.#{:build_published}"), build_lists_path(:filter => {:status => BuildList::BUILD_PUBLISHED})
%td= BuildList.for_status(BuildList::BUILD_PUBLISHED).for_user(current_user).count
= link_to t("layout.build_lists.statuses.#{:build_published}"), build_lists_path(:filter => {:status => BuildList::BUILD_PUBLISHED, :notified_at => midnight})
%td= BuildList.for_status(BuildList::BUILD_PUBLISHED).for_user(current_user).for_notified_date_period(midnight, nil).count
%tr
%td.first
= link_to t("layout.build_lists.statuses.#{:success}"), build_lists_path(:filter => {:status => BuildServer::SUCCESS})
%td= BuildList.for_status(BuildServer::SUCCESS).for_user(current_user).count
= link_to t("layout.build_lists.statuses.#{:success}"), build_lists_path(:filter => {:status => BuildServer::SUCCESS, :notified_at => midnight})
%td= BuildList.for_status(BuildServer::SUCCESS).for_user(current_user).for_notified_date_period(midnight, nil).count
%tr
%td.first
= link_to t("layout.build_lists.statuses.#{:build_started}"), build_lists_path(:filter => {:status => BuildServer::BUILD_STARTED})
%td= BuildList.for_status(BuildServer::BUILD_STARTED).for_user(current_user).count
= link_to t("layout.build_lists.statuses.#{:build_started}"), build_lists_path(:filter => {:status => BuildServer::BUILD_STARTED, :notified_at => midnight})
%td= BuildList.for_status(BuildServer::BUILD_STARTED).for_user(current_user).for_notified_date_period(midnight, nil).count
%tr
%td.first
= link_to t("layout.build_lists.statuses.#{:build_pending}"), build_lists_path(:filter => {:status => BuildList::BUILD_PENDING})
%td= BuildList.for_status(BuildList::BUILD_PENDING).for_user(current_user).count
= link_to t("layout.build_lists.statuses.#{:build_pending}"), build_lists_path(:filter => {:status => BuildList::BUILD_PENDING, :notified_at => midnight})
%td= BuildList.for_status(BuildList::BUILD_PENDING).for_user(current_user).for_notified_date_period(midnight, nil).count
%tr
%td.first
= link_to t("layout.build_lists.statuses.#{:build_error}"), build_lists_path(:filter => {:status => BuildServer::BUILD_ERROR})
%td= BuildList.for_status(BuildServer::BUILD_ERROR).for_user(current_user).count
= link_to t("layout.build_lists.statuses.#{:build_error}"), build_lists_path(:filter => {:status => BuildServer::BUILD_ERROR, :notified_at => midnight})
%td= BuildList.for_status(BuildServer::BUILD_ERROR).for_user(current_user).for_notified_date_period(midnight, nil).count
%tr
%td.first
= link_to t("layout.activity_feed.all_my_builds"), build_lists_path

View File

@ -1,7 +1,8 @@
.top
%span.date= activity_feed.created_at
%br
%span.subject Branch #{ branch_name } has been deleted
.text
%span
= t('notifications.bodies.delete_branch', :branch_name => branch_name)
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
.both
%span.date= activity_feed.created_at
.both
.fulltext
Into project #{ link_to(project_name, project_path(project_id)) }

View File

@ -1,27 +1,16 @@
- if defined? user_email
.top
.top
- if defined?(user_email)
.image
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
.text
%span.name
= link_to user_name, user_path(user_id)
.both
%span.date= activity_feed.created_at
.both
.text
%span
= raw t("notifications.bodies.#{change_type}_branch", {:branch_name => branch_name, :user_link => defined?(user_name) ? link_to(user_name, user_path(user_id)) : user_email})
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
.both
%span.subject Branch #{ branch_name } has been #{ change_type }d
.both
.fulltext
- unless defined? user_email
%span.date= activity_feed.created_at
%br
Branch #{ branch_name } has been #{ change_type }d
%br
%br
Into project #{ link_to(project_name, project_path(project_id)) }
%br
%br
- last_commits.each do |commit|
= link_to commit[0], commit_path(project_id, commit[0])
= commit[1]
%br
%span.date= activity_feed.created_at
.both
%span.subject
- last_commits.each do |commit|
= link_to commit[0], commit_path(project_id, commit[0])
= commit[1]
%br

View File

@ -1,14 +1,8 @@
.top
.image
= image_tag(avatar_url_by_email(activity_feed.user.email, :small), :alt => 'avatar')
.text
%span.name
= link_to activity_feed.user.uname, user_path(activity_feed.user.uname)
%span
= raw t("notifications.bodies.issue_assign_notification", { :issue_link => link_to(issue_title, project_issue_path(project_id, issue_serial_id))})
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
.both
%span.date= activity_feed.created_at
.both
.both
%span.subject= raw t("notifications.bodies.issue_assign_notification.title", :issue_link => link_to(issue_title, project_issue_path(project_id, issue_serial_id)))
.both
.fulltext
=# raw t("notifications.bodies.issue_assign_notification.content", :issue_link => link_to(issue_title, project_issue_path(project_id, issue_serial_id)))

View File

@ -2,16 +2,11 @@
.image
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
.text
%span.name
= link_to user_name, user_path(user_id)
%span
= raw t("notifications.bodies.new_comment_notification.title", :user_link => link_to(user_name, user_path(user_id)) )
= raw t("notifications.bodies.new_comment_notification.commit_content", {:commit_link => link_to(commit_message, commit_path(project_id, commit_id) + "#comment##{comment_id}")})
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
.both
%span.date= activity_feed.created_at
.both
.both
%span.subject #{ t("notifications.bodies.new_comment_notification.title", :user_name => user_name) }
.both
.fulltext
= raw t("notifications.bodies.new_comment_notification.commit_content", {:commit_link => link_to(commit_message, commit_path(project_id, commit_id))})
%br
%br
"#{ comment_body }"
%span.subject= comment_body

View File

@ -2,16 +2,11 @@
.image
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
.text
%span.name
= link_to user_name, user_path(user_id)
%span
= raw t("notifications.bodies.new_comment_notification.title", {:user_link => link_to(user_name, user_path(user_id))})
= raw t("notifications.bodies.new_comment_notification.content", {:issue_link => link_to(issue_title, project_issue_path(project_id, issue_serial_id) + "#comment##{comment_id}")})
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
.both
%span.date= activity_feed.created_at
.both
.both
%span.subject #{ t("notifications.bodies.new_comment_notification.title", :user_name => user_name) }
.both
.fulltext
= raw t("notifications.bodies.new_comment_notification.content", {:issue_link => link_to(issue_title, project_issue_path(project_id, issue_serial_id))})
%br
%br
"#{ comment_body }"
%span.subject= comment_body

View File

@ -2,13 +2,10 @@
.image
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
.text
%span.name
= link_to user_name, user_path(user_id)
%span
= raw t("notifications.bodies.new_issue_notification", { :user_link => link_to(user_name, user_path(user_id)), :issue_link => project_issue_path(project_id, issue_serial_id)})
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
.both
%span.date= activity_feed.created_at
.both
.both
%span.subject #{ t("notifications.bodies.new_issue_notification.title", :user_name => user_name) }
.both
.fulltext
= raw t("notifications.bodies.new_issue_notification.content", :issue_link => link_to(issue_title, project_issue_path(project_id, issue_serial_id)), :project_link => link_to(project_name, project_path(project_id)))
%span.subject= issue_title

View File

@ -2,13 +2,9 @@
.image
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
.text
%span.name
= link_to user_name, user_path(user_id)
%span
= raw t("notifications.bodies.wiki_new_commit_notification", {:user_link => user_name, :history_link => link_to("wiki", history_project_wiki_index_path(project_id))})
= raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) )
.both
%span.date= activity_feed.created_at
.both
.both
%span.subject #{ t("notifications.bodies.wiki_new_commit_notification.title", :user_name => user_name) }
.both
.fulltext
= raw t("notifications.bodies.wiki_new_commit_notification.content", {:history_link => link_to("wiki", history_project_wiki_index_path(project_id)), :project_link => link_to(project_name, project_path(project_id)) })

View File

@ -1,4 +1,4 @@
%tr{:id => "row#{build_list_counter}"}
%tr{:id => "row#{build_list_counter}", :class => "#{build_list_status(build_list)}"}
%td= link_to (build_list.bs_id.present? ? build_list.bs_id : t("layout.build_lists.bs_id_not_set")), build_list
%td= build_list.human_status
%td= link_to build_list.project.name, build_list.project

View File

@ -14,6 +14,7 @@
- if @issue.persisted?
-if can_manage
=form_for :issue, :url => [@project, @issue], :method => :put, :html => { :class => 'edit_executor issue'} do |f|
=hidden_field_tag "user-default_executor", nil, :name => 'issue[user_id]'
.current_executor
- if @issue.user
#user-0.people.nopointer

View File

@ -29,7 +29,7 @@
.droplist-wrap
#droplist.droplist
.a= link_to current_user.uname, current_user
.a= link_to t('layout.settings.label'), edit_user_registration_path
.a= link_to t('layout.settings.label'), edit_profile_path
.a= link_to t('layout.logout'), destroy_user_session_path, :method => :delete
.right
.both

View File

@ -1,5 +1,4 @@
.description-top
.img= image_tag 'code.png'
= text_field_tag :url, git_repo_url(project.git_repo_name), :class => 'name',
:type => 'text',:spellcheck => 'false', :readonly => true
.role

View File

@ -1,4 +1,4 @@
.activity
.activity{:id => presenter.comment_id? ? "comment##{presenter.comment_id}" : ''}
.top
- if presenter.buttons?
%span.buttons= raw presenter.buttons.join(' | ').html_safe

View File

@ -29,11 +29,16 @@
= f.text_field :location
.both
.leftlist
= f.label :avatar, t("activerecord.attributes.user.avatar")
= f.label :avatar, t("layout.users.avatar_with_size", :max => number_to_human_size(User::MAX_AVATAR_SIZE))
.rightlist
= image_tag(avatar_url(@user, :medium))
%br
%br
.leftlist
.rightlist
.check
%span#niceCheckbox1.niceCheck-main
= check_box_tag "delete_avatar", 1, false, :class => 'niceCheckbox1'
.forcheck= t('layout.users.delete_avatar')
.both
= f.file_field :avatar
.both
.leftlist

View File

@ -6,7 +6,7 @@
%ul
- if can? :edit, @user
%li{:class => (act == :edit && :users == contr) ? 'active' : ''}
= link_to t("layout.users.edit"), edit_user_path(@user)
= link_to t("layout.users.profile"), @user == current_user ? edit_profile_path : 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)

View File

@ -5,7 +5,7 @@ en:
my_last_projects: My last projects
all_my_projects: All my projects
all_my_builds: All my builds
my_builds_by_day: My buils for last 24 hours
my_builds_by_day: My today builds
new_project: Create project
notifications:
@ -19,20 +19,21 @@ en:
bodies:
new_comment_notification:
title: User %{user_name} has been added a new comment.
content: Issue %{issue_link}
commit_content: Commit %{commit_link}
new_issue_notification:
title: User %{user_name} has been added an issue.
content: Project %{project_link}. Issue %{issue_link}
title: '%{user_link} has been added a new comment'
content: in issue %{issue_link}
commit_content: in commit %{commit_link}
new_issue_notification: '%{user_link} has been added a new <a href="%{issue_link}">issue</a>'
ussue: issue
new_user_notification:
title: Hello, %{user_name}.
content: You have been sign up to project «ROSA Build System» and now can sign in.
email: ==Your email %{user_email}
password: ==Your password %{user_password}
issue_assign_notification:
title: You have been assigned to issue %{issue_link}
wiki_new_commit_notification:
title: User has been updated wiki
content: This %{history_link} has been changed into project %{project_link}
issue_assign_notification: You have been assigned to issue %{issue_link}
wiki_new_commit_notification: '%{user_link} has been updated %{history_link}'
invite_approve_notification: Invite to ABF
project: in project %{project_link}
delete_branch: Branch %{branch_name} has been deleted
create_branch: '%{user_link} has been created a new branch %{branch_name}'
update_branch: '%{user_link} has been pushed to branch %{branch_name}'

View File

@ -5,7 +5,7 @@ ru:
my_last_projects: Мои последние проекты
all_my_projects: Все мои проекты
all_my_builds: Все мои сборки
my_builds_by_day: Мои сборки за 24 часа
my_builds_by_day: Мои сборки за день
new_project: Создать проект
notifications:
@ -19,20 +19,21 @@ ru:
bodies:
new_comment_notification:
title: Пользователь %{user_name} добавил новый комментарий
content: Задача %{issue_link}
commit_content: Коммит %{commit_link}
new_issue_notification:
title: Пользователь %{user_name} добавил новую задачу
content: Проект %{project_link}. Задача %{issue_link}
title: '%{user_link} добавил новый комментарий'
content: в задаче %{issue_link}
commit_content: в коммите %{commit_link}
new_issue_notification: '%{user_link} добавил новую <a href="%{issue_link}">задачу</a>'
issue: задачу
new_user_notification:
title: Здравствуйте, %{user_name}.
content: Вы зарегистрированы на проекте «ROSA Build System» и теперь можете войти в систему.
email: ==Ваш email %{user_email}
password: ==Ваш пароль %{user_password}
issue_assign_notification:
title: Вам была назначена задача %{issue_link}
wiki_new_commit_notification:
title: Пользователь обновил wiki
content: Изменил %{history_link} в проекте %{project_link}
issue_assign_notification: Вам была назначена задача %{issue_link}
wiki_new_commit_notification: '%{user_link} обновил %{history_link}'
invite_approve_notification: Приглашение в ABF
project: в проекте %{project_link}
delete_branch: Удалена ветка %{branch_name}
create_branch: '%{user_link} создал новую ветку %{branch_name}'
update_branch: '%{user_link} внес изменения в ветку %{branch_name}'

View File

@ -3,7 +3,7 @@ en:
users:
list: List
new: Create
edit: Edit
profile: Profile
settings: Settings
new_header: New user
edit_header: Edit
@ -23,6 +23,8 @@ en:
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.
delete_avatar: Delete avatar
avatar_with_size: Avatar (less than %{max})
activerecord:
attributes:
@ -45,4 +47,4 @@ en:
location: Location
company: Company
avatar: Avatar
avatar_file_size: Avatar file size

View File

@ -3,7 +3,7 @@ ru:
users:
list: Список
new: Создать
edit: Редактировать
profile: Профиль
settings: Настройки
new_header: Новый пользователь
edit_header: Редактировать
@ -23,6 +23,8 @@ ru:
delete_warning: Внимание! Удаленный аккаунт восстановлению не подлежит.
private_settings_header: Изменение пароля
avatar_notice: При отсутствии загруженной аватарки будет использована Ваша аватарка на сервисе gravatar.
delete_avatar: Удалить аватар
avatar_with_size: Аватар (менее %{max})
activerecord:
attributes:
@ -41,8 +43,8 @@ ru:
password: Пароль
password_confirm: Повторите пароль
professional_experience: Профессиональный опыт
site: Вэб-сайт
site: Веб-сайт
location: Местонахождение
company: Компания
avatar: Аватар
avatar_file_size: Размер аватара

View File

@ -3,9 +3,12 @@ Rosa::Application.routes.draw do
# XML RPC
match 'api/xmlrpc' => 'rpc#xe_index'
put '/users' => 'users#update'
devise_scope :user do
get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru'
get '/user' => 'users#profile', :as => 'edit_profile'
put '/user' => 'users#update', :as => 'update_profile'
get '/users/:id/edit' => 'users#profile', :as => 'edit_user'
put '/users/:id/edit' => 'users#update', :as => 'update_user'
end
devise_for :users, :controllers => {:omniauth_callbacks => 'users/omniauth_callbacks'}

View File

@ -0,0 +1,12 @@
class DeleteDublicateSubscribes < ActiveRecord::Migration
def up
execute <<-SQL
DELETE FROM subscribes s
WHERE s.id NOT IN (SELECT MIN(s1.id) FROM SUBSCRIBES s1
GROUP BY s1.subscribeable_type, s1.user_id, s1.status, s1.subscribeable_id)
SQL
end
def down
end
end

View File

@ -0,0 +1,8 @@
class TruncateActivityFeed < ActiveRecord::Migration
def up
ActivityFeed.destroy_all
end
def down
end
end

View File

@ -241,7 +241,7 @@
</tr>
</thead>
<tbody>
<tr id="row1">
<tr id="row1" class="error">
<td>
<span style="display: none;">4729</span><a href="#">4729</a>
</td>
@ -267,7 +267,7 @@
2012-01-19 10:10 UTC
</td>
</tr>
<tr id="row2">
<tr id="row2" class="success">
<td>
<span style="display: none;">4728</span><a href="#">4728</a>
</td>

View File

@ -138,9 +138,6 @@
<div class="all">
<div class="desription-top">
<div class="img">
<img src="pics/code.png" alt="pic" />
</div>
<input class="name" value="git@git.com:snigipini/wacomdrivers.git" />
<div class="role">
чтение и запись

View File

@ -276,7 +276,7 @@ header div.droplist a:hover{
}
.sub-menu nav { /*Äë˙ ďîäěĺíţ áĺç íŕçâŕíč˙*/
.sub-menu nav { /*<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
float: left;
margin: 0px 0px 0px 0px;
}
@ -407,6 +407,10 @@ article h4 {
padding-bottom: 2px;
}
article h4.nomargin {
margin: 0px;
}
article p {
margin: 0;
padding: 0;
@ -1415,8 +1419,8 @@ div.desription-top input.name {
height: 21px;
width: auto;
color: #575756;
font-size: 12px;
width: 215px;
font-size: 11px;
width: 415px;
padding: 2px 5px 3px;
}
@ -1592,6 +1596,10 @@ table td.width145 {
width: 145px;
}
.width125 {
width: 125px;
}
table td.width30 {
width: 30px;
}
@ -1944,7 +1952,7 @@ img.delete-row {
}
table tbody tr.error td {
background: #e7bcbc;
background: #fedede;
}
table tbody tr.success td {
@ -2110,6 +2118,22 @@ article div.rightlist div.load {
padding: 5px 10px;
}
.notify.blue {
border: 1px solid #a9c6dd;
background: #dcecfa;
border-radius: 1px;
width: 555px;
margin-top: 20px;
text-align: right;
padding: 5px;
}
.notify.blue div.green {
border: 1px solid #bad099;
background: #d7e599;
float: left;
}
/* Pagination */
div.pagination em {
@ -2307,10 +2331,36 @@ div.tmargin10 {
margin-top: 10px;
}
.tmargin10 {
margin-top: 10px;
}
a.lmargin7 {
margin-left: 7px;
}
a.lmargin5 {
margin-left: 5px;
}
}
/*My projects*/
table.tablesorter tr.search td {
background: #dcecfa;
}
table.tablesorter tr.search td input[type="text"] {
height: 16px;
width: 830px;
border: 1px solid #cdcdcd;
border-radius: 4px;
padding: 5px;
font-family: Tahoma, Geneva, Helvetica, sans-serif;
font-size: 12px;
margin-top: 2px;
}
table.tablesorter.width565 {
width: 565px;
}

25
lib/tasks/build.rake Normal file
View File

@ -0,0 +1,25 @@
require 'highline/import'
require 'open-uri'
namespace :build do
desc "Build projects from list"
task :projects => :environment do
source = ENV['SOURCE'] || 'http://dl.dropbox.com/u/984976/rebuild_list.txt'
owner = User.find_by_uname!(ENV['OWNER'] || 'warpc')
platform = Platform.find_by_name!(ENV['PLATFORM'] || 'rosa2012lts')
arch = Arch.find_by_name!(ENV['ARCH'] || 'i586')
say "START build projects from #{source} for platform=#{platform.name}, owner=#{owner.uname}, arch=#{arch.name}"
open(source).readlines.each do |name|
name.chomp!; name.strip! #; name.downcase!
if p = Project.joins(:repositories).where('repositories.id IN (?)', platform.repositories).find_by_name(name)
p.build_for(platform, owner, arch)
say "== Build #{p.name} =="
else
say "== Not found #{name} =="
end
sleep 0.2
end
say 'DONE'
end
end