Merge branch 'master' of abf.rosalinux.ru:abf/rosa-build

This commit is contained in:
Vladmir Sharhsov(warpc) 2013-04-10 14:45:19 +04:00
commit 61a19b4e33
9 changed files with 17 additions and 26 deletions

View File

@ -42,7 +42,7 @@ class UserMailer < ActionMailer::Base
end
def issue_assign_notification(issue, user)
@user, @issue = user, issue
@issue = issue
mail(
:to => email_with_name(user, user.email),
:subject => subject_for_issue(@issue)

View File

@ -21,7 +21,9 @@ class KeyPair < ActiveRecord::Base
protected
def check_keys
dir = Dir.mktmpdir('keys-', "#{APP_CONFIG['root_path']}/tmp")
tmp = "#{APP_CONFIG['root_path']}/tmp"
system "sudo chown `whoami` #{tmp} && chmod 1777 #{tmp}"
dir = Dir.mktmpdir('keys-', tmp)
begin
%w(pubring secring).each do |kind|
filename = "#{dir}/#{kind}"

View File

@ -81,7 +81,7 @@ class CommentPresenter < ApplicationPresenter
end
def date
@date ||= I18n.l(@comment.updated_at, :format => :long)
@date ||= I18n.l(@comment.created_at, :format => :long)
end
def comment_id?

View File

@ -13,16 +13,16 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
else
opts[:project]
end
if @project
commit = commit || @project.repo.commit(comment.created_from_commit_hash.to_s(16))
commit = commit || @project.repo.commit(comment.created_from_commit_hash.to_s(16)) if @project
if @project && commit
@committer = User.where(:email => commit.committer.email).first || commit.committer
@commit_hash = commit.id
@committed_date, @authored_date = commit.committed_date, commit.authored_date
@commit_message = commit.message
else
@committer = t('layout.commits.unknown_committer')
@commit_hash = comment.created_from_commit_hash
@commit_hash = comment.created_from_commit_hash.to_s(16)
@committed_date = @authored_date = comment.created_at
@commit_message = t('layout.commits.deleted')
end

View File

@ -1,7 +1,3 @@
%p== Hello, #{@user.user_appeal}.
%p You have been assigned to issue #{ link_to @issue.title, project_issue_url(@issue.project, @issue) }
= render 'footer'
= render 'footer'

View File

@ -1,7 +1,3 @@
%p== Здравствуйте, #{@user.user_appeal}.
%p Вам была назначена задача #{ link_to @issue.title, project_issue_url(@issue.project, @issue) }
= render 'footer'
= render 'footer'

View File

@ -1,7 +1,7 @@
en:
layout:
advisories:
atom_header: Advisories
atom_title: Advisories
list_header: Advisories
form_header: New advisory
project_name: Project

View File

@ -173,7 +173,7 @@ module Modules
def reference_issue(identifier)
if issue = Issue.find_by_hash_tag(identifier, current_ability, @project)
url = project_issue_path(@project.owner, @project.name, issue.serial_id)
url = project_issue_path(issue.project.owner, issue.project.name, issue.serial_id)
title = "#{Issue.model_name.human}: #{issue.title}"
link_to(identifier, url, html_options.merge(title: title, class: "gfm gfm-issue #{html_options[:class]}"))
end
@ -183,15 +183,16 @@ module Modules
issue = Issue.find_by_hash_tag(identifier, current_ability, @project, '!')
if pull_request = issue.pull_request
title = "#{PullRequest.model_name.human}: #{pull_request.title}"
link_to(identifier, project_pull_request_path(@project, pull_request), html_options.merge(title: title, class: "gfm gfm-pull_request #{html_options[:class]}"))
link_to(identifier, project_pull_request_path(pull_request.to_project, pull_request), html_options.merge(title: title, class: "gfm gfm-pull_request #{html_options[:class]}"))
end
end
def reference_commit(identifier)
if commit = @project.repo.commit(identifier)
link_to shortest_hash_id(@commit.id), commit_path(options[:project], @commit.id)
title = GitPresenters::CommitAsMessagePresenter.present(commit, :project => @project).caption
link_to(identifier, commit_path(@project, commit), html_options.merge(title: title, class: "gfm gfm-commit #{html_options[:class]}"))
link_to shortest_hash_id(commit.id), commit_path(@project, commit.id)
title = GitPresenters::CommitAsMessagePresenter.present(commit, :project => @project) do |presenter|
link_to(identifier, commit_path(@project, commit), html_options.merge(title: presenter.caption, class: "gfm gfm-commit #{html_options[:class]}"))
end
end
end
end

View File

@ -64,10 +64,6 @@ describe UserMailer do
@email.from.should == [APP_CONFIG['do-not-reply-email']]
end
it 'should assign user name' do
@email.body.encoded.should match(@user.name)
end
it 'should assign issue title' do
@email.body.encoded.should match(@issue.title)
end