diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2010-09-27 00:00:16 +0200 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2010-09-27 00:00:16 +0200 |
commit | a426a6ca80e633fbf5e548ec78979d9d35e9dcfb (patch) | |
tree | 0b7db8c0c070ad2f362a76ce3aca922afcb2eaaa /error.cgi | |
parent | 8a4a2128e3c4bd7f2e1ac94e99f4a46447e66c24 (diff) |
error pages have unified look
Diffstat (limited to 'error.cgi')
-rwxr-xr-x | error.cgi | 35 |
1 files changed, 5 insertions, 30 deletions
@@ -19,32 +19,8 @@ # along with dudle. If not, see <http://www.gnu.org/licenses/>. # ############################################################################ -require "cgi" -$cgi = CGI.new -require 'gettext' -require 'gettext/cgi' -include GetText -GetText.cgi=$cgi -GetText.output_charset = 'utf-8' -require "locale" - -GetText.bindtextdomain("dudle",:path => "./locale/") - -require "config" - -require "html" - -title = _("Error") -$h = HTML.new(title) -$h.add_css("/#{DEFAULT_CSS}","default",true) -$h << <<END -<div id='header1'></div> -<div id='header2'></div> -<div id='header3'></div> -<div id='main'> -<div id='content'> -<h1>#{title}</h1> -END +require "dudle" +$d = Dudle.new(:title => _("Error"), :hide_lang_chooser => true) def urlescape(str) CGI.escapeHTML(CGI.escape(str).gsub("+","%20")) @@ -69,19 +45,18 @@ end errormessagebody = _("Hi!\n\nI found a bug in your application at %{urlofsite}.\nI did the following:\n\n<please describe what you did>\n<e.g., I wanted to sent a comment to the poll.>\n\nI am using <please state your browser and operating system>\n%{errormessage}\nYours,\n") % {:errormessage => errormessage, :urlofsite => SITEURL} subject = _("Bug in dudle") - $h << _("An error occured while executing dudle.<br/>Please send an error report, including your browser, operating system, and what you did to %{admin}.") % {:admin => "<a href='mailto:#{BUGREPORTMAIL}?subject=#{urlescape(subject)}&body=#{urlescape(errormessagebody)}'>#{BUGREPORTMAIL}</a>"} + $d << _("An error occured while executing dudle.<br/>Please send an error report, including your browser, operating system, and what you did to %{admin}.") % {:admin => "<a href='mailto:#{BUGREPORTMAIL}?subject=#{urlescape(subject)}&body=#{urlescape(errormessagebody)}'>#{BUGREPORTMAIL}</a>"} if (errorstr) errorheadstr = _("Please include the following as well:") - $h << <<ERROR + $d << <<ERROR <br/> #{errorheadstr} <pre style='background:#DDD;padding : 1em'>#{CGI.escapeHTML(errorstr)}</pre> ERROR end -$h << "</div></div>" -$h.out($cgi) +$d.out if AUTO_SEND_REPORT |