Author: hhubner Date: 2006-03-05 09:02:00 -0500 (Sun, 05 Mar 2006) New Revision: 1888
Added: branches/xml-class-rework/projects/lisp-ecoop/website/static/document-utils.css branches/xml-class-rework/projects/lisp-ecoop/website/static/document-utils.js branches/xml-class-rework/projects/lisp-ecoop/website/templates/upload.xml Modified: branches/xml-class-rework/projects/lisp-ecoop/src/handlers.lisp branches/xml-class-rework/projects/lisp-ecoop/src/lisp-ecoop.asd branches/xml-class-rework/projects/lisp-ecoop/src/packages.lisp branches/xml-class-rework/projects/lisp-ecoop/src/participant.lisp branches/xml-class-rework/projects/lisp-ecoop/src/tags.lisp branches/xml-class-rework/projects/lisp-ecoop/src/webserver.lisp branches/xml-class-rework/projects/lisp-ecoop/website/static/javascript.js branches/xml-class-rework/projects/lisp-ecoop/website/static/styles.css branches/xml-class-rework/projects/lisp-ecoop/website/templates/edit-profile.xml branches/xml-class-rework/projects/lisp-ecoop/website/templates/edit-submission.xml branches/xml-class-rework/projects/lisp-ecoop/website/templates/submission.xml branches/xml-class-rework/projects/lisp-ecoop/website/templates/toplevel.xml Log: Numerous changes to support the new data model with multiple documents per submission.
Modified: branches/xml-class-rework/projects/lisp-ecoop/src/handlers.lisp =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/src/handlers.lisp 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/src/handlers.lisp 2006-03-05 14:02:00 UTC (rev 1888) @@ -2,6 +2,9 @@
(enable-interpol-syntax)
+(defun format-object-id (format object &rest args) + (apply #'format nil format (store-object-id object) args)) + (defmacro with-lisp-ecoop-page ((req title) &body body) `(with-bknr-page (,req :title ,title) ,@body)) @@ -25,7 +28,7 @@ (with-query-params (req login full-name email text) (when (find-user login) (error "user ~A already exists" login)) - (make-participant login :full-name full-name :email email :text text :submission-pathname (request-uploaded-file req "submission")) + (make-participant login :full-name full-name :email email :text text :document-pathname (request-uploaded-file req "document")) (with-lisp-ecoop-page (req "Pariticpant created") "The participant has been created in the database and a welcome mail has been sent.")))
@@ -54,15 +57,50 @@
(defclass pdf-handler (object-handler) () - (:default-initargs :class 'submission)) + (:default-initargs :class 'document))
-(defmethod handle-object ((handler pdf-handler) (submission submission) req) - (let ((pdf (file-contents (blob-pathname submission)))) +(defmethod handle-object ((handler pdf-handler) (document document) req) + (let ((pdf (file-contents (blob-pathname document)))) (with-http-response (req *ent* :content-type "application/pdf") (setf (request-reply-content-length req) (length pdf)) (with-http-body (req *ent* :external-format '(unsigned-byte 8)) (write-sequence pdf net.aserve::*html-stream*)))))
+ +(defclass upload-document-handler (object-handler) + () + (:default-initargs :class 'submission)) + +(defmethod handle-object ((handler upload-document-handler) object req) + (error "Missing object ID")) + +(defmethod handle-object ((handler upload-document-handler) (submission submission) req) + (unless (submission-edit-permitted-p submission) + (error "can't edit this submission")) + (ecase (request-method req) + (:post + (when (request-uploaded-file req "document") + (with-query-params (req info) + (format t "; new document - info ~S~%" info) + (let ((file-name (request-uploaded-file req "document"))) + (with-open-file (pdf file-name) + (if (cl-ppcre:scan "^%PDF-" (read-line pdf)) + (let ((document (make-object 'document :info info :submission submission))) + (blob-from-file document file-name) + (redirect (format-object-id "/upload/~A?success=1" submission) req)) + (redirect (format-object-id "/upload/~A?failure=~A" submission (uriencode-string "Uploaded file does not appear to be a PDF file")) req))))))) + (:get + (redirect (format-object-id "/upload/~A" submission) req)))) + +(defclass delete-document-handler (object-handler) + () + (:default-initargs :class 'document)) + +(defmethod handle-object ((handler delete-document-handler) (document document) req) + (unless (submission-edit-permitted-p (document-submission document)) + (error "can't edit this submission")) + (delete-object document)) + (defclass admin-handler (admin-only-handler page-handler) ())
@@ -74,5 +112,7 @@ ("/add-participant" add-participant-handler) ("/edit-participant" edit-participant-handler) ("/pdf" pdf-handler) + ("/upload-document" upload-document-handler) + ("/delete-document" delete-document-handler) ("/admin" admin-handler))
Modified: branches/xml-class-rework/projects/lisp-ecoop/src/lisp-ecoop.asd =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/src/lisp-ecoop.asd 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/src/lisp-ecoop.asd 2006-03-05 14:02:00 UTC (rev 1888) @@ -8,12 +8,12 @@ (in-package :lisp-ecoop.system)
(defsystem :lisp-ecoop - :name "worldpay test" + :name "LISP ECOOP Website" :author "Hans Huebner hans@huebner.org" :version "0" :maintainer "Hans Huebner hans@huebner.org" :licence "BSD" - :description "BKNR Test Web Server" + :description "Website for the LISP ECOOP Workshops" :long-description ""
:depends-on (:bknr-modules :cxml :klammerscript)
Modified: branches/xml-class-rework/projects/lisp-ecoop/src/packages.lisp =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/src/packages.lisp 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/src/packages.lisp 2006-03-05 14:02:00 UTC (rev 1888) @@ -58,6 +58,10 @@ #:submission-remove-submitter #:submission-timeslot #:submission-documents + #:submission-edit-permitted-p + + #:document + #:document-info #:timeslot))
(defpackage :lisp-ecoop.tags
Modified: branches/xml-class-rework/projects/lisp-ecoop/src/participant.lisp =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/src/participant.lisp 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/src/participant.lisp 2006-03-05 14:02:00 UTC (rev 1888) @@ -3,9 +3,19 @@ (enable-interpol-syntax)
(define-lisp-ecoop-class document (blob) - ((info :update :documentation "Short information for the document (e.g. 'Slides' or 'Draft Paper')")) - (:default-initargs :type "application/pdf")) + ((info :update :documentation "Short information for the document (e.g. 'Slides' or 'Draft Paper')") + (submission :read :documentation "Submission that this document belongs to")) + (:default-initargs :type "application/pdf" :submission (error ":submission argument missing while creating document")))
+(defmethod initialize-persistent-instance :after ((document document)) + (with-slots (submission) document + (push document (submission-documents submission)))) + +(defmethod destroy-object :before ((document document)) + (with-slots (submission) document + (with-slots (documents) submission + (setf documents (remove document documents))))) + (define-lisp-ecoop-class submission () ((title :update :documentation "Title of the submission" :initform nil :attribute t) (abstract :update :documentation "Abstract or short description" :initform nil :element t) @@ -13,6 +23,13 @@ (timeslot :update :documentation "Timeslot scheduled for this submission" :initform nil :attribute t) (documents :update :documentation "List of documents attached to this submission" :initform nil :element t)))
+(defmethod destroy-object :before ((submission submission)) + (dolist (participant (submission-submitters submission)) + (with-slots (submissions) participant + (setf submissions (remove submission submissions)))) + (mapc #'destroy-object (submission-documents submission)) + (setf (submission-documents submission) nil)) + (defmethod destroy-object :before ((timeslot timeslot)) (when (subtypep (type-of (timeslot-content timeslot)) 'submission) (setf (submission-timeslot (timeslot-content timeslot)) nil))) @@ -20,6 +37,10 @@ (defmethod submission-type ((submission submission)) "Generic submission")
+(defun submission-edit-permitted-p (submission) + (or (admin-p (bknr-request-user *req*)) + (find (bknr-request-user *req*) (submission-submitters submission)))) + (defmethod submission-add-submitter ((submission submission) submitter) (pushnew submitter (submission-submitters submission)) (pushnew submission (participant-submissions submitter))) @@ -131,17 +152,19 @@ (user-login participant) password)))
-(defun make-participant (login &key full-name email text submission-pathname) +(defun make-participant (login &key full-name email text document-pathname) (let* ((initial-password (generate-random-password)) (participant (make-user login :full-name full-name :email email :password initial-password :class 'participant))) (when text (with-transaction ("set participant text") (setf (participant-text participant) text))) - (when submission-pathname - (let ((submission (make-object 'submission))) - (blob-from-file submission submission-pathname) + (when document-pathname + (let* ((submission (make-object 'submission)) + (document (make-object 'document :info "Initial paper"))) + (blob-from-file document document-pathname) (with-transaction ("set participant submission") + (push document (submission-documents submission)) (setf (participant-submissions participant) (list submission))))) (send-welcome-mail participant initial-password) participant))
Modified: branches/xml-class-rework/projects/lisp-ecoop/src/tags.lisp =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/src/tags.lisp 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/src/tags.lisp 2006-03-05 14:02:00 UTC (rev 1888) @@ -53,18 +53,19 @@ (delete-object participant) (html (:h2 "Participant has been deleted")) (return-from profile-editor)))) - (when (request-uploaded-file *req* "submission") - (with-query-params (*req* type title abstract) + (when (request-uploaded-file *req* "document") + (with-query-params (*req* type title abstract info) (format t "; new submission - title ~S abstract ~S~%" title abstract) - (let ((file-name (request-uploaded-file *req* "submission"))) + (let ((file-name (request-uploaded-file *req* "document"))) (with-open-file (pdf file-name) (if (cl-ppcre:scan "^%PDF-" (read-line pdf)) - (let ((submission (make-object (if (equal type "breakout-group-proposal") - 'breakout-group-proposal - 'paper) - :submitters (list participant) :title title :abstract abstract))) - (blob-from-file submission file-name) - (with-transaction ("adding pariticipant submission") + (let* ((submission (make-object (if (equal type "breakout-group-proposal") + 'breakout-group-proposal + 'paper) + :submitters (list participant) :title title :abstract abstract)) + (document (make-object 'document :info info :submission submission))) + (blob-from-file document file-name) + (with-transaction ("adding participant submission") (push submission (participant-submissions participant)))) (html ((:script :language "JavaScript") "alert('Invalid file format of uploaded, only PDF files are accepted')"))))))) (when (request-uploaded-file *req* "picture") @@ -91,24 +92,17 @@ (let ((*participant* participant)) (mapc #'emit-template-node children))))
-(defun submission-info (submission) - (if submission - (dolist (document (submission-documents submission)) - (with-open-file (submission-file (blob-pathname document)) - (format nil "(~D bytes, uploaded ~A)" - (file-length submission-file) - (format-date-time (file-write-date submission-file))))) - "[no submission uploaded]")) +(defun document-file-info (document) + (with-open-file (document-file (blob-pathname document)) + (format nil "(~A, uploaded ~A)" + (scale-bytes (file-length document-file)) + (format-date-time (file-write-date document-file)))))
(defvar *submission*)
(defun submission-from-request () (find-store-object (parse-integer (get-template-var :*path-arg*))))
-(defun submission-edit-permitted-p (submission) - (or (admin-p (bknr-request-user *req*)) - (find (bknr-request-user *req*) (submission-submitters submission)))) - (define-bknr-tag submission-editor (&key children) (let ((submission (submission-from-request))) (unless submission @@ -123,13 +117,15 @@ (delete-object submission) (html (:h2 "The submission has been deleted")) (return-from submission-editor)))) - (when (request-uploaded-file *req* "file") - (let ((file-name (request-uploaded-file *req* "file"))) + (when (request-uploaded-file *req* "document") + (let ((file-name (request-uploaded-file *req* "document"))) (with-open-file (pdf file-name) (cond ((cl-ppcre:scan "^%PDF-" (read-line pdf)) (html (:h2 "New document has been saved")) - (blob-from-file submission file-name)) + (with-query-params (*req* info) + (let ((document (make-object 'document :info info :submission submission))) + (blob-from-file document file-name)))) (t (html ((:script :language "JavaScript") "alert('Invalid file format of uploaded, only PDF files are accepted')"))))))) (with-query-params (*req* title abstract remove-submitter-id add-submitter-id) @@ -181,12 +177,18 @@ (:princ-safe (user-full-name participant))))))))))))))
(define-bknr-tag submission-uploader () - (html (:princ-safe (submission-info *submission*)) :br - ((:button :type "button" :value "show" :onclick (format-object-id "document.location.href = '/submission/~A';" *submission*)) - "show") - :br - "Choose PDF file and press 'upload'" :br - ((:input :type "file" :name "file")) ((:button :type "submit" :name "action" :value "upload") "upload"))) + (html + (:table + (:tbody + (dolist (document (submission-documents *submission*)) + (html + (:tr + (:td (:princ-safe (document-info document))) + (:td (:princ-safe (document-file-info document))) + (:td ((:button :type "button" :value "show" :onclick (format-object-id "document.location.href = '/pdf/~A';" document)) "show") + ((:button :type "button" :value "delete" + :onclick (format-object-id "return delete_document(~A, "~A");" document (document-info document))) "delete")))))))) + (html ((:button :type "button" :value "show" :onclick "return open_document_upload_window()") "upload")))
(define-bknr-tag submission-submitters-chooser () (let ((submitters (submission-submitters *submission*))) @@ -254,7 +256,6 @@ (dolist (submission (participant-submissions *participant*)) (html ((:a :href (format-object-id "/submission/~A" submission)) (:princ-safe (submission-title submission))) " (" (:princ-safe (submission-type submission)) ")" - :br (:princ-safe (submission-info submission)) :br)) (html "[no submission]")))
@@ -340,6 +341,14 @@ (html " " ((:a :href (format-object-id "/edit-submission/~A" submission)) "[Edit]")))))))
+(define-bknr-tag submission-document-links (&key (submission (object-from-request))) + (html + (:h2 "Documents") + (:ul + (dolist (document (submission-documents submission)) + (html (:li ((:a :href (format-object-id "/pdf/~A" document) :target "_new") + (:princ-safe (document-info document)) " " (:princ-safe (document-file-info document))))))))) + (define-bknr-tag load-argument-object (&key children) (let* ((object (object-from-request))) (object-to-template-vars object)
Modified: branches/xml-class-rework/projects/lisp-ecoop/src/webserver.lisp =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/src/webserver.lisp 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/src/webserver.lisp 2006-03-05 14:02:00 UTC (rev 1888) @@ -28,7 +28,8 @@ :destination ,(unix-namestring (merge-pathnames #p"static/" *website-directory*)))) :modules '(user images stats mailinglist mailinglist-registration participants schedule)
- :admin-navigation '(("user" . "/user/") + :admin-navigation '(("add participant" . "/add-participant") + ("user" . "/user/") ("stats" . "/stats") ("post mailinglists" . "/post-mailinglist") ("logout" . "/logout"))
Added: branches/xml-class-rework/projects/lisp-ecoop/website/static/document-utils.css =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/website/static/document-utils.css 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/website/static/document-utils.css 2006-03-05 14:02:00 UTC (rev 1888) @@ -0,0 +1,21 @@ +body { + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; + background-color: #ffffff; +} + +h1 { + font-size: 14pt; + font-weight: bold; +} + +div.page { + position: absolute; + visibility: hidden; + top: 20px; + left: 20px; +} + +label { + width: 200px; + float: left; +} \ No newline at end of file
Added: branches/xml-class-rework/projects/lisp-ecoop/website/static/document-utils.js =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/website/static/document-utils.js 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/website/static/document-utils.js 2006-03-05 14:02:00 UTC (rev 1888) @@ -0,0 +1,47 @@ +// -*- Java -*- Script + +function $(name) +{ + return document.getElementById(name); +} + +function init() +{ + var url = document.location.href; + + // alert('init: ' + url); + + if (url.match("failure=")) { + var message = url.replace(/.*failure=(.*)/, "$1"); + $('error-message').innerHTML = decodeURI(message); + $('failed').style.visibility = 'visible'; + } else if (url.match("success=1")) { + $('success').style.visibility = 'visible'; + window.opener.location.reload(); + setTimeout("window.close()", 1000); + } else { + $('form').style.visibility = 'visible'; + } +} + +function begin_upload() +{ + if ($('info_input').value.match(/^\s*$/)) { + $('info_input').style.backgroundColor = '#f33'; + $('info_input').focus(); + return false; + } + + $('form').style.visibility = 'hidden'; + $('progress').style.visibility = 'visible'; + + var action = document.location.href; + action = action.replace(/upload/, "upload-document"); + + // alert(action); + + $('upload_document_form').action = action; + + return true; +} +
Modified: branches/xml-class-rework/projects/lisp-ecoop/website/static/javascript.js =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/website/static/javascript.js 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/website/static/javascript.js 2006-03-05 14:02:00 UTC (rev 1888) @@ -1,5 +1,33 @@ // -*- Java -*-
+var POPUP_WINDOW_PARAMS = 'width=500,height=300,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes'; + +function http_request(url) +{ + var client; + + if (window.XMLHttpRequest) { + client = new XMLHttpRequest(); + } else { + client = new ActiveXObject("Microsoft.XMLHTTP"); + } + + client.open("GET", url, false); + + try { + if (window.XMLHttpRequest) { + client.send(null); + } else { + client.send(); + } + } + catch (e) { + debug('error sending request: ', e); + } + + return client.responseXML; +} + /* cms support */
function check(button, checkboxname, b) { @@ -24,7 +52,44 @@ /* adding/removing submitters */
function submitters_window(url) { - var submitters_window = open(url, "changesubmitters", "width=200,height=400,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes"); + var submitters_window = open(url, "changesubmitters", POPUP_WINDOW_PARAMS); submitters_window.focus(); return false; } + +/* Check upload parameters */ + +function check_document_upload() +{ + var info_input = document.getElementById('document-info-input'); + if (info_input.value == "") { + alert("Missing document info"); + info_input.focus(); + return false; + } + + return true; +} + +// Open document upload window + +function open_document_upload_window() { + var object_id = parseInt(window.location.href.replace(/.*/(\d+)/, "$1")); + open('/upload-document/' + object_id, 'upload', POPUP_WINDOW_PARAMS); + return false; +} + +// Delete a document + +function delete_document(id, info) { + if (!confirm('Delete document "' + info + '" ?')) { + return false; + } + + http_request('/delete-document/' + id); + + window.location.reload(); + + return true; +} +
Modified: branches/xml-class-rework/projects/lisp-ecoop/website/static/styles.css =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/website/static/styles.css 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/website/static/styles.css 2006-03-05 14:02:00 UTC (rev 1888) @@ -165,8 +165,8 @@ }
div#body div#content { - position: absolute; - left: 180px; + position: absolute; + left: 180px; }
body h1 { @@ -242,4 +242,5 @@
pre { font-family: Times, serif; -} \ No newline at end of file +} +
Modified: branches/xml-class-rework/projects/lisp-ecoop/website/templates/edit-profile.xml =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/website/templates/edit-profile.xml 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/website/templates/edit-profile.xml 2006-03-05 14:02:00 UTC (rev 1888) @@ -62,28 +62,6 @@ <tr> <td colspan="2"><lisp-ecoop:submission-list participant-only="1" /></td> </tr> - <tr><th colspan="2">New Submission</th></tr> - <tr> - <td>Type:</td> - <td> - <select name="type"> - <option value="paper">Paper</option> - <option value="breakout-group-proposal">Breakout Group Proposal</option> - </select> - </td> - </tr> - <tr> - <td>Title:</td> - <td><input type="text" name="title" size="80" /></td> - </tr> - <tr> - <td>Abstract:</td> - <td><textarea name="abstract" cols="76" rows="10"> </textarea></td> - </tr> - <tr> - <td>PDF:</td> - <td><input type="file" name="submission" /><input type="submit" name="action" value="upload" /></td> - </tr> <tr><th colspan="2">Action</th></tr> <tr> <td colspan="2"> @@ -96,11 +74,6 @@ </lisp-ecoop:profile-editor> <p> Please contact <a href="mailto:hans@bknr.net">Hans Hübner</a> for -inquiries relating to the workshop web site. We are interested in -developing the website into a LISP-based system to coordinate -distributed development activities and related real-life meetings -using an incremental development process. See <a -href="/bknr-technology">the Website technology blurb</a> for a -description of the technology used by this web site. +inquiries relating to the workshop web site. </p> </lisp-ecoop:page>
Modified: branches/xml-class-rework/projects/lisp-ecoop/website/templates/edit-submission.xml =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/website/templates/edit-submission.xml 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/website/templates/edit-submission.xml 2006-03-05 14:02:00 UTC (rev 1888) @@ -26,7 +26,7 @@ <td><textarea name="abstract" cols="76" rows="15">$(abstract)</textarea></td> </tr> <tr> - <td>Document (PDF)</td> + <td>Documents (PDF)</td> <td><lisp-ecoop:submission-uploader /></td> </tr> <tr><th colspan="2">Action</th></tr>
Modified: branches/xml-class-rework/projects/lisp-ecoop/website/templates/submission.xml =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/website/templates/submission.xml 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/website/templates/submission.xml 2006-03-05 14:02:00 UTC (rev 1888) @@ -8,6 +8,6 @@ <h1>$(title)</h1> <h2><lisp-ecoop:submission-submitter-links /></h2> <blockquote><pre>$(abstract)</pre></blockquote> - <a href="/pdf/$(object-id)">[Show PDF]</a> + <lisp-ecoop:submission-document-links /> </lisp-ecoop:load-argument-object> </lisp-ecoop:page>
Modified: branches/xml-class-rework/projects/lisp-ecoop/website/templates/toplevel.xml =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/website/templates/toplevel.xml 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/website/templates/toplevel.xml 2006-03-05 14:02:00 UTC (rev 1888) @@ -36,6 +36,7 @@ </div> <div id="content"> <bknr:tag-body /> + <hr class="content-rule"/> </div> </div> </body>
Added: branches/xml-class-rework/projects/lisp-ecoop/website/templates/upload.xml =================================================================== --- branches/xml-class-rework/projects/lisp-ecoop/website/templates/upload.xml 2006-03-03 22:31:33 UTC (rev 1887) +++ branches/xml-class-rework/projects/lisp-ecoop/website/templates/upload.xml 2006-03-05 14:02:00 UTC (rev 1888) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html + xmlns:lisp-ecoop="http://lisp-ecoop06.bknr.net%22%3E + <head> + <title>Upload document</title> + <link rel="stylesheet" type="text/css" href="/static/document-utils.css" /> + <script src="/static/document-utils.js" language="javascript" type="text/javascript"> </script> + </head> + <body class="utility-window" onload="init()"> + <div id="form" class="page"> + <h1>Upload a document</h1> + <p> + Your document needs to be in PDF format. Every document has an attached short + information text which describes the nature of the content. Suggested texts + include "Draft Paper", "Final Paper", "Slides". + </p> + <form method="post" name="upload_document_form" id="upload_document_form" enctype="multipart/form-data" onsubmit="return begin_upload();" action="/upload-document"> + <label for="info">Info text</label><br/> + <input type="text" size="40" maxlength="40" name="info" id="info_input"/><br/> + <label for="document">Document</label><br/> + <input type="file" name="document" value="*.pdf"/><br/> + <button type="submit" name="submit">Upload</button> + </form> + <p> + <a href="#" onclick="window.close();">Cancel</a> + </p> + </div> + <div id="progress" class="page"> + Upload in progress, please wait + </div> + <div id="success" class="page"> + Done uploading + </div> + <div id="failed" class="page"> + <p> + Upload failed: <span id="error-message"> </span> + </p> + <a href="#" onclick="window.close();">Dang!</a> + </div> + </body> +</html>