diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index b79be2446..71f4d8ea9 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -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) diff --git a/app/models/key_pair.rb b/app/models/key_pair.rb index 54f306116..ca8a3fe8c 100644 --- a/app/models/key_pair.rb +++ b/app/models/key_pair.rb @@ -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}" diff --git a/app/presenters/comment_presenter.rb b/app/presenters/comment_presenter.rb index ddab23e53..db69cf852 100644 --- a/app/presenters/comment_presenter.rb +++ b/app/presenters/comment_presenter.rb @@ -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? diff --git a/app/presenters/git_presenters/commit_as_message_presenter.rb b/app/presenters/git_presenters/commit_as_message_presenter.rb index 2d611d04e..26bc17c7b 100644 --- a/app/presenters/git_presenters/commit_as_message_presenter.rb +++ b/app/presenters/git_presenters/commit_as_message_presenter.rb @@ -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 diff --git a/app/views/user_mailer/issue_assign_notification.en.haml b/app/views/user_mailer/issue_assign_notification.en.haml index 3aa4a049a..91522375b 100644 --- a/app/views/user_mailer/issue_assign_notification.en.haml +++ b/app/views/user_mailer/issue_assign_notification.en.haml @@ -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' \ No newline at end of file diff --git a/app/views/user_mailer/issue_assign_notification.ru.haml b/app/views/user_mailer/issue_assign_notification.ru.haml index 5b5dcd7d5..616f120de 100644 --- a/app/views/user_mailer/issue_assign_notification.ru.haml +++ b/app/views/user_mailer/issue_assign_notification.ru.haml @@ -1,7 +1,3 @@ -%p== Здравствуйте, #{@user.user_appeal}. - - %p Вам была назначена задача #{ link_to @issue.title, project_issue_url(@issue.project, @issue) } - -= render 'footer' += render 'footer' \ No newline at end of file diff --git a/config/locales/models/advisory.en.yml b/config/locales/models/advisory.en.yml index fe3e1a16f..db8ccbef4 100644 --- a/config/locales/models/advisory.en.yml +++ b/config/locales/models/advisory.en.yml @@ -1,7 +1,7 @@ en: layout: advisories: - atom_header: Advisories + atom_title: Advisories list_header: Advisories form_header: New advisory project_name: Project diff --git a/lib/modules/models/markdown.rb b/lib/modules/models/markdown.rb index 1890b5923..55fe6c288 100644 --- a/lib/modules/models/markdown.rb +++ b/lib/modules/models/markdown.rb @@ -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 diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 95b8fd7f8..72c8674ec 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -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