116 Commits

Author SHA1 Message Date
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
Christopher Allan Webber
e2decbcf1e Removing the raw string-ness 2011-05-13 16:07:37 -05: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
7222955fba URLs should end in trailing slashes, or slash redirection doesn't work 2011-05-11 10:26:15 -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