You are here: Home > Latest news from Darcs > Displays revision number for wiki source

Revision 20080326211140-9043f-98f4ef...

Displays revision number for wiki source

app/views/wiki/raw.rhtml
db/translation/pt-BR.rb
test/functional/wiki_controller_test.rb

Changes to raw.rhtml

1
<% pagetext(@page.title, '(Raw wiki text)'.t) do %>
<% pagetext(@page.title, @page.position ? '(Raw wiki text from revision %s)' / @page.position.to_s : '(Raw wiki text)'.t) do %>
1
2
  <% cache(:controller=> 'wiki', :action => 'raw', :page => @page.name,
  <% cache(:controller=> 'wiki', :action => 'raw', :page => @page.name,
2
3
           :revision => @page_revision_id, :locale_suffix => @locale) do %>
           :revision => @page_revision_id, :locale_suffix => @locale) do %>
3
4
    <pre class="wikisource"><%= h(@page.text) -%></pre>
    <pre class="wikisource"><%= h(@page.text) -%></pre>
4

Changes to pt-BR.rb

36
'Features' => 'Sugestões',
'Features' => 'Sugestões',
36
37
'Events' => 'Eventos',
'Events' => 'Eventos',
37
38
'(Raw wiki text)' => '(Texto original)',
'(Raw wiki text)' => '(Texto original)',
38
 
'(Raw wiki text from revision %s)' => '(Texto original da revisão %s)',
39
39
40
40
# Source revision details page
# Source revision details page
41
41
'Revision details' => 'Detalhes de revisão', 
'Revision details' => 'Detalhes de revisão', 
42

Changes to wiki_controller_test.rb

505
    assert_xml_element %{//a[@href = "#{@controller.url_for(:only_path => true, :action => 'raw', :page_name => page.name, :revision => '2')}"]}
    assert_xml_element %{//a[@href = "#{@controller.url_for(:only_path => true, :action => 'raw', :page_name => page.name, :revision => '2')}"]}
505
506
    get :raw, :page_name => page.name, :revision => '2'
    get :raw, :page_name => page.name, :revision => '2'
506
507
    assert_tag :pre, :content => page.revisions[1].text
    assert_tag :pre, :content => page.revisions[1].text
507
 
    assert_xml_element '//div[@class="page-title"]/span[text() = "(Raw wiki text from revision 2)" and @id="revision"]'
508
508
  end
  end
509
509
510
510
  def test_does_not_display_revision_label_when_simply_displaying_a_page
  def test_does_not_display_revision_label_when_simply_displaying_a_page
511