38 Commits

Author SHA1 Message Date
Christopher Allan Webber
ad4aef3a67 Removing a tab. This is a tab-free zone! 2011-08-10 12:08:14 -05:00
Christopher Allan Webber
a5303e4791 For no good reason, I feel like 15 is a good number of default feed items. 2011-07-31 21:05:35 -05:00
Will Kahn-Greene
50854db05d Tweaks import lines switching \ for ( ). 2011-07-30 08:40:06 -04:00
Christopher Allan Webber
990d3b6985 Give useful verification information on users that need to verify their email 2011-07-28 22:12:24 -05:00
Joar Wandborg
f646f5d36d Updated MediaCommentForm.field_comment => MediaCommentForm.comment_content
*   Also changed file encoding of `user_pages/forms.py` from dos to unix.
2011-07-07 22:45:51 +02: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
Christopher Allan Webber
5949be9ad6 Make pagination on user profile point to the user gallery
This required a couple of changes:
 - making a new render_pagination macro
 - switching things over to use that
2011-07-02 22:09:46 -05:00
Joar Wandborg
6f59a3a324 Issue #362 - Simple comments - Changes based on feedback recieved from #mediagoblin
*   `db.models` - Removed `MediaEntry.get_comments()` and replaced it with a helper
    which just returns a cursor for the comments query
*   `media.html` - Added `{% set comment_author = comment.author() %}`
*   `user_pages.views` - media_home() now passes `MediaEntry.get_comments()`
    directly to `Pagination`, handles pagination for comments.
    *   Added `MEDIA_COMMENTS_PER_PAGE` to define the number of comments per page
        in the `media_home()` view.
2011-07-01 15:26:29 +02:00
Christopher Allan Webber
52359e9103 Excitedly send a user a message that their comment was posted. 2011-06-29 20:51:17 -05:00
Christopher Allan Webber
95e6da024d Use the cleaned_markdown_conversion method instead of doing that manually 2011-06-29 20:41:52 -05:00
Joar Wandborg
9074ee7c1d Issue #362 - Updated mediagoblin.user_pages.views to handle new "Simple comments" feature
*   ADDED `media_post_comment(request)` which creates `MediaComments`
    from POST requests
*   UPDATED `media_home(request, media, **kwargs)` now passes `comments`,
    `pagination` and `comments_form` to `media.html`
2011-06-29 01:29:39 +02:00
Christopher Allan Webber
0692c01e4c Merge remote branch 'remotes/jwandborg/issue_363'
Conflicts:
	setup.py
2011-06-19 20:00:35 -05:00
cfdv
4b5f5a08d3 user_gallery controller calls render_to_reponse 2011-06-16 13:00:11 -05:00
cfdv
184f2240cb adds routing.py and view.py changes 2011-06-16 12:59:48 -05:00
Joar Wandborg
44e2da2fe6 Added Markdown rendering for media_entry 2011-06-12 03:24:31 +02:00
Christopher Allan Webber
9038c9f9ac I have a strong preference for aligning all parameters in a function call. 2011-06-05 15:41:08 -05:00
Elrond
c9c2493435 Reformat render_to_response calls
Just a simple indentation and ordering change, no
functional change.
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
b5d3aec615 Moving all views over to using util.render_template()! 2011-06-04 17:36:36 -05:00
Bernhard Keller
00c3925614 modified atomfeed feature, corrected spacing, url generation, routing id 2011-05-23 19:00:46 +02:00
Christopher Allan Webber
16509be160 Update all the views so that they use the uploader reference instead
of uploader embedding
2011-05-22 16:06:45 -05:00
Christopher Allan Webber
5487efc401 This check is redundant now that it's handled by the decorator. 2011-05-20 19:12:44 -05:00
Christopher Allan Webber
01674e105c Make sure that a MediaEntry does belong to this appropriate user in
the decorator.  (Thanks Elrond)
2011-05-20 19:12:32 -05:00
Christopher Allan Webber
439e37f732 Cosmetic changes: removed an unused import, stripped some trailing whitespace. 2011-05-20 17:48:43 -05:00
Christopher Allan Webber
724933b154 MediaEntry slugs usable in URLs, & decorator that grabs media from the request 2011-05-20 17:47:36 -05:00
Christopher Allan Webber
434b322147 One more mild styling tweak 2011-05-19 22:42:38 -05:00
Christopher Allan Webber
1301a8ad57 Reorganizing the uses_pagination decorator a little and having it pass
in the page number to the view
2011-05-19 22:39:15 -05:00
Christopher Allan Webber
af4d0b5cb0 Merge remote branch 'remotes/hanaku/pagination'
Conflicts:
	mediagoblin/user_pages/views.py
2011-05-19 22:34:57 -05:00
Bernhard Keller
3eb6fc4f2f moved check for correct page values into decorator for view function 2011-05-19 22:52:18 +02:00
Bernhard Keller
44e3e917fb removed request arg from Pagination class
added get_page_url() in Pagination class, to generate proper urls without losing
other get arguments
2011-05-19 20:37:04 +02:00
Bernhard Keller
ca3ca51c5a changed some coding styles and changed the interface for pagination from __call__ to the
__init__, also getting a cursor as input, instead of the query details
2011-05-19 17:24:31 +02:00
Elrond
86f9b47387 Clean unused imports (found by pyflakes). 2011-05-18 22:03:52 +02:00
Bernhard Keller
ae85ed0f97 added Pagination class, usage description in Pagination,__call__
added pagination.html, object_gallery.html as templates
2011-05-18 17:32:49 +02:00
Elrond
254bc43174 Move ObjectId, DESCENDING to db.util
We used to import those from pymongo and mongokit directly.
We should import them from a single place. So let's try
db.util for this.
2011-05-18 11:32:29 +02:00
Sebastian Spaeth
1ab8467320 Show images in reverse submit order
Fixes bug #327. Just do a .sort('created', DESCENDING) on Media when
showing them to show the latest first.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-05-16 14:55:05 +02:00
Sebastian Spaeth
7acdbfd364 Improve user homepage
1) Only consider user's with 'status': 'active'. We don't want to
   display unconfirmed/blocked users, right?
2) Actually query user's media in the view and display on their home
   page.
3) Throw an error 404 if we don't find a valid user, rather than saying,
   "User not found" (from within the template).
4) Pass in medias as media_entries to remain compatible with the 'root'
   page.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-05-12 23:10:21 -05:00
Christopher Allan Webber
f624940844 404 appropriately here 2011-05-10 16:25:04 -05:00
Sebastian Spaeth
9a16e16ffa Implement simple media detail page
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>
2011-05-10 16:01:43 -05:00