Граф коммитов

907 Коммитов

Автор SHA1 Сообщение Дата
Paul Craciunoiu a523e8084c [614049] Profile model! Included: one test and test helper. 2010-12-01 15:22:54 -08:00
James Socol e88f5d6f0a Admin: exclude tags and don't require parent. [bug 615780] 2010-12-01 16:00:04 -05:00
James Socol 0403ecca30 Don't update translations of an unsaved article. [bug 615787] 2010-12-01 11:57:29 -05:00
James Socol cc8ed8874f Force rebuild tasks to write to the master. 2010-11-30 19:05:33 -05:00
Ricky Rosario 4e6d30b430 When redirecting to next URL, stay on https. [bug 615375] 2010-11-30 15:47:55 -05:00
James Socol cbde7ba7dd Celery-safe generate_image_thumbnail. [bug 615385] 2010-11-30 10:24:33 -05:00
Ricky Rosario b6c50cf963 Prefill username and not password on validation error. [bug 614700] 2010-11-30 08:45:27 -05:00
Ricky Rosario aa322e855a Implemented AuthenticationForm that optionally allows users with is_active=False to log in. [bug 614705] 2010-11-30 08:45:27 -05:00
Ricky Rosario 0047f637bf Implemented password reset. [bug 614589] 2010-11-29 11:05:51 -05:00
Paul Craciunoiu 8985cf8d99 [614365] Edit page strings were not localizable. 2010-11-24 16:18:43 -08:00
James Socol a0f7635240 Registration page. [bug 614007] 2010-11-24 19:08:10 -05:00
James Socol 0eb2b2ed74 Add a logout_required decorator. 2010-11-24 19:03:46 -05:00
Paul Craciunoiu 76ba8fa1a2 [614365] Localize some kbforums strings. 2010-11-24 15:48:59 -08:00
Paul Craciunoiu ed19c00b82 Feedback from Ricky and James 2010-11-24 14:54:26 -08:00
Paul Craciunoiu ddff624011 [614050] Move upload form to its own file and include it. 2010-11-24 14:54:26 -08:00
Ricky Rosario 7213950d4b New users app for login, logout, and redirect (and more to come). [bug 613986, bug 614002, bug 612750, bug 612749]
* Includes a SHA-256 auth backend.
2010-11-24 12:16:15 -05:00
James Socol ef64e23e0d Update link targets. [bug 614753] 2010-11-24 11:02:53 -05:00
James Socol 3a7e4e0b78 Fix placeholder and small l10n. [bug 614285] 2010-11-24 10:11:53 -05:00
Ricky Rosario 68290398a0 Made table of contents header localizable via js. Fixed document contributors string. [bug 614292] 2010-11-24 10:01:35 -05:00
Fred Wenzel 19ab09fdda Indicate which replies the user has replied to recently. Bug 612929. 2010-11-23 21:22:09 -05:00
James Socol f06838c6d4 Force cache invalidation on upload. [bug 614110] 2010-11-23 20:41:57 -05:00
James Socol b787337581 Remove tagging from translation pages. [bug 614054] 2010-11-23 18:34:49 -05:00
Erik Rose 14b4457d24 [614115] Prevent infinite recursion of templates and includes. 2010-11-23 15:20:10 -08:00
James Socol 01d8761778 Drop 'Template:' from the home page docs. [bug 614319] 2010-11-23 15:25:13 -05:00
James Socol 6d5b57eec0 Fix RuntimeError in wiki.cron.rebuild_kb. 2010-11-23 12:51:27 -05:00
James Socol 82024f93cd urlparams should leave multi-value query string params alone. [bug 614092] 2010-11-23 12:47:41 -05:00
Erik Rose f7adf352b8 [614113] Killed hanging </a> tag on KB Discussion tab. 2010-11-22 16:26:12 -08:00
Paul Craciunoiu 0c51281182 [612744] Don't show 'Allow translations' for non-en-US new documents. 2010-11-22 14:55:23 -08:00
Fred Wenzel 8e6a272808 Show how many responses a tweet has and who responded first. Bug 612935. 2010-11-22 13:20:12 -08:00
James Socol 775fb894a5 Make Include safer and more like Template. [bug 613969] 2010-11-22 11:22:53 -05:00
Fred Wenzel 1013db8b13 CC_SHOW_REPLIES setting to switch off showing tweet replies if necessary. Bug 612943. 2010-11-19 17:05:46 -08:00
Fred Wenzel e471008024 Show/hide responses to tweets. Bug 612943. 2010-11-19 17:05:42 -08:00
Paul Craciunoiu b51d8b5cee [613329] Videos can link to CDN if setting provided. 2010-11-19 16:31:41 -08:00
Fred Wenzel 3e47b027a3 PEP8 and pyflakes fixes for twitter app. 2010-11-19 16:25:21 -08:00
Fred Wenzel 9c9515e2b2 PEP8 and pyflakes fixes for customercare. 2010-11-19 16:25:21 -08:00
Fred Wenzel 7158f9c7fe Store replies to customer care in the database. Bug 612931. 2010-11-19 16:25:04 -08:00
Paul Craciunoiu 3a77be46cf [609027] Video modal
* 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
2010-11-19 13:55:26 -08:00
Ricky Rosario 2c1502b3fd Added Upload Media link to media modal. [bug 611868] 2010-11-19 16:06:47 -05:00
James Socol f846004720 Relax requirements for based_on [bug 604466 and bug 612962]
* Can now translate documents with no approved revision.
* Can now edit documents with no approved revision.
2010-11-19 13:20:50 -05:00
James Socol 6742b74473 Don't overwrite the parent's Relevant To info. [bug 613271] 2010-11-19 12:30:04 -05:00
Ricky Rosario 6fe894e481 Media form clean() methods now call parent class clean() so that unique_together validation happens. [bug 612440] 2010-11-19 11:26:06 -05:00
Erik Rose 5ce0ddead4 [612968] Stop considering validation error messages to be safe HTML. 2010-11-18 16:31:17 -08:00
James Socol 747700d56c Validate video extensions. [bug 612425] 2010-11-18 18:59:38 -05:00
James Socol d576f0087c Validate slugs. [bug 612955] 2010-11-18 18:30:44 -05:00
Erik Rose 1becb459eb [611404] Parent and child now always have the same category.
* 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().
2010-11-18 14:15:38 -08:00
Ricky Rosario cf4fd220fc Now able to specifify a localizable_url to use as a base when switching languages. [bug 611703] 2010-11-18 16:03:37 -05:00
Ricky Rosario 597c019112 For new translations, start with the current, or last, English revision. [bug 613168] 2010-11-18 15:31:05 -05:00
James Socol c83591b7c7 Default to desktop versions and OSes [bug 611415] 2010-11-18 15:14:08 -05:00
Ricky Rosario 412a2b72de Show the list of contributors on the article page. [bug 613167] 2010-11-18 12:27:00 -05:00
James Socol 66ea3c9f23 Remove superfluous periods. [bug 611016] 2010-11-18 10:19:43 -05:00
Paul Craciunoiu 44cb5fea46 Update categories: Navigation, How to, and renumbering.
* Add 'How to' category and include it in default search.
* Add 'Navigation' category.
* Renumber all categories to leave room for future changes.
2010-11-17 16:05:46 -08:00
Ricky Rosario 160d885d76 Use application/json for async calls, except for the async upload case. [bug 613014] 2010-11-17 18:02:20 -05:00
Ricky Rosario bbcfd32914 Added view and template for deleting a Revision. [bug 604186] 2010-11-17 17:30:51 -05:00
James Socol 79a0a257cc Update link targets. [bug 611013] 2010-11-17 17:19:01 -05:00
Erik Rose 5020b228ca [612916] Tolerate NULL based_on values in translation current revisions. 2010-11-17 13:54:27 -08:00
Paul Craciunoiu b358ef9b49 [611394] and [611677] {for} and {button} nesting + [[Image:]] default to frameless. 2010-11-17 11:06:05 -08:00
Ricky Rosario 0155a7816d Cancelling upload now removes draft asynchronously. [bug 611470] 2010-11-17 12:51:12 -05:00
Ricky Rosario 6ae585b298 Added the For Contributors box to all contributor pages. [bug 612605] 2010-11-16 21:12:48 -05:00
Paul Craciunoiu 2bcef98750 [611821] Order media by most recently uploaded. 2010-11-16 16:42:44 -08:00
Paul Craciunoiu 9d356ed7f9 Add chowse's video thumbnail placeholder and use it. 2010-11-16 13:34:11 -08:00
Paul Craciunoiu c489e8ea91 [609023] Allow users to upload their own video thumbnail. 2010-11-16 11:50:39 -08:00
Erik Rose 4947eb01d7 [608100] Assure on save() that is_localizable is False for non-English articles.
Also relocate 2 misplaced tests.
2010-11-16 09:15:21 -08:00
Ricky Rosario 6ace981c7e Solution html now maked safe [bug 611722] 2010-11-16 09:38:22 -05:00
Ricky Rosario ff362fe55f Added data-for to safe attributes list for the wiki parser. [bug 611266] 2010-11-15 19:04:40 -05:00
Ricky Rosario 12a2ecc07c Previews now render more accurately. [bug 609916] 2010-11-15 19:02:48 -05:00
James Socol f37da5a10a Use urlparams from AMO and fix a test. [bug 611733] 2010-11-15 16:47:50 -05:00
Erik Rose c481354d88 [608847] Add advisory message to out-of-date translations. 2010-11-15 12:58:25 -08:00
Ricky Rosario 894d7c1f14 Made review translation sections collapsible. [bug 611326] 2010-11-15 12:16:43 -05:00
Paul Craciunoiu 2d8b505ae4 [610450] Video presentation: don't show if there's nothing to show, and no more slide.
* Also add some TODOs and a SkipTest.
2010-11-12 15:40:08 -08:00
James Socol f50e34479c Sphinx now considers FX and OS values from parents of translations. [bug 611716] 2010-11-12 18:35:19 -05:00
James Socol f41a053950 Oh, those are tooltips! [bug 611016] 2010-11-12 16:09:47 -05:00
Paul Craciunoiu da17b1565d [604211] Delete and edit images and videos. Includes permissions.
* 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.
2010-11-12 12:36:09 -08:00
Ricky Rosario 80020404b1 Added UI for watching locales. [bug 611691] 2010-11-12 15:33:07 -05:00
Ricky Rosario 162bdf6f5f Added keywords and summary to revision reviews and comparisons. [bug 602511] 2010-11-12 12:38:20 -05:00
Ricky Rosario cc5c27fbba Added pointing nurse to more help section of article page. [bug 611475] 2010-11-12 12:36:38 -05:00
Erik Rose cc40a9aadd [575820] [602325] Implement nice tagging widget for KB document editing. Factor tagging widget out into its own app. Rename "Tags" to "Topics" in the wiki app.
Questions app has yet to be refactored to use the new app.
2010-11-11 21:23:18 -08:00
James Socol a2f6c5193d Add a long title to VersionMetadata. [bug 611416] 2010-11-11 20:14:09 -05:00
Ricky Rosario e3a1e51af3 Redirect to a valid URL after saving document form on the translate page. [bug 611454] 2010-11-11 20:11:44 -05:00
James Socol fabc3ed133 Alphabetize and add to wiki.admin. 2010-11-11 18:36:01 -05:00
James Socol 01f9d7d990 Anyone can create new documents or localizations. [bug 611449] 2010-11-11 18:00:42 -05:00
Paul Craciunoiu e69dbc7a7a [595376] Upload frontend for images and videos in the gallery
* 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
2010-11-11 14:12:28 -08:00
Paul Craciunoiu 28a1cf4159 [595376] Minor fixes for gallery view
* Forgotten sidebar blocks for media object view.
* Fix unicode in CSS, bleh
2010-11-11 14:11:50 -08:00
James Socol f7154e2aa4 Updating strings for bug 611016. 2010-11-11 16:15:25 -05:00
Ricky Rosario e65dd3f929 Now the slug/title change detection is case-insensitive. [bug 611395] 2010-11-11 16:13:28 -05:00
Ricky Rosario 76869f1a88 Before saving a new l10n Document, make sure the Revision submitted is valid. [bug 611357] 2010-11-11 15:31:21 -05:00
Ricky Rosario 919257d8b7 Added model specific icons to the search results. [bug 467482] 2010-11-11 12:58:30 -05:00
Ricky Rosario 953efe2d4b * Added locale to form so that the unique_together validation would occur correctly [bug 599989]
* Added javascript validation of Slug/Locale and Title/Locale uniqueness
2010-11-11 10:54:50 -05:00
Ricky Rosario 1e393cbf43 Gracefully (no stack traces) handle validation errors in DocumentForm when translating. [bug 611003] 2010-11-11 10:51:26 -05:00
Ricky Rosario 31c94c9501 Filled in some lipsums in the review modals. [bug 609391] 2010-11-11 10:48:31 -05:00
Ricky Rosario 7d00fda402 After l10n revision edit, redirect to correct URL using localized slug. Also allow /edit on localized docs. [bug 610418] 2010-11-10 13:42:30 -05:00
James Socol d35172e68d Fix a number of small things. (Several bugs.)
* 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.
2010-11-10 11:28:02 -05:00
Ricky Rosario 47c1710c7a * Allow for hiding some showfor selectors from the UI while keeping them in the backend [bug 610712]
* 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]
2010-11-10 10:48:19 -05:00
Erik Rose 7883673f11 Remove an unused import. 2010-11-09 13:25:51 -08:00
Erik Rose 6680bcd27c [605477] Add Contributor Dashboard.
* 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.
2010-11-09 13:25:51 -08:00
James Socol b871ad5863 Make the advanced search appear for everyone. [bug 610424] 2010-11-09 15:18:07 -05:00
James Socol 7641075015 Update search filters with Help With selection [bug 610424] 2010-11-09 15:08:51 -05:00
James Socol 7c24fb4734 A KB-rebuild task. [bug 589853]
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.
2010-11-09 13:01:36 -05:00
Ricky Rosario d0fd7df51f Implemented Media helper for wiki editor [bug 601687] 2010-11-09 11:01:08 -05:00
James Socol 3819612cc1 Templates with no approved revisions no longer crash. [bug 605326] 2010-11-08 19:16:49 -05:00
James Socol 112e8a4840 Anyone can create new revisions. [bug 610421]
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.
2010-11-08 17:00:40 -05:00
Ricky Rosario ac5f88d9a3 Implemented tag page [bug 609900] 2010-11-05 16:27:01 -04:00
James Socol e3f46fc42c Media gallery search. [bug 594780] 2010-11-05 14:52:33 -04:00
James Socol 713fd08bf9 Mobile home page [bug 607983]. 2010-11-05 13:59:39 -04:00
Ricky Rosario ad072d0ff7 Fixed test I failed to update on previous commit. 2010-11-05 11:28:49 -04:00
Ricky Rosario b880f864d2 Improving our messaging [bug 607976 / bug 607968] 2010-11-05 10:38:41 -04:00
Erik Rose ac8f93e423 Improve tests for main L10n Dash template: actually make sure some (of the correct) data gets spit out. Cover some of the trickier cases of the Unreviewed Changes query with tests. 2010-11-04 23:04:47 -07:00
Erik Rose 6cc5a8e097 Factor up the cursor handling and other minor flow control to Readout. Use a DB slave rather than master.
The factoring means we don't need nassssty tuple indexing anymore. Watch those tuples unpack! :-D
2010-11-04 23:04:47 -07:00
Erik Rose 20b73ca301 Make History page fall back to ID when ordering revisions by creation date. 2010-11-04 23:04:46 -07:00
Erik Rose 6ac9141958 Quit providing pluggable templates for readout tables, because everything ended up using the same one. 2010-11-04 23:04:46 -07:00
Erik Rose a391b2e2c2 Add Unreviewed Changes readout to L10n Dash.
Consequently, make the readout template able to display a list of users who changed an article.
2010-11-04 23:04:46 -07:00
Erik Rose 0684123b5e Add Out-of-Date Translations readout to the L10n Dash.
* 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.
2010-11-04 23:04:46 -07:00
Paul Craciunoiu d5751fbd0a [609098] Erase metadata before saving changes. 2010-11-04 22:10:46 -07:00
James Socol 9c7e416d44 Related documents. [bug 604121]
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.
2010-11-04 18:36:45 -04:00
Ricky Rosario a7a25f8e04 Implemented locale selection page [bug 606533] 2010-11-04 18:03:36 -04:00
Ricky Rosario 2168a9aed8 Preview in the right locale. [bug 609680] 2010-11-04 17:58:42 -04:00
James Socol 6983214939 Implement full localization fallback. [bug 608089] 2010-11-04 16:11:12 -04:00
James Socol b09eb579a3 Get rid of the CamelCase. 2010-11-04 16:11:11 -04:00
Ricky Rosario ac223a988e Fixed issue where localized documents couldn't be edited. The form was missing the is_localizable field in that case. [bug 609098] 2010-11-04 11:27:40 -04:00
Ricky Rosario fe63410b04 Only show Localize Article tab when the document is localizable [bug 608286] 2010-11-03 20:30:36 -04:00
Ricky Rosario c733396e49 Only show For Contributors module to authenticated users [bug 609322] 2010-11-03 20:13:41 -04:00
Ricky Rosario ef50c0ea24 Translate page is now two forms after initial translation [bug 604805]
Also fixes styling bug [bug 608342]
2010-11-03 20:09:08 -04:00
Erik Rose b5f5136aec Add a test that notices repeated version numbers in the DB migration filenames that could screw up schematic's assumptions. Bump the version of every migration since 42 to conform. 2010-11-03 15:33:37 -07:00
Paul Craciunoiu 6c20d6c15e [596116] Unicode in filenames now supported in upload app. And more.
* 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.
2010-11-03 14:23:17 -07:00
James Socol b737067cfb Advanced search can now filter by OS/version [bug 601655] 2010-11-03 14:27:26 -04:00
James Socol b53aa9c040 Point link on search results to new URL. [bug 605572] 2010-11-03 13:51:20 -04:00
James Socol f1bd0dfd4f Make summary purpose more explicit. [bug 607304] 2010-11-03 13:44:27 -04:00
Paul Craciunoiu 984a2969c9 [603787] Media gallery fits in with the new theme.
* 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
2010-11-02 12:10:19 -07:00
James Socol bcc661e5c7 Activating some admin control over Documents. [bug 608326] 2010-11-02 14:50:54 -04:00
Paul Craciunoiu e7cfe390f2 [605275] Unique metadata for wiki documents.
Documents now can't have the same metadata multiple times, e.g. multiple (item_id, document_id) entries.
2010-11-02 09:10:31 -07:00
Ricky Rosario 35192472b3 Styled the "Help with:" selects. Uses jquery.selectbox plugin. [bug 607301] 2010-11-01 19:33:08 -04:00
Ricky Rosario d6a328e65f Removed summary and static TOC from article page [bug 607301]
Gracefully handle {for} without data-for attr [bug 607779]
2010-11-01 19:32:34 -04:00
Fred Wenzel 4ae173551c Make Army of Awesome page validate. Bug 608086. 2010-11-01 16:02:57 -07:00
James Socol ce54806721 Create a new chat app. [bug 605476]
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.
2010-11-01 10:17:50 -04:00
Ricky Rosario 16491dc5d4 Don't send reviewed notification to reviewer [bug 604548] 2010-11-01 10:17:09 -04:00
Ricky Rosario 399e244d6b Fix for issue where commit message defaulted to the value from the previous revision instead of being blank. [bug 607786] 2010-11-01 10:06:50 -04:00
Ricky Rosario 15c32d0a7a How about 100k character maximum for wiki content? [bug 608279] 2010-10-29 15:59:43 -04:00
Fred Wenzel ce9fafcb6b Infinite scrolling for Customer Care page. Bug 606342. 2010-10-28 16:49:37 -07:00
Erik Rose 9c881b1946 Docstring fix: is_localizable can be true on a translatable document even if there exist no translations at the moment. 2010-10-28 14:15:52 -07:00
Fred Wenzel d28db24a0c Search box for customer care sidebar. Bug 607667. 2010-10-28 12:36:45 -07:00
James Socol 0b4b2fe31f Add middleware to replace + with %20 in URLs.
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.
2010-10-28 11:50:00 -04:00
James Socol d5909c341b Redirect /kb/ to /home/ [bug 607433]
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.
2010-10-27 10:24:46 -04:00
Erik Rose 1d71650444 [603808] Built out infrastructure for the Localization (and Contributor) Dashboards.
* 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
2010-10-26 16:20:32 -07:00
Ricky Rosario 32a72faa7d Minimal styling for article list pages [bug 607296] 2010-10-26 13:28:53 -04:00
Fred Wenzel da8ee12622 Link user name and avatar to user twitter page. Bug 606337. 2010-10-26 09:44:29 -07:00
Fred Wenzel 8263a87402 Link tweets to their permalinks. Bug 606331. 2010-10-26 08:53:32 -07:00
Ricky Rosario e109136aa7 Typo causing wiki js bundle to never be loaded 2010-10-25 22:36:32 -04:00
Ricky Rosario 6f26978456 Implemented Document Helpful/Not Helpful voting [bug 606193] 2010-10-25 22:14:48 -04:00
Fred Wenzel b03d0d9c82 Exclude bugs filed by fx4status, plus tests. Bug 606397. 2010-10-25 14:36:12 -07:00
Paul Craciunoiu 8f58c81bd8 [586478] New home page
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.
2010-10-25 12:11:47 -04:00
Paul Craciunoiu c47c08d46e [599006] Add is_localizable field and UI behavior for it.
* 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.
2010-10-22 18:28:05 -07:00
James Socol 123cd38c13 'Relevant to' all default to checked. [bug 601609] 2010-10-21 17:31:03 -04:00
James Socol b8ed4bb3f4 Fix the CSRF token on article un/watch forms. [bug 605289]
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.
2010-10-21 16:16:20 -04:00
Ricky Rosario b7d57bd1ff Styled the review, compare, and revision view pages [bug 605145] 2010-10-21 14:39:19 -04:00
James Socol 42ec744c32 Fix tests after edit-link commit. 2010-10-21 10:56:19 -04:00
James Socol af2741f7aa Link to edit view of localized articles. [bug 604806] 2010-10-20 19:51:39 -04:00
Ricky Rosario 5259489a7b Style the wiki form pages (new/edit/localize) [bug 605141] 2010-10-20 17:36:27 -04:00
James Socol 26079cc398 Hook up sidebar link to discussion page. 2010-10-20 10:50:19 -04:00
James Socol 4aa9140cea Say hello to KB discussion. [bug 602958]
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.
2010-10-20 10:50:18 -04:00
James Socol 07193c4df5 Clean up wiki.urls. 2010-10-19 18:40:04 -04:00
Paul Craciunoiu 6d6c5ad8dc [586478] Dashboards app with home page 2010-10-19 11:40:26 -07:00
Erik Rose eba501ffb2 [605311] [602356] edit_document and translate views now set Revision.based_on to the current default-language revision of the doc as of when the Edit link was clicked. URL-prefixing middleware now cleans up properly after an exception.
* 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.
2010-10-19 10:33:38 -07:00
James Socol f1eec6b710 Update tests for bug 604808 (see py-wikimarkup). 2010-10-18 14:41:05 -04:00
Paul Craciunoiu b32729708b [604776] Improved links to new documents.
* Adds a class="new" to internal links to documents that do not exist.
2010-10-18 10:22:45 -07:00
Paul Craciunoiu ffdc45bfd2 [604524] Image, Video and Template hooks fall back to English version.
* 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
2010-10-15 14:51:26 -07:00
Paul Craciunoiu 156ed505d2 [602693] Some fixes to make video migration friendlier, based on feedback from oremj 2010-10-15 12:58:12 -07:00
Paul Craciunoiu f983b9eeb0 [603847] Migrated image titles are set to the filename. 2010-10-15 12:43:17 -07:00
Erik Rose 07cc8d5891 [604572] Make the right-hand revision number in the diff view accurate. 2010-10-14 20:35:34 -07:00
Ricky Rosario 2860f1c71f [bug 604439] Stylized the revision history page.
* Refactored the vertical tabs into a macro and added them to appropriate pages
2010-10-14 21:22:15 -04:00
Paul Craciunoiu 10423b7b8b [603847] Image migration
* 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
2010-10-14 14:33:40 -07:00
Ricky Rosario ba62807f70 [bug 603609] Applied new theme styling to Article page.
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*!!!
2010-10-14 14:41:39 -04:00
James Socol 5a947024e5 New @permission_required decorator that sends 403s sometimes. [bug 603500] 2010-10-13 18:04:07 -04:00
Paul Craciunoiu a12b24f862 [602693] Video migration with tests.
* 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)
2010-10-13 13:08:21 -07:00
James Socol 585e910d88 Client-side handlers for read-only mode to deactivate forms. 2010-10-11 17:44:38 -04:00
James Socol 3a929b1aa3 Server-side read-only implementation, thanks Jeff! [bug 570284] 2010-10-11 17:44:37 -04:00
Erik Rose 7dea87de8a [598315] [600407] Re-did document editing page. It's now 2 forms and allows editing of unversioned metadata. Changing titles and slugs generates the appropriate redirects as well.
* 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().
2010-10-11 13:34:09 -07:00
Erik Rose 404a97fae7 Add disclosers for the sections on the Edit Article page.
Use HTML 5 <details> and <summary> tags with jQuery/CSS fallback.
2010-10-11 13:32:02 -07:00
James Socol 0d4f9c87e9 Simple JSON access to article data. [bug 592816] 2010-10-11 15:57:27 -04:00
James Socol 80ec7c8e22 Make a test less fragile. 2010-10-11 15:57:27 -04:00
Ricky Rosario 2024b7b229 Implemented Preview for wiki content. [bug 599052] 2010-10-11 14:28:52 -04:00
Erik Rose 8dd5e129c8 [602974] ForParser now tolerates leading text runs that aren't within a tag. 2010-10-08 18:12:40 -07:00
Paul Craciunoiu e664ef5c3d [600747] Video hook and render with Flash fallback.
* 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.
2010-10-07 15:07:19 -07:00
Ricky Rosario 9c7d553d32 Showfor modal helper [bug 601686] 2010-10-07 17:41:05 -04:00
Ricky Rosario adfc4b746b * Refactored Marky for easier customization between the different apps
* Added Marky to wiki content textareas
* Added headings (H1, H2, H3) buttons to editor on wiki pages [bug 601693]
2010-10-07 17:31:52 -04:00
James Socol 41fdf97b06 Allow unicode through the twitter middleware. [bug 602399] 2010-10-07 13:39:45 -04:00
James Socol 559c348ec1 More handy updates to Sphinx tests, thanks to Dave. 2010-10-06 11:36:18 -04:00
James Socol b7591ce204 More robust user input handling. 2010-10-06 11:32:19 -04:00
James Socol 54bbd07cbb Allow outgoing unicode and refactor. [bug 602134] 2010-10-06 11:32:14 -04:00
James Socol cdb9c7a1df Update some forum tests to be simpler thanks to new test-utils. 2010-10-05 18:49:58 -04:00
James Socol 927614d46c Fix and update search tests. 2010-10-05 18:49:53 -04:00
James Socol 3af9ceacad Search view is returning results from the new KB. 2010-10-05 18:48:15 -04:00
James Socol 21defa5439 Fixes from feedback. 2010-10-05 18:48:15 -04:00
Alex Buchanan 579d6040ce Merge branch 'custcare' 2010-10-05 10:44:42 -07:00
Alex Buchanan adf595af0f Customer care, tweet text encoding, bug 601834, remove smart_str 2010-10-05 17:30:43 +00:00
Alex Buchanan be6f064fe5 Customer care, cron, stop KeyErrors, fallback to 'en' when iso_language_code doesn't exist 2010-10-05 17:13:01 +00:00
Ricky Rosario f96d6f402a Removed empty gallery js bundle 2010-10-05 12:35:48 -04:00
Ricky Rosario 323d77d082 Added revision view/template [bug 593469] 2010-10-04 16:30:11 -04:00
Alex Buchanan 8a92dc1b2d Customer care, clean tweet data with Bleach 2010-10-04 13:18:39 -07:00
Ricky Rosario 0c6ce69486 Added locale support to EventWatch. [bug 599022] 2010-10-04 14:21:20 -04:00
Erik Rose 1b4bf5ab12 [601297] ForParser now uses html5lib, which lets it handle self-closing tags properly.
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.
2010-10-04 10:52:44 -07:00
Fred Wenzel 41767593a2 Do not send unicode to the logger in Customer Care cron job. Bug 601611. 2010-10-04 16:44:53 +02:00
Alex Buchanan 24afd8c3d6 Customer care, UI notifications for refresh button 2010-10-01 16:13:37 -07:00
Alex Buchanan 36a6820ce0 Customer care, error messages, reply-modal focus, @username #fxhelp in tweet content UI, and refactor JS 2010-10-01 16:13:37 -07:00
Erik Rose 7b17317f39 [596369] Look to the default locale for hints if slug is not found in the requested locale. 2010-10-01 15:42:16 -07:00
Ricky Rosario a28744ebeb Created UI for document watching/unwatching [bug 600680] 2010-10-01 13:15:43 -04:00
Erik Rose 95c5e672e6 Make a little brevity/clarity tweak to LocaleURLMiddleware. 2010-10-01 09:44:31 -07:00
Fred Wenzel d008312a18 Added "ago" to timesince blob 2010-10-01 13:46:03 +02:00
Alex Buchanan a903e678f3 twitter_post validation and missing package 2010-10-01 13:46:03 +02:00
Ricky Rosario 43506ea0fe Fixed js error by bailing out of SHOWFOR code when not on the Document page [bug 599353] 2010-09-30 17:14:53 -04:00
Erik Rose 0d3e8a8f10 [589947] Implement Wikipedia-style redirects.
* Do automatic redirect creation on retitling and restubbing. Avoid collisions with existing document titles and slugs.
* Implement content-injection-safe backlinks to redirect pages from the pages they redirect to. Implement redirect suppression so you can stay at (and edit) the redirect once you get there.
* Fix a template bug where the browser and OS choosers wouldn't show up on documents that had no approved content.
* Delete "parent" from a translate.html, which I don't think was supposed to be there.
* document() helper once again respects a slug kwarg if provided.
* Remove pointless html kwarg from doc_rev helper function. The passed-in HTML always got paved over immediately.
* Add @require_GET to some views that assume the GET method.
* Hoist doc_rev up to wiki.tests.

To come: UI for changing the slug and title of documents
2010-09-29 13:55:41 -07:00
Ricky Rosario 3ca004621b Added document watch (for edits) [bug 599030] 2010-09-29 16:51:45 -04:00
Alex Buchanan dce1476ea7 Customer care, small fixes for CSS, security, and tweet refresh 2010-09-29 20:38:24 +00:00
Alex Buchanan f7684cfcfd Customer care, refresh button 2010-09-29 12:27:23 +00:00
Alex Buchanan 591d88614f Customer Care, when prompting for auth, remember which tweet a user is replying to 2010-09-29 12:25:51 +00:00
Alex Buchanan 9fd5b8bb04 Customer Care security and cleanup 2010-09-29 12:25:28 +00:00
Alex Buchanan dbe13b7e2f Customer Care, lots more CSS fixes 2010-09-29 01:55:47 +00:00
Alex Buchanan d7b57daa68 Customer Care, bug 600238, SSL endpoints for Twitter OAuth 2010-09-28 16:45:21 -07:00
Alex Buchanan c7542fbba4 Customer Care, tweet submission, add @recipient and remove debugging 2010-09-28 16:45:20 -07:00
Alex Buchanan 33231243e5 Customer Care, lots of minor HTML/CSS/JS template fixes 2010-09-28 16:45:20 -07:00
Ricky Rosario 8a85a71eb2 Added `ready for review` notification [bug 599022]
* Includes a change to the notifications app to allow watching a model (all instances), instead of just a single instance.
2010-09-28 17:46:59 -04:00
Ricky Rosario 1fdbd59a3f Reviewed notification for revision creator [bug 599017] 2010-09-28 17:41:23 -04:00
Alex Buchanan 1ad3f3567f Customer Care. Twitter OAuth and template fixes. 2010-09-27 15:59:31 -07:00
Alex Buchanan f919dbde27 Customer Care templates 2010-09-27 15:59:00 -07:00
Fred Wenzel 3d9d460a99 Customer Care. Canned responses, incl. initial data. Bug 591942. 2010-09-27 15:58:57 -07:00
Fred Wenzel 78f55c9b91 Customer Care is born. Tweet collection included! 2010-09-27 15:57:41 -07:00
Ricky Rosario 49a7c6fbe3 [bug 595220] Made revision significance field optional. It is only set on approval now. 2010-09-24 13:59:36 -04:00
Ricky Rosario ef4f41abd2 [bug 596674]
* Prompt for and store commit message.
* Don't store review message in revision, it will be sent in the notification.
* Refactored modals activated on button click (edit submit, translation submit, review message).
2010-09-24 11:50:53 -04:00
Ricky Rosario f04a9509e8 Now showing the number of votes in past X days [bug 592495] 2010-09-23 16:52:25 -04:00
Ricky Rosario 3b794ae54f Implemented Translation review template. [bug 595857] 2010-09-23 12:15:48 -04:00
Erik Rose 723d72682b [595221] Add Edit link to documents. 2010-09-22 13:39:43 -07:00
Ricky Rosario ad7d991d9a Only list documents in the current locale [bug 598311] 2010-09-21 22:12:24 -04:00
Ricky Rosario 3257aa6c41 [bug 595858] Translate page 2010-09-21 21:34:53 -04:00
Erik Rose 90e153e759 [597474] Make "Revision rendered html" section of review page use the fancy-pants wiki renderer, not the stripped-down one from the forums. 2010-09-21 16:12:46 -07:00
Erik Rose da74a1828b [597252] Build browser/version and OS sniffing for document pages.
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.
2010-09-21 12:23:48 -07:00
Erik Rose e21da2e2bc [593306] Implement {for} frontend: TOC generation, OS and browser selection UI, hiding and showing sections, etc.
* Add JS that obeys the {for} tags, showing and hiding the proper page elements.
* Strip whitespace off {for} parameters in the parser so JS doesn't have to tolerate it.
* Generate a TOC in JS, taking what's visible into account. Add just enough TOC CSS that I can stand to look at it.
* Build UI for choosing {for} OS. Page and TOC update according to choice. Use semantically correct <select>s for the OS and browser selectors. We can style as desired. Split into optgroups as per the mockup. Show the OS/browser selectors even when JS is off--just to indicate what's currently shown--but they're disabled.
* Tweak CSS to not color non-href anchors blue.
* The SUMO team tends to write per-browser content only in broad strokes, encompassing many versions. Thus, made the {for} stuff use the same FF version enum as the article search does. It lines up perfectly with current use and is simple.
* Stop repeating an OS enum: start using the one we already had in models.
* Add alternating numbering styles for TOC entries after consulting with chowse.
* Couple filteredFors() to the page: it didn't end up being useful for the TOC builder, and this simplifies it.
* To come later: sniffing and cookies.
2010-09-20 14:04:38 -07:00
Erik Rose dff12cc67a [586458] [592840] Add support for {for} wiki directive, both inline and block-level.
* Add support for {for} tags: swapping tags for something the wiki formatter will consider inline, running the formatter, replacing the tags, balancing them properly to tolerate user error (since there can be no such thing as invalid wiki markup), and finally choosing whether to make each showfor a div or a span. Nesting showfors works fine.
* Move Knowledgebase-specific wiki parser stuff into wiki.parser.
* Change default value of sumo.parser.WikiParser.parse's show_toc arg to match wikimarkup's.
* Move the sumo app's wiki_to_html() into its parser module to match the placement of the one in the wiki app.
2010-09-20 14:04:38 -07:00
Erik Rose 76235a2701 Make SUMO's WikiParser a subclass of wikimarkup's Parser.
This is in preparation for showfor implementation, which uses a custom tag handler, which receives a copy of the parser when called. With the previous composition-based wrapping, the uncustomized parser would be passed to the tag handler, and any markup inside the tag would be parsed in an un-SUMO-like fashion.
2010-09-20 14:02:09 -07:00
Paul Craciunoiu 3497ee646c [597468] Fall back to default locale when babel doesn't support the currently used one. 2010-09-17 14:34:42 -07:00
Paul Craciunoiu d2958f441c [597070] wiki_to_html util returns unicode, helper returns jinja2.Markup object. 2010-09-16 14:11:16 -07:00
Paul Craciunoiu 57f3f568f5 [592674] Media gallery uploads backend
* 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
2010-09-15 15:23:58 -07:00
Paul Craciunoiu b36fe8e362 [589027] Template hook and custom syntax support
* 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)
2010-09-15 13:44:23 -07:00
Ricky Rosario a79017cbf1 Some minor cleanups from review:
* DRYer new_revision view
* less LOC for dict in test_compare_revisions
2010-09-15 09:53:58 -04:00
Paul Craciunoiu 2d058d950d Clean up code a bit, remove some unnecessary comments and commented out code, and add a test. 2010-09-14 15:49:32 -07:00
Ricky Rosario 3f4882455e [bug 595870] Now correctly setting revision.based_on 2010-09-13 19:23:11 -04:00
Ricky Rosario f415ad8ce4 Document.get_absolute_url() now uses reverse 2010-09-10 16:46:17 -04:00
Ricky Rosario e32749d76b Fixed import for latest django-mozilla-product-details 2010-09-10 15:14:46 -04:00
Ricky Rosario 0d7b90380f [bug 592671] Media and media gallery page 2010-09-10 14:35:12 -04:00
Ricky Rosario 14c6c102e8 [593036] Compare revisions 2010-09-07 19:36:47 -04:00
Ricky Rosario 1d5d97c6b6 [bug 593039] Revision history page
* Includes a change to reverse and url helper to take an optional locale parameter
2010-09-07 17:56:36 -04:00
Ricky Rosario 77a3003763 The Review Revision view/template [bug 593041] 2010-09-07 17:35:45 -04:00
Paul Craciunoiu 28061e093f [592670] Media gallery models: a gallery app
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
2010-09-07 13:16:21 -07:00
James Socol 1dc5d2c2e7 [bug 583427] Removing old fixtures and content types. 2010-09-03 14:28:29 -04:00
James Socol 74aed8d653 [bug 583427] Deleting legacy Forum models. 2010-09-03 13:01:20 -04:00
Paul Craciunoiu 28997476c5 [592100] Adding slug for documents and use it for internal links
* 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
2010-09-02 13:37:32 -07:00
Paul Craciunoiu 7f5e465ee4 Fix some check.py complaints 2010-09-02 13:37:32 -07:00
Paul Craciunoiu 163869835f [592415] Use thumbnail_or_file() right after uploading image 2010-09-01 16:14:42 -07:00
Paul Craciunoiu bddf33f880 Undo changes made in [591454] Make 2.2.x branch work with the updated py-wikimarkup 2010-09-01 10:24:42 -07:00
James Socol 9930bf85fb Stop Answer.get_absolute_url() from making any DB queries. 2010-09-01 12:25:39 -04:00
Ricky Rosario 18bb2b346d [bug 586452] Edit articles view/form/template 2010-09-01 10:09:40 -04:00
Paul Craciunoiu 8d435a7953 [586176] Deleting image leaves thumbnail behind.
* 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.
2010-08-31 12:07:34 -07:00
Paul Craciunoiu d365e6e242 [591454] Make 2.2.x branch work with the updated py-wikimarkup 2010-08-31 11:16:44 -07:00
Erik Rose b695952635 [590776] LocaleURLMiddleware's setting of a thread-local prefixer is now reversed when the request ends, removing one source of apparently random test failures. A short book follows:
* 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`.
* 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.
2010-08-31 11:16:27 -07:00
Erik Rose 8988e2b319 [590704] Switch all tests to use a cache-flushing base class.
test_utils.TestCase also adds an instrumented Jinja render() method so we can assert things about request.context, which contains what's passed into templates.
2010-08-30 22:28:48 -07:00
Erik Rose 0cc4a80bce Stop re-instantiating `Client()`; Django's `TestCase` already provides one. 2010-08-27 14:58:52 -07:00
Erik Rose c7da7d9728 [590776] LocaleURLMiddleware's setting of a thread-local prefixer is now reversed when the request ends, removing one source of apparently random test failures. A short book follows:
* 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.
2010-08-27 13:57:29 -07:00
Ricky Rosario 4d15da56d4 Wrap all datetimes in <time datetime="... 2010-08-27 13:59:51 -04:00
Ricky Rosario 75ad73988a [bug 584577] Tagged question feeds 2010-08-27 13:19:01 -04:00
Ricky Rosario 370c6621a4 [bug 589243] Basic view for creating documents 2010-08-26 17:29:28 -04:00
Erik Rose 60e4e584b8 Fix a mistakenly failing test.
Note: you might need to restart memcached to get it passing. A sweeping fix for this sort of thing is forthcoming.
2010-08-26 15:36:58 -04:00
Ricky Rosario b28d728eaf Bare minimal views and templates for:
* New document
* New revision (== edit document)
* Document revision history
* Document list by category
* All documents list

TODO: Build them all up and polish!
2010-08-26 15:36:57 -04:00
Paul Craciunoiu 7bb0bd800b Fix failing tests, for some reason caused by explicit deletes 2010-08-26 15:36:56 -04:00
Paul Craciunoiu b6fef79a88 [588576] Add an include hook for the wiki parser
Depends on a fix in py-wikimarkup which makes the parser instantiatable.
* parser refactoring for optional wiki_hooks
* inside-function imports to avoid circular importing
* revision save updates document's html, if the revision is more recent
* make hooks pep8er (use _ instead of camelCase)
* move _document and _revision to wiki/tests/__init__.py
* make new document URL be identical to existing document URL
* use from |django.conf import settings| instead of |import settings| everywhere
* move get and post lambdas to sumo/tests/__init__.py
2010-08-26 15:36:55 -04:00
Ricky Rosario 82aefe1a2c [bug 586451] Basic document view template (no CSS included) 2010-08-26 15:36:54 -04:00
Ricky Rosario 9eb84ce307 Some boilerplate for wiki app. 2010-08-26 15:36:53 -04:00
Erik Rose 45c4b993f0 Make firefox_versions and operating_systems delegate to the parent document so we can store this data only once.
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.
2010-08-26 15:36:53 -04:00
Erik Rose a690cccd49 Update and renumber migration 32 (nee 31) to jibe with edits to models. Oops!
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.
2010-08-26 15:36:52 -04:00
Erik Rose 0298e71116 Start wiki app and add skeletal models.
Still plenty to do, but we should be able to collaborate on the rest as we implement.
2010-08-26 15:36:51 -04:00
Paul Craciunoiu 6975470794 [588228] Force num_voted to 0 if None or '' 2010-08-24 10:48:55 -07:00
Cheng Wang 0b1bc5c954 Fixing bug 589902 to add new uservoice link for mobile 2010-08-23 17:24:31 -07:00
Erik Rose d6ee4b054f [589948] Remove redundant AutoField declarations from forums models. 2010-08-23 15:24:11 -07:00
Paul Craciunoiu b3037299df [586330] Pin celery to master 2010-08-20 19:04:59 -07:00
Erik Rose c56c51b117 [588994] Make Threads keep track of their forums and update their last posts when a thread is moved. Keep forums from evaporating when their last posts are moved.
Also move test_delete_last_and_only_post_in_thread into ThreadModelTestCase, since it tests the Thread model.
2010-08-20 17:52:08 -07:00
Erik Rose e04fb4a4ad Factor up last_post_id calculation for both forums and threads. 2010-08-20 14:49:39 -07:00
Paul Craciunoiu 65bd879599 [595029] Cache solution.question to avoid a db lookup in build_solution_notification 2010-08-19 12:25:15 -07:00
Ricky Rosario ca9b467f0b [Bug 582131] Implemented post preview for:
* New forum thread
* Forum reply (new and edit)
* Answer (new and edit)
2010-08-18 21:39:01 -04:00
Erik Rose 67a4192d12 [583106] Introduce 2 new permissions--view_in_forum and post_in_forum--making it possible to have hidden-to-the-public and read-only forums.
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.)
2010-08-16 17:42:40 -07:00
Erik Rose 31735a32b4 Factor the lookup triad resolution out of has_perm_or_owns_or_403() so it's easier to follow. 2010-08-16 17:27:08 -07:00
Paul Craciunoiu 9788f8c8cf [587709] Checking in Cheng's changes to the AAQ form. 2010-08-16 14:34:13 -07:00
Ricky Rosario 476c546c52 Get our tests to pass 2010-08-11 12:06:52 -07:00
Ricky Rosario 806cd53a72 Implemented forum-wide watches. (bug 583273) 2010-08-10 20:38:54 -07:00
Ricky Rosario 5536aca929 [bug 570427] Threads can be moved to different forums now 2010-08-10 18:25:44 -07:00
Paul Craciunoiu d3b0a7eced [575389] Check post_edit_forum permission on forum object, not thread. 2010-08-10 16:56:57 -07:00
Paul Craciunoiu dca544a53f Increase the time delta for forums models tests to avoid Hudson random failures. 2010-08-09 14:29:33 -07:00
Paul Craciunoiu fe5acbcd0a [584937] Flags are not deleted for deleted objects.
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.
2010-08-09 11:57:22 -07:00
Ricky Rosario ed55bcb294 When deleting the solution to a question, set the question solution to None (bug 585313) 2010-08-09 10:42:13 -07:00
Ricky Rosario c814e090b3 Added flagit.can_moderate permission (bug 585198) 2010-08-07 10:11:47 -04:00
Erik Rose f89133ce28 [584741] Collapse and escape linebreaks on troubleshooting info for questions. 2010-08-06 17:01:43 -07:00
Ricky Rosario de88df123d Redirect to answers page after confirming question (bug 585071) 2010-08-06 14:44:58 -04:00
Ricky Rosario 510d596843 AAQ content changes missed in previous round (bug 584870) 2010-08-06 14:28:01 -04:00
James Socol 74836d07ec [bug 584597] Show the value of the frequency, not the key. 2010-08-06 13:52:36 -04:00
Paul Craciunoiu 01bf4d901a [584885] Don't preserve old ids and reply to Tiki threads with new link. Add migration to lock threads from forum 6. 2010-08-06 10:33:21 -07:00