From: ivan Date: Tue, 17 Apr 2001 18:10:23 +0000 (+0000) Subject: new, more readable table.html from JD X-Git-Tag: STAFF_0_4~1 X-Git-Url: http://git.freeside.biz/gitweb/?p=staff.git;a=commitdiff_plain;h=ac945f592a2c42f23f709c3d65e74c5eb1d4855e new, more readable table.html from JD --- diff --git a/TODO b/TODO index 771ae48..bba92ca 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,8 @@ +the kludge which greps for inputbox("field") in template to find valid form +fields doesn't work when there are multiple inputbox'es on a line. perhaps +it is time to come up with something that's not a kludge - but what? have +user specify all the field names explicitly, elsewhere? + here's a one-liner to find duplicate inputbox'es: grep inputbox staffing.html | perl -pe '/inputbox\(\"(.*)\"\)/ or die; $_="$1\n";' | sort | uniq -d @@ -49,3 +54,45 @@ easier. Nothing like feature creep, eh? :-) Cheers, Rob +On Tue, Dec 19, 2000 at 07:53:19PM -0800, goolie wrote: +> +> Ivan, +> +> Tell me... how hard would it be to get this staffsheet thing to print out +> names and the times their supposed to work? Pretty hard, huh? I'm just +> curious... + +to do it "right", as in, have the staffsheet know about *time*. that +wouldn't be trivial. that's my long-term project, where you layout the +staff sheet with an html interface, and it knows what time each signup box +is. + +however, if you could, say, add a field to each { inputbox } which is just +what you wanted to print out on the slip... that i could do without a lot +of work. + +so right now, inputbox'es look like: + + { inputbox("shift_name"); } + +and instead, they would look like: + + { inputbox("shift_name", "shift time etc. to print on slip" ); } + +and i could print slips with people's names/emails, the extra stuff above +and something standard that goes on each slip... + +how's that work for you? + +> And then, how hard would "search" functionality be, so i could search for +> my name... + +the quick kludge answer: you could grep the data directory? the filenames +correspond to the inputbox tags you define, so... + +something else...? + +-- +meow + + diff --git a/table.html b/table.html index 0ddf7ae..c89b9b5 100644 --- a/table.html +++ b/table.html @@ -1,199 +1,165 @@ - - - +Staffing Sheet + -Viberation - - - - + - - - -
- - - -
- - - - - - - - - - -
- -  
-  
- - - - - -{ form(); } +

Staffing Sheet

-

{ warnings(); }

+

Jump to documentation

-


-show results in printable format

+

{ form(); }

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

{ warnings(); }

+ +
Time - Door - Parking - Time -
9pm - 10pm{ inputbox("Door 1"); }{ inputbox("Park 1"); } 9pm - 10pm
10pm - 11pm{ inputbox("Park 2"); }10pm - 11pm
11pm - 12am{ inputbox("Door 2"); }{ inputbox("Park 3"); }11pm - 12am
12am - 1am{ inputbox("Park 4"); }12am - 1am
1am - 2am{ inputbox("Door 3"); }{ inputbox("Park 5"); }1am - 2am
2am - 3am{ inputbox("Park 6"); }2am - 3am
3am - 4am{ inputbox("Door 5"); }{ inputbox("Park 7"); }3am - 4am
4am - 5am{ inputbox("Park 8"); }4am - 5am
5am - 6am  5am - 6am
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Time + Door 1 + Door 2 + Door 3 + Door 4
8:30{ inputbox("Door-1-A"); }{ inputbox("Door-2-A"); }{ inputbox("Door-3-A"); } 
9:00
9:30
10:00{ inputbox("Door-1-B"); }{ inputbox("Door-2-B"); }{ inputbox("Door-3-B"); }{ inputbox("Door-4-B"); }
10:30
11:00
11:30{ inputbox("Door-1-C"); }{ inputbox("Door-2-C"); }{ inputbox("Door-3-C"); }{ inputbox("Door-4-C"); }
12:00
12:30
1:00{ inputbox("Door-1-D"); }{ inputbox("Door-2-D"); }{ inputbox("Door-3-D"); } 
1:30
2:00
2:30{ inputbox("Door-1-E"); }{ inputbox("Door-2-E"); }{ inputbox("Door-3-E"); }
3:00
3:30
4:00 + cleanup
- +

Don't forget to include your e-mail address in the form!

+
+show results in printable format

+ +
- - -
+

Documentation

Copyright ©2000 Adam Gould
Copyright ©2000 Michal Migurski
-Copyright ©2000 Ivan Kohler
+Copyright ©2000 and 2001 Ivan Kohler
All rights reserved.
-This program is free software; you can redistribute it and or modify it under the terms of the GNU General Public License or the Artistic License. +This program is free software; you can redistribute it and or modify it under +the terms of the GNU General +Public License or the +Artistic License.

+

Above is an example of the Online Staffing Sheet in +action. Names can be modified by typing in the fields. Hitting "Submit" +automatically updates the storage directory.

+ +

Download

+ +

All relevant files are included in the +staff-0.3.tar.gz archive.

+ +

You also need the +Text::Template, +MailTools and +TimeDate perl +modules. +(CPAN +will query, download and build perl modules automatically.)

+ +

Configuration

+ +

Configuring the staffing sheet is easy.

+ +

Front-end changes can be made to the +table.html file, which stores the layout of the +staffing sheet and is used to generate the database file. The table.html file +uses some non-standard tags:

+ +
    +
  • \{ form(); \}
    + Use this tag to start your form instead of the HTML + <FORM> tag. (You should end the form with the normal + </FORM> tag.) + +
  • \{ inputbox("shift"); \}
    + This tag specifies the name of a workshift, as in + \{ inputbox("Door 1"); \}. The text enclosed in the + tag is used as the workshift name, and is used to generate FORM INPUT + fields by the shift.cgi program. Characters allowed within the tag + include spaces, digits, and letters; however the tag cannot begin or end + with a space. To ensure trouble-free use, please keep the tag on + ONE line. For an example of intended use, check the + source of table.html. + +
  • \{ warnings(); \}
    + If, during the time between when you load the form and when you submit + your changes, one of the fields you are changing has been changed by + someone else, your changes will not be accepted and a warning will be + issued next to the input box for that field. You can use the + \{ warnings(); \} tag to return a list of all + warnings, so that you can locate them prominantly on the resulting page. + +
  • Note: old-style + <WORKSHIFT>shift</WORKSHIFT> tags can be + converted to \{ inputbox("shift"); \} tags with the + convert-template.pl program: + ./convert-template.pl old-table-file.html >new-table-file.html. +
+ +

Other than these tags, anything goes. You can (and probably should) include +tables, various types of text formatting, and anything else not covered by the +above restrictions. If you need to use the \{ or +\} characters (the curly braces), you must preceed them with +a \ (backslash). See the +Text::Template +documentation for details on the substitution language.

+ +

Back-end configuration involves editing a few lines in the +shift.cgi file. The $template_file variable must +be set to the full path and name of the front-end table.html file. The +$data_directory must be set to the full path and name of a +directory where the data will be stored. If you want to enable the optional +mail-notification feature (will send email to anyone who has their shift +replaced if they included an email address), set the +$mail_smtpserver variable to the name of an SMTP server which will +relay your messages, set the $mail_from variable to the address +you wish to appear in the From:, Sender: and Reply-To: headers, set the +$mail_subject variable to the subject you wish to appear in the +Subject: header, set the @mail_cc variable to any addresses you +wish Cc:'ed, and set the $mail_footer variable to a message which +will appear at the bottom of all warning messages.
-

- Above is an example of the Online Staffing Sheet in action. Names can be modified by typing in the fields. Hitting "Submit" automatically updates the storage directory. -

- -

Download

- -

All relevant files are included in the staff-0.3.tar.gz archive.

-

You also need the Text::Template, MailTools and TimeDate perl modules. (CPAN will query, download and build perl modules automatically) - - -

Configuration

- -

- Configuring the staffing sheet is easy. -

- -

- Front-end changes can be made to the table.html file, which stores the layout of the staffing sheet and is used to generate the database file. The table.html file uses some non-standard tags: -

    -
  • \{ form(); \}
    - Use this tag to start your form instead of the HTML <FORM> tag. (You should end the form with the normal </FORM> tag.) -
  • \{ inputbox("shift"); \}
    - This tag specifies the name of a workshift, as in \{ inputbox("Door 1"); \}. The text enclosed in the tag is used as the workshift name, and is used to generate FORM INPUT fields by the shift.cgi program. Characters allowed within the tag include spaces, digits, and letters; however the tag cannot begin or end with a space. To ensure trouble-free use, please keep the tag on ONE line. For an example of intended use, check the source of table.html. -
  • \{ warnings(); \}
    - If, during the time between when you load the form and when you submit your changes, one of the fields you are changing has been changed by someone else, your changes will not be accepted and a warning will be issued next to the input box for that field. You can use the \{ warnings(); \} tag to return a list of all warnings, so that you can locate them prominantly on the resulting page. -
  • Note: old-style <WORKSHIFT>shift</WORKSHIFT> tags can be converted to \{ inputbox("shift"); \} tags with the convert-template.pl program: ./convert-template.pl old-table-file.html >new-table-file.html. -
- Other than these tags, anything goes. You can include tables, various types of text formatting, and anything else not covered by the above restrictions. If you need to use the \{ or \} characters (the curly braces), you must preceed them with a \ (backslash). See the Text::Template documentation for details on the substitution language. -

- -

- Back-end configuration involves editing a few lines in the shift.cgi file. The $template_file variable must be set to the full path and name of the front-end table.html file. The $data_directory must be set to the full path and name of a directory where the data will be stored. If you want to enable the optional mail-notification feature (will send email to anyone who has their shift replaced if they included an email address), set the $mail_smtpserver variable to the name of an SMTP server which will relay your messages, set the $mail_from variable to the address you wish to appear in the From:, Sender: and Reply-To: headers, set the $mail_subject variable to the subject you wish to appear in the Subject: header, set the @mail_cc variable to any addresses you wish Cc:'ed, and set the $mail_footer variable to a message which will appear at the bottom of all warning messages.

###
 # user-servicable parts
 ###
@@ -218,73 +184,70 @@ END
 # end of user-servicable parts
 ###
 
- -

Use

- -

- To use the files, install shift.cgi in a public web directory as a CGI program. (probably by placing it in a cgi-bin directory or using AddHandler). Permissions for all files must be set correctly. To make the shift.cgi excecutable, set its permissions to 755 (rwxr-xr-x):
-

chmod 755 shift.cgi

- To create the the data directory:
-
mkdir /path/to/data_dir

- The data directory needs to be writable by the user executing the CGI. It's probably best to simply make the data directory owned by the user as which shift.cgi runs (probably the user as which the web server answers requests, unless you are using suEXEC), and set its permissions to 755:
-
chown httpd /path/to/data_dir
-chmod 755 /path/to/data_dir
-

- -

Help

- -

- -

- -

Development

- -
    -
  • Anonymous CVS access:
    CVSROOT is :pserver:anonymous@cleanwhisker.420.am:/home/cvs/cvsroot
    The password for the user anonymous is anonymous.
    The module name is staff.
    So to check out the current tree, you would do (bash):
    + +

    Use

    + +

    To use the files, install shift.cgi in a public web +directory as a CGI program. (probably by placing it in a +cgi-bin +directory or using +AddHandler). +Permissions for all files must be set correctly. To make the +shift.cgi excecutable, set its permissions to 755 +(rwxr-xr-x):
    + +

    chmod 755 shift.cgi

    + +To create the the data directory:
    + +
    mkdir /path/to/data_dir

    + +The data directory needs to be writable by the user executing the CGI. It's +probably best to simply make the data directory owned by the user as which +shift.cgi runs (probably the +user as which the web +server answers requests, unless you are using +suEXEC), and set its +permissions to 755:
    + +
    chown httpd /path/to/data_dir
    +chmod 755 /path/to/data_dir

    + +

    Help

    + + + +

    Development

    + +
      +
    • Anonymous CVS access:
      CVSROOT is + :pserver:anonymous@cleanwhisker.420.am:/home/cvs/cvsroot
      + The password for the user anonymous is anonymous.
      + The module name is staff.
      + So to check out the current tree, you would do (bash):
      $ export CVSROOT=":pserver:anonymous@cleanwhisker.420.am:/home/cvs/cvsroot"
       $ cvs login
       (Logging in to anonymous@cleanwhisker.420.am)
       CVS password:
       $ cvs checkout staff
       
      -
    • Browse the CVS tree online via cvsweb. - -
    • Subscribe to the development mailing list by sending a blank message to stafflist-devel-subscribe@420.am. -
    - - - -
- - - +
  • Browse the CVS tree online via cvsweb. - - -
  • -
    + -
    +
  • Subscribe to the development mailing list by sending a blank message to + + stafflist-devel-subscribe@420.am. + - -