comparison app/controllers/wiki_controller.rb @ 1517:dffacf8a6908 redmine-2.5

Update to Redmine SVN revision 13367 on 2.5-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:29:00 +0100
parents e248c7af89ec
children
comparison
equal deleted inserted replaced
1516:b450a9d58aed 1517:dffacf8a6908
275 redirect_to_referer_or history_project_wiki_page_path(@project, @page.title) 275 redirect_to_referer_or history_project_wiki_page_path(@project, @page.title)
276 end 276 end
277 277
278 # Export wiki to a single pdf or html file 278 # Export wiki to a single pdf or html file
279 def export 279 def export
280 @pages = @wiki.pages.all(:order => 'title', :include => [:content, {:attachments => :author}]) 280 @pages = @wiki.pages.
281 order('title').
282 includes([:content, {:attachments => :author}]).
283 all
281 respond_to do |format| 284 respond_to do |format|
282 format.html { 285 format.html {
283 export = render_to_string :action => 'export_multiple', :layout => false 286 export = render_to_string :action => 'export_multiple', :layout => false
284 send_data(export, :type => 'text/html', :filename => "wiki.html") 287 send_data(export, :type => 'text/html', :filename => "wiki.html")
285 } 288 }
286 format.pdf { 289 format.pdf {
287 send_data(wiki_pages_to_pdf(@pages, @project), :type => 'application/pdf', :filename => "#{@project.identifier}.pdf") 290 send_data(wiki_pages_to_pdf(@pages, @project),
291 :type => 'application/pdf',
292 :filename => "#{@project.identifier}.pdf")
288 } 293 }
289 end 294 end
290 end 295 end
291 296
292 def preview 297 def preview
349 extend helper unless self.instance_of?(helper) 354 extend helper unless self.instance_of?(helper)
350 helper.instance_method(:initial_page_content).bind(self).call(page) 355 helper.instance_method(:initial_page_content).bind(self).call(page)
351 end 356 end
352 357
353 def load_pages_for_index 358 def load_pages_for_index
354 @pages = @wiki.pages.with_updated_on.reorder("#{WikiPage.table_name}.title").includes(:wiki => :project).includes(:parent).all 359 @pages = @wiki.pages.with_updated_on.
360 reorder("#{WikiPage.table_name}.title").
361 includes(:wiki => :project).
362 includes(:parent).
363 all
355 end 364 end
356 end 365 end