Move html markup of WikiCloth exception from locales to controller

This commit is contained in:
Julius 2013-12-22 18:09:40 +01:00
parent 496a250495
commit 42e983f7ee
3 changed files with 3 additions and 3 deletions

View file

@ -1167,7 +1167,7 @@ de:
title_list: Seiten-Liste title_list: Seiten-Liste
body: body:
title_toc: Inhalt title_toc: Inhalt
wikicloth_exception: <span class="alert alert-error">Entschuldigung, ein Fehler ist aufgetreten. Möglicherweise ist ein ungewöhnlicher Text die Ursache. Bearbeiten der Seite kann helfen, diesen Fehler zu beseitigen.</span> wikicloth_exception: Entschuldigung, ein Fehler ist aufgetreten. Möglicherweise ist ein ungewöhnlicher Text die Ursache. Bearbeiten der Seite kann helfen, diesen Fehler zu beseitigen.
create: create:
notice: Seite wurde angelegt notice: Seite wurde angelegt
cshow: cshow:

View file

@ -1171,7 +1171,7 @@ en:
title_list: List of pages title_list: List of pages
body: body:
title_toc: Content title_toc: Content
wikicloth_exception: <span class="alert alert-error">An error occured. Sorry for that. It might be that the wiki syntax has been used in an unusual way. Please try to edit the page to get rid of this error.</span> wikicloth_exception: An error occured. Sorry for that. It might be that the wiki syntax has been used in an unusual way. Please try to edit the page to get rid of this error.
create: create:
notice: Page was created notice: Page was created
cshow: cshow:

View file

@ -5,7 +5,7 @@ module PagesHelper
render_opts = {:locale => I18n.locale} # workaround for wikicloth 0.8.0 https://github.com/nricciar/wikicloth/pull/59 render_opts = {:locale => I18n.locale} # workaround for wikicloth 0.8.0 https://github.com/nricciar/wikicloth/pull/59
WikiCloth.new({:data => body+"\n", :link_handler => Wikilink.new, :params => {:referer => title}}).to_html(render_opts).html_safe WikiCloth.new({:data => body+"\n", :link_handler => Wikilink.new, :params => {:referer => title}}).to_html(render_opts).html_safe
rescue rescue
t('.wikicloth_exception').html_safe # try the following with line breaks: === one === == two == = three = "<span class='alert alert-error'>#{t '.wikicloth_exception'}</span>".html_safe # try the following with line breaks: === one === == two == = three =
end end
def link_to_wikipage(page, text = nil) def link_to_wikipage(page, text = nil)