118 Commits

Author SHA1 Message Date
Sebastian Spaeth
65969d3fb7 Simplify check_media_slug_used
Remove the unused dummy_db argument and generally make the function
readable.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2013-01-15 14:49:50 +01:00
Sebastian Spaeth
abc4da2927 Enable /u/USERNAME/edit/ pattern #588
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>
2013-01-09 09:56:53 +01:00
Elrond
3d91433230 Move things from routing.py to tools/routing.py
This stops a cyclic import.

Move add_route, mount and endpoint_to_controller into
tools/routing.py and change all callers.
2012-12-23 12:26:34 +01:00
Sebastian Spaeth
cfa922295e Convert return HttpException to raise HttpException
controllers (view function) raise HttpException's and do not return them.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-23 11:58:51 +01:00
Sebastian Spaeth
950124e640 webob.HTTPFound --> MG.tools.redirect
Transition away from webob.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-21 08:11:40 +01:00
Sebastian Spaeth
62d14bf50b Transition webob.HttpForbidden to webob's exceptions Forbidden
Also the BadRequest exception.
2012-12-21 08:11:40 +01:00
Sebastian Spaeth
5c2b84869f Move DBModel._id -> DBModel.id
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>
2012-12-21 00:30:48 +01:00
Elrond
32255ec015 Fix translations around.
This includes:
- Mark more strings for translation
- Don't mark html-only nonsense for translation
- Mark a better part for translation.
2012-12-03 16:52:35 +01:00
Christopher Allan Webber
ee62c51d79 Merge remote-tracking branch 'refs/remotes/spaetz/trac_475_email_notification_checkbox' 2012-11-13 08:55:14 -06:00
LotusEcho
5e5b8acfec Don't put checkbox text on separate line (#475)
Manually render the "notify me" checkbox line in the account settings
to not put the form label as a heading but in the same line as the
checkbox.

Edit forms.py to use the label attribute for the caption.

Original patch modified by Sebastian Spaeth to 1) not translate the
checkbox label in the template, it is translated in forms.py already.
2) Simplify the HTML, manually constructing the <label> tag is not
necessary, WTforms does it automatically.

Author:    LotusEcho <Emma.C.Echo@gmail.com>
Modified-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-11-13 15:47:34 +01:00
Joar Wandborg
c43f8c1d92 Fixed attachments 2012-10-23 01:10:46 +02:00
Joar Wandborg
7742dcc1fb Switched most stuff over from Routes
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.
2012-10-14 13:46:31 +02:00
Joar Wandborg
111a609df5 Replaced all request.POST with request.form, ...
- Fixed error handling in OAuth plugin
- Changed request.POST file fields to request.files
2012-09-29 21:08:20 +02:00
Christopher Allan Webber
a648102890 Too much was marked for translation this gettext message.
Thanks for catching AVRS!
2012-09-24 14:00:34 -05:00
Aaron Williamson
b5a64f7884 Removed unnecessary reference to may_edit_collection in edit views.py 2012-09-18 18:10:36 +02:00
Aaron Williamson
be5be1154f Added basic collection functionality 2012-09-18 18:10:36 +02:00
Jef van Schendel
e175251899 Edit comment-notification text 2012-07-20 22:03:43 +02:00
Joar Wandborg
825b136227 Added some security checks to attachment upload, it's still not
waterproof.
2012-06-24 21:29:07 +02:00
Joar Wandborg
879ff4bde6 Merge remote-tracking branch 'is_derek/bug405_email_notifications_for_comments' into notifications-merge
Conflicts:
	mediagoblin/db/mongo/migrations.py
2012-06-10 15:53:46 +02:00
Will Kahn-Greene
a855e92a98 Fix problems from pyflakes output 2012-06-03 15:53:34 -04:00
Jakob Kramer
f646e2e11b use _ function on some now untranslatable strings 2012-04-19 20:15:07 +02:00
Derek Moore
fa72e51689 Updates to send email comments, included translation, better validation. 2012-03-25 22:25:54 -07:00
Derek Moore
252eaf21d5 These are changes for issue #405, add email comment notification. 2012-03-15 16:38:56 -07:00
Joar Wandborg
703d09b985 Changed from key-notation to dot-notation in edit_profile 2012-03-08 01:02:40 +01:00
Elrond
b62b3b982a Generic check_media_slug_used db utility.
In two cases (generating a new slug and editing the slug)
it is nice to know in advance (before the db gets angry)
that the slug is used/free. So created a db utility
function to check for this on mongo and sql:
check_media_slug_used()
2012-03-05 21:37:05 +01:00
Elrond
3502958113 Attachment support in the SQL backend
attachments working with the sql backend.

- SQL Schema for attachment files, ordering attachments by
  their name, not by the submission order (as earlier).
- Dot-Notation for attachments, where missing.
- convert existing attachments over from mongo -> sql
2012-02-28 20:52:35 +01:00
Elrond
1e72e075f8 Drop pre-rendered html: MediaEntry.description_html
After a bit of discussion, we decided to drop the
pre-rendered html from the database and render it on
the fly.

In another step, we will use some proper caching method to
cache this stuff.

This commit affects the MediaEntry.description_html part.
2012-02-18 12:41:25 +01:00
Elrond
e61ab0998b Drop pre-rendered html: User.bio_html
After a bit of discussion, we decided to drop the
pre-rendered html from the database and render it on
the fly.

In another step, we will use some proper caching method to
cache this stuff.

This commit affects the User.bio_html part.
2012-02-18 12:35:30 +01:00
Christopher Allan Webber
cf29e8a824 It's 2012 all up in here 2012-02-02 09:44:13 -06:00
Elrond
de91730336 Nearly complete support for Tags
These changes allow all of the rest of the code to use tags
in sql as they were used on mongo. It's not efficient at
all, as changing tags usually means to remove all old tags
and adding all new.

The only problem here is: Old slugs for tags are not
removed, because they're shared across all MediaTags and
dropping orphans is not always easy.
2012-01-28 19:32:43 +01:00
Christopher Allan Webber
da6206c4be Oops, I broke teh all rights reserved ;) 2012-01-21 16:56:49 -06:00
Christopher Allan Webber
2788e6a164 License "all rights reserved" default should be None/NULL, not empty string 2012-01-21 16:40:39 -06:00
Elrond
3c351460e1 Fix unit tests with new license support
Make the license field in the forms optional and let them
properly be defaulted to "".
2012-01-21 19:24:36 +01:00
Aaron Williamson
97ec97dbc7 Minor formatting and syntax fix. 2012-01-18 21:21:49 -05:00
Aaron Williamson
a6c49d49dc Fixed a syntax error in edit/views and added back in some missing license stuff from models 2012-01-17 01:22:02 -05:00
Aaron Williamson
99a270e952 Merged changes with upstream 2012-01-17 00:59:21 -05:00
Aaron Williamson
25b48323a8 First crack at basic license support. 2012-01-17 00:33:55 -05:00
Jef van Schendel
fafec72740 Remove unnecessary piece of text in media.html. Fix "Markdown text" indentation so they are the same. 2012-01-13 23:23:02 +01:00
Elrond
0ab21f981a Dot-Notation: Some random places 2012-01-11 11:42:26 +01:00
Elrond
49af00e491 Make show-password-js work for change password too
The show password js depends on the password field to have
an id of "password". So give it a proper id.

Also fixed the label generation for the case of field.name
and field.id being different.
2012-01-05 14:47:15 +01:00
Jef van Schendel
c8071fa591 Create edit_account.html 2012-01-05 00:17:45 +01:00
Jef van Schendel
9c196287ad Add Markdown for submit page, edit page, profile edit page; thus fixing ticket #690 2012-01-04 17:48:16 +01:00
Jef van Schendel
6f55906078 Fix #715: On media submit page, "Separate" is misspelled 2011-12-30 19:45:00 +01:00
Elrond
1d93996604 Dot-Notation for MediaEntry.description(_html) 2011-12-05 21:08:58 +01:00
Elrond
5da0bf901b Dot-Notation for MediaEntry.slug 2011-12-05 21:08:58 +01:00
Elrond
ec82fbd85c Dot-Notation for MediaEntry.title 2011-12-05 21:08:58 +01:00
Elrond
1ceb4fc868 Dot-Notation for MediaEntry.uploader 2011-12-05 21:08:58 +01:00
Elrond
4b77f86ab4 Dot-Notation for Users.bio and .bio_html 2011-12-05 21:08:58 +01:00
Elrond
a24e5133ed Dot-Notation for Users.url 2011-12-05 21:08:58 +01:00
Elrond
bec591d85b Dot-Notation for Users.is_admin 2011-12-05 21:08:57 +01:00