aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xaccess_control.rb9
-rw-r--r--dudle.css2
-rwxr-xr-xedit_columns.rb10
-rw-r--r--html.rb1
-rwxr-xr-xindex.cgi2
-rwxr-xr-xinvite_participants.rb76
-rw-r--r--poll.rb4
-rw-r--r--timepollhead.rb2
8 files changed, 90 insertions, 16 deletions
diff --git a/access_control.rb b/access_control.rb
index c50f08a..fb00673 100755
--- a/access_control.rb
+++ b/access_control.rb
@@ -25,7 +25,14 @@ if __FILE__ == $0
$cgi = CGI.new
-load "../html.rb"
+olddir = File.expand_path(".")
+Dir.chdir("..")
+load "html.rb"
+load "config.rb"
+Dir.chdir(olddir)
+
+
+
acusers = {}
diff --git a/dudle.css b/dudle.css
index e541010..632ba69 100644
--- a/dudle.css
+++ b/dudle.css
@@ -157,7 +157,7 @@ html {
margin-right:auto;
width:auto;
display: table;
- min-width: 35em;
+ min-width: 45em;
}
div#tabs{
diff --git a/edit_columns.rb b/edit_columns.rb
index c6cd967..fbeed1c 100755
--- a/edit_columns.rb
+++ b/edit_columns.rb
@@ -42,8 +42,6 @@ class << Time
end
end
-acusers = {}
-
revbeforeedit = VCS.revno
if $cgi.include?("undo_revision") && $cgi["undo_revision"].to_i < revbeforeedit
@@ -56,14 +54,6 @@ else
table = YAML::load_file("data.yaml")
end
-# TODO: move to own tab
-#if $cgi.include?("add_participant")
-# if $cgi.include?("delete_participant")
-# table.delete($cgi["olduser"])
-# else
-# table.add_participant($cgi["olduser"],$cgi["add_participant"],{})
-# end
-#end
table.edit_column($cgi["columnid"],$cgi["new_columnname"],$cgi) if $cgi.include?("new_columnname")
table.delete_column($cgi["deletecolumn"]) if $cgi.include?("deletecolumn")
diff --git a/html.rb b/html.rb
index 6f296cd..f7c9c5f 100644
--- a/html.rb
+++ b/html.rb
@@ -88,6 +88,7 @@ module Dudle
["History","history.cgi"],
["",""],
["Edit Columns","edit_columns.cgi"],
+ ["Invite Participants","invite_participants.cgi"],
["Access Control","access_control.cgi"],
["Delete Poll","delete_poll.cgi"],
["",""],
diff --git a/index.cgi b/index.cgi
index 651fa33..aa6d062 100755
--- a/index.cgi
+++ b/index.cgi
@@ -54,7 +54,7 @@ if $cgi.include?("create_poll")
VCS.init
File.symlink("../participate.rb","index.cgi")
VCS.add("index.cgi")
- ["atom","customize", "history", "edit_columns","access_control", "delete_poll"].each{|f|
+ ["atom","customize", "history", "edit_columns","access_control", "delete_poll", "invite_participants"].each{|f|
File.symlink("../#{f}.rb","#{f}.cgi")
VCS.add("#{f}.cgi")
}
diff --git a/invite_participants.rb b/invite_participants.rb
new file mode 100755
index 0000000..15c7dd1
--- /dev/null
+++ b/invite_participants.rb
@@ -0,0 +1,76 @@
+#!/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 <http://www.gnu.org/licenses/>. #
+############################################################################
+
+require "yaml"
+require "cgi"
+
+
+if __FILE__ == $0
+
+$cgi = CGI.new
+
+olddir = File.expand_path(".")
+Dir.chdir("..")
+require "html"
+load "config.rb"
+require "poll"
+Dir.chdir(olddir)
+# BUGFIX for Time.parse, which handles the zone indeterministically
+class << Time
+ alias_method :old_parse, :parse
+ def Time.parse(date, now=self.now)
+ Time.old_parse("2009-10-25 00:30")
+ Time.old_parse(date)
+ end
+end
+
+
+table = YAML::load_file("data.yaml")
+
+# TODO: move to own tab
+#if $cgi.include?("add_participant")
+# if $cgi.include?("delete_participant")
+# table.delete($cgi["olduser"])
+# else
+# table.add_participant($cgi["olduser"],$cgi["add_participant"],{})
+# end
+#end
+
+$html = HTML.new("dudle - #{table.name} - Invite Participants")
+$html.header["Cache-Control"] = "no-cache"
+load "../charset.rb"
+$html.add_css("../dudle.css")
+
+$html << "<body>"
+$html << Dudle::tabs("Invite Participants")
+
+$html << <<TABLE
+ <div id='main'>
+ <h1>#{table.name}</h1>
+ <h2>Invite or Delete Participants</h2>
+ #{table.to_html}
+TABLE
+
+$html << "</div></body>"
+
+$html.out($cgi)
+end
+
diff --git a/poll.rb b/poll.rb
index b74bf08..dfb676f 100644
--- a/poll.rb
+++ b/poll.rb
@@ -60,7 +60,7 @@ class Poll
end
end
- def to_html(edituser, showparticipation = true)
+ def to_html(edituser = "", showparticipation = true)
ret = "<table border='1' summary='Main Poll table'>\n"
ret += @head.to_html
@@ -176,7 +176,7 @@ class Poll
ret += "<input type='submit' value='Save Changes' />"
ret += "<br /><input style='margin-top:1ex' type='submit' name='delete_participant' value='Delete User' />"
else
- ret += "<input type='submit' value='Add User' />"
+ ret += "<input type='submit' value='Save' />"
end
ret += "</td>\n"
diff --git a/timepollhead.rb b/timepollhead.rb
index 37202af..6b77afb 100644
--- a/timepollhead.rb
+++ b/timepollhead.rb
@@ -344,7 +344,7 @@ END
ret += "<input type='hidden' name='columnid' value='#{TimeString.new(d,nil).to_s}' />"
end
ret += <<END
- <input type="text" name='columntime' title='e.g.: 09:30, morning, afternoon' maxlength="7" style="width: 7ex" /><br />
+ <input type="text" name='columntime' title='e.g.: 09:30, morning, afternoon' style="width: 7ex" /><br />
<input type="submit" value="Add" style="width: 100%" />
</div>
</form>