You are here: Home > Latest news from Darcs > Formats and beautifies parsing error message

Revision 20080329005325-9043f-075649...

Formats and beautifies parsing error message

app/helpers/application_helper.rb
public/stylesheets/motiro.css
test/functional/wiki_controller_test.rb

Changes to application_helper.rb

72
    begin
    begin
72
73
      @renderer.render_wiki_text(text)
      @renderer.render_wiki_text(text)
73
74
    rescue
    rescue
74
75
      content_tag(:div, ('The following wiki code contains an error that ' +
    content_tag(:div,
75
76
                         'prevents it from being correctly formatted.').t,
                  image_tag('error.png') +
76
77
                  :class => 'wikierror') +
                  content_tag(:p, ('The following wiki code contains an ' +
77
 
                                   'error that prevents it from being ' +
78
 
                                   'correctly formatted.').t),
79
 
                :class => 'message wikierror') +
80
78
      content_tag(:pre, h(text), :class => 'wikisource')
      content_tag(:pre, h(text), :class => 'wikisource')
81
79
    end
    end
82
80
  end
  end
83

Changes to motiro.css

50
    display: table;
    display: table;
50
51
}
}
51
52
52
 
div.pagetext div.wikierror {
53
 
    border: 1px solid #ff6330;
54
 
    background-color: #eeeeb0;
55
 
    width: 28em;
56
 
}
57
 
58
53
div.message img {
div.message img {
59
54
    float: left;
    float: left;
60
55
    margin: 0 .2em .1em .2em;
    margin: 0 .2em .1em .2em;
61

Changes to wiki_controller_test.rb

532
                           :done => '0',
                           :done => '0',
532
533
                           :kind => 'common', :editors => '' }
                           :kind => 'common', :editors => '' }
533
534
    follow_redirect
    follow_redirect
534
535
    assert_tag :div, :attributes => { :class => "wikierror" }
    assert_tag :div, :attributes => { :class => "message wikierror" }
535
536
    assert_tag :pre, :content => ''
    assert_tag :pre, :content => ''
536
537
  end
  end
537
538
538