This has two parts:
* A RelatedDocument model/table that's used to store document relatedness.
* A cron job that populates the table as efficiently as it can.
The cron can run hourly/daily/whatever makes sense. (Maybe during a KB sprint
we can crank it up and normally we can turn it back down.)
The cron does need to run on the master because it does an INSERT...SELECT.
* Convert latin1 tables to utf8 (also give them an explicit collation)
* Add settings for max filename length and validate the form against them.
* Add form validation messages.
* Uploading images through ajax now works (iframe access was denied).
* Alter all filename fields in the db to increase the max_length.
* Organize upload tests better.
* Hide "Allow translations" for documents with existing translations since you can't disallow them.
* Disable the "Localize" side tab if document is not localizable.
* Add Document.save checks for disallowing children if self is not localizable.
* Also politely check and break if trying to disallow children on a document which already has some.
Adds a `kbforums` app, which is a clone of the `forums` app with a few
tweaks:
* The top-level `Forum` model is replaced by `wiki.models.Document`.
* The permissions have been simplified. There are no per-document forum
permissions.
* The `Document` does not track its `last_post`.
* `Post.author` has been renamed to `Post.creator` following our ad hoc
standard.
* The ability to override `Post.created` and `Post.updated`, only used
in the data migration, is gone.
* Moving threads is gone. This needs more thought, and moving to the
`forums` app is non-trivial.
* Videos are identified by title and locale
* Depends on an update in py-wikimarkup which adds support for <video> and <source> tags (py-wikimarkup commit cc06e6d264622891b6b018e8670c9ef4bb12d618)
* Attaches all the _hook_*s to the WikiParser class, because they need a contextual locale.
* Adds locale support for any of the hooks that do document lookup.
* Uses SWFobject JS lib to support flash fallback for video.
* Adds a migration for unique ('locale', 'title') on gallery_video and gallery_image
* Adds a WIKI_VIDEO_WIDTH|HEIGHT constant that may be used as MAX_WIDTH|HEIGHT in the future, once we get video thumbnails.
* Raise FixtureMissingError in test helpers, e.g. on creating media gallery image and wiki revision, instead of creating testuser
* Add ImageUploadForm and VideoUploadForm
* Simplify gallery app's urls.py
* Adds a bunch of gallery utils to create and upload media
* Adds two views up_media_async, del_media_async
* Rename upload_images to upload_imageattachments
* Define a more generic upload_media function to be used by the gallery app
* Document some of our coding conventions
* Add a migration for the video model
* Define a MAX_FILESIZE for video uploads (16 megabytes), overwritable in settings_local.py
* Templates are simply documents with title.startswith('Template:')
* Template args are not wiki parsed
* Document.save() keeps is_template in sync with document.title
* Add a migration for the new is_template column
* Turn {note}{/note} into <div class="note"></div>, and similarly for {warning}
* Turn {menu This is a menu item} into <span class="menu">This is a menu item</span>
* Turn {key X} into <span class="key">X</span>
* Expand {key ctrl+alt+X} into <span class="key">ctrl + <span class="key">alt</span> + <span class="key">X</span>
* Allow for inline templates (there is a check for templates containing newlines in hook_template)
Includes:
* migrations for the models
* a shared abstract model Media for the concrete Image and Video models
* restricting locale choices in the gallery and wiki models
* some check.py complaints and cleanup
* a documentation section for production regarding upload paths
* Also checks for existence of document in parser._getWikiLink
* Add JS support for slug. Uses django's URLify function combined with their jQuery plugin, prepopulate
* Add migration 35 to add the slug column to the model
* Using django's urlquote/urlencode and removing our related sumo tests
If you already ran 31-wiki-app, drop the wiki_document and wiki_revision tables before running 32-wiki-app.
Also:
* Index OS and FF version values, since we'll want to filter by those for document listings.
* Move content_parsed property to Document (which makes more sense), and comment it out. Whoever needs it can uncomment and test it.
* Change table types to InnoDB and charset to utf8.
A forum not having one of the new permissions defined on it via django-authority is considered to grant that permission to the world. (The auth backends we're using have no concept of granting a permission to the world.)
Also:
* cleans up a TODO for edit question in the flagged_question.html template.
* checks if content_object is set before attempting to show it. Downside is that we won't find integrity errors if they occur otherwise, but those shouldn't occur in the first place.