Merge branch 'master' into #604-Remove_old_buildlist_created_more_than_3_month_ago

Conflicts:
	app/models/project.rb
	db/schema.rb
This commit is contained in:
Vladimir Sharshov 2012-08-07 00:53:43 +04:00
commit f35d4cd873
43 changed files with 659 additions and 100 deletions

BIN
app/assets/images/check.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -1173,6 +1173,144 @@ table.tablesorter tr td.no_results {
} }
/* end */ /* end */
article div.all {
width: 860px;
}
div.inner-columns {
width: 100%;
height: auto;
display: block;
}
div.inner-columns:after {
clear: both;
content: ".";
display: block;
height: 0;
visibility: hidden;
}
div.inner-columns.equal section {
width: 430px;
float: left;
}
section.first div {
width: 415px;
}
form.inline_errors span.error {
display: inline-block;
color: #FF5050;
}
div.form-actions {
text-align: right;
padding-bottom: 5px;
}
div.form-actions .button {
margin-right: 50px;
}
dl.form, div.form-actions {
margin: 15px 0;
}
dl.form > dt {
margin: 0 0 6px;
}
dl.form > dt label {
color: #333333;
font-size: 14px;
font-weight: bold;
position: relative;
}
dl.form > dd {
margin: 0;
padding: 0;
border: 0, none;
}
dl.form > dd > input[type="text"],
dl.form > dd > input[type="password"],
dl.form > dd > textarea {
width: 350px;
border: 1px solid #A0A0A0;
border-radius: 4px;
padding: 5px;
font-family: Tahoma, Geneva, Helvetica, sans-serif;
font-size: 12px;
}
dl.form > dd > input.error[type="text"],
dl.form > dd > input.error[type="password"],
dl.form > dd > textarea.error {
border-color: #FF8080;
}
dl.form > dd > input[type="text"],
dl.form > dd > input[type="password"] {
height: 16px;
}
dl.form > dd > textarea {
height: 110px;
}
ul.checklist {
font-size: 12px;
font-weight: bold;
margin: 20px 0;
padding: 0;
}
ul.checklist li {
background: image-url("check.png") no-repeat scroll 0 2px transparent;
list-style-type: none;
margin: 15px 0;
padding-left: 25px;
}
div.all.feedback_sended {
background: image-url("feedback.png") no-repeat scroll 49% 0 transparent;
height: 500px;
text-align: center;
}
article div.all.feedback_sended h1 {
font-size: 48px;
font-weight: normal;
margin: 165px 0 0;
padding: 0;
}
article div.all.feedback_sended h2 {
font-size: 18px;
font-weight: normal;
margin: 5px 0 0;
padding: 0;
}
article div.all.feedback_sended p.pages {
margin-top: 70px;
width: 280px;
}
article div.all.feedback_sended p.search {
margin-top: 80px;
width: 230px;
}
article div.all.feedback_sended p {
font-size: 14px;
margin: 0 auto;
padding: 0;
text-align: center;
}
hr.bootstrap { hr.bootstrap {
border: 0; border: 0;
border-top: 1px solid #eeeeee; border-top: 1px solid #eeeeee;

View File

@ -0,0 +1,22 @@
# -*- encoding : utf-8 -*-
class ContactsController < ApplicationController
def new
@form = Feedback.new(current_user)
end
def create
@form = Feedback.new(params[:feedback])
if @form.perform_send
flash[:notice] = I18n.t("flash.contact.success")
redirect_to sended_contact_path
else
flash[:error] = I18n.t("flash.contact.error")
render :new and return
end
end
def sended
end
end

View File

@ -24,4 +24,5 @@ class PagesController < ApplicationController
def tos def tos
end end
end end

View File

@ -41,8 +41,14 @@ class Projects::BuildListsController < Projects::BaseController
def create def create
notices, errors = [], [] notices, errors = [], []
@platform = Platform.find params[:build_list][:save_to_platform_id]
@platform = Platform.includes(:repositories).find params[:build_list][:save_to_platform_id]
@repository = @project.repositories.where(:id => @platform.repository_ids).first
params[:build_list][:save_to_repository_id] = @repository.id
params[:build_list][:auto_publish] = false if @platform.released params[:build_list][:auto_publish] = false if @platform.released
Arch.where(:id => params[:arches]).each do |arch| Arch.where(:id => params[:arches]).each do |arch|
Platform.main.where(:id => params[:build_for_platforms]).each do |build_for_platform| Platform.main.where(:id => params[:build_for_platforms]).each do |build_for_platform|
@build_list = @project.build_lists.build(params[:build_list]) @build_list = @project.build_lists.build(params[:build_list])

View File

@ -14,6 +14,8 @@ module ApplicationHelper
'right bigpadding' 'right bigpadding'
when controller_name == 'platforms' && action_name == 'clone' when controller_name == 'platforms' && action_name == 'clone'
'right middlepadding' 'right middlepadding'
when controller_name == 'contacts' && action_name == 'sended'
'all feedback_sended'
else else
content_for?(:sidebar) ? 'right' : 'all' content_for?(:sidebar) ? 'right' : 'all'
end end

View File

@ -0,0 +1,34 @@
class FeedbackMailer < ActionMailer::Base
FBM_CONFIG = APP_CONFIG['feedback']
default :to => FBM_CONFIG['email'],
:cc => FBM_CONFIG['cc'],
:bcc => FBM_CONFIG['bcc']
include Resque::Mailer # send email async
def feedback_form_send(form_data)
@data = Feedback.new(form_data)
from = "#{@data.name} <#{@data.email}>"
subj = prepare_subject(@data.subject)
mail :from => from, :subject => subj
end
protected
def prepare_subject(subject)
res = ''
res << affix(FBM_CONFIG['subject_prefixes'])
res << subject
res << affix(FBM_CONFIG['subject_postfixes'])
res = res.strip.gsub(/\s+/, ' ')
res
end
def affix(affixes)
' %s ' % Array(affixes).map{|e| "[#{e}]"}.join
end
end

View File

@ -3,6 +3,7 @@ class BuildList < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :arch belongs_to :arch
belongs_to :save_to_platform, :class_name => 'Platform' belongs_to :save_to_platform, :class_name => 'Platform'
belongs_to :save_to_repository, :class_name => 'Repository'
belongs_to :build_for_platform, :class_name => 'Platform' belongs_to :build_for_platform, :class_name => 'Platform'
belongs_to :user belongs_to :user
belongs_to :advisory belongs_to :advisory
@ -13,7 +14,8 @@ class BuildList < ActiveRecord::Base
UPDATE_TYPES = %w[security bugfix enhancement recommended newpackage] UPDATE_TYPES = %w[security bugfix enhancement recommended newpackage]
RELEASE_UPDATE_TYPES = %w[security bugfix] RELEASE_UPDATE_TYPES = %w[security bugfix]
validates :project_id, :project_version, :arch, :include_repos, :presence => true validates :project_id, :project_version, :arch, :include_repos,
:build_for_platform_id, :save_to_platform_id, :save_to_repository_id, :presence => true
validates_numericality_of :priority, :greater_than_or_equal_to => 0 validates_numericality_of :priority, :greater_than_or_equal_to => 0
validates :update_type, :inclusion => UPDATE_TYPES, validates :update_type, :inclusion => UPDATE_TYPES,
:unless => Proc.new { |b| b.advisory.present? } :unless => Proc.new { |b| b.advisory.present? }
@ -22,6 +24,9 @@ class BuildList < ActiveRecord::Base
validate lambda { validate lambda {
errors.add(:build_for_platform, I18n.t('flash.build_list.wrong_platform')) if save_to_platform.platform_type == 'main' && save_to_platform_id != build_for_platform_id errors.add(:build_for_platform, I18n.t('flash.build_list.wrong_platform')) if save_to_platform.platform_type == 'main' && save_to_platform_id != build_for_platform_id
} }
validate lambda {
errors.add(:save_to_repository, I18n.t('flash.build_list.wrong_repository')) unless save_to_repository_id.in? save_to_platform.repositories.map(&:id)
}
LIVE_TIME = 4.week # for unpublished LIVE_TIME = 4.week # for unpublished
MAX_LIVE_TIME = 3.month # for published MAX_LIVE_TIME = 3.month # for published

104
app/models/feedback.rb Normal file
View File

@ -0,0 +1,104 @@
# This class is based on
# https://github.com/rails/rails/blob/4da6e1cce2833474034fda0cbb67b2cc35e828da/activerecord/lib/active_record/validations.rb
class Feedback
include ActiveModel::Conversion
include ActiveModel::Validations
include ActiveModel::Serializers::JSON
include ActiveModel::MassAssignmentSecurity
extend ActiveModel::Naming
attr_accessor :name, :email, :subject, :message
attr_accessible :name, :email, :subject, :message
validates :name, :subject, :message, :presence => true
validates :email, :presence => true,
:format => { :with => /\A[^@]+@([^@\.]+\.)+[^@\.]+\z/,
:allow_blank => false }
def initialize(args = {}, options = {})
return args.dup if args.is_a? Feedback
if args.respond_to? :name and args.respond_to? :email
self.name, self.email = args.name, args.email
elsif args.respond_to? :each_pair
sanitize_for_mass_assignment(args, options[:as]).each_pair do |k, v|
send("#{k}=", v)
end
else
return false
end
end
# FIXME: Maybe rename to `save`?
def perform_send(options = {})
perform_validations(options) ? real_send : false
end
def perform_send!(options={})
perform_validations(options) ? real_send : raise(ActiveRecord::RecordInvalid.new(self))
end
def new_record?
true
end
def persisted?
false
end
def message_with_links
message.to_s.dup.auto_link
end
def attributes
%w{ name email subject message }.inject({}) do |h, e|
h.merge(e => send(e))
end
end
def to_s
str = %w{ name email subject message }.map do |e|
"#{e}: #{ send(e).inspect }"
end.join(', ')
return "#<#{self.class} #{str}>"
end
class << self
def create(attributes = nil, options = {}, &block)
do_create(attributes, options, false, &block)
end
def create!(attributes = nil, options = {}, &block)
do_create(attributes, options, true, &block)
end
protected
def do_create(attributes = nil, options = {}, bang = false, &block)
if attributes.is_a?(Array)
attributes.collect { |attr| do_create(attr, options, bang, &block) }
else
object = new(attributes, options)
yield(object) if block_given?
bang ? object.perform_send! : object.perform_send
object
end
end
end
protected
def real_send
FeedbackMailer.feedback_form_send(self).deliver
end
def perform_validations(options={})
perform_validation = options[:validate] != false
perform_validation ? valid?(options[:context]) : true
end
end
Feedback.include_root_in_json = false

View File

@ -180,7 +180,7 @@ class Platform < ActiveRecord::Base
arches.map(&:name).each do |arch| arches.map(&:name).each do |arch|
begin begin
return if mass_build.reload.stop_build return if mass_build.reload.stop_build
p.build_for(self, user, arch, auto_publish, mass_build_id) p.build_for(self, rep.id, user, arch, auto_publish, mass_build_id)
rescue RuntimeError, Exception rescue RuntimeError, Exception
# p.async(:build_for, self, user, arch, auto_publish, mass_build_id) # TODO need this? # p.async(:build_for, self, user, arch, auto_publish, mass_build_id) # TODO need this?
end end

View File

@ -90,6 +90,7 @@ class Project < ActiveRecord::Base
# If project platform repository is main, only main will be connect # If project platform repository is main, only main will be connect
main_rep_id = platform.repositories.find_by_name('main').id main_rep_id = platform.repositories.find_by_name('main').id
build_reps_ids = [main_rep_id, repository_id].compact.uniq build_reps_ids = [main_rep_id, repository_id].compact.uniq
arch = Arch.find_by_name(arch) if arch.acts_like?(:string) arch = Arch.find_by_name(arch) if arch.acts_like?(:string)
build_lists.create do |bl| build_lists.create do |bl|
bl.save_to_platform = platform bl.save_to_platform = platform

View File

@ -0,0 +1,48 @@
- set_meta_tags :title => t('layout.contact.page_header')
%h1= t("layout.contact.header")
%p= t("layout.contact.subheader")
%hr.bootstrap
.inner-columns.equal
%section.first
%div
= form_for @form, :url => contact_path, :html => {:class => 'inline_errors'} do |f|
%dl.form
%dt= f.label :name, t("activerecord.attributes.user.name")
%dd
= f.text_field :name, :placeholder => t("layout.contact.placeholders.name"),
:class => @form.errors.messages[:name].present? ? 'error' : ''
%dl.form
%dt= f.label :email, t("activerecord.attributes.user.email")
%dd
= f.text_field :email, :placeholder => t("layout.contact.placeholders.email"),
:class => @form.errors.messages[:email].present? ? 'error' : ''
%dl.form
%dt= f.label :subject, t("layout.contact.subject")
%dd
= f.text_field :subject, :placeholder => t("layout.contact.placeholders.subject"),
:class => @form.errors.messages[:subject].present? ? 'error' : ''
%dl.form
%dt= f.label :message, t("layout.contact.message")
%dd
= f.text_area :message, :placeholder => t("layout.contact.placeholders.message"),
:class => @form.errors.messages[:message].present? ? 'error' : ''
.form-actions
= f.submit t("layout.contact.send_request"), :class => 'button'
%section.last
%div
%h3= t("layout.contact.info.header")
%ul.checklist
- t("layout.contact.info.items").try(:each) do |item|
%li= item
%hr.bootstrap
%p= t("layout.contact.questions_info")

View File

@ -0,0 +1,8 @@
%h1= t("layout.contact.thanks")
%h2= t("layout.contact.thanks_2")
%p.pages
= t("layout.contact.open_pages")
%p.search
= t("layout.contact.use_search")
.both

View File

@ -0,0 +1,7 @@
!!!
%html
%head
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
%body
= simple_format @data.message_with_links

View File

@ -0,0 +1 @@
<%= @data.message.chomp %>

View File

@ -14,3 +14,6 @@
%li %li
= image_tag 'square.png' = image_tag 'square.png'
= link_to t('bottom_menu.tos'), tos_url #t('bottom_menu.tos_url') = link_to t('bottom_menu.tos'), tos_url #t('bottom_menu.tos_url')
%li
= image_tag 'square.png'
= link_to t('bottom_menu.support'), contact_url

View File

@ -0,0 +1,6 @@
- if project.description.present?
.description
%h3= t("layout.projects.about_subheader")
%p
= project.description
-# link_to t('layout.read_more'), '#'

View File

@ -1,11 +1,6 @@
= render 'submenu' = render 'submenu'
= render 'repo_block', :project => @project = render 'repo_block', :project => @project
= render 'about_block', :project => @project
.description
%h3= t("layout.projects.about_subheader")
%p
= @project.description
= link_to t('layout.read_more'), '#'
%h3= t("layout.projects.last_commit") %h3= t("layout.projects.last_commit")
- GitPresenters::CommitAsMessagePresenter.present(@commit, :branch => @branch, :project => @project) do |presenter| - GitPresenters::CommitAsMessagePresenter.present(@commit, :branch => @branch, :project => @project) do |presenter|

View File

@ -13,6 +13,6 @@
%li= link_to t("project_menu.tracker"), project_issues_path(@project), :class => (contr == :issues ? 'active' : nil) %li= link_to t("project_menu.tracker"), project_issues_path(@project), :class => (contr == :issues ? 'active' : nil)
- if @project.has_wiki - if @project.has_wiki
%li= link_to t("project_menu.wiki"), project_wiki_index_path(@project), :class => (contr == :wiki ? 'active' : nil) %li= link_to t("project_menu.wiki"), project_wiki_index_path(@project), :class => (contr == :wiki ? 'active' : nil)
%li= link_to t("project_menu.readme"), "#" #pending %li=# link_to t("project_menu.readme"), "#" #pending
- if can? :update, @project - if can? :update, @project
%li= link_to t("project_menu.settings"), edit_project_path(@project), :class => (act == :edit && contr == :projects ? 'active' : nil) %li= link_to t("project_menu.settings"), edit_project_path(@project), :class => (act == :edit && contr == :projects ? 'active' : nil)

View File

@ -3,6 +3,6 @@
%td= build_list.human_status %td= build_list.human_status
%td= link_to build_list.project.name_with_owner, build_list.project %td= link_to build_list.project.name_with_owner, build_list.project
%td= build_list_version_link(build_list) %td= build_list_version_link(build_list)
%td= link_to build_list.save_to_platform.name, build_list.save_to_platform %td= link_to "#{build_list.save_to_platform.name}/#{build_list.save_to_repository.name}", [build_list.save_to_platform, build_list.save_to_repository]
%td= build_list.arch.name %td= build_list.arch.name
%td= link_to build_list.user.try(:fullname), build_list.user %td= link_to build_list.user.try(:fullname), build_list.user

View File

@ -7,7 +7,7 @@
%th.lpadding16= t("activerecord.attributes.build_list.status") %th.lpadding16= t("activerecord.attributes.build_list.status")
%th.lpadding16= t("activerecord.attributes.build_list.project") %th.lpadding16= t("activerecord.attributes.build_list.project")
%th.lpadding16= t("activerecord.attributes.build_list.project_version") %th.lpadding16= t("activerecord.attributes.build_list.project_version")
%th.lpadding16= t("activerecord.attributes.build_list.save_to_platform") %th.lpadding16= t("activerecord.attributes.build_list.save_to_repository")
%th.lpadding16= t("activerecord.attributes.build_list.arch") %th.lpadding16= t("activerecord.attributes.build_list.arch")
%th.lpadding16= t("activerecord.attributes.build_list.user") %th.lpadding16= t("activerecord.attributes.build_list.user")
%tbody= render :partial => 'projects/build_lists/build_list', :collection => @build_lists %tbody= render :partial => 'projects/build_lists/build_list', :collection => @build_lists

View File

@ -9,7 +9,9 @@
.leftlist= t("activerecord.attributes.build_list.container_path") .leftlist= t("activerecord.attributes.build_list.container_path")
.rightlist .rightlist
- if @build_list.status == BuildList::BUILD_PUBLISHED - if @build_list.status == BuildList::BUILD_PUBLISHED
= t("layout.build_lists.container_published") = raw "%s %s" % [t("layout.build_lists.container_published"),
link_to("#{@build_list.save_to_platform.name}/#{@build_list.save_to_repository.name}",
[@build_list.save_to_platform, @build_list.save_to_repository])]
- elsif @build_list.container_path.present? - elsif @build_list.container_path.present?
- container_url = "http://#{request.host_with_port}/downloads#{@build_list.container_path}" - container_url = "http://#{request.host_with_port}/downloads#{@build_list.container_path}"
= link_to container_url, container_url = link_to container_url, container_url
@ -26,9 +28,9 @@
.rightlist .rightlist
= link_to @build_list.build_for_platform.name, @build_list.build_for_platform = link_to @build_list.build_for_platform.name, @build_list.build_for_platform
.both .both
.leftlist= t("activerecord.attributes.build_list.save_to_platform") .leftlist= t("activerecord.attributes.build_list.save_to_repository")
.rightlist .rightlist
= link_to @build_list.save_to_platform.name, @build_list.save_to_platform = link_to "#{@build_list.save_to_platform.name}/#{@build_list.save_to_repository.name}", [@build_list.save_to_platform, @build_list.save_to_repository]
.both .both
.leftlist= t("activerecord.attributes.build_list.include_repos") .leftlist= t("activerecord.attributes.build_list.include_repos")
.rightlist= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ') .rightlist= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ')

View File

@ -1,12 +1,8 @@
-set_meta_tags :title => "#{title_object @project} #{t('at') if @branch} #{@branch.try :name}" -set_meta_tags :title => "#{title_object @project} #{t('at') if @branch} #{@branch.try :name}"
= render 'submenu' = render 'submenu'
= render 'repo_block', :project => @project = render 'repo_block', :project => @project
= render 'about_block', :project => @project
.description
%h3= t("layout.projects.about_subheader")
%p
= @project.description
= link_to t('layout.read_more'), '#'
%h3= t("layout.projects.last_commit") %h3= t("layout.projects.last_commit")
- GitPresenters::CommitAsMessagePresenter.present(@commit, :branch => @branch, :project => @project) do |presenter| - GitPresenters::CommitAsMessagePresenter.present(@commit, :branch => @branch, :project => @project) do |presenter|

View File

@ -1,11 +1,7 @@
-set_meta_tags :title => [title_object(@project), shortest_hash_id(@commit.id), @commit.message] -set_meta_tags :title => [title_object(@project), shortest_hash_id(@commit.id), @commit.message]
= render 'submenu' = render 'submenu'
= render 'about_block', :project => @project
.description
%h3= t("layout.projects.about_subheader")
%p
= @project.description
= link_to t('layout.read_more'), '#'
%h3= t("layout.projects.last_commit") %h3= t("layout.projects.last_commit")
- GitPresenters::CommitAsMessagePresenter.present(@commit, :branch => @branch, :project => @project) do |presenter| - GitPresenters::CommitAsMessagePresenter.present(@commit, :branch => @branch, :project => @project) do |presenter|

View File

@ -1,21 +1,18 @@
-set_meta_tags :title => title_object(@project) -set_meta_tags :title => title_object(@project)
= render 'submenu' = render 'submenu'
= render 'repo_block', :project => @project = render 'repo_block', :project => @project
= render 'about_block', :project => @project
- if @project.parent_id.present? || @project.srpm.exists?
.description
%h3= t("layout.projects.about_subheader")
%p
= @project.description
= link_to t('layout.read_more'), '#'
.both .both
#repo-wrapper #repo-wrapper
%h3= t("layout.projects.files_in_project") %h3= t("layout.projects.files_in_project")
.files .files
.l= render 'whereami' .l= render 'whereami'
.both .both
%table#myTable.tablesorter.project{:cellpadding => "0", :cellspacing => "0"} %table#myTable.tablesorter.project{:cellpadding => "0", :cellspacing => "0"}
%thead %thead
%tr %tr
@ -27,3 +24,41 @@
%tr %tr
%td.centered{:colspan => 4} %td.centered{:colspan => 4}
%h3= I18n.t("layout.git.repositories.empty") %h3= I18n.t("layout.git.repositories.empty")
- else
- if current_user
%h3= t("layout.projects.git_global_setup")
%p
%code
= "git config --global user.name #{current_user.fullname}"
%br/
= "git config --global user.email #{current_user.email}"
%br/
git config --global http.postBuffer 524288000
%h3= t("layout.projects.create_repository")
%p
%code
= "git clone #{git_repo_url(@project.git_repo_name)}"
%br/
= "cd #{@project.name}"
%br/
%br/
%p= t("layout.projects.move_files_to_folder")
%br/
%code
git add .
%br/
git commit -m 'description message'
%br/
git push -u origin master
%h3= t("layout.projects.existing_git_repo")
%p
%code
cd existing_git_repo
%br/
= "git remote add origin #{git_repo_url(@project.git_repo_name)}"
%br/
git push -u origin master

View File

@ -17,6 +17,7 @@ en:
contacts_url: http://www.rosalab.com/about/contacts contacts_url: http://www.rosalab.com/about/contacts
tos: Terms Of Service tos: Terms Of Service
tos_url: http://www.rosalab.com/about tos_url: http://www.rosalab.com/about
support: Support
project_menu: project_menu:
project: Project project: Project
commits: Commits commits: Commits

View File

@ -17,6 +17,7 @@ ru:
contacts_url: http://www.rosalab.ru/about/contacts contacts_url: http://www.rosalab.ru/about/contacts
tos: Условия использования tos: Условия использования
tos_url: http://www.rosalab.ru/about tos_url: http://www.rosalab.ru/about
support: Служба поддержки
project_menu: project_menu:
project: Проект project: Проект
commits: Коммиты commits: Коммиты

View File

@ -19,6 +19,7 @@ en:
include_repos: Included repositories include_repos: Included repositories
created_at: Created on created_at: Created on
save_to_platform: Platform save_to_platform: Platform
save_to_repository: Repository
build_for_platform: Build for platform build_for_platform: Build for platform
update_type: Update type update_type: Update type
build_requires: Build with all the required packages build_requires: Build with all the required packages
@ -125,5 +126,7 @@ en:
no_project_version_found: Project version '%{project_version}' not found no_project_version_found: Project version '%{project_version}' not found
no_arch_or_platform_selected: At least one of architecture of platform must selected no_arch_or_platform_selected: At least one of architecture of platform must selected
wrong_platform: Only the primary platform can be selected for the main repository! wrong_platform: Only the primary platform can be selected for the main repository!
wrong_repository: Repository to save package to must belongs to platform.
cannot_write: You can't build project to this repository.
can_not_published: Build can only be published with status "Build complete" can_not_published: Build can only be published with status "Build complete"
frozen_platform: In case of a repository for package storage with frozen platform allowed only bugfix and security updates frozen_platform: In case of a repository for package storage with frozen platform allowed only bugfix and security updates

View File

@ -19,6 +19,7 @@ ru:
include_repos: Подключаемые репозитории include_repos: Подключаемые репозитории
created_at: Создан created_at: Создан
save_to_platform: Платформа save_to_platform: Платформа
save_to_repository: Репозиторий
build_for_platform: Собрано для платформы build_for_platform: Собрано для платформы
update_type: Критичность обновления update_type: Критичность обновления
build_requires: Пересборка с зависимостями build_requires: Пересборка с зависимостями
@ -124,5 +125,7 @@ ru:
no_project_version_found: Выбранная версия '%{project_version}' не найдена no_project_version_found: Выбранная версия '%{project_version}' не найдена
no_arch_or_platform_selected: Выберите хотя бы одну архитектуру и платформу no_arch_or_platform_selected: Выберите хотя бы одну архитектуру и платформу
wrong_platform: Для основного репозитория (main) может быть выбран только его же основная платформа! wrong_platform: Для основного репозитория (main) может быть выбран только его же основная платформа!
wrong_repository: Репозиторий для сохранения должен принадлежать платформе.
cannot_write: Вы не можете собирать пакет в этот репозиторий.
can_not_published: Опубликовать сборку можно только со статусом "Собран" can_not_published: Опубликовать сборку можно только со статусом "Собран"
frozen_platform: В случае выбора репозитория для сохранения пакетов из замороженнной платформы разрешены только bugfix и security обновления frozen_platform: В случае выбора репозитория для сохранения пакетов из замороженнной платформы разрешены только bugfix и security обновления

View File

@ -0,0 +1,34 @@
en:
layout:
contact:
page_header: Contact us
header: Contact us
subheader: Were here to help with any questions or comments.
send_request: Send Request
thanks: Thanks for feedback!
thanks_2: Your request in progress.
open_pages: Please, continue your work
use_search: Try to find something cool?
placeholders:
name: Your name
email: user@example.com
subject: I want to say about ...
message: Problem description
subject: Subject
message: Message
questions_info: If you need help with a project hosted on ABF, please contact the project's owner.
info:
header: What's in a great support request?
items:
- "Be succinct, we'll ask if we need more info"
- "The name of the user, repository, build list etc youre having troubles with"
flash:
contact:
success: Request successfully sended
error: Sending request failed

View File

@ -0,0 +1,34 @@
ru:
layout:
contact:
page_header: Обратная связь
header: Свяжитесь с нами
subheader: Мы готовы помочь вам с любыми вопросами и комментариями.
send_request: Отправить запрос
thanks: Спасибо за сообщение!
thanks_2: Мы уже начали работу.
open_pages: Продолжайте работу с системой
use_search: Воспользуйтесь поиском
placeholders:
name: Ваше имя
email: user@example.com
subject: Я хочу сказать о...
message: Описание проблемы
subject: Тема сообщения
message: Сообщение
questions_info: Если вам нужна помощь с проектом, размещенным на ABF, пожалуйста, свяжитесь с владельцем проекта.
info:
header: Каким должен быть хороший запрос?
items:
- "Будьте кратки. Если нам понадобится дополнительная информация, мы ее запросим."
- "Укажите, с чем у вас возникла проблема: имя пользователя, репозиторий, сборочный лист и т.д."
flash:
contact:
success: Запрос успешно отправлен
error: Не удалось отправить запрос

View File

@ -34,6 +34,10 @@ en:
has_issue_description: Tracker adds a lightweight issue management system tightly integrated with your repository. has_issue_description: Tracker adds a lightweight issue management system tightly integrated with your repository.
has_wiki_description: Wikis are the simplest way to allow other users to contribute content. Any user can create and edit pages for documentation, examples, support or anything you wish. has_wiki_description: Wikis are the simplest way to allow other users to contribute content. Any user can create and edit pages for documentation, examples, support or anything you wish.
human_average_build_time: Expected time is %{hours} h. %{minutes} min. human_average_build_time: Expected time is %{hours} h. %{minutes} min.
git_global_setup: Git global setup
create_repository: Create Repository
move_files_to_folder: Move files you need to the project or create them.
existing_git_repo: Git repo already exist?
git_help: git_help:
cloning: Cloning the repository cloning: Cloning the repository

View File

@ -34,6 +34,10 @@ ru:
has_issue_description: Трэкер предоставляет лекговесный менеджер для задач по разработке Вашего проекта. has_issue_description: Трэкер предоставляет лекговесный менеджер для задач по разработке Вашего проекта.
has_wiki_description: Wiki - это самый простой способ предоставить другим вносить свой вклад в развитие Вашего проекта. Каждый пользователь нашего сервиса может использовать Wiki для документирования, примеров, поддержки или всего другого, в чем у Вас появится необходимость. has_wiki_description: Wiki - это самый простой способ предоставить другим вносить свой вклад в развитие Вашего проекта. Каждый пользователь нашего сервиса может использовать Wiki для документирования, примеров, поддержки или всего другого, в чем у Вас появится необходимость.
human_average_build_time: 'Ожидаемое время: %{hours} ч. %{minutes} мин.' human_average_build_time: 'Ожидаемое время: %{hours} ч. %{minutes} мин.'
git_global_setup: Общие настройки Git
create_repository: Создание репозитория
move_files_to_folder: Переместите нужные файлы в проект или создайте их.
existing_git_repo: Git репозиторий уже существует?
diff_show_header: "%{files} с %{additions} и %{deletions}." diff_show_header: "%{files} с %{additions} и %{deletions}."
about_subheader: "О проекте" about_subheader: "О проекте"

View File

@ -1,5 +1,10 @@
# -*- encoding : utf-8 -*- # -*- encoding : utf-8 -*-
Rosa::Application.routes.draw do Rosa::Application.routes.draw do
resource :contact, :only => [:new, :create, :sended] do
get '/' => 'contacts#new'
get :sended
end
devise_scope :users do devise_scope :users do
get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru' get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru'
end end

View File

@ -4,7 +4,7 @@ base_path = "/srv/rosa_build"
rails_env = ENV['RAILS_ENV'] || 'production' rails_env = ENV['RAILS_ENV'] || 'production'
worker_processes 4 worker_processes 8
working_directory File.join(base_path, 'current') # available in 0.94.0+ working_directory File.join(base_path, 'current') # available in 0.94.0+
# listen File.join(base_path, 'tmp', 'pids', 'unicorn.sock') # listen File.join(base_path, 'tmp', 'pids', 'unicorn.sock')

View File

@ -0,0 +1,26 @@
class AddSaveToRepositoryToBuildLists < ActiveRecord::Migration
def self.up
add_column :build_lists, :save_to_repository_id, :integer
BuildList.scoped.includes(:project => :repositories, :save_to_platform => :repositories).find_in_batches do |batch|
batch.each do |bl|
begin
project = bl.project
platform = bl.save_to_platform
rep = (project.repositories.map(&:id) & platform.repositories.map(&:id)).first
bl.save_to_repository_id = rep
bl.save!
rescue Exception => e
puts e.inspect
false
end
end
end
end
def self.down
remove_column :build_lists, :save_to_repository_id
end
end

View File

@ -53,8 +53,8 @@ ActiveRecord::Schema.define(:version => 20120730214052) 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
@ -63,8 +63,8 @@ ActiveRecord::Schema.define(:version => 20120730214052) 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
@ -75,8 +75,8 @@ ActiveRecord::Schema.define(:version => 20120730214052) 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
@ -126,6 +126,7 @@ ActiveRecord::Schema.define(:version => 20120730214052) do
t.integer "duration" t.integer "duration"
t.integer "advisory_id" t.integer "advisory_id"
t.integer "mass_build_id" t.integer "mass_build_id"
t.integer "save_to_repository_id"
end end
add_index "build_lists", ["advisory_id"], :name => "index_build_lists_on_advisory_id" add_index "build_lists", ["advisory_id"], :name => "index_build_lists_on_advisory_id"
@ -333,6 +334,8 @@ ActiveRecord::Schema.define(:version => 20120730214052) do
t.integer "build_count", :default => 0, :null => false t.integer "build_count", :default => 0, :null => false
end end
add_index "projects", ["owner_id"], :name => "index_projects_on_name_and_owner_id_and_owner_type", :unique => true, :case_sensitive => false
create_table "register_requests", :force => true do |t| create_table "register_requests", :force => true do |t|
t.string "name" t.string "name"
t.string "email" t.string "email"
@ -395,17 +398,14 @@ ActiveRecord::Schema.define(:version => 20120730214052) do
t.string "email", :default => "", :null => false t.string "email", :default => "", :null => false
t.string "encrypted_password", :default => "", :null => false t.string "encrypted_password", :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", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
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.integer "own_projects_count", :default => 0, :null => false
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.text "professional_experience" t.text "professional_experience"
t.string "site" t.string "site"
t.string "company" t.string "company"
@ -417,6 +417,9 @@ ActiveRecord::Schema.define(:version => 20120730214052) do
t.integer "failed_attempts", :default => 0 t.integer "failed_attempts", :default => 0
t.string "unlock_token" t.string "unlock_token"
t.datetime "locked_at" t.datetime "locked_at"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "authentication_token" t.string "authentication_token"
t.integer "build_priority", :default => 50 t.integer "build_priority", :default => 50
end end

View File

@ -24,7 +24,7 @@ module Rosa
if (params = request.path_parameters) && params[:treeish] # parse existing branch (tag) and path if (params = request.path_parameters) && params[:treeish] # parse existing branch (tag) and path
branch_or_tag = begin branch_or_tag = begin
(p = Project.find_by_owner_and_name params[:owner_name], params[:project_name]) && (p = Project.find_by_owner_and_name params[:owner_name], params[:project_name]) &&
p.repo.branches_and_tags.detect{|t| params[:treeish].start_with?(t.name)}.try(:name) || p.repo.branches_and_tags.map(&:name).sort{|a,b| b.length <=> a.length}.detect{|b| params[:treeish].start_with?(b)} ||
params[:treeish].split('/').first params[:treeish].split('/').first
end end
if path = params[:treeish].sub(branch_or_tag, '')[1..-1] and path.present? if path = params[:treeish].sub(branch_or_tag, '')[1..-1] and path.present?

View File

@ -27,7 +27,7 @@ namespace :import do
say 'DONE' say 'DONE'
end end
# bundle exec rake import:srpm RAILS_ENV=production BASE=/share/platforms/naulinux5x_personal/tmp/SRPMS LIST=https://dl.dropbox.com/u/984976/nauschool5x.srpms.txt OWNER=naulinux PLATFORM=naulinux REPO=main > log/srpm_naulinux.log # bundle exec rake import:srpm RAILS_ENV=production BASE=/share/platforms/naulinux5x_personal/tmp/SRPMS LIST=https://dl.dropbox.com/u/984976/nauschool5x.srpms.txt OWNER=naulinux PLATFORM=naulinux REPO=main CLEAR=true > log/srpm_naulinux.log &
desc 'Import SRPMs as projects' desc 'Import SRPMs as projects'
task :srpm => :environment do task :srpm => :environment do
base = ENV['BASE'] || '/share/alt_repos/rsync' base = ENV['BASE'] || '/share/alt_repos/rsync'
@ -36,17 +36,39 @@ namespace :import do
owner = User.find_by_uname(ENV['OWNER']) || Group.find_by_uname!(ENV['OWNER'] || 'altlinux') owner = User.find_by_uname(ENV['OWNER']) || Group.find_by_uname!(ENV['OWNER'] || 'altlinux')
platform = Platform.find_by_name!(ENV['PLATFORM'] || 'altlinux5') platform = Platform.find_by_name!(ENV['PLATFORM'] || 'altlinux5')
repo = platform.repositories.find_by_name!(ENV['REPO'] || 'main') repo = platform.repositories.find_by_name!(ENV['REPO'] || 'main')
clear = ENV['CLEAR'] == 'true' ? true : false
say "START import projects from '#{base}' using '#{list || mask}' for '#{owner.uname}' to repo '#{platform.name}/#{repo.name}'." say "START import projects from '#{base}' using '#{list || mask}' for '#{owner.uname}' to repo '#{platform.name}/#{repo.name}'."
repo.project_to_repositories.clear if agree "Clear destination repo #{platform.name}/#{repo.name}?" repo.project_to_repositories.clear if clear
(list ? open(list).readlines.map{|n| File.join base, n.chomp.strip} : Dir[File.join base, mask]).each do |path| (list ? open(list).readlines.map{|n| File.join base, n.chomp.strip} : Dir[File.join base, mask]).each do |srpm_file|
print "Processing '#{path}'..." print "Processing '#{srpm_file}'... "
if name = `rpm -q --qf '[%{Name}]' -p #{path}` and $?.success? and name.present? if name = `rpm -q --qf '[%{Name}]' -p #{srpm_file}` and $?.success? and name.present?
p = Project.find_or_create_by_name_and_owner_type_and_owner_id(name, owner.class.to_s, owner.id) if clear # simply add
p.import_srpm(path, platform.name) project = Project.find_or_create_by_name_and_owner_type_and_owner_id(name, owner.class.to_s, owner.id)
repo.projects << p repo.projects << project
print "Ok! - #{p.name}" else # check if project already added
if project = repo.projects.find_by_name(name) || repo.projects.by_name(name).first # fallback to speedup
print "Found project '#{project.owner.uname}/#{project.name}' in '#{platform.name}/#{repo.name}'."
elsif scoped = Project.where(:owner_id => owner.id, :owner_type => owner.class) and
project = scoped.find_by_name(name) || scoped.by_name(name).first
begin
repo.projects << project
rescue Exception => e
print "Add project '#{project.owner.uname}/#{project.name}' to '#{platform.name}/#{repo.name}' FAILED: #{e.message}."
else else
print 'Fail!' print "Add project '#{project.owner.uname}/#{project.name}' to '#{platform.name}/#{repo.name}' OK."
end
else
description = ::Iconv.conv('UTF-8//IGNORE', 'UTF-8', `rpm -q --qf '[%{Description}]' -p #{srpm_file}`)
project = Project.create!(:name => name, :description => description) {|p| p.owner = owner}
repo.projects << project
print "Create project #{project.owner.uname}/#{project.name} in #{platform.name}/#{repo.name} OK."
end
end
project.import_srpm(srpm_file, platform.name)
print " Code import complete!"
else
print 'RPM Error!'
end end
puts puts
end end

View File

@ -87,7 +87,10 @@
<a href="#">Confidentiality</a> <img src="/pics/square.png" alt="_"> <a href="#">Confidentiality</a> <img src="/pics/square.png" alt="_">
</li> </li>
<li> <li>
<a href="#">Security</a> <a href="#">Security</a> <img src="/pics/square.png" alt="_">
</li>
<li>
<a href="/contact">Support</a>
</li> </li>
</ul> </ul>
</footer> </footer>

View File

@ -89,7 +89,10 @@
<a href="#">Confidentiality</a> <img src="/pics/square.png" alt="_"> <a href="#">Confidentiality</a> <img src="/pics/square.png" alt="_">
</li> </li>
<li> <li>
<a href="#">Security</a> <a href="#">Security</a> <img src="/pics/square.png" alt="_">
</li>
<li>
<a href="/contact">Support</a>
</li> </li>
</ul> </ul>
</footer> </footer>

View File

@ -49,7 +49,10 @@ We apologize for any inconvenience.</h2>
<a href="#">Confidentiality</a> <img src="/assets/square.png" alt="_"> <a href="#">Confidentiality</a> <img src="/assets/square.png" alt="_">
</li> </li>
<li> <li>
<a href="#">Security</a> <a href="#">Security</a> <img src="/pics/square.png" alt="_">
</li>
<li>
<a href="/contact">Support</a>
</li> </li>
</ul> </ul>
</footer> </footer>