aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Several edits to header dropdown:Jef van Schendel2012-12-021-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Style the up/down arrow as a button - Remove the Actions header - Remove redundant original "Add media" button - Style "Add media" and "Create new collection" links as buttons
| * | | | First commit to add header dropdownJef van Schendel2012-12-023-28/+34
| | | | |
* | | | | Merge commit '9408938' from 565_workbench_cleanup (spaetz)Christopher Allan Webber2013-01-178-43/+96
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Add @get_workbench testSebastian Spaeth2013-01-161-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test the decorator function and proper cleanup after it's usage. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | | | Shorten Workbench(Manager) method namesSebastian Spaeth2013-01-163-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) destroy_self() is a horrible function name, make it "destroy". workbench.destroy() is descriptive enough. 2) WorkbenchManager.create_workbench() -> WorkbenchManager.create() We use the pattern "with workbench_manager.create() as workbench:" No need to mention workbenches three times in a row... Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | | | Switch over media processor to use the get_workbench decorator (#565)Sebastian Spaeth2013-01-165-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes workbench getting more convenient by eliminating some boilerplate and more robust by cleaning the workbench up even if processing ends with an Exception. Finally, this fixes the bugs in the ascii and video backends to never call workbench.destroy, so those workbenches were never cleaned up. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | | | Implement @get_workbench decoratorSebastian Spaeth2013-01-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This passes in a Workbench() via the 'workbench' keyword argument, and conveniently cleans it up after the function has finished. 2 out of our 5 backends forgot to clean up their workbench, so this is clearly needed :-). Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | | | Make Workbench() a context managerSebastian Spaeth2013-01-161-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to use "with Workbench() as foo: do_stuff..." No consumers have been switched yet though. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | | Change position of "Delete account" link, put it below the formJef van Schendel2013-01-172-6/+10
| | | | |
* | | | | Better "delete my account" placementSebastian Spaeth2013-01-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the "delete my account" link location by not placing it outside the main content bar. It still might require more tweaks. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | | Introduce user_deletion test.Sebastian Spaeth2013-01-171-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delete a user via web interface and see if it works. TODO: this does not test that related entries are also cleaned up and we should extend the test to do so. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | | Allowing to delete a user account (#302)Sebastian Spaeth2013-01-174-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a "Delete user account" template and link to it from the user account settings page. Create a delete_account function and fill in most blanks. We can now successfully delete our own account. Thanks to Elrond for catching a stray csrf_exempt in a previous iteration of this patch. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | | import db.sql.util -> db.utilSebastian Spaeth2013-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merging an old branch, I reintroduced an import of db.sql.util rather than db.util. Fixing the glitch. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | | Merge branch '540_User_delete_deletes_related_entries'Sebastian Spaeth2013-01-172-21/+69
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Implement User.delete() (#540)Sebastian Spaeth2013-01-171-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set User.collections to her Collections using the backref feature. This way we can iterate a user's collections and delete them all. Delete all MediaEntries/Files/attachments/comments/collections etc before finally deleting the User object. This is the backend work for issue 302 (allow a user to delete ones own account)
| * | | | Implement Collection.delete()Sebastian Spaeth2013-01-171-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deleting a Collection should automatically delete all containing items. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | | | Implement MediaEntry().delete() (#540)Sebastian Spaeth2013-01-172-19/+37
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Make the workbench destroy itself for video processing also.Christopher Allan Webber2013-01-161-0/+3
| | | |
* | | | Merge remote-tracking branch ↵Christopher Allan Webber2013-01-162-8/+10
|\ \ \ \ | | | | | | | | | | | | | | | 'refs/remotes/spaetz/561_use_workbench_not_tempfiles'
| * | | | Audio and video should use workbench instead of tempfiles (#561)Sebastian Spaeth2013-01-082-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using lots of tempfiles in the audio and video processing backends which worked around our workbench system. Still use the tempfiles package but create them in the workbench directory. This can help address the uploads of large files (#419) where /tmp might be a smallish tmpfs and our workbench a real disk. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | | Merge remote-tracking branch 'refs/remotes/elrond/misc/use_media_id'Christopher Allan Webber2013-01-168-15/+27
|\ \ \ \ \
| * | | | | Start to use the media_id in "admin" URLs.Elrond2013-01-118-15/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-154-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | collection browsing: drop atom feed from page templateStefano Zacchiroli2013-01-151-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rationale: it refers to something else than a "collection feed" thanks to Elrond der Elbenfuerst for pointing this out
* | | | | | collections: add support to browse existing collectionsStefano Zacchiroli2013-01-154-3/+88
| |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | | | | #571: Fixed. Display collection description with Markdown formatting.Tiberiu C. Turbureanu2013-01-151-1/+3
| | | | |
* | | | | Unbreak 301 responsesSebastian Spaeth2013-01-151-0/+4
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The move to werkzeug routing went pretty smooth, but one thing was broken by accident: URLs without final slash result in a 301 werkzeug.routing.RequestRedirect response. We displayed it as a generic error page rather than actually sending the redirect. Do that. One thing it does though is to skip all meddlewares, which should be OK for a 301 response, but might need rework if we decide otherwise. With this, 301 responses with lacking final slash are unbroken again. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | Simplify check_media_slug_usedSebastian Spaeth2013-01-153-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the unused dummy_db argument and generally make the function readable. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | More explicit get_or_create patternSebastian Spaeth2013-01-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't do "user = getUser() or newUser()" in one line. It is bound to confuse poor souls. Be more explicit here and even add a code comment. Thanks to Elrond for not liking the previous pattern. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | Improve error message wording (#564)Sebastian Spaeth2013-01-141-4/+8
| | | | | | | | | | | | | | | | | | | | Improve error message wording if no csf cookie could be detected. Also, make the error text translatable.
* | | | Use the new logo.html thingy in airy.Elrond2013-01-132-98/+25
| | | |
* | | | Move logo part into bits/logo.htmlElrond2013-01-132-7/+26
| | | | | | | | | | | | | | | | | | | | To make it easier for themers to replace the logo, move it out into its own logo.html.
* | | | Kill db_host, db_name, and db_port from config_spec.ini.Elrond2013-01-131-3/+0
|/ / / | | | | | | | | | The last bits of mongo. Let me remove them.
* | | Make runtests.sh be useable from anywhere.Elrond2013-01-111-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now you can have your current directory anywhere and call runtests.sh with full path and it'll find the way to nosetests and the tests directory on its own. Most useful if you're inside the mediagoblin/ dir and can just call "../runtests.sh".
* | | issue 355: Only run tests in mediagoblin/tests/Elrond2013-01-111-1/+26
| | | | | | | | | | | | | | | | | | | | | If you don't give an option argument (starting with a dash) to runtests.sh then it will append the directory with all the tests to the commandline of nosetests. That way it will only search there for tests.
* | | Improve and extend profile editing testsSebastian Spaeth2013-01-091-76/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only ever ran the password changing test here, and not the half-existing test for changing the bio and homepage. Fix the tests to actually run both tests. We check that setting bio and homepage to a valid value works as expected. We also test for invalid bio (too long) and invalid URLs setting fails. (which is what we want). - Check that the old /edit/profile/ address redirects to /u/USER/edit/. - Check that /u/USER/edit/ works as expected - Check that /u/OTHERUSER/edit/ fails with a 403 Forbidden error when we are not logged in as that user. The last remaining test that would be useful is to make a user an admin and make sure the admin can edit other users' profiles. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | Enable /u/USERNAME/edit/ pattern #588Sebastian Spaeth2013-01-094-18/+26
| | | | | | | | | | | | | | | | | | | | | | | | Transition from the inconsistent /edit/profile/?username=FOO to the nicer /u/FOO/edit/. The old pattern will still work and redirects to the new URL. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | Fix tests on webtest < 1.3.6.Elrond2013-01-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Debian testing ships webtest 1.3.4. And it would be nice to use the base packages. One of the csrf tests fails on webtest < 1.3.6. But using a fresh app fixes it. We have no clue, why exactly. When we require webtest 1.3.6, change this.
* | | Move db.sql.migration_tools to db.migration_tools.Elrond2013-01-085-4/+4
| | | | | | | | | | | | Follow the new trend.
* | | Add inspect_table.Elrond2013-01-082-7/+11
| | | | | | | | | | | | | | | | | | In our current scheme of migrations, we reflect the current sql schema into an SQLAlchemy schema. So let's have a tool function for this.
* | | Move all the migration tools into new migration_tools.pyElrond2013-01-086-253/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | Factor all the migration related stuff out into a new .db.sql.migration_tools. First we don't have to load this module for our normal server. Second it makes all the import dependencies a little more cleaner.
* | | Fixing import to mediagoblin.db.base in stl modelsChristopher Allan Webber2013-01-081-1/+1
| | | | | | | | | | | | | | | Previously we had mediagoblin.db.sql.base, that just changed to drop the sql; fixing.
* | | Merge branch 'WIP/test_performance'Sebastian Spaeth2013-01-0810-48/+43
|\ \ \ | |/ / |/| |
| * | tests: More instances where a fresh database is not neededSebastian Spaeth2013-01-085-31/+27
| | | | | | | | | | | | Save test runtime by not dumping the databases when not needed.
| * | Don't get a fresh app when not neededSebastian Spaeth2013-01-084-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | These tests, don't need fresh databases, so don't discard and recreate the tables. This reduces test suite runtime on my laptop from 130 to 96 seconds. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | Do not fail is a user exists alreadySebastian Spaeth2013-01-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the tests want to create a new user, don't fail if it already exists and just reuse the existing one. This allows us to run tests without dumping the whole database if that is not needed for the tests. The upcoming tests for test_edit will make use of this. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | Don't read full image media into RAM on copying (#419)Sebastian Spaeth2013-01-081-10/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | We copy uploaded media from the queue store to the local workbench and then to its final destination. The latter was done by simply: dst.write(src.read()) which is of course evil as it reads the whole file content into RAM. Which *might* arguably still be OK for images, but you never know. Make use of the provided storage() methods that offer chunked copying rather than opening and fudging with files ourselves. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Fix slug lookup regression (#587)Sebastian Spaeth2013-01-081-17/+21
| | | | | | | | | | | | | | | | | | | | | | Removing the Mongo InvalidID legacy code removed an explicit check for "int" for the id lookup. This led the @get_user_media_entry decorator to fail if we looked up a nonexisting non-numerical slug (it tried to query the id with a string, which failed). Cast id to int and return 404 in case it is non-numeric which fixes the regression. It does not fix the underlying problem of slug_or_id lookups that were discussed. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Made the airy header element responsive againJoar Wandborg2013-01-071-0/+6
| |