aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages
Commit message (Collapse)AuthorAgeFilesLines
* Use media.id for collecting media too.Elrond2013-02-242-2/+2
| | | | 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!
* Fixing user gallery tags filter to be on slug rather than name.Christopher Allan Webber2013-02-211-1/+1
| | | | This commit sponsored by Kat Walsh. Thanks, Kat!
* Merge remote-tracking branch 'refs/remotes/spaetz/WIP/user_tag_gallery'Christopher Allan Webber2013-02-212-3/+15
|\
| * Implement user's tag filtered gallery pageSebastian Spaeth2013-01-212-3/+15
| | | | | | | | | | | | | | | | 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 errors in collection viewsJoar Wandborg2013-02-181-0/+5
| | | | | | | | When a collection does not exist, render the 404 page.
* | Change from email format in tag URI to domain formatJoar Wandborg2013-02-131-2/+2
| | | | | | | | Also fixed a bug (thanks pyflakes)
* | Address concerns in Issue #543Joar Wandborg2013-02-131-8/+10
| | | | | | | | | | | | | | - Fixed PEP-008 issues. - Removed .user-{user} from the tag URI and put it before the domain, such as {user}@{host} instead. - Use year from collection.created instead of current year.
* | Mark "Collection" for translation in media_collect.Elrond2013-02-051-1/+3
| |
* | Moved MediaComment form descriptions to apt. placeJoar Wandborg2013-01-221-2/+5
|/
* Fix linking to comments.Elrond2013-01-172-3/+4
| | | | | | | | | | | | | | 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.
* Return to media collection page if no collection selectedSebastian Spaeth2013-01-171-0/+4
| | | | | | | | | | schendje rightly pointed out that we should not return to the media homepage if we did not select a collection on the "collect" page, but should actually return to the collect page. This is an improvement of the user experience ;-) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Merge branch '540_User_delete_deletes_related_entries'Sebastian Spaeth2013-01-171-16/+1
|\
| * Implement MediaEntry().delete() (#540)Sebastian Spaeth2013-01-171-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | Deleting a MediaEntry instance will automatically delete all related comments and files/attachments. This moves implementation logic out of views.py and allows to make use of this functionality when e.g. deleting a User() account. Whenever a MediaEntry entry is deleted, this will also sql-delete the corresponding MediaFile entry. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Merge remote-tracking branch 'refs/remotes/elrond/misc/use_media_id'Christopher Allan Webber2013-01-162-5/+6
|\ \
| * | Start to use the media_id in "admin" URLs.Elrond2013-01-112-5/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | 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-152-4/+4
| | | | | | | | | | Rationale, avoid confusion between views user_collection and user_collections (note trailing "s"). Ditto for the collection(s).html templates.
* | collection browsing: remove pagination supportStefano Zacchiroli2013-01-151-6/+2
| | | | | | | | | | | | | | rationale: we do not expect hundreds of collection (and it was likely broken anyhow) thanks to Elrond der Elbenfuerst for pointing this out
* | collections: add support to browse existing collectionsStefano Zacchiroli2013-01-152-0/+21
|/ | | | | | | - 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
* Remove custom GMQuery classSebastian Spaeth2013-01-071-1/+1
| | | | | | | | | We provided a custom GMQuery class that offered a .sort() method for compatibility with the Mongo syntax. Now that we have settled for sqlalchemy which uses the order_by() method, we can safely remove this custom class and move a little closer to "pure" and native sqlalchemy usage. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Move db.sql.models* to db.models*Sebastian Spaeth2013-01-071-1/+1
|
* Remove mediagoblin.db.sql.fake.DESCENDINGSebastian Spaeth2013-01-071-3/+2
| | | | | | | | This is the last remnant that requires us to keep db.sql.fake.py. Use ModelName.desc() or sqlalchemy.sql.expression.desc(column) to achieve descending sorts. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Remove ObjectId from the treeSebastian Spaeth2012-12-251-2/+2
| | | | | | | This was one of the last remaining Mongo holdouts and has been removed from the tree herewith. Good bye, ObjectId. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Mongo removal: Remove the validate=True arg to obj.save()Elrond2012-12-241-3/+3
| | | | | all callers were forced to use validate=True anyway. So remove this useless stuff.
* 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.
* Compare user by id not object equalitySebastian Spaeth2012-12-231-4/+1
| | | | | | | | | | Elrond correctly remarked that we should be comparing user by id and not by comparing User objects (as I mistakenly did). He is right, of course! Also removing the 2 stray debug prints that were left over. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Improve sqlalchemy filter rulesSebastian Spaeth2012-12-231-19/+22
| | | | | | | | | | | | Thanks to Elrond's review. 1) Use filter_by more consistently rather than mixing filter and filter_by. 2) Add multiple AND conditions in the same filter rule rather than using separate ones. 3) The atom feeds used filter_by(Modelname.attr == ...) which was the wrong pattern, of course. Thanks for repairing my junk Elrond! Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Remove mongolisms from user_pages.view #451Sebastian Spaeth2012-12-212-54/+46
|
* Refactor media_collectSebastian Spaeth2012-12-211-85/+76
| | | | | | | | | | | Remove lots of MOngolisms. Refactor this to remove some indentation levels. Don't do: if success: ... if success: .... if success: ...
* webob.HTTPFound --> MG.tools.redirectSebastian Spaeth2012-12-211-5/+3
| | | | | | Transition away from webob. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Move DBModel._id -> DBModel.idSebastian Spaeth2012-12-212-14/+14
| | | | | | | | | | | | | | | | | | | | | | | We were refering to model._id in most of the code base as this is what Mongo uses. However, each use of _id required a) fixup of queries: e.g. what we did in our find() and find_one() functions moving all '_id' to 'id'. It also required using AliasFields to make the ._id attribute available. This all means lots of superfluous fixing and transitioning in a SQL world. It will also not work in the long run. Much newer code already refers to the objects by model.id (e.g. in the oauth plugin), which will break with Mongo. So let's be honest, rip out the _id mongoism and live with .id as the one canonical way to address objects. This commit modifies all users and providers of model._id to use model.id instead. This patch works with or without Mongo removed first, but will break Mongo usage (even more than before) I have not bothered to fixup db.mongo.* and db.sql.convert (which converts from Mongo to SQL) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fix user collection gallerySebastian Spaeth2012-12-051-13/+9
| | | | | | | | | | | We were fetching the user collection gallery by slug only, so if two users had the same collection slug, we would not have been sure which one we'd get. Fix this by explicitly only fetching the specific user's collections. Also switch over the view function to make use of the new active_user_from_url decorator that fetches the User() object for us. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Switch over the user gallery to the active_user_from_url decoratorSebastian Spaeth2012-12-051-13/+10
| | | | | | | | This switches the user gallery page over to use the new decorator, and cleans up the queries to be in proper sqlalchemy format rather than the old mongo format. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* make media_manager a property of MediaEntry in mixin.pySebastian Spaeth2012-12-041-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | In all cases where get_media_manager(_media_type_as_string) was called in our code base we ultimately passed in a "MediaEntry().media_type" to get the matching MEDIA_MANAGER. It so makes sense to make this a function of the MediaEntry rather than a global function in mediagoblin.media_types and passing around media_entry.media_type as arguments all the time. It saves a few import statements and arguments. I also made it so the Media_manager property is cached for subsequent calls, although I am not too sure that this is needed (there are other cases for which this would make more sense) Also add a get_media_manager test to the media submission tests. It submits an image and checks that both media.media_type and media.media_manager return the right thing. Not sure if these tests could not be merged with an existing submission test, but it can't hurt to have things explicit. TODO: Right now we iterate through all existing media_managers to find the right one based on the string of its module name. This should be made a simple dict lookup to avoid all the extra work. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* 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.
* Replaced all request.POST with request.form, ...Joar Wandborg2012-09-291-11/+11
| | | | | - Fixed error handling in OAuth plugin - Changed request.POST file fields to request.files
* Style fixesJoar Wandborg2012-09-181-21/+33
|
* Fixed post-collect redirect to always take user to image collected.Aaron Williamson2012-09-181-1/+1
|
* Reference collection creator through already-existing collection_item's ↵Aaron Williamson2012-09-181-1/+1
| | | | foreign key
* Added basic collection functionalityAaron Williamson2012-09-183-5/+316
|
* Panel improvementsJoar Wandborg2012-07-111-7/+17
| | | | | | | | | | - Added progress meter for video and audio media types. - Changed the __repr__ method of a MediaEntry to display a bit more useful explanation. - Added a new MediaEntry.state, 'processing', which means that the task is running the processor on the item currently. - Fixed some PEP8 issues in user_pages/views.py - Fixed the ATOM TAG URI to show the correct year.
* Merge branch 'master' into 201207-testfixesBrett Smith2012-07-081-1/+12
|\
| * fixing bug #255 as Joar and CWebber ask me to do :)Jorge Araya Navarro2012-06-281-1/+12
| |
* | Prevent non-Unicode SQLAlchemy warnings in most submission tests.Brett Smith2012-07-081-8/+8
|/ | | | This commit makes test_submission mostly warning-clean.
* Fixed some comment notification code for compliance with SQLJoar Wandborg2012-06-102-12/+15
| | | | * Pulled instance name in notification email from config
* Merge remote-tracking branch ↵Joar Wandborg2012-06-102-0/+61
|\ | | | | | | | | | | | | 'is_derek/bug405_email_notifications_for_comments' into notifications-merge Conflicts: mediagoblin/db/mongo/migrations.py
| * Updates to send email comments, included translation, better validation.Derek Moore2012-03-251-9/+9
| |