PublishPageProposal¶
- people need to upload files as part of the publish process
- people want more feedback and less upload errors
Proposed flow¶
We'll have a "prepublish" form with just the captcha in it, and a bit of info. We can invite the user to log in or create an account, and talk a bit about the security implications of the choice (perhaps in a javascript flap-out thing).
Entering the captcha data creates a new Article record in the database with the state "new".
The user is redirected to the "new" page.
At the top of the "new" page is an HTML5 multi-file upload form, so the user can start uploading stuff while they fill in the form fields. I've already done some experiments with this, it works really well although I haven't yet tested the old-tech fallbacks.
As file uploads happen, a progress bar shows what's going on with them.
As file uploads complete, a thumbnail is displayed in the page showing whatever's going on - creation of video thumbnails, photo thumbnails, etc.
The actual video encoding will need to be handed off to the video processor in the normal way.
The user fills in the textual form fields - title, summary, body, tags, place tags, author, etc.
The user hits submit:
- if all file uploads are complete, the Content record is re-saved with the new information, in state "published"
- if all file uploads are not yet complete, the user is told to chill out and wait for it
Benefits¶
- Captchas never fail, or at least they fail right at the start before they can piss the user off too much (like after a video upload)
- The user gets reminded about their login status right at the start of the process, providing better security / convenience awareness
- File uploads happen while the user is filling out the publish form
- Progress bar feedback is provided on uploads
- Multiple-file selection is possible on uploads, so the user can select, say, 15 photos at once off their hard drive instead of having to select each one individually
Code changes needed to pull this off¶
Add a "prepublish" action to the ContentController with appropriate views for each Content subclass, and do the captcha validation here.
Question - how will tumbles work? i guess they can work pretty much as they do now, really - probably the tumbles thing will be better solved with an app anyway.
Add a state machine to Content to keep track of moderation status, with the following states:- new
- published
- promoted
- featured
- hidden
Add mime type detection so users don't need to differentiate between the different kinds of files they're uploading. Files should be automatically handled based on mime type, the current system sucks and i never intended it to be set up in the crappy way that it is for so long, it was supposed to be temporary.
The controller action will need to assess what each file upload is, verify it against arrays of known file types, and hand the file off to an appropriate processor method.
We'll need a scheduled task which goes and deletes "new" database records which are older than, say, 24 hours, to deal with orphaned/unfinished articles where the user never finished constructing the article.
Problems¶
The workflow detailed above has implications for how video uploads happen - currently, videos can be uploaded in either their own form or as part of an article, and they get validated on :title, :published_by, and :body (as well as needing to have a file). The workflow above opens up the question of what we want to do with Video as a content type - should it continue to work as it does now (in which case everything is gonna get way more complex in the above upload scenario) or should we just require Video to be uploaded as part of an Article? If we take the latter option (Video must be attached to an Article), then what will happen to all existing, already-uploaded Videos?