* Localize our login/logout URLs
* Write a login_required decorator
* Factor our login_required, logout_required and permission_required to use a common user_access_decorator
* Move access tests around to be happier with where they belong.
* Bunch more tests for the permission_required decorator.
* Two new views: edit_avatar, delete_avatar
* Each redirect to edit_profile view after success.
* Make sure there is always only one avatar file per profile by deleting old ones when new avatars are uploaded.
* Feedback from Gandalf - flexibility > convenience in localizing by media type, so strings are universally split, e.g. 'Delete this image', 'Delete this video', etc.
* Localize any previously unlocalizable items in the media gallery
* 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.
This fixes...
* Cases where extra instances of <p><br></p> could be inserted between adjacent block-level {for}s
* Places where wrapping the contents of an ordered list item in a {for} could cause numbering to restart
* 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
* Remove category-picking UI from translate page.
* Tighten up a test whose failure took me a long time to diagnose.
* Clarify the limitations of _inherit descriptor factory.
* (Per request) validate category value, in addition to its requiredness, on save().
* 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
* Bug 607959 - "History" tab stays highlighted when comparing revisions.
* Bug 607962 - Fix search box width on Linux.
* Bug 608849 - Fix old-style sidebar on AoA.
* Bug 610359 - Fix home page layout on Linux.
* Bug 610672 - Update link to mobile and use url() in the header.
* Bug 610699 - Make the dotted border on the homepage bigger.
* Bug 610703 - Use MetaBlack for <mark> in headings.
* Handle OS->Browser dependency (only show browsers available for selected OS) [bug 609325]
* Redirect mobile home->desktop home when desktop OS is selected, and vice-versa.
* Initialize the showfor selector widget only when necessary and after the values have been set in initForTags(). [bug 610701]
* Contributor and L10n Dashes are very similar. Factor up the common parts.
* Give the L10N_READOUTS constant sole discretion on what appears on the main L10n dash. I had given the template control for more flexibility, but even in this small case, I managed to get some IDs desynced, which broke a few intra-page links. As a result, add short_title and details_link_text attrs to readouts, and change L10N_READOUTS to a SortedDict.
* Add a locale arg to Readout constructor which can override the one in request. This lets the Contributor Dash always show English data, independent of what language the UI is in.
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.
I took the absolute minimun change to make this work, leaving the
Document.allows_revision_by method in place, in case we do end up with
different permissions for, e.g., templates.
If that code rots for a while and it looks like we'll never do that,
we can take a bigger patch when there's more time and remove it
completely.
* Fix <summary> styling on translate.html.
* The list of l10n dashboard readouts with detail views is now managed by readouts.py, since it's in a position to know.
* Started moving un-common parts of the Outdated/Untranslated template out; it looks like we're going to be able to reuse that one table for almost everything. The template will probably get renamed and CSS rules generalized when my verbal center comes back online.
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.
* Update grid view and individual media file view to match chowse's mockups.
* Get rid of the gallery base.html template and use the wiki one.
* No more ?locale query param, just switch the site language
* Add generic autosubmit selects, initialized in main.js
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.
Because django.views.generic.simple.redirect_to requires a full URL and
it's too early to call reverse() at that point, I've added a simple
view, sumo.views.redirect_to that behaves similarly. I've included
tests for the new view, as well as testing the specific redirect.
* 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.
* 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.
The {{ csrf() }} function doesn't work inside Jinja2 macros. I think
they don't have the correct context. (Even passing request to the macro
didn't help.)
Keep an eye out for it.
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.
* Attempting to visit the translate view in the en-US locale no longer 404s; it now helpfully redirects to the edit view.
* Trying to translate an unapproved document now shows an error (though this has to change again (see bug 604466).
* It is no longer permitted to make a new document in a non-default locale. (This test is temporarily skipped and should be reinstated when we get the "non-localizable" bool on Document and thus get this ability back.)
* Document.save() now raises a ValidationError if you try to save a parentless article that's not in the default locale.
* Revised translate.html. Tweaked labels to reflect that we no longer always show the latest revision. Diff now compares the English version the current translation is based on and the current English version so translators can see what has changed in the English article since it was last translated.
* errorlist.html now displays non-field errors as well.
* Add an "original" property to Document as a shortcut for finding the English version.
* wiki.tests.TestCaseBase no longer unnecessarily clears the cache.
* Removed a duplicate test.
* Refactored doc_rev() to RepeatOurselves less.
* Revision's string representation now includes the revision ID: handy for debugging.
* 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
* Similar to video migration
* Generates thumbnails
* Shrinks down the image if the image is too large
* Skips and warns if file is not an actual image
TODOs:
* Refactor the right side vertical tabs to be reusable across pages (macro?)
* Some js/css to convert showfor <select/>'s to dhtml widget
* Try to make the Related Articles and TOC horizontal separator w/o image
* Try to make the fading article rounded border (top right) w/o images?
* Lots of <a />'s with src="#"
* IE*!!!
* Does not tolerate lonely ogg files
* Resumes migration from where it left off
* Tested on 128 videos copied from our cdn, videos.mozilla.org
* Rewrite upload.utils to avoid passing around max_file_size parameter
* Removed unnecessary test for create_imageattachment (functionality already covered in check_file_size test)
* The new_revision form is now 2 forms: one for versioned data and one for document-scoped metadata. This supports the UI revision that takes our final agreed-upon requirements into account.
* Redirects now start numbering at "Some Title Redirect 1" rather than "Some Title Redirect 2". I don't know what I was thinking before.
* Document.allows_editing_by() is now called allows_revision_by(), freeing up the name "allows_editing_by" to mean "non-versioned document metadata can be edited by".
* Stick <article> tags around wiki document content for syndication niceness and the ability to use H1s.
* Rename new_revision view to edit_document, since it does more than make new revisions now.
* There was some repetition every time we saved a RevisionForm. Factored it and some existing helper procs into RevisionForm.save().
* Turn the _process_doc_form() helper into an overloaded DocumentForm.save().
* 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.
Consequently...
* Reordered a few XML strings in tests to conform to actual output. We really need an easy to compare XML trees.
* Made a test less brittle.