Skip to content

Commit

Permalink
Merge pull request #429 from ox-it/template-and-view-review
Browse files Browse the repository at this point in the history
Template and view review
  • Loading branch information
ahaith committed Apr 25, 2016
2 parents fb1b168 + 25e03c8 commit 1667535
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 54 deletions.
2 changes: 1 addition & 1 deletion talks/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
{% elif user.email %}
<li><p class="navbar-text"><i class="glyphicon glyphicon-user"></i> {{ user.email }}</p></li>
{% endif %}
<li {% if '/user/lists' in request.path %} class="active" {% endif %}><a href="{{ manage_lists }}"><span class="glyphicon glyphicon-list-alt"></span> Manage Lists</a></li>
<li {% if '/user/lists' in request.path %} class="active" {% endif %}><a href="{{ manage_lists }}"><span class="glyphicon glyphicon-list-alt"></span> Manage Collections</a></li>
<li><a href="{% url 'logout' %}">Logout</a></li>
{% else %}
<li><a href="{% url 'login' %}">Login</a></li>
Expand Down
14 changes: 4 additions & 10 deletions talks/templates/events/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@
<div class="container">
<div class="row">
<div class="col-sm-3 col-xs-12">
<h3>View all:</h3>
<ul class="nav nav-list well">
<li>
<a href="{% url 'list-event-groups' %}">Series</a>
</li>
<li>
<a href="{% url 'view-public-lists' %}">Public Lists</a>
</li>
</ul>


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


<h3>Filters</h3>
<ul class="nav nav-list well">
Expand Down Expand Up @@ -77,7 +72,6 @@ <h3>Filters</h3>

{% block main %}

<h2 class="hidden-xs">Browse Talks</h2>

<div class="js-upcoming-events">
{% if events %}
Expand Down
2 changes: 1 addition & 1 deletion talks/templates/events/event-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ <h3 class="panel-title contains-floating-buttons">
{% endfor %}

{% if event_group.public_collections_containing_this_event_group %}
<li class="list-group-item"><strong>This series features in the following public lists</strong>:
<li class="list-group-item"><strong>This series features in the following public collections</strong>:
<ul class="list-unstyled">
{% for collection in event_group.public_collections_containing_this_event_group %}
<li><a href="{{ collection.get_absolute_url }}">{{ collection.title }}</a></li>
Expand Down
2 changes: 1 addition & 1 deletion talks/templates/events/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ <h3 class="panel-title contains-floating-buttons event">
{% endif %}
<li class="list-group-item"><strong>Audience</strong>: {{ event.get_audience_display }} </li>
{% if event.public_collections_containing_this_event %}
<li class="list-group-item"><strong>This talk features in the following public lists</strong>:
<li class="list-group-item"><strong>This talk features in the following public collections</strong>:
<ul class="list-unstyled">
{% for collection in event.public_collections_containing_this_event %}
<li><a href="{{ collection.get_absolute_url }}">{{ collection.title }}</a></li>
Expand Down
35 changes: 32 additions & 3 deletions talks/templates/events/event_group_list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
{% extends "base.html" %}
{% extends "layouts/2-column.html" %}
{% load bootstrap %}
{% load staticfiles %}

{% block content %}
<h1>Existing series</h1>
{% 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>Lecture/Seminar Series</h1>
<div class="list-group">
{% for object in object_list %}
<div class="list-group-item">
Expand Down
11 changes: 11 additions & 0 deletions talks/templates/events/navigation_for_listing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<ul class="nav nav-list well">
<li>
<a href="{% url 'browse_events' %}">All Talks</a>
</li>
<li>
<a href="{% url 'list-event-groups' %}">Lecture/Seminar Series</a>
</li>
<li>
<a href="{% url 'list-public-lists' %}">Talk Collections</a>
</li>
</ul>
2 changes: 1 addition & 1 deletion talks/templates/events/topic.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<h3 class="panel-title">Topic:
{{ topic.prefLabel }}
<div class="formatting-links">
<a class="formatting-link plain-text-link" href="{% url 'show-topic' %}?uri={{ topic.uri }}&format=txt" title="View a plain text version of this topic">
Expand Down
6 changes: 3 additions & 3 deletions talks/templates/users/add_to_collections_widget.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Add this {% if item_desc %}{{ item_desc }}{% else %}talk{% endif %} to list
Add this {% if item_desc %}{{ item_desc }}{% else %}talk{% endif %} to collection
<span class="caret"></span>
</button>
<ul class="dropdown-menu nav">
Expand All @@ -13,7 +13,7 @@
{% ifequal item_desc 'series' %}
<a class="js-toggle-collection-item {% if collection|collection_contains_item:event_group %}active-collection{% endif %}"
href="#"
title="{% if collection|collection_contains_item:event_group %}Remove from list{% else %}Add to list{% endif %}"
title="{% if collection|collection_contains_item:event_group %}Remove from collection{% else %}Add to collection{% endif %}"
data-collection="{{ collection.slug }}"
data-group="{{ event_group.slug }}"
data-action="{% if collection|collection_contains_item:event_group %}remove{% else %}add{% endif %}">
Expand All @@ -24,7 +24,7 @@
{% else %}
<a class="js-toggle-collection-item {% if collection|collection_contains_item:event %}active-collection{% endif %}"
href="#"
title="{% if collection|collection_contains_item:event %}Remove from list{% else %}Add to list{% endif %}"
title="{% if collection|collection_contains_item:event %}Remove from collection{% else %}Add to collection{% endif %}"
data-collection="{{ collection.slug }}"
data-event="{{ event.slug }}"
data-action="{% if collection|collection_contains_item:event %}remove{% else %}add{% endif %}">
Expand Down
8 changes: 4 additions & 4 deletions talks/templates/users/collection_delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
{% load bootstrap %}
{% load staticfiles %}

{% block title %}Delete list{% endblock %}
{% block title %}Delete collection{% endblock %}

{% block content %}

<h3>Delete the list</h3>
<h3>Delete the collection</h3>

<p>You are about to delete the list "{{ collection.title }}".</p>

<p>Do you confirm?</p>
<p>Are you sure?</p>

<p>
<form method="post">
{% csrf_token %}
<input type="submit" value="Yes, delete the list" class="btn btn-danger">
<input type="submit" value="Yes, delete the collection" class="btn btn-danger">
<a class="btn btn-default" href="{% url 'manage-lists' %}">Cancel</a>
</form>

Expand Down
4 changes: 2 additions & 2 deletions talks/templates/users/collection_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load bootstrap %}
{% load staticfiles %}

{% block title %}{% if collection %}Edit List{% else %}Add List{% endif %}{% endblock %}
{% block title %}{% if collection %}Edit Collection{% else %}Add Collection{% endif %}{% endblock %}

{% block extrahead %}
<!-- Typeahead.js -->
Expand All @@ -17,7 +17,7 @@

{% block content %}

<h2 class="hidden-xs">{% if collection %}Edit list: {{ collection.title }}{% else %}Add new list{% endif %}</h2>
<h2 class="hidden-xs">{% if collection %}Edit collection: {{ collection.title }}{% else %}Add new collection{% endif %}</h2>

<form class="form-horizontal" method="post" action="{{ request.get_full_path }}">{% csrf_token %}
<div class="form-group">
Expand Down
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 %}Browse Public Talk Collections{% 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>Talk 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 %}
19 changes: 8 additions & 11 deletions talks/templates/users/collection_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
{% load staticfiles %}
{% load users %}

{% block title %}View List{% endblock %}
{% block title %}Collection{% endblock %}

{% block extrahead %}{% endblock %}

{% block content %}

<h2 class="hidden-xs">View list</h2>

<div class="panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">
<h3 class="panel-title contains-floating-buttons">
<h3 class="panel-title contains-floating-buttons">Collection:
{{ collection.title }}
{% if collection.public %}
<i class="fa fa-globe" title="This list is visible to all Oxford Talks users"></i>
Expand Down Expand Up @@ -51,16 +50,16 @@ <h3 class="panel-title contains-floating-buttons">

{% else %}
{% if show_all %}
<p>You haven't added any talks to this list yet.</p>
<p>You haven't added any talks to this collection yet.</p>
{% else %}
<p>There are no upcoming talks in this list.</p>
<p>There are no upcoming talks in this collection.</p>
{% endif %}
{% endif %}
</li>

{% if event_groups %}
<li class="list-group-item">
<strong>This list contains talks from the following series:</strong>
<strong>This collection contains talks from the following series:</strong>
{% for event_group in event_groups %}
<br>
<a href="{{ event_group.get_absolute_url }}">{{ event_group.title }}</a>
Expand All @@ -70,7 +69,7 @@ <h3 class="panel-title contains-floating-buttons">
</ul>
{% if contributors %}
<div class="panel-footer">
<strong>The following Talks editors can contribute to this list:</strong>
<strong>The following Talks editors are curating this collection:</strong>
{% for contributor in contributors %}
<br>{{ contributor.user.first_name }} {{ contributor.user.last_name }}
{% endfor %}
Expand All @@ -80,13 +79,11 @@ <h3 class="panel-title contains-floating-buttons">
{% if show_all %}
<strong>Showing all talks </strong><a class="btn btn-default navbar-btn" href="{% url 'view-list' collection.slug %}">Show upcoming talks only</a>
{% else %}
<strong>Only showing upcoming talks </strong><a class="btn btn-default navbar-btn" href="{% url 'view-list' collection.slug %}?show_all=true">Show all talks in this list</a>
<strong>Only showing upcoming talks </strong><a class="btn btn-default navbar-btn" href="{% url 'view-list' collection.slug %}?show_all=true">Show all talks in this collection</a>
{% endif %}
</div>
</div>

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


{% endblock %}
22 changes: 11 additions & 11 deletions talks/templates/users/collections.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load staticfiles %}
{% load users %}

{% block title %}Manage Lists{% endblock %}
{% block title %}Manage My Collections{% endblock %}

{% block extrahead %}

Expand All @@ -18,19 +18,19 @@

{% block content %}

<h2 class="hidden-xs">Manage lists</h2>
<h2 class="hidden-xs">Manage My Collections</h2>

<div id="collection-alert-container"></div>
<ul class="nav nav-tabs">
<li role="presentation" class="active"><a href="{% url 'manage-lists' %}">My Lists</a></li>
<li role="presentation"><a href="{% url 'view-public-lists' %}">All Public Lists</a></li>
<li role="presentation" class="active"><a href="{% url 'manage-lists' %}">My Collections</a></li>
<li role="presentation"><a href="{% url 'view-public-lists' %}">All Public Collections</a></li>
</ul>

<ul class="list-group">

<li class="list-group-item">
<p><strong>
Lists that I've created:
Collections that I've created:
</strong></p>
<ul class="list-unstyled">
{% for collection in collections_owner %}
Expand All @@ -47,15 +47,15 @@ <h2 class="hidden-xs">Manage lists</h2>
</div>
</li>
{% empty %}
<p>You haven't created any lists yet.</p>
<p>You haven't created any collections yet.</p>
{% endfor %}
</ul>
</li>

{% if user_is_a_contributor %}
<li class="list-group-item">
<p><strong>
Lists that I can contribute to:
Collections that I can contribute to:
</strong></p>
<ul class="list-unstyled">
{% for collection in collections_editor %}
Expand All @@ -66,15 +66,15 @@ <h2 class="hidden-xs">Manage lists</h2>
{% endif %}
</li>
{% empty %}
<p>You haven't been invited to collaborate on any lists yet.</p>
<p>You haven't been invited to collaborate on any collections yet.</p>
{% endfor %}
</ul>
</li>
{% endif %}

<li class="list-group-item">
<p><strong>
Public lists that I've subscribed to:
Public collections that I've subscribed to:
</strong></p>
<ul class="list-unstyled">
{% for collection in collections_reader %}
Expand All @@ -90,13 +90,13 @@ <h2 class="hidden-xs">Manage lists</h2>
</div>
</li>
{% empty %}
<p>You haven't subscribed to any public lists yet.</p>
<p>You haven't subscribed to any public collections yet.</p>
{% endfor %}
</ul>
</li>

</ul>

<a href="{% url "add-list" %}" class="btn btn-primary" type="button">Add new list</a>
<a href="{% url "add-list" %}" class="btn btn-primary" type="button">Add new collection</a>

{% endblock %}

0 comments on commit 1667535

Please sign in to comment.