Skip to content

Commit

Permalink
Added browse collection view
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
envycontent committed Apr 25, 2016
1 parent 14919a4 commit 974af9c
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 5 deletions.
2 changes: 1 addition & 1 deletion talks/templates/events/navigation_for_listing.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<a href="{% url 'list-event-groups' %}">Lecture/Seminar Series</a>
</li>
<li>
<a href="{% url 'view-public-lists' %}">Talk Collections</a>
<a href="{% url 'list-public-lists' %}">Talk Collections</a>
</li>
</ul>
56 changes: 56 additions & 0 deletions talks/templates/users/collection_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% extends "layouts/2-column.html" %}
{% load bootstrap %}
{% load staticfiles %}

{% block title %}Lecture/Seminar Series{% endblock %}

{% block topcontent %}

{% endblock %}


{% block side %}

<div class="container">
<div class="row">
<div class="col-sm-3 col-xs-12">


{% include 'events/navigation_for_listing.html' %}



</div>

</div>
</div>

{% endblock %}


{% block main %}

<h1>Collections</h1>

<ul class="list-group">
<li class="list-group-item">
<p><strong>

</strong></p>
<ul class="list-unstyled">
{% for collection in collections %}
<li class="contains-floating-buttons">
<a href="{% url 'view-list' collection.slug %}">{{ collection.title }}</a>

</li>
{% empty %}
<p>There are no public collections available.</p>
{% endfor %}
</ul>
</li>
</ul>




{% endblock %}
4 changes: 1 addition & 3 deletions talks/templates/users/collection_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ <h3 class="panel-title contains-floating-buttons">Collection:
</div>
</div>

{% if user.id %}
<a href="{% url "manage-lists" %}" class="btn btn-default">Back to Collections</a>
{% endif %}


{% endblock %}
3 changes: 2 additions & 1 deletion talks/users/urls.py
Original file line number Diff line number Diff line change
@@ -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<collection_slug>[^/]+)/$', view_collection, name='view-list'),
url(r'^lists/id/(?P<collection_slug>[^/]+)/edit$', edit_collection, name='edit-list'),
Expand Down
6 changes: 6 additions & 0 deletions talks/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

1 comment on commit 974af9c

@envycontent
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.