aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages/routing.py
Commit message (Collapse)AuthorAgeFilesLines
* Removed almost all of the code from coresaksham11152016-07-191-11/+1
|
* Only video uploader can edit their subtitlessaksham11152016-07-191-1/+1
|
* Made decorators views for Customize Interfacesaksham11152016-07-191-0/+5
|
* Subtitle built over attachments : workingsaksham11152016-07-191-0/+5
|
* added filtering by entry state in processing panelBoris Bobrov2016-02-011-0/+5
|
* Change 'federation' name to 'api' which is more suitableJessica Tallon2015-02-151-0/+4
|
* Created the media metadata editor pagetilly-Q2014-05-061-0/+4
|
* I did some more code-keeping in this commit. I added a lot of documentation, sotilly-Q2013-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that most of my functions do indeed have effective docstrings. I also changed the decorators so that they imply eachother in a logical way. I also modified the one decorator get_media_comment_by_id to be more usable with the variable urls of mediagoblin.user_pages.views:file_a_report. I also noticed a few tests had broken, so I went through them and fixed them up, finding that mostly there were problems in my actual writing of the tests. I also did a few other small tasks such as creating a new User method to check whether or not a User is ban- -ned. =============================================================================== Added in documentation =============================================================================== --\ mediagoblin/db/models.py --\ mediagoblin/decorators.py --\ mediagoblin/moderation/forms.py --\ mediagoblin/moderation/tools.py --\ mediagoblin/moderation/views.py --\ mediagoblin/user_pages/lib.py =============================================================================== Rearranged decorators to be more efficient =============================================================================== --\ mediagoblin/decorators.py --| Made it so that user_not_banned is encapsulated in require_active_login --| Made it so that require_active_login is encapsulated in user_has_privilege --| Changed get_media_comment_by_id into get_optional_media_comment_by_id. It | now returns valid code if the MediaComment id is absent. This makes it pos- | -sible to use this decorator for the function: | mediagoblin.user_pages.views:file_a_report --\ mediagoblin/user_pages/views.py --| Replaced the mediagoblin.user_pages.views:file_a_comment_report with the | decorator mentioned above --\ mediagoblin/user_pages/routing.py ----------------------------------------------------------- | took out unnecessary @user_not_banned decorators | ----------------------------------------------------------- --\ mediagoblin/submit/views.py --\ mediagoblin/user_pages/views.py =============================================================================== Fixed broken tests =============================================================================== --\ mediagoblin/tests/test_auth.py --\ mediagoblin/tests/test_privileges.py --\ mediagoblin/tests/test_submission.py =============================================================================== Fixed broken code =============================================================================== --\ mediagoblin/tools/response.py =============================================================================== Other Tasks =============================================================================== --\ mediagoblin/db/models.py --| Added in User.is_banned() method --\ mediagoblin/decorators.py --| Utitilized User.is_banned() method in the user_not_banned decorator --\ mediagoblin/moderation/views.py --| Made it impossible for an admin to ban themself. --| Got rid of a vestigial print statement --\ mediagoblin/templates/mediagoblin/base.html --| Made it so the top panel does not show up for users that are banned. --\ mediagoblin/templates/mediagoblin/moderation/user.html --| Rearranged the javascript slightly ===============================================================================
* Merge branch 'master' into OPW-Moderation-Updatetilly-Q2013-08-201-0/+4
|\ | | | | | | | | | | | | | | Conflicts: mediagoblin/db/models.py mediagoblin/decorators.py mediagoblin/routing.py mediagoblin/user_pages/views.py
| * Added comment preview functionality to user pages. It works by passing the ↵Emily O'Leary2013-08-071-0/+4
| | | | | | | | | | | | comment's value as a JSON string to a new handler that lives at /ajax/comment/preview. The query string is decoded, unquoted, and has its leading and trailing quotes removed to match the input that cleaned_markdown_conversion expects. It does this in real time with a 500ms lag by using a timer. Initially I tried the onChange handler but you need to lose focus for that to process. The javascript timer is only invoked if the add comment button is pressed. A request is only sent if the comment box is not empty and the current value is not the same as the last value.
* | This is the first stage of my project of implenting admin/moderator functiona-tilly-Q2013-06-241-0/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lity. At this point, I have finished all the of basic work with the models! I still need to do some tightening of their documentation, but they seem to be working well. Working with Models ======================================== --\ mediagoblin/db/models.py --| Added in the Report model and table. This model is strictly a parent ----| Added in the CommentReport model which holds information about a report | filed against a comment. This class inherits from Report. ----| Added in the MediaReport model which holds information about a report f- | -iled against a media entry. This class inherits from Report. --| Added in a UserBan model and table. This model is in a one to one relatio- | -nship with User. This object acts as a marker for whether a user is banned | or not. --| Added in a Group model. These objects are in a many-to-many relationship | with User to explain which privileges a User has. ----| Added in GroupUserAssociation which is a table used to hold this many to | many relationship between Group & User. --\ mediagoblin/db/migrations.py --| Added in the migrations for all of the additions to models --| Added UserBan_v0 --| Added Report_v0 ----| Added CommentReport_v0 ----| Added MediaReport_v0 --| Added Group_v0 ----| Added GroupUserAssociation_v0 Working with Templates, Views, and Routing =============================================== >>> Reporting a Comment or a MediaEntry --\ mediagoblin/user_pages/views.py --| Added in the function file_a_report to allow user to file reports against | MediaEntries or Comments. Handles GET and POST requests. --| Added in the function file_a_comment_report which uses file_a_report but | also catches appropriate information for comment_ids. I may be able to do | this more eloquently with decorators. --\ mediagoblin/user_pages/routing.py --| Added in route 'mediagoblin.user_pages.media_home.report_media' | (linked to address /u/<user>/m/<media>/report/ ) --| Added in route ''mediagoblin.user_pages.media_home.report_comment' | (linked to address /u/<user>/m/<media>/c/<comment>/report/ ) --\ mediagoblin/templates/mediagoblin/user_pages/report.html --| I created this file to handle the filing of a report. --\ mediagoblin/templates/mediagoblin/user_pages/media.html --| Modified this file to add in links allowing users to report either media | or comments. --\ mediagoblin/user_pages/lib.py --| Added in build_report_form which processes data as either a CommentReport or | a MediaReport depending on which parameters are present --\ mediagoblin/user_pages/forms.py --| Added in CommentReportForm --| Added in MediaReportForm --| note: ReportForm is vestigial to an earlier strategy I used and I'll remove it | promptly --\ mediagoblin/decorators.py --| Added in 'get_media_comment_by_id' for use in mediagoblin/user_pages/views.py >>> New Admin Panels --\ mediagoblin/admin/views.py --| Added in the function admin_users_panel --| Added in the function admin_reports_panel --\ mediagoblin/admin/routing.py --| Added in route 'mediagoblin.admin.users' | (linked to address '/a/users') --| Added in route 'mediagoblin.admin.reports' | (linked to address '/a/reports/') --\ mediagoblin/templates/admin/user.html --| Created this file as a template for monitoring users --\ mediagoblin/templates/admin/report.html --| Created this file as a template for monitoring reports filed against media or | comments
* Use media.id for collecting media too.Elrond2013-02-241-1/+1
| | | | Also remove some useless whitespace while at it.
* Use the media id for attachmemt editing.Elrond2013-02-241-1/+1
| | | | And remove some stray white space from the output.
* Making the tags on media pages point to the user's tag listing specifically.Christopher Allan Webber2013-02-211-1/+1
| | | | This commit sponsored by Torsten Meissner. Thanks, Torsten!
* Implement user's tag filtered gallery pageSebastian Spaeth2013-01-211-0/+5
| | | | | | | | tags used to be global, you could only browse media by tag for all users. This patch implements a view that allows us to browse only a user's tagged media. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fix linking to comments.Elrond2013-01-171-1/+1
| | | | | | | | | | | | | | when linking to a comment in a MediaEntry, the page did not contain a <a name="comment"> because, well: We fetched a string comment-id from the routing. And the pagination code tried to compare that to the int id on the comment. Fix is to let routing fetch an int from the url. Easy. Relatedly remove duplicated comment_id fetching from the URL in the view.
* Merge remote-tracking branch 'refs/remotes/elrond/misc/use_media_id'Christopher Allan Webber2013-01-161-3/+3
|\
| * Start to use the media_id in "admin" URLs.Elrond2013-01-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | We have a bunch of URLs that are more for internal use. At least they're definitely not intended to be posted somewhere for long term useage. When those things affect a media, it's much better to reference the media by its id. This can't change, ever. This is better for races. Like someone posting a comment while the owner corrects a typo in the slug.
* | collection browsing: rename view/template user_collections -> collection_listStefano Zacchiroli2013-01-151-2/+2
| | | | | | | | | | Rationale, avoid confusion between views user_collection and user_collections (note trailing "s"). Ditto for the collection(s).html templates.
* | collections: add support to browse existing collectionsStefano Zacchiroli2013-01-151-0/+4
|/ | | | | | | - add a route at /u/<user>/collections/ (note trailing 's') that lists all existing collections - move there the "Create new collection" link, if the user is logged in - add a new link "Browse collections" from root.html
* Move things from routing.py to tools/routing.pyElrond2012-12-231-1/+1
| | | | | | | This stops a cyclic import. Move add_route, mount and endpoint_to_controller into tools/routing.py and change all callers.
* Remove mongolisms from user_pages.view #451Sebastian Spaeth2012-12-211-0/+1
|
* Fixed attachmentsJoar Wandborg2012-10-231-1/+1
|
* Fixed 404 page under werkzeug.routingJoar Wandborg2012-10-141-1/+1
| | | | | - Removed ?lang=<langcode> feature due to incompatibility with werkzeug routes in the current state of the architecture.
* Switched most stuff over from RoutesJoar Wandborg2012-10-141-45/+65
| | | | | | | | | | Removed the Routes routing functionality and replaced it with werkzeug.routes. Most views are functional. Known issues: - Translation integration with the request object is not yet figured out. This breaks 404 pages.
* Added basic collection functionalityAaron Williamson2012-09-181-0/+15
|
* It's 2012 all up in hereChristopher Allan Webber2012-02-021-1/+1
|
* 508. Updates copyright/license informationWill Kahn-Greene2011-09-011-1/+1
|
* Feature #403 - Ability to delete media entries - Fixes according to feedbackJoar Wandborg2011-08-301-2/+2
| | | | | | | | | | * Moved `mediagoblin.confirm` stuff to `mediagoblin.user_pages`, templates too. * Removed route extension for `mediagoblin.confirm` * Created `delete_media_files` which deletes all media files on the public_store when the entry is deleted * Created a new decorator to check if a user has the permission to delete an entry.
* I think confirm_delete deserves a url like /confirm-delete/ rather than ↵Christopher Allan Webber2011-08-291-2/+3
| | | | | | /confirm/ Adjusting appropriately.
* Merge remote branch 'remotes/jwandborg/f403_ability_to_delete'Christopher Allan Webber2011-08-281-0/+2
|\ | | | | | | | | | | | | Conflicts: mediagoblin/edit/views.py mediagoblin/templates/mediagoblin/user_pages/media.html mediagoblin/user_pages/routing.py
| * + 'confirm' section for confirmation dialoguesMark Holmquist2011-08-221-0/+2
| | | | | | | | | | + implemented delete functionality * fixed several instances of 'must be an instance of unicode, not str'
* | Merge branch 'master' into jwandborg-f482_media_attachmentsChristopher Allan Webber2011-08-221-1/+5
|\| | | | | | | | | | | | | | | | | Conflicts: mediagoblin/config_spec.ini mediagoblin/edit/forms.py mediagoblin/edit/views.py mediagoblin/submit/views.py mediagoblin/templates/mediagoblin/user_pages/media.html
| * Processing panel viewChristopher Allan Webber2011-08-141-1/+5
| | | | | | | | Now you can view your failed and in-process media items!
* | Feature #482 - Media attachments -Joar Wandborg2011-08-221-1/+4
|/ | | | | * Moved attachment uploading to separate view * Support for multiple attachments!
* Issue #431 - Prevent comment link expiry - Added functionality for comment ↵Joar Wandborg2011-07-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | linking * `media.html` * Changed comment textarea handle from `comment` => `field_comment` * Active comment is hilighted with the CSS class name `comment_active` and also with the hyperlink anchor #comment * Changed media.html so that pagination always uses Route('mediagoblin.user_pages.media_home') as base_url * `user_pages/forms.py` * Renamed MediaComment form field `comment` => `field_comment` * `user_pages/routing.py` * Added route for `/u/joar/m/123..456/c/234..567/`, points to `media_home` * `user_pages/views.py` * `media_home` now checks if the request contains a comment id parameter then acts accordingly with pagination whether to call it with a `jump_to_id` or not. * `media_post_comment` - Updated MediaCommentForm field name `comment` => `field_comment` * `util.py` * `redirect` now supports querystring arguments. - NOT USED (should we keep it? I think so, it might be useful, sometime [don't call me a code hoarder]). * `Pagination.__init__` now accepts one further argument, the `jump_to_id`. It assist the comment linking functionality in finding and returning the proper page for a comment. This feature will work for all kinds of objects. It might not be optimal, but it is well functional :)
* Issue #362 - Added a route to MediaComment POST handlerJoar Wandborg2011-06-291-1/+4
|
* adds routing.py and view.py changescfdv2011-06-161-0/+2
|
* Mount media editing under /u/{username}/m/{media}/edit/Christopher Allan Webber2011-06-041-0/+2
|
* modified atomfeed feature, corrected spacing, url generation, routing idBernhard Keller2011-05-231-1/+3
|
* MediaEntry slugs usable in URLs, & decorator that grabs media from the requestChristopher Allan Webber2011-05-201-1/+1
|
* Removing the raw string-nessChristopher Allan Webber2011-05-131-1/+1
|
* URLs should end in trailing slashes, or slash redirection doesn't workChristopher Allan Webber2011-05-111-3/+3
|
* Implement simple media detail pageSebastian Spaeth2011-05-101-0/+24
This patch creates a "homepage" for each media. The URL is /u/<username>/m/<objID>. On it we display the media and some details. It is ugly and lacking some stuff but it works. The only thing left to do is to throw an 404 error if the <username> and the media uploader don't correspond. - Also create a user "home page" while at it. It is merely a place holder for now though. - Link from the entries on the homepage, to the media pages, so we actually find them. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>