#!/usr/bin/env ruby ############################################################################ # Copyright 2009 Benjamin Kellermann # # # # This file is part of dudle. # # # # Dudle is free software: you can redistribute it and/or modify it under # # the terms of the GNU Affero General Public License as published by # # the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # # Dudle is distributed in the hope that it will be useful, but WITHOUT ANY # # WARRANTY; without even the implied warranty of MERCHANTABILITY or # # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public # # License for more details. # # # # You should have received a copy of the GNU Affero General Public License # # along with dudle. If not, see . # ############################################################################ require "cgi" if __FILE__ == $0 $cgi = CGI.new load "../html.rb" $html = HTML.new("dudle - Customize") load "../charset.rb" $html.header["Cache-Control"] = "no-cache" $html.add_css("../dudle.css") $html << < #{Dudle::tabs("Customize")}

Customize Personal Settings

You need cookies enabled in order to personalize your settings. END $html << <

Charset

CHARSET [["Use normal strings","ascii"], ["Use special characters (#{UTFCHARS})","utf"]].each{|description,href| selected = href == (USEUTF ? "utf" : "ascii") $html << "" } $html << < CHARSET $html << <

Stylesheet

    CHARSET [["default","dudle.css"], ["PrimeLife","primelife.css"], ["TU Dresden","tud.css"]].each{|descr,cssfile| $html << "
  • #{descr}
  • " } $html << < CHARSET username = $cgi.cookies["username"][0] if $cgi.include?("delete_username") username = "" $html.add_cookie("username",username,"/",Time.now - 1*60*60*24*365) elsif $cgi.include?("username") username = $cgi["username"] $html.add_cookie("username",username,"/",Time.now + 1*60*60*24*365) end $html << <

    Default Username

    CHARSET $html << "" $html << "" $html.out($cgi) end
Current Setting Description
" $html << CROSS if selected $html << "" $html << "" unless selected $html << description $html << "" unless selected $html << "