From a8ee935ee3323f74b7add71c167a0a4039857402 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Wed, 28 Oct 2009 16:53:06 +0100 Subject: usability: use invite feature inside the table --- config_poll.rb | 25 ++++++++++--------------- participate.rb | 2 +- poll.rb | 11 +++++------ print.css | 2 +- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/config_poll.rb b/config_poll.rb index e16f9ef..587a260 100755 --- a/config_poll.rb +++ b/config_poll.rb @@ -58,7 +58,13 @@ else acusers[k] = v } - table.invite_delete($cgi["invite_delete"]) if $cgi.include?("invite_delete") and $cgi["invite_delete"] != "" + 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["new_columnname"],$cgi["columndescription"],$cgi["old_columnname"]) if $cgi.include?("new_columnname") table.delete_column($cgi["delete_column"]) if $cgi.include?("delete_column") @@ -129,28 +135,17 @@ $htmlout += <
  •  poll 
  •  config 
  • + HTMLHEAD $htmlout += <

    #{table.name}

    -#{table.to_html($cgi["edituser"],true,$cgi["editcolumn"])} -TABLE - -$htmlout += < -
    - Invite/Delete Participant
    -
    - - -
    + #{table.to_html($cgi["edituser"],true,$cgi["editcolumn"])} -
    - -INVITEDELETE +TABLE # ADD/REMOVE COLUMN $htmlout +=<" ret += "\n" - if config - else + unless config @head.sort.each{|columntitle,columndescription| ret += "
    " } + ret += "
    " [[YES, YESVAL],[NO, NOVAL],[MAYBE, MAYBEVAL]].each{|valhuman, valbinary| @@ -173,8 +172,10 @@ EDITDELETE } ret += "
    " + else + ret += "" end - ret += "" if @data.include?(edituser) ret += "" ret += "
    " @@ -264,13 +265,11 @@ ADDCOMMENT } store "Participant #{name.strip} edited" end - def invite_delete(name) + def delete(name) htmlname = CGI.escapeHTML(name.strip) if @data.has_key?(htmlname) @data.delete(htmlname) store "Participant #{name.strip} deleted" - else - add_participant("",name,{}) end end def store comment diff --git a/print.css b/print.css index 07c6052..caa204e 100644 --- a/print.css +++ b/print.css @@ -42,7 +42,7 @@ td { td.sum, td.date, td.name, td.checkboxes { background-color:Silver; } -div#add_comment,div#edit_column, div#invite_delete, div#history, div#backlink, input.delete_comment_button, tr#add_participant, div#configlink{ +div#add_comment,div#edit_column, div#history, div#backlink, input.delete_comment_button, tr#add_participant, div#configlink{ visibility: collapse; } th { -- cgit v1.2.3