Skip to content

Commit

Permalink
Merge pull request #432 from ox-it/simplify-text-and-icons
Browse files Browse the repository at this point in the history
Simplify text and icons
  • Loading branch information
ahaith committed Apr 26, 2016
2 parents 1667535 + eeedc78 commit 0969a9d
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 85 deletions.
2 changes: 1 addition & 1 deletion talks/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def title_display(self):
if self.title:
return self.title
else:
return "Untitled talk"
return "Title TBC"

def user_can_edit(self, user):
"""
Expand Down
12 changes: 2 additions & 10 deletions talks/templates/events/department.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,8 @@ <h3 class="panel-title">
{% endif %}

<div class="formatting-links">
<a class="formatting-link plain-text-link" href="{% url 'show-department' org.id %}?format=txt" title="View a plain text version of this department's talks">
<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
<span class="formatting-link-text">plain text version</span>

</a>
<a class="formatting-link ics-link" href="{% url 'api-search-events-ics' %}?start_date={{ todays_date }}&include_subdepartments=on&organising_department={{ org.id }}" title="Import this department's talks into your calendar">
<span class="fa fa-calendar" aria-hidden="true"></span>
<span class="formatting-link-text">add to your calendar</span>
</a>

{% include "events/department_plain_text_link.html" %}
{% include "events/department_ics_link.html" %}

</div>
</h3>
Expand Down
4 changes: 4 additions & 0 deletions talks/templates/events/department_ics_link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- ical/ics link -->
<a class="formatting-link ics-link" href="{% url 'api-search-events-ics' %}?start_date={{ todays_date }}&include_subdepartments=on&organising_department={{ org.id }}" title="Import this department's talks into your calendar">
<span class="fa fa-lg fa-calendar" aria-hidden="true"></span>
</a>
4 changes: 4 additions & 0 deletions talks/templates/events/department_plain_text_link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- plain text link -->
<a class="formatting-link plain-text-link" href="{% url 'show-department' org.id %}?format=txt" title="View a plain text version of this department's talks">
<span class="fa fa-lg fa-file-text-o" aria-hidden="true"></span>
</a>
35 changes: 21 additions & 14 deletions talks/templates/events/event-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<div class="panel-heading">
<h3 class="panel-title contains-floating-buttons">
{{ event_group.title }}
<div class="formatting-links">
<div class="formatting-links pull-right">
{% include "events/event_group_plain_text_link.html" %}
{% include "events/event_group_ics_link.html" %}
{% if editable_collections %}
Expand All @@ -52,9 +52,11 @@ <h3 class="panel-title contains-floating-buttons">
</div>
</h3>
</div>
{% if event_group.description %}
<div class="panel-body">
<p>{% if event_group.description %}{{ event_group.description_html | safe }}{% else %}<i>This series does not yet have an abstract</i>{% endif %}</p>
<p>{{ event_group.description_html | safe }}</p>
</div>
{% endif %}
<!-- List group -->
<ul class="list-group">
<li class="list-group-item"><strong>Type</strong>: {{ event_group.get_group_type_display }}</li>
Expand Down Expand Up @@ -101,24 +103,17 @@ <h3 class="panel-title contains-floating-buttons">

</li>
{% empty %}
<div class="panel-footer">
<li class="list-group-item">
{% if show_all %}
There are no talks for this series yet
{% else %}
No upcoming talks to display for this series. Press the button below to show all talks.
{% endif %}
</div>
</li>
{% endfor %}

{% if event_group.public_collections_containing_this_event_group %}
<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>
{% endfor %}
</ul>
</li>
{% endif %}
</ul>


<div class="panel-footer">
{% if show_all %}
Expand All @@ -127,6 +122,18 @@ <h3 class="panel-title contains-floating-buttons">
<strong>Only showing upcoming talks </strong><a class="btn btn-default navbar-btn" href="{% url 'show-event-group' event_group.slug %}?show_all=true">Show all talks in this series</a>
{% endif %}
</div>
</ul>
</div>


{% if event_group.public_collections_containing_this_event_group %}
<p><strong>This series features in the following public collections</strong>:</p>
<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>
{% endfor %}
</ul>
{% endif %}



{% endblock %}
4 changes: 2 additions & 2 deletions talks/templates/events/event_group_ics_link.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- ical/ics link -->
<a class="formatting-link ics-link" href="/api/series/{{ event_group.slug }}.ics" title="Import this series into your calendar">
<span class="fa fa-calendar" aria-hidden="true"></span>
<span class="formatting-link-text">add to your calendar</span>
<span class="fa fa-lg fa-calendar" aria-hidden="true"></span>
<span class="formatting-link-text"></span>
</a>
3 changes: 1 addition & 2 deletions talks/templates/events/event_group_plain_text_link.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- plain text link -->
<a class="formatting-link plain-text-link" href="/talks/series/id/{{ event_group.slug }}?format=txt" title="View a plain text version of this series">
<span class="fa fa-file-text-o" aria-hidden="true"></span>
<span class="formatting-link-text">plain text version</span>
<span class="fa fa-lg fa-file-text-o" aria-hidden="true"></span>
</a>
3 changes: 1 addition & 2 deletions talks/templates/events/event_ics_link.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- ical/ics link -->
<a class="formatting-link ics-link" href="/api/talks/{{ event.slug }}.ics" title="Import this talk into your calendar">
<span class="fa fa-calendar" aria-hidden="true"></span>
<span class="formatting-link-text">add to your calendar</span>
<span class="fa fa-lg fa-calendar" aria-hidden="true"></span>
</a>
3 changes: 1 addition & 2 deletions talks/templates/events/event_plain_text_link.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- plain text link -->
<a class="formatting-link plain-text-link" href="/talks/id/{{ event.slug }}?format=txt" title="View a plain text version of this talk">
<span class="fa fa-file-text-o" aria-hidden="true"></span>
<span class="formatting-link-text">plain text version</span>
<span class="fa fa-lg fa-file-text-o" aria-hidden="true"></span>
</a>
7 changes: 2 additions & 5 deletions talks/templates/events/person.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
<div class="panel-heading">
<h3 class="panel-title">
{{ person.name }}
<div class="formatting-links">
<a class="formatting-link plain-text-link" href="{% url 'show-person' person.slug %}?format=txt" title="View a plain text version of this page">
<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
<span class="formatting-link-text">plain text version</span>
</a>
<div class="formatting-links pull-right">
{% include "events/person_plain_text_link.html" %}
</div>
</h3>
</div>
Expand Down
5 changes: 5 additions & 0 deletions talks/templates/events/person_plain_text_link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- plain text link -->
<a class="formatting-link plain-text-link"
href="{% url 'show-person' person.slug %}?format=txt" title="View a plain text version of this page">
<span class="fa fa-lg fa-file-text-o" aria-hidden="true"></span>
</a>
7 changes: 2 additions & 5 deletions talks/templates/events/topic.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
<div class="panel-heading">
<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">
<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
</a>
</div>
<div class="formatting-links pull-right">
{% include "events/topic_plain_text_link.html" %} </div>
</h3>
</div>

Expand Down
12 changes: 12 additions & 0 deletions talks/templates/events/topic_plain_text_link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- plain text link -->
<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">
<span class="fa fa-lg fa-file-text-o" aria-hidden="true"></span>
</a>







2 changes: 1 addition & 1 deletion 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 collection
Add to collection
<span class="caret"></span>
</button>
<ul class="dropdown-menu nav">
Expand Down
3 changes: 1 addition & 2 deletions talks/templates/users/collection_ics_link.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- ical/ics link -->
<a class="formatting-link ics-link" href="/api/collections/id/{{ collection.slug }}.ics" title="Import this list into your calendar">
<span class="fa fa-calendar" aria-hidden="true"></span>
<span class="formatting-link-text">add to your calendar</span>
<span class="fa fa-lg fa-calendar" aria-hidden="true"></span>
</a>
3 changes: 1 addition & 2 deletions talks/templates/users/collection_plain_text_link.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- plain text link -->
<a class="formatting-link plain-text-link" href="/user/lists/id/{{ collection.slug }}?format=txt" title="View a plain text version of this list">
<span class="fa fa-file-text-o" aria-hidden="true"></span>
<span class="formatting-link-text">plain text version</span>
<span class="fa fa-lg fa-file-text-o" aria-hidden="true"></span>
</a>
96 changes: 59 additions & 37 deletions talks/templates/users/collection_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,36 @@

{% block content %}

{% spaceless %}

{% if perms.events.change_event %}
<div class="container-fluid">
<div class="row bg-primary">
<div class="col-md-11"><h4>{{ event.get_status_display }}</h4></div>
<div class="col-md-1">
<strong>
{% if request.tuser %}
{% ifequal collection|collection_permission:user 'owner' %}
<a class="btn btn-default navbar-btn" href="{% url 'edit-list' collection.slug %}">Edit</a>
{% endifequal %}
{% endif %}
</strong>
</div>
</div>
</div>
{% endif %}

{% endspaceless %}



<div class="panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">
<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>
{% endif %}
{% if request.tuser %}
{% ifequal collection|collection_permission:user 'owner' %}
<div class="manage-lists-buttons">
<a href="{% url "edit-list" collection.slug %}" class="btn btn-primary">Edit</a>
</div>
{% endifequal %}
<i class="fa fa-globe" title="This collection is visible to all Oxford Talks users"></i>
{% endif %}
<div class="formatting-links">
{% include "users/collection_plain_text_link.html" %}
Expand All @@ -38,52 +53,59 @@ <h3 class="panel-title contains-floating-buttons">Collection:
</div>
{% endif %}
<ul class="list-group">
<li class="list-group-item">
<strong>Talks:</strong>
{% if events %}

{% if events %}

{% for event in events %}
<br>
{% include "events/event_teaser.html" %}
{% for event in events %}
<li class="list-group-item"> {% include "events/event_teaser.html" %}
</li>

{% endfor %}
{% endfor %}

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

{% if event_groups %}
<li class="list-group-item">
<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>
{% endfor %}
</li>
{% endif %}
</ul>
{% if contributors %}
<div class="panel-footer">
<strong>The following Talks editors are curating this collection:</strong>
{% for contributor in contributors %}
<br>{{ contributor.user.first_name }} {{ contributor.user.last_name }}
{% endfor %}
</div>
{% endif %}

<div class="panel-footer">
{% 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 collection</a>
{% endif %}
</div>

</div>

{% if contributors %}
<p>
<strong>The following Talks editors are curating this collection:</strong></p>
<ul>
{% for contributor in contributors %}
<li>{{ contributor.user.first_name }} {{ contributor.user.last_name }}</li>
{% endfor %}
</ul>
{% endif %}

{% if event_groups %}
<p>
<strong>This collection contains talks from the following series:</strong></p>
<ul>
{% for event_group in event_groups %}
<li>
<a href="{{ event_group.get_absolute_url }}">{{ event_group.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}


{% endblock %}

0 comments on commit 0969a9d

Please sign in to comment.