* Register and log the user in right after
* Chowse input on text and UI
* Log the user out right after asking a question if they are not active yet.
* Pull out the common modals CSS into main.css
* Add handle_login and handle_register to share login/register code with users app (see apps/users/utils.py)
* Rename password1 to password so auth.login works properly when registering.
* Use different input ids for the registration form, so registration form and login form can be on the same page and the labels work properly.
* Adds a common function for video/image hooks
* Adds support for modal + placeholder html text + title
* Multiple modals on the same page
* Close modals with escape or by clicking on overlay
* Added a new migration for gallery permissions: add, change, delete
* Draft titles are now abstracted to a constant and a function, get_draft_title
* Edits set the updated_by field
* Use ModelForm.save() when saving drafts.
* Add a delete confirmation page and refactor some CSS to share to-delete styling.
* Fix a JS error in safari, .delete property is reserved
* Fix draft form error display and some string changes for the upload form.
* Adds a modal form that runs the user step by step through the upload process, as described in http://people.mozilla.com/~chowse/drop/sumo/kb/v7/toolbox/03_media_gallery.png
* Extracts the code for wrapping inputs in forms and POSTing to iframes from upload.js into libs/jquery.ajaxupload.js
* During image upload, a user can cancel or edit the metadata (title, locale, description).
* Cancelling or uploading an invalid image changes the hint message above the image.
* Neat fact of the day: cancelling an iframe from loading can be done by changing it's src to null in JavaScript.
* This form does not work with JavaScript disabled. Must it?
* Modal form automatically opens if drafts exist
* No video upload validation yet.
* Simplify gallery urls.py
* Disable submit button while uploading
This adds a task that spawns seperate, child tasks that re-render the
knowledge base in 100-document chunks. It also adds a number of helpers
to access the main task. (wiki.tasks.rebuild_kb) The main task is rate-
limited to once every 20 minutes. The chunks are not rate limited right
now.
* settings.WIKI_REBUILD_ON_DEMAND
- There may be cases, like a KB sprint, where it's more efficient to
do periodic KB rebuilds. This setting (when False) disables all on-
demand (e.g.: triggered through the app) rebuilds.
* wiki.tasks.schedule_rebuild_kb
- This method will try to queue a rebuild_kb task provided certain
conditions are met:
* settings.WIKI_REBUILD_ON_DEMAND is True
* There is not another queued rebuild_kb task.
If both of these are true, queue a task and set the lock. (When a
rebuild_kb task starts, it clears the lock.)
* wiki.views._maybe_schedule_rebuild(form)
- When editing an existing document, we only need to rebuild if the
title or slug has changed. This checks form.changed_data for either
field, then calls schedule_rebuild_kb() if necessary.
* wiki.cron.rebuild_kb
- For those times when on-demand rebuilds are too frequent, we can
schedule this cron, which just fires off the rebuild_kb task.
* 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.
Created a new app because it involves multiple views and a cron. The
cron will need to be set up to run once/minute. It does a proxy request
to the chat server (settings.CHAT_SERVER) to get the queue status, then
stores the result in the cache (settings.CHAT_CACHE_KEY). The
/chat/queue-status/ view dumps out whatever's in the cache or returns a
503 status if the cache is empty.
Among the other changes to the KB, while PHP's urldecode() maps + to a
space, Django does not. Hence all the old URLs had + in place of %20.
This middleware checks the path for +s, and redirects with %20s if it
finds any. It doesn't touch the query string.
* Markup, CSS, templates, and queries for the Overview and Untranslated Articles localization summaries are in place, though there's still some optimization to do.
* Add a `number()` template function for localized thousands formatting, etc.
* Stub out Contributors Dash view just so we can reverse() to it.
* Add trivial tests. Perhaps horrific ones testing the accuracy of the queries will follow. Perhaps.
* To come: WebTrends integration and the rest of the dashboard readouts
Create a new home page at /home/ that pulls in editable content from
the wiki. Involves some tweaks to the wiki templates. Also add the rest
of the KB categories.
* Hard coded top side can be localized with gettext
* Not tested for IE
* Migration to create initial templates
* Inherits from wiki base template
As the new design propagates to the rest of the site, we need to make
the common/layout templates the base of both wiki and home page.
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.
* fall back if locale-specified version does not exist.
* return message if English version does not exist either.
* make wiki_to_html() and parse() receive and pass around locale
* 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.
Also switch to namedtuples for several tuples that were getting too big for their britches. Now we don't have to continually add items to unpacks all over the app when tuples grow.
Cookies to come.
* 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
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
* Don't save thumbnail twice, wait until it's generated.
* [590004] Fixes foreign key leakage in tests - test_utils.TransactionTestCase truncated django_content_type. Landed a fix in test_utils and added a setting to use it, TEST_UTILS_NO_TRUNCATE
* No more SkipTests in the upload app. Hoping Hudson shows mercy and passes all of them this time.
* Change ImageAttachment docstring to reflect reality.
* Make LocaleURLMiddleware clean up after itself: clear the thread-local prefixer variable that it sets before the request. Tests can now run in any order without the thread-local setting of one influencing the next. This also uncovers a lot of buggy tests which were mistakenly depending on the work of previous ones. Much of the rest of this changeset is toward fixing these.... A good test to compare before and after this commit is `test_json_callback_validation`. Run it alone, and LocaleMiddleware tosses us a 301 because we don't have a locale prefix set. Run it in concert with other tests, and somebody else sets the thread-local for it.
* Added `LocalizingClient`, which provides the functionality of django.test.client.Client but implicitly prepends a locale code to anything you request. This saves dodging the initial 301 that LocaleURLMiddleware returns in response to an un-prepended request. It also makes "priming" the middleware by doing an initial arbitrary request unnecessary (and ineffective, since the middleware no longer leaks state). Removed all instances of such priming.
* Switched many tests to use `LocalizingClient`. Some uses of plain `Client` remain, but those are correct, since they test things like the middleware's 301s.
* Renamed `set_url_prefix` and `get_url_prefix` to better reflect their purpose: they hold Prefixers, not prefixes.
* Added a `force_locale` kwarg to `sumo.urlresolvers.reverse()`, which forces the same default locale as would normally be used by the middleware to be prepended onto the result, even if there is no prefixer set. This is useful when you need to get a reversed URL against which to compare a 301's Location in a test.
* Moved `split_path()` out of `Prefixer`, since it needs no instance state and I needed it in `LocalizingClient`.
* `Prefixer` can now be instantiated without a request, in which case it defaults to a fairly blank one and returns results largely determined by `settings.LANGUAGE_CODE`.
* Stopped expecting locale prefixes in wiki parser tests: the parser is being run outside any request and so should return unlocalized URLs.
* Ripped `get_url` off the legacy `Forum` and `ForumThread` models and deleted its tests. This was a lot faster than trying to fix them, and the entire models are dying for 2.3 anyway.
* Fixed a gabillion other tests. I like to think I understood each one's intent before causing it to pass, but extra eyes are certainly welcome.
* Fixed some pyflakes violations: semicolons, whitespace, unused imports, etc.
Other minor improvements:
* Move content_parsed to Document and comment it out. Whoever needs it can uncomment and test it.
* Rename parent inverse relationship to "translations".
* Start testing operating_systems attr.
* Added offset and limit kwargs to SearchClient.query(): handy now for AAQ suggestion search, maybe handy later for more efficient pagination.
* Refactored search clients. They now have a _prepare() method for setting up the sphinx client prior to querying, so we don't have to repeat query().
* Tags are added for full and tenths-place variants (e.g., 4.0.1 and 4.0) of known Firefox versions.
* An OS will be auto-tagged if there exists a tag with its name (case insensitive). (I posit ease of administration outweighs risk of abuse.)
* Finished off questions_config based on Cww's etherpad.
* Show user agent string in System Details pop-up.
* Introduce an autocomplete widget with decent user feedback on both adding and removal. Should be reusable elsewhere without much work. Also has non-JS fallback.
* Tag storage for the autocompleter is client-side, which lets us take reaction time from 300ms (or greater) down to around 0. Also provides lighter server load, and, as a side effect, containment search for tags rather than just prefix (the former being tricky to index with MySQL). Uses linear search atm, but performance on an 814-word vocab is acceptable on a 2GHz i7.
Adds a column to questions.models.Question that tracks votes per week.
The denormalized column has an index for fast sorting.
Also adds a cron job, designed to be run once a day during a low-traffic
period, that resyncs the new column.
Audit forum views for master-slave race conditions. Added a few comments about possible ones but didn't find any that can't be equally caused by our autocommitting.