From 6359acd9178d291cb2a31d2f32e329e3e4b8ca99 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Wed, 14 Mar 2012 21:50:58 +0600 Subject: [PATCH 01/20] [refs #194] fixed executor bug --- app/views/issues/_manage_sidebar.html.haml | 4 ++-- app/views/issues/show.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/issues/_manage_sidebar.html.haml b/app/views/issues/_manage_sidebar.html.haml index 6cbb2cf42..581d281b5 100644 --- a/app/views/issues/_manage_sidebar.html.haml +++ b/app/views/issues/_manage_sidebar.html.haml @@ -1,5 +1,5 @@ -content_for :sidebar do - - can_manage = can? :write, @issue.project + - can_manage = can?(:update, @issue) && @issue.persisted? || can?(:create, @project.issues.new) && @issue.new_record? - if @issue.persisted? .bordered.nopadding %h3=t('activerecord.attributes.issue.status') @@ -22,7 +22,7 @@ .name="#{@issue.user.uname} (#{@issue.user.name})" =hidden_field_tag "user-0", @issue.user.id, :name => 'issue[user_id]' .both - - else + - elsif @issue.user .people.nopointer .avatar=image_tag avatar_url(@issue.user), :alt => 'avatar' .name="#{@issue.user.uname} (#{@issue.user.name})" diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml index d382b3279..97e39954e 100644 --- a/app/views/issues/show.html.haml +++ b/app/views/issues/show.html.haml @@ -16,7 +16,7 @@ .fulltext.view.issue_body=@issue.body .both %br -- if can? :write, @issue.project +- if can? :update, @issue =link_to t('layout.edit'), '#', :id => 'edit_issue_content', :class => 'button' =form_for :issue, :url => [@project, @issue], :method => :put, :html => { :class => 'edit_form issue', :style => 'display:none;' } do |f| .leftlist= t('activerecord.attributes.issue.title') + ':' From bce8618c30b51be2156991d6a8b872841c87e847 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 15 Mar 2012 00:51:22 +0600 Subject: [PATCH 02/20] [refs #194] removed reduntant check --- app/views/issues/_manage_sidebar.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/issues/_manage_sidebar.html.haml b/app/views/issues/_manage_sidebar.html.haml index 581d281b5..ce7969ed6 100644 --- a/app/views/issues/_manage_sidebar.html.haml +++ b/app/views/issues/_manage_sidebar.html.haml @@ -1,5 +1,5 @@ -content_for :sidebar do - - can_manage = can?(:update, @issue) && @issue.persisted? || can?(:create, @project.issues.new) && @issue.new_record? + - can_manage = can?(:update, @issue) && @issue.persisted? || @issue.new_record? - if @issue.persisted? .bordered.nopadding %h3=t('activerecord.attributes.issue.status') From e7ac387466474681ffbf971cfaa2fca799f6d995 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 15 Mar 2012 18:10:10 +0600 Subject: [PATCH 03/20] [refs #265] fixed check rails env --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index f0e6bc84d..eb41ea381 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -262,7 +262,7 @@ class Project < ActiveRecord::Base end def write_hook - is_production = ENV['RAILS_ENV'] == 'production' + is_production = Rails.env == "production" hook = File.join(::Rails.root.to_s, 'tmp', "post-receive-hook") FileUtils.cp(File.join(::Rails.root.to_s, 'bin', "post-receive-hook.partial"), hook) File.open(hook, 'a') do |f| From 7bab315b9610d31aa9ace0b75b9529ffda22b322 Mon Sep 17 00:00:00 2001 From: Vladimir Sharshov Date: Thu, 15 Mar 2012 18:02:10 +0400 Subject: [PATCH 04/20] [Refs #279] Fix url and submit button size --- app/assets/stylesheets/design/main.scss | 11 ++++++++--- doc/design/styles/main.css | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/design/main.scss b/app/assets/stylesheets/design/main.scss index b7837e899..2034b2fb3 100644 --- a/app/assets/stylesheets/design/main.scss +++ b/app/assets/stylesheets/design/main.scss @@ -440,7 +440,7 @@ article a.button { background-image: linear-gradient(top, #68a3d8, #125687); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#68a3d8', EndColorStr='#125687'); border: 1px solid #5084b4; - padding: 4px 20px; + padding: 4px 20px 6px; margin: 0; font-size: 12px; text-decoration: none; @@ -509,7 +509,7 @@ article input[type="submit"] { background-image: linear-gradient(top, #68a3d8, #125687); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#68a3d8', EndColorStr='#125687'); border: 1px solid #5084b4; - padding: 0px 20px 0px; + padding: 3px 20px 5px; margin: 0; font-size: 12px; text-decoration: none; @@ -519,7 +519,6 @@ article input[type="submit"] { border-radius: 5px; text-align: center; height: auto; - height: 28px; width: auto; font-family: Tahoma; } @@ -2212,3 +2211,9 @@ div.width400.rmargin55 { div.tmargin10 { margin-top: 10px; } + +/*My projects*/ + +article h3 a { + font-size: 14px; +} diff --git a/doc/design/styles/main.css b/doc/design/styles/main.css index f48269b4c..edf152f70 100644 --- a/doc/design/styles/main.css +++ b/doc/design/styles/main.css @@ -444,7 +444,7 @@ article a.button { background-image: linear-gradient(top, #68a3d8, #125687); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#68a3d8', EndColorStr='#125687'); border: 1px solid #5084b4; - padding: 4px 20px; + padding: 4px 20px 6px; margin: 0; font-size: 12px; text-decoration: none; @@ -513,7 +513,7 @@ article input[type="submit"] { background-image: linear-gradient(top, #68a3d8, #125687); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#68a3d8', EndColorStr='#125687'); border: 1px solid #5084b4; - padding: 0px 20px 0px; + padding: 3px 20px 5px; margin: 0; font-size: 12px; text-decoration: none; @@ -523,7 +523,6 @@ article input[type="submit"] { border-radius: 5px; text-align: center; height: auto; - height: 28px; width: auto; font-family: Tahoma; } @@ -2364,3 +2363,7 @@ table.tablesorter tr.search td input[type="text"] { table.tablesorter.width565 { width: 565px; } + +article h3 a { + font-size: 14px; +} \ No newline at end of file From 4addff059b7d20a17c31f2886539d771169a71ee Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 15 Mar 2012 23:52:54 +0600 Subject: [PATCH 05/20] [refs #265] added activity feed tabs --- app/controllers/activity_feeds_controller.rb | 6 +++++- app/models/activity_feed.rb | 15 ++++++++++++++- app/views/activity_feeds/_feed_tabs.html.haml | 5 +++++ app/views/activity_feeds/index.html.haml | 4 ++++ app/views/layouts/application.html.haml | 2 ++ config/locales/menu.en.yml | 8 +++++++- config/locales/menu.ru.yml | 8 +++++++- config/locales/models/activity_feed.en.yml | 2 +- config/locales/models/activity_feed.ru.yml | 6 +++--- 9 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 app/views/activity_feeds/_feed_tabs.html.haml diff --git a/app/controllers/activity_feeds_controller.rb b/app/controllers/activity_feeds_controller.rb index e5b5274d8..b18f047d4 100644 --- a/app/controllers/activity_feeds_controller.rb +++ b/app/controllers/activity_feeds_controller.rb @@ -2,6 +2,10 @@ class ActivityFeedsController < ApplicationController before_filter :authenticate_user! def index - @activity_feeds = current_user.activity_feeds.order('created_at DESC').limit(10) + @filter = t('feed_menu').has_key?(params[:filter].to_sym) ? params[:filter].to_sym : :all + @activity_feeds = current_user.activity_feeds + @activity_feeds = @activity_feeds.where(:kind => "ActivityFeed::#{@filter.upcase}".constantize) unless @filter == :all + + @activity_feeds = @activity_feeds.paginate :page => params[:page] end end diff --git a/app/models/activity_feed.rb b/app/models/activity_feed.rb index 934ef56ea..34f2257bc 100644 --- a/app/models/activity_feed.rb +++ b/app/models/activity_feed.rb @@ -1,9 +1,22 @@ class ActivityFeed < ActiveRecord::Base - belongs_to :user + CODE = ['git_delete_branch_notification', 'git_new_push_notification', 'new_comment_commit_notification'] + TRACKER = ['issue_assign_notification', 'new_comment_notification', 'new_issue_notification'] + BUILD = [] + WIKI = ['wiki_new_commit_notification'] + + belongs_to :user serialize :data + default_scope order('created_at DESC') + + self.per_page = 10 + def partial 'activity_feeds/partials/' + self.kind end + + def self.last_messages?(relation, page) + true #relation.count <= ActivityFeed::PER_PAGE * page + end end diff --git a/app/views/activity_feeds/_feed_tabs.html.haml b/app/views/activity_feeds/_feed_tabs.html.haml new file mode 100644 index 000000000..e1e9af45d --- /dev/null +++ b/app/views/activity_feeds/_feed_tabs.html.haml @@ -0,0 +1,5 @@ +.sub-menu + %nav + %ul + - (collection = t 'feed_menu').each do |base, title| + %li= link_to title, activity_feeds_path(:filter => base), :class => @filter == base ? 'active' : '' diff --git a/app/views/activity_feeds/index.html.haml b/app/views/activity_feeds/index.html.haml index 4ea9e88fa..9fdf04cca 100644 --- a/app/views/activity_feeds/index.html.haml +++ b/app/views/activity_feeds/index.html.haml @@ -2,5 +2,9 @@ - @activity_feeds.each do |activity_feed| .activity = render_activity_feed(activity_feed) +- if @activity_feeds.next_page + %a{:href => activity_feeds_path({:filter => @filter, :page => @activity_feeds.next_page})} + .messages.messages-last=t('layout.activity_feed.load_messages') - content_for :sidebar, render('sidebar') +- content_for :feed_tabs, render('feed_tabs') diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 23c58d426..678acb6ba 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -37,6 +37,8 @@ .sub-menu= yield :submenu .both = render "layouts/flashes" + - if content_for?(:feed_tabs) + = yield :feed_tabs %article - if content_for?(:sidebar) %aside= yield :sidebar diff --git a/config/locales/menu.en.yml b/config/locales/menu.en.yml index 3736e6cb6..2958b8c81 100644 --- a/config/locales/menu.en.yml +++ b/config/locales/menu.en.yml @@ -26,4 +26,10 @@ en: tracker: Tracker wiki: Wiki readme: Readme - settings: Settings \ No newline at end of file + settings: Settings + feed_menu: + all: Все + code: Код + tracker: Трекер + build: Сборка + wiki: Вики \ No newline at end of file diff --git a/config/locales/menu.ru.yml b/config/locales/menu.ru.yml index 2a56ac703..0762e887e 100644 --- a/config/locales/menu.ru.yml +++ b/config/locales/menu.ru.yml @@ -26,4 +26,10 @@ ru: tracker: Трекер wiki: Wiki readme: Readme - settings: Настройки \ No newline at end of file + settings: Настройки + feed_menu: + all: Все + code: Код + tracker: Трекер + build: Сборка + wiki: Вики \ No newline at end of file diff --git a/config/locales/models/activity_feed.en.yml b/config/locales/models/activity_feed.en.yml index 474ee3feb..3297f83b0 100644 --- a/config/locales/models/activity_feed.en.yml +++ b/config/locales/models/activity_feed.en.yml @@ -7,6 +7,7 @@ en: all_my_builds: All my builds my_builds_by_day: My today builds new_project: Create project + load_messages: Load messages notifications: subjects: @@ -23,7 +24,6 @@ en: content: in issue %{issue_link} commit_content: in commit %{commit_link} new_issue_notification: '%{user_link} has been added a new issue' - 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. diff --git a/config/locales/models/activity_feed.ru.yml b/config/locales/models/activity_feed.ru.yml index b912d2266..30d1b4572 100644 --- a/config/locales/models/activity_feed.ru.yml +++ b/config/locales/models/activity_feed.ru.yml @@ -7,6 +7,7 @@ ru: all_my_builds: Все мои сборки my_builds_by_day: Мои сборки за день new_project: Создать проект + load_messages: Загрузить сообщения notifications: subjects: @@ -20,10 +21,9 @@ ru: bodies: new_comment_notification: title: '%{user_link} добавил новый комментарий' - content: в задаче %{issue_link} - commit_content: в коммите %{commit_link} + content: к задаче %{issue_link} + commit_content: к коммиту %{commit_link} new_issue_notification: '%{user_link} добавил новую задачу' - issue: задачу new_user_notification: title: Здравствуйте, %{user_name}. content: Вы зарегистрированы на проекте «ROSA Build System» и теперь можете войти в систему. From 3719b40889587773ed2041e52a5ae58b74fe1479 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 16 Mar 2012 00:22:56 +0600 Subject: [PATCH 06/20] [refs #265] removed unused code --- app/models/activity_feed.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/models/activity_feed.rb b/app/models/activity_feed.rb index 34f2257bc..940037663 100644 --- a/app/models/activity_feed.rb +++ b/app/models/activity_feed.rb @@ -16,7 +16,4 @@ class ActivityFeed < ActiveRecord::Base 'activity_feeds/partials/' + self.kind end - def self.last_messages?(relation, page) - true #relation.count <= ActivityFeed::PER_PAGE * page - end end From dce26c79e08c92818815752e699228aaa5071dd2 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 16 Mar 2012 00:25:05 +0600 Subject: [PATCH 07/20] [refs #265] fixed en locale --- config/locales/menu.en.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/locales/menu.en.yml b/config/locales/menu.en.yml index 2958b8c81..64b1fc88b 100644 --- a/config/locales/menu.en.yml +++ b/config/locales/menu.en.yml @@ -28,8 +28,8 @@ en: readme: Readme settings: Settings feed_menu: - all: Все - code: Код - tracker: Трекер - build: Сборка - wiki: Вики \ No newline at end of file + all: All + code: Code + tracker: Tracker + build: Build + wiki: Wiki \ No newline at end of file From dd5f51de71de7b851e013d94442a84ef4592e8d0 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 16 Mar 2012 21:37:58 +0600 Subject: [PATCH 08/20] [refs #265] added build tasks feed --- app/controllers/activity_feeds_controller.rb | 2 +- app/models/activity_feed_observer.rb | 16 +++++++++++++++- .../partials/_build_list_notification.haml | 17 +++++++++++++++++ app/views/git/repositories/_show.html.haml | 4 ++-- app/views/git/shared/_whereami.html.haml | 2 +- config/locales/models/activity_feed.en.yml | 8 ++++++-- config/locales/models/activity_feed.ru.yml | 8 +++++++- 7 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 app/views/activity_feeds/partials/_build_list_notification.haml diff --git a/app/controllers/activity_feeds_controller.rb b/app/controllers/activity_feeds_controller.rb index b18f047d4..ff03a16e4 100644 --- a/app/controllers/activity_feeds_controller.rb +++ b/app/controllers/activity_feeds_controller.rb @@ -2,7 +2,7 @@ class ActivityFeedsController < ApplicationController before_filter :authenticate_user! def index - @filter = t('feed_menu').has_key?(params[:filter].to_sym) ? params[:filter].to_sym : :all + @filter = t('feed_menu').has_key?(params[:filter].try(:to_sym)) ? params[:filter].to_sym : :all @activity_feeds = current_user.activity_feeds @activity_feeds = @activity_feeds.where(:kind => "ActivityFeed::#{@filter.upcase}".constantize) unless @filter == :all diff --git a/app/models/activity_feed_observer.rb b/app/models/activity_feed_observer.rb index 61f0e160a..82b412f94 100644 --- a/app/models/activity_feed_observer.rb +++ b/app/models/activity_feed_observer.rb @@ -1,5 +1,5 @@ class ActivityFeedObserver < ActiveRecord::Observer - observe :issue, :comment, :user + observe :issue, :comment, :user, :build_list def after_create(record) case record.class.to_s @@ -128,6 +128,20 @@ class ActivityFeedObserver < ActiveRecord::Observer :project_id => record.project.id, :project_name => record.project.name, :project_owner => record.project.owner.uname} ) end + + when 'BuildList' + if [BuildList::BUILD_PUBLISHED, BuildServer::SUCCESS, BuildServer::BUILD_ERROR, BuildServer::PLATFORM_NOT_FOUND, + BuildServer::PROJECT_NOT_FOUND, BuildServer::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH].include? record.status + record.project.owner_and_admin_ids.each do |recipient| + ActivityFeed.create( + :user => User.find(recipient), + :kind => 'build_list_notification', + :data => {:task_num => record.bs_id, :build_list_id => record.id, :status => record.status, :notified_at => record.notified_at, + :project_id => record.project_id, :project_name => record.project.name, :project_owner => record.project.owner.uname, + :user_name => record.user.name, :user_email => record.user.email, :user_id => record.user_id} + ) + end + end end end diff --git a/app/views/activity_feeds/partials/_build_list_notification.haml b/app/views/activity_feeds/partials/_build_list_notification.haml new file mode 100644 index 000000000..9f9d133f8 --- /dev/null +++ b/app/views/activity_feeds/partials/_build_list_notification.haml @@ -0,0 +1,17 @@ +.top + .image + = image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar') + .text + %span + = raw t('notifications.bodies.build_task', :task_num => task_num, :task_link => build_list_path(build_list_id)) + = raw t('notifications.bodies.project', :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) ) + - message, error = case status + - when BuildList::BUILD_PUBLISHED + - ['published', nil] + - when BuildServer::SUCCESS + - ['success', nil] + - else ['failed', t("layout.build_lists.statuses.#{BuildList::HUMAN_STATUSES[status]}")] + = raw t("notifications.bodies.build_status.#{message}", :error => error) + .both + %span.date= notified_at + .both diff --git a/app/views/git/repositories/_show.html.haml b/app/views/git/repositories/_show.html.haml index c3f4229d2..1c09afb69 100644 --- a/app/views/git/repositories/_show.html.haml +++ b/app/views/git/repositories/_show.html.haml @@ -28,11 +28,11 @@ - if entry.is_a? Grit::Blob .pic= image_tag 'code.png' .name - = link_to(entry.name, blob_path(@project, @treeish, entry_path), :class => 'files-see').encode_to_default + = link_to(entry.name, blob_path(@project, 'rosa_devel', entry_path), :class => 'files-see').encode_to_default - else .pic= image_tag 'folder.png' .name - = link_to(entry.name, tree_path(@project, @treeish, entry_path), :class => 'files-see').encode_to_default + = link_to(entry.name, tree_path(@project, 'rosa_devel', entry_path), :class => 'files-see').encode_to_default %td %span{:style => "display: none;"}= commit.committed_date || commit.authored_date#> Dec 31, 2011 = l(commit.committed_date || commit.authored_date, :format => :short) #31 декабря 2011 diff --git a/app/views/git/shared/_whereami.html.haml b/app/views/git/shared/_whereami.html.haml index f01ba7fb0..5ec21885e 100644 --- a/app/views/git/shared/_whereami.html.haml +++ b/app/views/git/shared/_whereami.html.haml @@ -1,5 +1,5 @@ %p#file-name1 - = link_to @project.name, tree_path(@project, :treeish => @treeish.encode_to_default) + = link_to @project.name, tree_path(@project, :treeish => html_escape(@treeish.encode_to_default)) = File::SEPARATOR - if @path.present? - paths = File.split(@path) diff --git a/config/locales/models/activity_feed.en.yml b/config/locales/models/activity_feed.en.yml index 3297f83b0..4a53e3560 100644 --- a/config/locales/models/activity_feed.en.yml +++ b/config/locales/models/activity_feed.en.yml @@ -33,7 +33,11 @@ en: 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}' \ No newline at end of file + update_branch: '%{user_link} has been pushed to branch %{branch_name}' + build_task: 'Build task #%{task_num}' + build_status: + published: published successfully + success: complete successfully + failed: complete with error "%{error}" diff --git a/config/locales/models/activity_feed.ru.yml b/config/locales/models/activity_feed.ru.yml index 30d1b4572..2703c9a1f 100644 --- a/config/locales/models/activity_feed.ru.yml +++ b/config/locales/models/activity_feed.ru.yml @@ -17,6 +17,7 @@ ru: new_user_notification: Регистрация на проекте «%{ project_name }» issue_assign_notification: Вам назначили задачу invite_approve_notification: Приглашение в ABF + build_task: Сборочное задание bodies: new_comment_notification: @@ -36,4 +37,9 @@ ru: delete_branch: Удалена ветка %{branch_name} create_branch: '%{user_link} создал новую ветку %{branch_name}' - update_branch: '%{user_link} внес изменения в ветку %{branch_name}' \ No newline at end of file + update_branch: '%{user_link} внес изменения в ветку %{branch_name}' + build_task: 'Сборочное задание №%{task_num}' + build_status: + published: успешно опубликовано + success: успешно собрано + failed: завершилось с ошибкой "%{error}" From 22d7f8d975aaf307f79a87dc053250d092bc5bdc Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Sat, 17 Mar 2012 00:55:03 +0600 Subject: [PATCH 09/20] [refs #265] shit --- app/views/git/repositories/_show.html.haml | 4 ++-- app/views/git/shared/_whereami.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/git/repositories/_show.html.haml b/app/views/git/repositories/_show.html.haml index 1c09afb69..c3f4229d2 100644 --- a/app/views/git/repositories/_show.html.haml +++ b/app/views/git/repositories/_show.html.haml @@ -28,11 +28,11 @@ - if entry.is_a? Grit::Blob .pic= image_tag 'code.png' .name - = link_to(entry.name, blob_path(@project, 'rosa_devel', entry_path), :class => 'files-see').encode_to_default + = link_to(entry.name, blob_path(@project, @treeish, entry_path), :class => 'files-see').encode_to_default - else .pic= image_tag 'folder.png' .name - = link_to(entry.name, tree_path(@project, 'rosa_devel', entry_path), :class => 'files-see').encode_to_default + = link_to(entry.name, tree_path(@project, @treeish, entry_path), :class => 'files-see').encode_to_default %td %span{:style => "display: none;"}= commit.committed_date || commit.authored_date#> Dec 31, 2011 = l(commit.committed_date || commit.authored_date, :format => :short) #31 декабря 2011 diff --git a/app/views/git/shared/_whereami.html.haml b/app/views/git/shared/_whereami.html.haml index 5ec21885e..f01ba7fb0 100644 --- a/app/views/git/shared/_whereami.html.haml +++ b/app/views/git/shared/_whereami.html.haml @@ -1,5 +1,5 @@ %p#file-name1 - = link_to @project.name, tree_path(@project, :treeish => html_escape(@treeish.encode_to_default)) + = link_to @project.name, tree_path(@project, :treeish => @treeish.encode_to_default) = File::SEPARATOR - if @path.present? - paths = File.split(@path) From fb89eedca322e770172e10bd557368833bd939f6 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Sat, 17 Mar 2012 00:58:41 +0600 Subject: [PATCH 10/20] [refs #265] forgot build list setup --- app/models/activity_feed.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/activity_feed.rb b/app/models/activity_feed.rb index 940037663..3bd57217c 100644 --- a/app/models/activity_feed.rb +++ b/app/models/activity_feed.rb @@ -2,7 +2,7 @@ class ActivityFeed < ActiveRecord::Base CODE = ['git_delete_branch_notification', 'git_new_push_notification', 'new_comment_commit_notification'] TRACKER = ['issue_assign_notification', 'new_comment_notification', 'new_issue_notification'] - BUILD = [] + BUILD = ['build_list_notification'] WIKI = ['wiki_new_commit_notification'] belongs_to :user From 4b26eebeca955d1a8d3fc1afd48893ab6af26a8f Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Sun, 18 Mar 2012 12:20:31 +0400 Subject: [PATCH 11/20] [refs #223] Add new design to build list task page --- app/assets/stylesheets/design/custom.scss | 12 ++ app/assets/stylesheets/design/main.scss | 35 ++++ app/helpers/build_lists_helper.rb | 24 +++ app/views/build_lists/_submenu.html.haml | 14 +- app/views/build_lists/show.html.haml | 234 +++++++++++++++------- config/locales/models/build_list.en.yml | 1 + config/locales/models/build_list.ru.yml | 1 + doc/design/abf-monitoring task.html | 204 +++++++++++++++++++ doc/design/styles/main.css | 67 ++++++- spec/helpers/build_lists_helper_spec.rb | 15 ++ 10 files changed, 518 insertions(+), 89 deletions(-) create mode 100644 app/helpers/build_lists_helper.rb create mode 100644 doc/design/abf-monitoring task.html create mode 100644 spec/helpers/build_lists_helper_spec.rb diff --git a/app/assets/stylesheets/design/custom.scss b/app/assets/stylesheets/design/custom.scss index 10698998f..cc3e2ad3e 100644 --- a/app/assets/stylesheets/design/custom.scss +++ b/app/assets/stylesheets/design/custom.scss @@ -444,3 +444,15 @@ table.wiki .history .td2 .name span.username { } #fork-and-edit {display:block;} + +div.notify.blue div.nocolor { + float: left; + border: 1px solid #a9c6dd; +} + +div.notify.blue div.red { + float: left; + border: 1px solid #ddd; + background-color: #FBE3E4; + border-color: #FBC2C4; +} diff --git a/app/assets/stylesheets/design/main.scss b/app/assets/stylesheets/design/main.scss index bc13f0e97..6a1c2ed45 100644 --- a/app/assets/stylesheets/design/main.scss +++ b/app/assets/stylesheets/design/main.scss @@ -1590,6 +1590,10 @@ table td.width145 { width: 145px; } +.width125 { + width: 125px; +} + table td.width30 { width: 30px; } @@ -1941,6 +1945,21 @@ img.delete-row { cursor: pointer; } +table tbody tr.error td { + background: #fedede; +} + +table tbody tr.success td { + background: #e3edb7; +} + +table.tablesorter.width565 { + width: 565px; +} + +table.tablesorter thead th { + padding-left: 5px; +} /* Create group */ @@ -2101,6 +2120,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 { diff --git a/app/helpers/build_lists_helper.rb b/app/helpers/build_lists_helper.rb new file mode 100644 index 000000000..c351afae1 --- /dev/null +++ b/app/helpers/build_lists_helper.rb @@ -0,0 +1,24 @@ +module BuildListsHelper + def build_list_status_color(status) + if [BuildList::BUILD_PUBLISHED, BuildServer::SUCCESS].include? status + return 'green' + end + if [BuildServer::BUILD_ERROR, BuildServer::PLATFORM_NOT_FOUND, + BuildServer::PROJECT_NOT_FOUND,BuildServer::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH].include? status + return 'red' + end + + 'nocolor' + end + + def build_list_item_status_color(status) + if BuildServer::SUCCESS == status + return 'success' + end + if [BuildServer::DEPENDENCIES_ERROR, BuildServer::BUILD_ERROR, BuildList::Item::GIT_ERROR].include? status + return 'error' + end + + '' + end +end diff --git a/app/views/build_lists/_submenu.html.haml b/app/views/build_lists/_submenu.html.haml index 06ade1465..e329b7afb 100644 --- a/app/views/build_lists/_submenu.html.haml +++ b/app/views/build_lists/_submenu.html.haml @@ -1,7 +1,11 @@ - content_for :submenu do - - if content_for?(:sidebar) + - if @build_list .left - %nav - %ul - %li= link_to t('layout.projects.list_header'), build_lists_path, :class => (params[:controller] == 'build_lists' ? 'active' : nil) - %li= link_to t('layout.products.list_header'), '#' \ No newline at end of file + = @build_list.project.name + - else + - if content_for?(:sidebar) + .left + %nav + %ul + %li= link_to t('layout.projects.list_header'), build_lists_path, :class => (params[:controller] == 'build_lists' ? 'active' : nil) + %li= link_to t('layout.products.list_header'), '#' diff --git a/app/views/build_lists/show.html.haml b/app/views/build_lists/show.html.haml index 486d3afd6..d07fd2131 100644 --- a/app/views/build_lists/show.html.haml +++ b/app/views/build_lists/show.html.haml @@ -1,81 +1,161 @@ -%table.columns2.info - %tr - %td.first= t("activerecord.attributes.build_list.name") - %td= @build_list.present? ? @build_list.name : t("layout.build_lists.name_not_yet_defined") - %tr - %td= t("activerecord.attributes.build_list.bs_id") - %td= @build_list.bs_id - %tr - %td= t("activerecord.attributes.build_list.container_path") - %td - - if @build_list.status == BuildList::BUILD_PUBLISHED - = t("layout.build_lists.container_published") - - elsif @build_list.container_path.present? - - container_url = "http://#{request.host_with_port}/downloads#{@build_list.container_path}" - = link_to container_url, container_url - %tr - %td= t("activerecord.attributes.build_list.bpl") - %td= link_to @build_list.bpl.name, @build_list.bpl - %tr - %td= t("activerecord.attributes.build_list.pl") - %td= link_to @build_list.pl.name, @build_list.pl - %tr - %td= t("activerecord.attributes.build_list.include_repos") - %td= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ') - %tr - %td= t("activerecord.attributes.build_list.update_type") - %td= @build_list.update_type - %tr - %td= t("activerecord.attributes.build_list.build_requires") - %td= @build_list.build_requires - %tr - %td= t("activerecord.attributes.build_list.auto_publish") - %td= @build_list.auto_publish - %tr - %td= t("activerecord.attributes.build_list.status") - %td= @build_list.human_status - %tr - %td= t("activerecord.attributes.build_list.project") - %td= link_to @build_list.project.name, project_path(@build_list.project) - %tr - %td= t("activerecord.attributes.build_list.project_version") - %td= @build_list.project_version - %tr - %td= t("activerecord.attributes.build_list.arch") - %td= @build_list.arch.name - %tr - %td= t("activerecord.attributes.build_list.user") - %td= link_to @build_list.user.try(:fullname), @build_list.user - %tr - %td= t("activerecord.attributes.build_list.notified_at") - %td= @build_list.notified_at - %tr - %td= t("activerecord.attributes.build_list.is_circle") - %td= t("layout.#{@build_list.is_circle?}_") - -%br -%br - -= link_to t("layout.publish"), publish_build_list_path(@build_list), :method => "put", :confirm => t("layout.confirm"), :class => "button" if @build_list.can_publish? and can?(:publish, @build_list) - -%br -%br - -%h2= t("layout.build_lists.items_header") -= t("layout.build_lists.no_items_data") if @item_groups.blank? - +.notify.blue + %div{:class => build_list_status_color(@build_list.status)} + %p= @build_list.human_status + %p 2012-01-27 17:28:05 UTC + .both +%h3= t("layout.build_lists.main_data") +.leftside.width125= t("activerecord.attributes.build_list.container_path") +.leftside + - if @build_list.status == BuildList::BUILD_PUBLISHED + = t("layout.build_lists.container_published") + - elsif @build_list.container_path.present? + - container_url = "http://#{request.host_with_port}/downloads#{@build_list.container_path}" + = link_to container_url, container_url +.both +.leftside.width125= t("activerecord.attributes.build_list.user") +.leftside + = link_to @build_list.user.try(:fullname), @build_list.user +.both += link_to t("layout.publish"), publish_build_list_path(@build_list), :method => "put", :confirm => t("layout.confirm"), :class => "button tmargin10" if @build_list.can_publish? and can?(:publish, @build_list) +.hr +%h3= t("layout.build_lists.main_data") +.leftside.width125= t("activerecord.attributes.build_list.bpl") +.leftside + = link_to @build_list.bpl.name, @build_list.bpl +.both +.leftside.width125= t("activerecord.attributes.build_list.pl") +.leftside + = link_to @build_list.pl.name, @build_list.pl +.both +.leftside.width125= t("activerecord.attributes.build_list.include_repos") +.leftside= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ') +.both +.leftside.width125= t("activerecord.attributes.build_list.update_type") +.leftside= @build_list.update_type +.both +.leftside.width125= t("activerecord.attributes.build_list.build_requires") +.leftside= @build_list.build_requires +.both +.leftside.width125= t("activerecord.attributes.build_list.auto_publish") +.leftside= @build_list.auto_publish +.both +.leftside.width125= t("activerecord.attributes.build_list.project_version") +.leftside= @build_list.project_version +.both +.leftside.width125= t("activerecord.attributes.build_list.arch") +.leftside= @build_list.arch.name +.both +.leftside.width125= t("activerecord.attributes.build_list.notified_at") +.leftside= @build_list.notified_at +.both +.leftside.width125= t("activerecord.attributes.build_list.is_circle") +.leftside= t("layout.#{@build_list.is_circle?}_") +.both +.leftside.width125 Recurrent +.leftside false +.both +.hr +%h3= t("layout.build_lists.items_header") +- if @item_groups.blank? + %h4.nomargin= t("layout.build_lists.no_items_data") - @item_groups.each_with_index do |group, level| - %h3.title Level ##{level} - %table.columns3.info - %tr - %th.first= t("activerecord.attributes.build_list/item.name") - %th= t("activerecord.attributes.build_list/item.version") - %th.last= t("activerecord.attributes.build_list/item.status") + -#%h4.nomargin= "#{group} ##{level}" + - group.each do |item| + %h4.nomargin= "#{item.name} ##{level}" + %table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"} + %thead + %tr + %th= t("activerecord.attributes.build_list/item.name") + %th= t("activerecord.attributes.build_list/item.version") + %th= t("activerecord.attributes.build_list/item.status") + %tbody + %tr{:class => build_list_item_status_color(item.status)} + %td= item.name + %td= item.version + %td= item.human_status +.both - - group.each do |item| - %tr{:class => cycle("odd", "even")} - %td= item.name - %td= item.version - %td= item.human_status +:javascript + $('article .all').addClass('bigpadding'); + +-#%table.columns2.info +-# %tr +-# %td.first= t("activerecord.attributes.build_list.name") +-# %td= @build_list.present? ? @build_list.name : t("layout.build_lists.name_not_yet_defined") +-# %tr +-# %td= t("activerecord.attributes.build_list.bs_id") +-# %td= @build_list.bs_id +-# %tr +-# %td= t("activerecord.attributes.build_list.container_path") +-# %td +-# - if @build_list.status == BuildList::BUILD_PUBLISHED +-# = t("layout.build_lists.container_published") +-# - elsif @build_list.container_path.present? +-# - container_url = "http://#{request.host_with_port}/downloads#{@build_list.container_path}" +-# = link_to container_url, container_url +-# %tr +-# %td= t("activerecord.attributes.build_list.bpl") +-# %td= link_to @build_list.bpl.name, @build_list.bpl +-# %tr +-# %td= t("activerecord.attributes.build_list.pl") +-# %td= link_to @build_list.pl.name, @build_list.pl +-# %tr +-# %td= t("activerecord.attributes.build_list.include_repos") +-# %td= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ') +-# %tr +-# %td= t("activerecord.attributes.build_list.update_type") +-# %td= @build_list.update_type +-# %tr +-# %td= t("activerecord.attributes.build_list.build_requires") +-# %td= @build_list.build_requires +-# %tr +-# %td= t("activerecord.attributes.build_list.auto_publish") +-# %td= @build_list.auto_publish +-# %tr +-# %td= t("activerecord.attributes.build_list.status") +-# %td= @build_list.human_status +-# %tr +-# %td= t("activerecord.attributes.build_list.project") +-# %td= link_to @build_list.project.name, project_path(@build_list.project) +-# %tr +-# %td= t("activerecord.attributes.build_list.project_version") +-# %td= @build_list.project_version +-# %tr +-# %td= t("activerecord.attributes.build_list.arch") +-# %td= @build_list.arch.name +-# %tr +-# %td= t("activerecord.attributes.build_list.user") +-# %td= link_to @build_list.user.try(:fullname), @build_list.user +-# %tr +-# %td= t("activerecord.attributes.build_list.notified_at") +-# %td= @build_list.notified_at +-# %tr +-# %td= t("activerecord.attributes.build_list.is_circle") +-# %td= t("layout.#{@build_list.is_circle?}_") +-# +-#%br +-#%br +-# +-#= link_to t("layout.publish"), publish_build_list_path(@build_list), :method => "put", :confirm => t("layout.confirm"), :class => "button" if @build_list.can_publish? and can?(:publish, @build_list) +-# +-#%br +-#%br +-# +-#%h2= t("layout.build_lists.items_header") +-#= t("layout.build_lists.no_items_data") if @item_groups.blank? +-# +-#- @item_groups.each_with_index do |group, level| +-# %h3.title Level ##{level} +-# %table.columns3.info +-# %tr +-# %th.first= t("activerecord.attributes.build_list/item.name") +-# %th= t("activerecord.attributes.build_list/item.version") +-# %th.last= t("activerecord.attributes.build_list/item.status") +-# +-# - group.each do |item| +-# %tr{:class => cycle("odd", "even")} +-# %td= item.name +-# %td= item.version +-# %td= item.human_status = render 'build_lists/submenu' diff --git a/config/locales/models/build_list.en.yml b/config/locales/models/build_list.en.yml index 517cc53d5..eb86a4647 100644 --- a/config/locales/models/build_list.en.yml +++ b/config/locales/models/build_list.en.yml @@ -58,6 +58,7 @@ en: container_published: 'Container in a repository' action: Action new_header: New build + main_data: Main data ownership: header: Build list ownership diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index 531448717..0bfa9ec88 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -58,6 +58,7 @@ ru: container_published: 'Контейнер размещен в репозитории' action: Действие new_header: Новая сборка + main_data: Основные данные ownership: header: Принадлежность заданий diff --git a/doc/design/abf-monitoring task.html b/doc/design/abf-monitoring task.html new file mode 100644 index 000000000..f590c6be4 --- /dev/null +++ b/doc/design/abf-monitoring task.html @@ -0,0 +1,204 @@ + + + + + Сборочная среда + + + + + + + +
+ +
+
+
+
+ + + + + +
+ + + +
+
+ avatar +
+ +
+ +
+
+ + + +
+ +
+
+
+
+
+
+ + + + +
+
+ + +
+ +
+ +
+
+

Build published

+
+

2012-01-27 17:28:05 UTC

+
+ +

Основные данные

+
Container path
+ +
+
User
+ +
+ Опубликовать + +
+ +

Основные данные

+
Platform
+ +
+
Packet list repository
+ +
+
Includes repository
+
main
+
+
Update type
+
security
+
+
Dependable build requires
+
false
+
+
Automated publishing
+
true
+
+
Version
+
latest_mandriva2011
+
+
Architecture
+
i586
+
+
Recurrent
+
false
+
+ +
+ +

Build items

+

Item #0

+ + + + + + + + + + + + + + + + +
NameVersionStatus
libreofficelatest_mandriva2011Build complete
+ +
+ +
+ +
+
+
+ +
+ + + + \ No newline at end of file diff --git a/doc/design/styles/main.css b/doc/design/styles/main.css index b1caadb42..edf152f70 100644 --- a/doc/design/styles/main.css +++ b/doc/design/styles/main.css @@ -276,7 +276,7 @@ header div.droplist a:hover{ } -.sub-menu nav { /* */ +.sub-menu nav { /*��� ������� ��� ��������*/ 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; @@ -440,7 +444,7 @@ article a.button { background-image: linear-gradient(top, #68a3d8, #125687); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#68a3d8', EndColorStr='#125687'); border: 1px solid #5084b4; - padding: 4px 20px; + padding: 4px 20px 6px; margin: 0; font-size: 12px; text-decoration: none; @@ -509,7 +513,7 @@ article input[type="submit"] { background-image: linear-gradient(top, #68a3d8, #125687); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#68a3d8', EndColorStr='#125687'); border: 1px solid #5084b4; - padding: 0px 20px 0px; + padding: 3px 20px 5px; margin: 0; font-size: 12px; text-decoration: none; @@ -519,7 +523,6 @@ article input[type="submit"] { border-radius: 5px; text-align: center; height: auto; - height: 28px; width: auto; font-family: Tahoma; } @@ -1415,8 +1418,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 +1595,10 @@ table td.width145 { width: 145px; } +.width125 { + width: 125px; +} + table td.width30 { width: 30px; } @@ -1944,7 +1951,7 @@ img.delete-row { } table tbody tr.error td { - background: #e7bcbc; + background: #fedede; } table tbody tr.success td { @@ -2110,6 +2117,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 +2330,40 @@ 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; +} + +article h3 a { + font-size: 14px; } \ No newline at end of file diff --git a/spec/helpers/build_lists_helper_spec.rb b/spec/helpers/build_lists_helper_spec.rb new file mode 100644 index 000000000..bda7a8ffb --- /dev/null +++ b/spec/helpers/build_lists_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the BuildListsHelper. For example: +# +# describe BuildListsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe BuildListsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end From c8329d378394e0af6dcac1c578915687dcd0ba43 Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Mon, 19 Mar 2012 10:36:39 +0400 Subject: [PATCH 12/20] [refs #223] Remove unnessecary things from build list page --- app/views/build_lists/show.html.haml | 83 ---------------------------- 1 file changed, 83 deletions(-) diff --git a/app/views/build_lists/show.html.haml b/app/views/build_lists/show.html.haml index d07fd2131..02f0fa4ca 100644 --- a/app/views/build_lists/show.html.haml +++ b/app/views/build_lists/show.html.haml @@ -51,9 +51,6 @@ .leftside.width125= t("activerecord.attributes.build_list.is_circle") .leftside= t("layout.#{@build_list.is_circle?}_") .both -.leftside.width125 Recurrent -.leftside false -.both .hr %h3= t("layout.build_lists.items_header") - if @item_groups.blank? @@ -78,84 +75,4 @@ :javascript $('article .all').addClass('bigpadding'); --#%table.columns2.info --# %tr --# %td.first= t("activerecord.attributes.build_list.name") --# %td= @build_list.present? ? @build_list.name : t("layout.build_lists.name_not_yet_defined") --# %tr --# %td= t("activerecord.attributes.build_list.bs_id") --# %td= @build_list.bs_id --# %tr --# %td= t("activerecord.attributes.build_list.container_path") --# %td --# - if @build_list.status == BuildList::BUILD_PUBLISHED --# = t("layout.build_lists.container_published") --# - elsif @build_list.container_path.present? --# - container_url = "http://#{request.host_with_port}/downloads#{@build_list.container_path}" --# = link_to container_url, container_url --# %tr --# %td= t("activerecord.attributes.build_list.bpl") --# %td= link_to @build_list.bpl.name, @build_list.bpl --# %tr --# %td= t("activerecord.attributes.build_list.pl") --# %td= link_to @build_list.pl.name, @build_list.pl --# %tr --# %td= t("activerecord.attributes.build_list.include_repos") --# %td= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ') --# %tr --# %td= t("activerecord.attributes.build_list.update_type") --# %td= @build_list.update_type --# %tr --# %td= t("activerecord.attributes.build_list.build_requires") --# %td= @build_list.build_requires --# %tr --# %td= t("activerecord.attributes.build_list.auto_publish") --# %td= @build_list.auto_publish --# %tr --# %td= t("activerecord.attributes.build_list.status") --# %td= @build_list.human_status --# %tr --# %td= t("activerecord.attributes.build_list.project") --# %td= link_to @build_list.project.name, project_path(@build_list.project) --# %tr --# %td= t("activerecord.attributes.build_list.project_version") --# %td= @build_list.project_version --# %tr --# %td= t("activerecord.attributes.build_list.arch") --# %td= @build_list.arch.name --# %tr --# %td= t("activerecord.attributes.build_list.user") --# %td= link_to @build_list.user.try(:fullname), @build_list.user --# %tr --# %td= t("activerecord.attributes.build_list.notified_at") --# %td= @build_list.notified_at --# %tr --# %td= t("activerecord.attributes.build_list.is_circle") --# %td= t("layout.#{@build_list.is_circle?}_") --# --#%br --#%br --# --#= link_to t("layout.publish"), publish_build_list_path(@build_list), :method => "put", :confirm => t("layout.confirm"), :class => "button" if @build_list.can_publish? and can?(:publish, @build_list) --# --#%br --#%br --# --#%h2= t("layout.build_lists.items_header") --#= t("layout.build_lists.no_items_data") if @item_groups.blank? --# --#- @item_groups.each_with_index do |group, level| --# %h3.title Level ##{level} --# %table.columns3.info --# %tr --# %th.first= t("activerecord.attributes.build_list/item.name") --# %th= t("activerecord.attributes.build_list/item.version") --# %th.last= t("activerecord.attributes.build_list/item.status") --# --# - group.each do |item| --# %tr{:class => cycle("odd", "even")} --# %td= item.name --# %td= item.version --# %td= item.human_status - = render 'build_lists/submenu' From 348fd40daf916a76187dcc7bcf85a09dd8702eb4 Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Mon, 19 Mar 2012 12:39:46 +0400 Subject: [PATCH 13/20] [refs #223] Fix build status color helpers --- app/assets/stylesheets/design/custom.scss | 13 +++++++++++++ app/helpers/build_lists_helper.rb | 14 ++------------ app/views/build_lists/_build_list.html.haml | 4 ++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/design/custom.scss b/app/assets/stylesheets/design/custom.scss index 025989465..d540944b1 100644 --- a/app/assets/stylesheets/design/custom.scss +++ b/app/assets/stylesheets/design/custom.scss @@ -463,6 +463,19 @@ table.tablesorter tr td.buttons a span.delete { #fork-and-edit {display:block;} +.notify.blue div.success { + border: 1px solid #bad099; + background: #d7e599; + float: left; +} + +div.notify.blue div.error { + float: left; + border: 1px solid #ddd; + background-color: #FBE3E4; + border-color: #FBC2C4; +} + div.notify.blue div.nocolor { float: left; border: 1px solid #a9c6dd; diff --git a/app/helpers/build_lists_helper.rb b/app/helpers/build_lists_helper.rb index 4e14740b8..ec670a549 100644 --- a/app/helpers/build_lists_helper.rb +++ b/app/helpers/build_lists_helper.rb @@ -1,11 +1,11 @@ module BuildListsHelper def build_list_status_color(status) if [BuildList::BUILD_PUBLISHED, BuildServer::SUCCESS].include? status - return 'green' + return 'success' end if [BuildServer::BUILD_ERROR, BuildServer::PLATFORM_NOT_FOUND, BuildServer::PROJECT_NOT_FOUND,BuildServer::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH].include? status - return 'red' + return 'error' end 'nocolor' @@ -21,14 +21,4 @@ module BuildListsHelper '' end - - 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 diff --git a/app/views/build_lists/_build_list.html.haml b/app/views/build_lists/_build_list.html.haml index 67a70608b..04443371e 100644 --- a/app/views/build_lists/_build_list.html.haml +++ b/app/views/build_lists/_build_list.html.haml @@ -1,4 +1,4 @@ -%tr{:id => "row#{build_list_counter}", :class => "#{build_list_status(build_list)}"} +%tr{:id => "row#{build_list_counter}", :class => "#{build_list_status_color(build_list.status)}"} %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 @@ -6,4 +6,4 @@ %td= build_list.arch.name %td= link_to build_list.user.try(:fullname), build_list.user %td= link_to image_tag('x.png', :class => 'delete-row', :id => "delete-row#{build_list_counter}"), cancel_build_list_path(build_list), :method => :put, :confirm => t('layout.confirm') if build_list.can_cancel? and can?(:cancel, build_list) - %td= build_list.notified_at \ No newline at end of file + %td= build_list.notified_at From 296acd80da17816a3ec0014ff65170a962ee8274 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Mon, 19 Mar 2012 15:07:09 +0600 Subject: [PATCH 14/20] [refs #265] added build waiting message --- app/models/activity_feed_observer.rb | 3 ++- .../activity_feeds/partials/_build_list_notification.haml | 2 ++ config/locales/models/activity_feed.en.yml | 1 + config/locales/models/activity_feed.ru.yml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/activity_feed_observer.rb b/app/models/activity_feed_observer.rb index 2442b1e9d..b5c356421 100644 --- a/app/models/activity_feed_observer.rb +++ b/app/models/activity_feed_observer.rb @@ -131,7 +131,8 @@ class ActivityFeedObserver < ActiveRecord::Observer when 'BuildList' if [BuildList::BUILD_PUBLISHED, BuildServer::SUCCESS, BuildServer::BUILD_ERROR, BuildServer::PLATFORM_NOT_FOUND, - BuildServer::PROJECT_NOT_FOUND, BuildServer::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH].include? record.status + BuildServer::PROJECT_NOT_FOUND, BuildServer::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH].include? record.status or + (record.status == BuildList::BUILD_PENDING && record.bs_id_changed?) record.project.owner_and_admin_ids.each do |recipient| ActivityFeed.create( :user => User.find(recipient), diff --git a/app/views/activity_feeds/partials/_build_list_notification.haml b/app/views/activity_feeds/partials/_build_list_notification.haml index 9f9d133f8..aa6ddebd7 100644 --- a/app/views/activity_feeds/partials/_build_list_notification.haml +++ b/app/views/activity_feeds/partials/_build_list_notification.haml @@ -6,6 +6,8 @@ = raw t('notifications.bodies.build_task', :task_num => task_num, :task_link => build_list_path(build_list_id)) = raw t('notifications.bodies.project', :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_id)) ) - message, error = case status + - when BuildList::BUILD_PENDING + - ['pending', nil] - when BuildList::BUILD_PUBLISHED - ['published', nil] - when BuildServer::SUCCESS diff --git a/config/locales/models/activity_feed.en.yml b/config/locales/models/activity_feed.en.yml index 4a53e3560..8b3c5cad6 100644 --- a/config/locales/models/activity_feed.en.yml +++ b/config/locales/models/activity_feed.en.yml @@ -41,3 +41,4 @@ en: published: published successfully success: complete successfully failed: complete with error "%{error}" + pending: build waiting diff --git a/config/locales/models/activity_feed.ru.yml b/config/locales/models/activity_feed.ru.yml index 2703c9a1f..052e4c5c5 100644 --- a/config/locales/models/activity_feed.ru.yml +++ b/config/locales/models/activity_feed.ru.yml @@ -43,3 +43,4 @@ ru: published: успешно опубликовано success: успешно собрано failed: завершилось с ошибкой "%{error}" + pending: ожидает сборки From 5e08b89f6af0f42df774432f28081e1d8e06b979 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Mon, 19 Mar 2012 15:23:59 +0600 Subject: [PATCH 15/20] [refs #265] shoter commit hash in message --- .../activity_feeds/partials/_git_new_push_notification.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/activity_feeds/partials/_git_new_push_notification.haml b/app/views/activity_feeds/partials/_git_new_push_notification.haml index 43948fcb0..6d5488015 100644 --- a/app/views/activity_feeds/partials/_git_new_push_notification.haml +++ b/app/views/activity_feeds/partials/_git_new_push_notification.haml @@ -11,6 +11,6 @@ .both %span.subject - last_commits.each do |commit| - = link_to commit[0], commit_path(project_id, commit[0]) + = link_to shortest_hash_id(commit[0]), commit_path(project_id, commit[0]) = commit[1] %br From 64aec8db64028877615bfeb10da1f5973c3363cb Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Mon, 19 Mar 2012 15:39:14 +0600 Subject: [PATCH 16/20] [refs #265] remove existing hook when install from task --- lib/tasks/hook.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/hook.rake b/lib/tasks/hook.rake index aa4636739..911666636 100644 --- a/lib/tasks/hook.rake +++ b/lib/tasks/hook.rake @@ -18,7 +18,7 @@ namespace :hook do projects = ENV['project_id'] ? Project.where(:id => eval(ENV['project_id'])) : Project projects.where('created_at >= ?', Time.now.ago(ENV['period'] ? eval(ENV['period']) : 100.years)).each do |project| hook_file = File.join(project.path, 'hooks', 'post-receive') - FileUtils.cp(hook, hook_file) + FileUtils.copy_entry(hook, hook_file, false, false, true) count = count + 1 end say "Writing to #{count.to_s} repo(s)" From 30038f4c9ca450f676cad1da61da781f214b5a79 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Mon, 19 Mar 2012 15:58:30 +0600 Subject: [PATCH 17/20] [refs #265] show 10 symbols of the commit hash --- app/helpers/commit_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/commit_helper.rb b/app/helpers/commit_helper.rb index 26cbc061b..c1ff9402f 100644 --- a/app/helpers/commit_helper.rb +++ b/app/helpers/commit_helper.rb @@ -33,7 +33,7 @@ module CommitHelper end def shortest_hash_id(id) - id[0..8] + id[0..9] end def short_commit_message(message) From 0c1d57cd8c93b2d3b6360fd49b52e47b7e9b3f33 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Mon, 19 Mar 2012 17:54:06 +0600 Subject: [PATCH 18/20] [refs #279] can resize textarea in product edit page --- app/assets/stylesheets/design/custom.scss | 4 ++++ app/views/products/_form.html.haml | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/design/custom.scss b/app/assets/stylesheets/design/custom.scss index d540944b1..3708ef247 100644 --- a/app/assets/stylesheets/design/custom.scss +++ b/app/assets/stylesheets/design/custom.scss @@ -601,3 +601,7 @@ table.dataTable tr.odd td.sorting_1 { table.dataTable tr.even td.sorting_1 { background-color: #FFFFFF; } + +div.rightlist textarea.resizable { + resize: both; +} diff --git a/app/views/products/_form.html.haml b/app/views/products/_form.html.haml index b3dbc07b5..9a48fdc40 100644 --- a/app/views/products/_form.html.haml +++ b/app/views/products/_form.html.haml @@ -3,23 +3,23 @@ .both .leftlist= f.label :description, t("activerecord.attributes.product.description"), :class => :label -.rightlist= f.text_area :description, :class => 'text_field', :cols => 80 +.rightlist= f.text_area :description, :class => 'text_field resizable', :cols => 80 .both .leftlist= f.label :build_script, t("activerecord.attributes.product.build_script"), :class => :label -.rightlist= f.text_area :build_script, :class => 'text_field', :cols => 80 +.rightlist= f.text_area :build_script, :class => 'text_field resizable', :cols => 80 .both .leftlist= f.label :counter, t("activerecord.attributes.product.counter"), :class => :label -.rightlist= f.text_area :counter, :class => 'text_field', :cols => 80 +.rightlist= f.text_area :counter, :class => 'text_field resizable', :cols => 80 .both .leftlist= f.label :ks, t("activerecord.attributes.product.ks"), :class => :label -.rightlist= f.text_area :ks, :class => 'text_field', :cols => 80 +.rightlist= f.text_area :ks, :class => 'text_field resizable', :cols => 80 .both .leftlist= f.label :menu, t("activerecord.attributes.product.menu"), :class => :label -.rightlist= f.text_area :menu, :class => 'text_field', :cols => 80 +.rightlist= f.text_area :menu, :class => 'text_field resizable', :cols => 80 .both %p From c3bb559bfbd7fef295834e2f59b6ca99b31b97e8 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Mon, 19 Mar 2012 19:47:57 +0600 Subject: [PATCH 19/20] [refs #308] hide password & password confirmation --- app/views/devise/registrations/new.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 19bebe4d4..5fb9371d6 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -21,11 +21,11 @@ .both .left=t('activerecord.attributes.user.password') .right - = f.text_field :password, :id => 'password', :class => "registartion-input #{password_error ? 'registartion-input-error' : ''}" + = f.password_field :password, :id => 'password', :class => "registartion-input #{password_error ? 'registartion-input-error' : ''}" .both .left=t('activerecord.attributes.user.password_confirm') .right - = f.text_field :password_confirmation, :id => 'password2', :class => "registartion-input #{password_error ? 'registartion-input-error' : ''}" + = f.password_field :password_confirmation, :id => 'password2', :class => "registartion-input #{password_error ? 'registartion-input-error' : ''}" .both .in =f.submit t("layout.devise.shared_links.sign_up"), :class => 'button', :id => 'btnLogin' From 556c2055b4908d052fab2b5d39857eb26aa2d340 Mon Sep 17 00:00:00 2001 From: Vladimir Sharshov Date: Mon, 19 Mar 2012 18:48:54 +0400 Subject: [PATCH 20/20] Enable unicorn zero time deploy --- lib/recipes/unicorn.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/recipes/unicorn.rb b/lib/recipes/unicorn.rb index 880005cbe..388c48902 100644 --- a/lib/recipes/unicorn.rb +++ b/lib/recipes/unicorn.rb @@ -18,8 +18,9 @@ Capistrano::Configuration.instance(:must_exist).load do run "#{try_sudo} kill -s USR2 `cat #{unicorn_pid}`" rescue warn 'deploy:reload FAILED' end task :restart, :roles => :app, :except => { :no_release => true } do - stop - start # blue pill will do it? + reload + #stop + #start # blue pill will do it? end end end