86 Commits

Author SHA1 Message Date
Nathan Yergler
6bfbe02426 Merge remote-tracking branch 'refs/remotes/upstream/master' into 569-application-middleware
Conflicts:
	mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
2011-10-01 12:08:58 -07:00
Nathan Yergler
f1226c98c4 Issue 361 Initial implementation of CSRF protection middleware 2011-09-04 18:15:52 -07:00
Christopher Allan Webber
b998d80be4 I can't believe I checked in my debugging garbage, removed! 2011-09-04 18:26:28 -05:00
Christopher Allan Webber
63e7abdf0f delete_media_files() might as well use itervalues (thx Elrond) 2011-09-04 18:24:04 -05:00
Will Kahn-Greene
12a100e4d8 508. Updates copyright/license information 2011-09-01 20:50:19 -04:00
Joar Wandborg
502073f2bf Feature #403 - Ability to delete media entries - Fixes according to feedback
*   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.
2011-08-30 23:16:46 +02:00
Christopher Allan Webber
d56de0c2db Merge remote branch 'remotes/jwandborg/configure_smtp' 2011-08-27 12:00:54 -05:00
Joar Wandborg
d71170ad0a Feature #489 - SMTP configuration options - Acts on feedback from cwebber.
http://bugs.foocorp.net/issues/489#note-2
2011-08-25 19:38:13 +02:00
Christopher Allan Webber
bae8f3d8c2 Adding and making use of the new 404 error page :) 2011-08-20 15:55:08 -05:00
Christopher Allan Webber
a7c641d11e Allow a user to pass in a status to render_to_response 2011-08-20 15:43:58 -05:00
Christopher Allan Webber
b5017dbac8 Switch the grid over to using a... erk... table! :)
Also changes the gridification routine a bit.
2011-08-18 22:00:55 -05:00
Christopher Allan Webber
1c266dc328 Utilities to lazily translate strings and also fake a translation for extraction 2011-08-10 10:48:02 -05:00
Christopher Allan Webber
03e5bd6d35 Provide a pass_to_ugettext method and set up gettext to default to English. 2011-08-08 22:51:03 -05:00
Christopher Allan Webber
84f279649b We should pass ugettext instead of gettext into the jinja template env
Otherwise we might get UnicodeDecodeErrors :)
2011-08-08 22:32:28 -05:00
Christopher Allan Webber
145922b8a4 Changed mediagoblin translations directory to the one we actually use. 2011-08-07 00:05:09 -05:00
Joar Wandborg
47364ead6b Added SMTP configuration options 2011-08-07 01:22:31 +02:00
Christopher Allan Webber
1b89b817e5 Removing option to make tags lowercase
...that's basically handled by the slugification
2011-07-30 21:54:18 -05:00
Christopher Allan Webber
3cdf366acf Merge branch 'remotes/gullydwarf-cfdv/f360_tagging' (early part) into mergetags
Conflicts:
	mediagoblin/config_spec.ini
	mediagoblin/edit/views.py
	mediagoblin/util.py
2011-07-30 13:09:01 -05:00
Caleb Forbes Davis V
f99b5caeb6 modifies duplicate tag check for list of dict tag type change 2011-07-28 00:01:50 -05:00
Caleb Forbes Davis V
0712a06dc6 changes tags to a list of dicts in the db, adding tag slugs
- adds a function to convert the tag list of dicts to a text string
  properly delimited for loading into forms
- tag string conversion function updated to generate list of dicts
- updates all mentions of the conversion of the string to the tags db
  object
- adds a tags template utility and updates the media template accordingly
2011-07-27 14:51:57 -05:00
Caleb Forbes Davis V
10d7496da2 use config_spec.ini to store tag parsing directives 2011-07-25 23:46:36 -05:00
Caleb Forbes Davis V
909371cdce raises tag length error in form context instead of in message queue 2011-07-21 00:02:57 -05:00
Christopher Allan Webber
5f72a4c331 Merge remote branch 'remotes/jwandborg/feature_400-resize_images_to_fit_page'
Conflicts:
	mediagoblin/db/migrations.py
	mediagoblin/db/models.py
	mediagoblin/process_media/__init__.py
	mediagoblin/templates/mediagoblin/user_pages/media.html
	mediagoblin/util.py
2011-07-16 16:28:12 -05:00
Caleb Forbes Davis V
cc7ff3c505 enforces maximum tag length with (in)appropriate messaging 2011-07-13 00:03:49 -05:00
Caleb Forbes Davis V
4451219560 ensures no duplicate tags per media entry 2011-07-12 22:52:32 -05:00
Caleb Forbes Davis V
6f2e4585cc uses standard functions instead of form filters and fixes taglist default
- seems simpler to use the same tag field processing procedures on media
  submit and edit, so now processing with a regular function instead of
  a form filter. Filters run on form load and post by default.
- moved tags to sidebar
- taglist defaults to [] instead of None
- adds case sensitivity toggle
2011-07-12 22:43:26 -05:00
Caleb Forbes Davis V
93e3468a2a displays the tags on edit correctly now
-before it was running the tags field through the submit filter.
 that was kind of dumb
-removes the filter function from the edit form
-adds unicode syntax in the filter function
-uses split correctly when saving the edited tags to mongodb
2011-07-12 20:43:16 -05:00
Deb
6ae8b541f9 removed email variables from globals module 2011-07-12 21:21:35 -04:00
Caleb Forbes Davis V
cdf538bd61 adds filter function to parse and clean tags field input
- for some reason the tags are showing up in the media edit form
  with u'..' and surrounded with []. I don't know why, grr
2011-07-12 20:06:17 -05:00
Joar Wandborg
af2fcba5c4 Issue #431 - Prevent comment link expiry - Added functionality for comment 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 :)
2011-07-07 18:04:19 +02:00
Joar Wandborg
2c9e635ae2 Feature #400 - Resize images to fit on page - Additions
*   `migrations.py`
    *   Removed empty line
    *   Added empty line
*   `models.py`
    *   Added `MediaEntry.get_display_media()` helper function
*   `process_media.__init__.py`
    *	Updated `process_media_initial()`
    	*   Renamed `main` => `original`.
	*   Added condition to `medium`, it's only created if the original
	    dimensions exceed the MEDIUM_SIZE dimensions.
*   `media.html`
    *	The image tag is now populated by `MediaEntry.get_display_media()`
*   `util.py`
    *	Added `DISPLAY_IMAGE_FETCHING_ORDER`, used by `MediaEntry.get_display_media()`
2011-07-03 05:46:00 +02:00
Elrond
42ef819cbb Move get_jinja_loader to init submodule. 2011-07-02 20:50:31 +02:00
Caleb Forbes Davis V
a8923a7da3 removes messages.add_message from the global template context
templates don't add messages. views are responsible for that.
2011-06-27 23:49:57 -05:00
Caleb Forbes Davis V
2264670357 adds message queue
Feature #368 - messaging framework
* message levels are debug, info, success, warning, and error
* display mechanism - base.html includes messages.html for now
* fetch_messages and add_message are available to all templates
  using jinja2 environment.globals
* messages are displayed and cleared. no persistence
2011-06-27 13:25:55 -05:00
Christopher Allan Webber
4fd18da0a8 Also fix clean_html so that it doesn't barf on an empty string. 2011-06-21 08:20:05 -05:00
Christopher Allan Webber
8268884653 Fix cleaned_markdown_conversion so that it doesn't bork on empty strings
Basically, clean_html would throw an error on '', so we just return ''
"if not text"
2011-06-20 21:01:05 -05:00
Christopher Allan Webber
4bf8e8888c Adds util.cleaned_markdown_conversion() and uses it in the submission process
This simplifies the markdown processing & html cleaning of descritions
and etc by providing a wrapper function that we can use in multiple
locations.
2011-06-19 20:41:40 -05:00
Christopher Allan Webber
0692c01e4c Merge remote branch 'remotes/jwandborg/issue_363'
Conflicts:
	setup.py
2011-06-19 20:00:35 -05:00
Christopher Allan Webber
07f35dad60 Removing a couple of unused imports from util.py 2011-06-19 11:41:48 -05:00
Christopher Allan Webber
0a7805f913 util.read_config_file() no longer needed; removing. 2011-06-19 11:10:45 -05:00
Joar Wandborg
9e883ed3b2 Merge branch 'master' of http://git.gitorious.org/mediagoblin/mediagoblin 2011-06-15 22:18:24 +02:00
Christopher Allan Webber
a68ee5556e A super strict HTML cleaner method with mediocre tests. 2011-06-13 21:01:19 -05:00
Christopher Allan Webber
6e7ce8d1af mediagoblin.globals->mediagoblin.mg_globals 2011-06-12 17:27:37 -05:00
Joar Wandborg
44e2da2fe6 Added Markdown rendering for media_entry 2011-06-12 03:24:31 +02:00
Christopher Allan Webber
66471f0ee4 A clear_test_buckets() method 2011-06-06 07:44:12 -05:00
Christopher Allan Webber
a7fcc027aa Merge remote branch 'remotes/elrond/idea/shortcuts' 2011-06-05 15:36:51 -05:00
Christopher Allan Webber
67e8c45d2a We should store the template path, not the template object, as the key
in our testing cache
2011-06-05 10:31:29 -05:00
Elrond
9150244afa Create redirect shortcut and use it around
This is just replacing exc.HTTPFound(location=request.urlgen(...))
by redirect(request, ...). No magic.
2011-06-05 16:16:03 +02:00
Elrond
1c63ad5d35 Create render_to_reponse and use it everywhere.
Just a shortcut for Response(render_template(...))
2011-06-05 16:16:03 +02:00
Christopher Allan Webber
f99f61c65c Cache template environments and gettexts so we don't have to reproduce
them on every request.
2011-06-04 16:44:22 -05:00