Merge branch 'add_wiki_comments' of git://github.com/seeingidog/gitlabhq into seeingidog-add_wiki_comments

Conflicts:
	app/controllers/admin/mailer_controller.rb
	app/controllers/notes_controller.rb
This commit is contained in:
randx 2012-07-25 21:36:30 +03:00
commit 61c85332d2
10 changed files with 117 additions and 1 deletions

View file

@ -0,0 +1,47 @@
class Admin::MailerController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :authenticate_admin!
def preview
end
def preview_note
@note = Note.first
@user = @note.author
@project = @note.project
case params[:type]
when "Commit" then
@commit = @project.commit
render :file => 'notify/note_commit_email', :layout => 'notify'
when "Issue" then
@issue = Issue.first
render :file => 'notify/note_issue_email', :layout => 'notify'
when "Wiki" then
render :file => 'notify/note_wiki_email', :layout => 'notify'
else
render :file => 'notify/note_wall_email', :layout => 'notify'
end
rescue
render :text => "Preview not available"
end
def preview_user_new
@user = User.first
@password = "DHasJKDHAS!"
render :file => 'notify/new_user_email', :layout => 'notify'
rescue
render :text => "Preview not available"
end
def preview_issue_new
@issue = Issue.first
@user = @issue.assignee
@project = @issue.project
render :file => 'notify/new_issue_email', :layout => 'notify'
rescue
render :text => "Preview not available"
end
end

View file

@ -17,6 +17,8 @@ class WikisController < ApplicationController
return render_404 unless can?(current_user, :write_wiki, @project)
end
@note = @project.notes.new(:noteable => @wiki)
respond_to do |format|
if @wiki
format.html