From 974af9c93e959a7352372e14eb2c72b32809e3f7 Mon Sep 17 00:00:00 2001 From: envycontent Date: Mon, 25 Apr 2016 12:50:11 +0100 Subject: [PATCH] Added browse collection view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a browse collection view so as not to confuse the user with the ‘manage collection’ interface. Updated the navigation include and removed an unnecessary ‘back to collections’ button from the bottom of the collection view, bringing it into line with a series view. --- .../events/navigation_for_listing.html | 2 +- talks/templates/users/collection_list.html | 56 +++++++++++++++++++ talks/templates/users/collection_view.html | 4 +- talks/users/urls.py | 3 +- talks/users/views.py | 6 ++ 5 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 talks/templates/users/collection_list.html diff --git a/talks/templates/events/navigation_for_listing.html b/talks/templates/events/navigation_for_listing.html index 49f7e483..f5820fb0 100644 --- a/talks/templates/events/navigation_for_listing.html +++ b/talks/templates/events/navigation_for_listing.html @@ -6,6 +6,6 @@ Lecture/Seminar Series
  • - Talk Collections + Talk Collections
  • \ No newline at end of file diff --git a/talks/templates/users/collection_list.html b/talks/templates/users/collection_list.html new file mode 100644 index 00000000..bad2bcd4 --- /dev/null +++ b/talks/templates/users/collection_list.html @@ -0,0 +1,56 @@ +{% extends "layouts/2-column.html" %} +{% load bootstrap %} +{% load staticfiles %} + +{% block title %}Lecture/Seminar Series{% endblock %} + +{% block topcontent %} + +{% endblock %} + + +{% block side %} + +
    +
    +
    + + + {% include 'events/navigation_for_listing.html' %} + + + +
    + +
    +
    + +{% endblock %} + + +{% block main %} + +

    Collections

    + + + + + + +{% endblock %} diff --git a/talks/templates/users/collection_view.html b/talks/templates/users/collection_view.html index a4b4e106..36e63b66 100644 --- a/talks/templates/users/collection_view.html +++ b/talks/templates/users/collection_view.html @@ -84,8 +84,6 @@

    Collection: -{% if user.id %} - Back to Collections -{% endif %} + {% endblock %} diff --git a/talks/users/urls.py b/talks/users/urls.py index 36ac0136..1a03ec17 100644 --- a/talks/users/urls.py +++ b/talks/users/urls.py @@ -1,11 +1,12 @@ from django.conf.urls import patterns, url -from talks.users.views import (manage_collections, list_public_collections, view_collection, add_collection, edit_collection, delete_collection) +from talks.users.views import (manage_collections, list_public_collections, browse_public_collections, view_collection, add_collection, edit_collection, delete_collection) urlpatterns = patterns('', url(r'^lists$', manage_collections, name='manage-lists'), url(r'^lists/public$', list_public_collections, name='view-public-lists'), + url(r'^lists/browse-public$', browse_public_collections, name='list-public-lists'), url(r'^lists/new$', add_collection, name='add-list'), url(r'^lists/id/(?P[^/]+)/$', view_collection, name='view-list'), url(r'^lists/id/(?P[^/]+)/edit$', edit_collection, name='edit-list'), diff --git a/talks/users/views.py b/talks/users/views.py index 7035ab7e..5866a7fb 100644 --- a/talks/users/views.py +++ b/talks/users/views.py @@ -41,6 +41,12 @@ def list_public_collections(request): return render(request, 'users/public_collections.html', context) +def browse_public_collections(request): + context = {} + context['collections'] = Collection.objects.filter(public=True) + + return render(request, 'users/collection_list.html', context) + def view_collection(request, collection_slug): collection = Collection.objects.get(slug=collection_slug)