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

907 Коммитов

Автор SHA1 Сообщение Дата
Ricky Rosario 1230d591ac In the document view, fallback to default locale if the translation has no current_revision. 2010-12-10 11:24:59 -05:00
Paul Craciunoiu 036b3a62cd [615591] Don't use LOGIN_* or LOGOUT_* settings, use reverse() instead.
* 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.
2010-12-09 14:22:25 -08:00
Ricky Rosario 98d0490f79 Don't link to translation if it doesn't have a current revision. [bug 615827] 2010-12-09 13:41:32 -05:00
James Socol acdc9415ce Improve messaging around registration. [bug 617809] 2010-12-09 11:33:45 -05:00
Fred Wenzel 44737bd53d Actually store replies with UTC timezone, not a few hours off. Bug 617785. 2010-12-08 16:01:37 -08:00
Fred Wenzel 226c6857d4 Show the first user to reply to a tweet as opposed to the latest. Bug 617418. 2010-12-08 15:05:58 -08:00
Paul Craciunoiu 3de879b48f [617379, 617162] Avatar is replaced when new one is uploaded. Also allow to delete avatar.
* 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.
2010-12-08 13:33:04 -08:00
Ricky Rosario 5855049ddf Fixed kb dashboard link text and profile link url. [bug 617124] 2010-12-08 15:46:02 -05:00
Ricky Rosario 9589426e29 Fixed sidebar links. [bug 617124] 2010-12-08 11:45:40 -05:00
James Socol f618255d56 Check for an existing avatar before generating. [bug 617090] 2010-12-07 18:27:23 -05:00
Ricky Rosario 6c07b39216 When editing an existing localization without a current revision, fallback to the latest non-rejected revision's content. [bug 615701] 2010-12-07 15:54:48 -05:00
Ricky Rosario 40aa3867dc Show busy spinner image when submitting a tweet reply. [bug 617363] 2010-12-07 15:12:29 -05:00
Paul Craciunoiu b71bb1e229 [615385] Fix to generate video thumbnails. Needs refactoring in the future. 2010-12-07 10:26:10 -08:00
Paul Craciunoiu 8b674baa8a [478929] Resize avatars and restrict upload size. 2010-12-07 10:16:08 -08:00
James Socol 87fd878be5 Nuke the converter. 2010-12-07 12:57:56 -05:00
James Socol 9ffcff5381 Missed a spot. 2010-12-07 12:57:55 -05:00
James Socol 34e2d68987 Nuke Tiki fixtures. 2010-12-07 12:57:55 -05:00
James Socol 9fd43dc2b0 Remove expired management commands. 2010-12-07 12:57:55 -05:00
James Socol f04b54b802 Nuke Tiki Category. 2010-12-07 12:57:55 -05:00
James Socol 56016dce33 Nuke WikiPage. 2010-12-07 12:57:54 -05:00
James Socol 63bb20c6da Make Questions know about the new Wiki app. [bug 617224] 2010-12-07 12:57:54 -05:00
James Socol b49c63faa1 Nuke Tiki Sessions from Orbit [bug 613987] 2010-12-07 12:57:54 -05:00
Ricky Rosario 13f4f96396 Show two significant digits for response rate %. [bug 617109] 2010-12-07 10:54:47 -05:00
James Socol e1e65d0a9b Update profile_url and add display_name. [bug 616565] 2010-12-06 20:21:43 -05:00
Ricky Rosario f2549893f2 Changed minimum slug length to 3 characters. [bug 617169] 2010-12-06 20:17:46 -05:00
Paul Craciunoiu 86cedcb916 [614375] Make gallery media_type localizable. Also 'Description', 'Locale', and 'Title'
* 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
2010-12-06 16:56:17 -08:00
Paul Craciunoiu 3721384dc9 [614016] Profile view and tests. 2010-12-06 16:43:56 -08:00
Ricky Rosario d04a9bfc85 Open link to twitter user profile in new tab. [bug 612977, bug 612979] 2010-12-06 19:39:43 -05:00
Erik Rose 8377e7e05a [612983] Show a link to and time since the original tweet in the reply dialog. 2010-12-06 16:12:08 -08:00
Erik Rose 7110b18be9 Correct spelling of "speach-bubbles" CSS ID. 2010-12-06 16:12:08 -08:00
James Socol daf91013f3 Update profile_avatar to show the avatar or a default. [bug 616565, bug 614036] 2010-12-06 18:06:52 -05:00
James Socol 1a8aec2478 Move profile_url and profile_avatar to users. [bug 616565] 2010-12-06 18:06:52 -05:00
Fred Wenzel fe2ece3855 Make list of ignored users changeable in the settings. Bug 617095. 2010-12-06 14:41:59 -08:00
Fred Wenzel 955ac599b9 Do not throw 405 error when logging out. Bug 612969. 2010-12-06 11:58:36 -08:00
Fred Wenzel 80fe0380af Added signin buttons to Customer Care page. Bug 612974. 2010-12-06 11:55:45 -08:00
Erik Rose 8c1c78d04c [616284] Make auto-created redirects unlocalizable.
As for the other deleted comment, we decided to implement the locale fallback instead of doing that.
2010-12-06 11:23:10 -08:00
Erik Rose 09c452b88d [614664] Tolerate wikimarkup's habit of including adjacent newlines in the paragraphs the stripper makes for block-level {for}s.
More specifically, make the unstripper work in more (all?) cases so the rebalancer doesn't move the {/for} up into the empty paragraph.
2010-12-06 10:50:41 -08:00
Ricky Rosario ab721763c5 Added parsing of {pref } in wiki syntax. [bug 617019] 2010-12-06 13:20:23 -05:00
Paul Craciunoiu 6bb15f7b6a [614011] AAQ login/register, now its own page.
* 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.
2010-12-03 12:47:11 -08:00
James Socol 61b2a3dc56 Save the correct URL of the avatar. [bug 614464] 2010-12-03 14:43:29 -05:00
Ricky Rosario f4ee276e67 Implemented the Edit Profile page. [bug 614019] 2010-12-03 14:31:02 -05:00
James Socol 57033320b0 Create a management command to migrate users and avatars. [bug 614464] 2010-12-03 11:48:38 -05:00
James Socol ebaca5ebc3 Make profile/nick/display name optional. 2010-12-03 11:48:37 -05:00
Fred Wenzel aa6b61a068 Keep number of avatars in Customer Care stats to a maximum of 16 (4x4). 2010-12-02 14:48:26 -08:00
Erik Rose 23934a28cc [615825] When stripping {for}s, ForParser now takes any whitespace gobbled up by previous for-token matches into account when deciding how much padding to add to the current one. It also takes into account any newlines added when spacing out previous block-level {for} tokens into their own paragraphs.
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
2010-12-02 11:47:04 -08:00
Ricky Rosario 14a4f32c1d Use hashlib instead of deprecated sha1. 2010-12-02 12:57:44 -05:00
Fred Wenzel f8b4bf3365 Warn if Customercare stats data is outdated. Bug 612966. 2010-12-02 09:42:31 -08:00
Ricky Rosario a10cdef003 Implemented user account activation via confirmation email. [bug 614703] 2010-12-02 12:13:20 -05:00
Fred Wenzel 9effabdf32 Merge branch 'cc-tweet-summary-612952' 2010-12-01 16:36:15 -08:00
Fred Wenzel a6f1910595 Show tweet statistics in the Customer Care sidebar. Bugs 612952, 612966, 612960, 612964. 2010-12-01 16:35:40 -08:00
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