author links on print page are smart about whether they are being exported or just displayed in the browser

This commit is contained in:
Alexey Verkhovsky 2005-01-30 05:33:05 +00:00
parent c99d675780
commit 5ea3f93bf9
3 changed files with 11 additions and 3 deletions

View file

@ -44,7 +44,11 @@ class WikiController < ApplicationController
end
def export_html
export_pages_as_zip('html') { |page| @page = page; render_to_string 'wiki/print' }
export_pages_as_zip('html') do |page|
@page = page
@link_mode = :export
render_to_string 'wiki/print'
end
end
def export_markup
@ -149,6 +153,7 @@ class WikiController < ApplicationController
end
def print
@link_mode ||= :show
# to template
end

View file

@ -10,5 +10,5 @@
<div class="byline">
<%= @page.revisions? ? "Revised" : "Created" %> on <%= @page.pretty_created_at %>
by
<%= @page.author_link({ :mode => :export }) %>
<%= @page.author_link({ :mode => (@link_mode || :show) }) %>
</div>