[Tests] track coverage of templates
[mygpo.git] / mygpo / web / templates / episode-history.html
blobd7c4c0c1301776e75910d2d16b5b0c0d3eb2d62a
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load humanize %}
4 {% load episodes %}
5 {% load devices %}
6 {% load podcasts %}
7 {% load mygpoutil %}
8 {% load time %}
9 {% load youtube %}
10 {% load flickr %}
11 {% load charts %}
12 {% load utils %}
14 {% load menu %}
15 {% block mainmenu %}{{ "/podcast/"|main_menu }}{% endblock %}
16 {% block sectionmenu %}
17 {% if podcast.title %}
18 {{ "/podcast/"|section_menu:podcast.title }}
19 {% else %}
20 {{ "/podcast/"|section_menu:"Unnamed Podcast" }}
21 {% endif %}
22 {% endblock %}
24 {% block head %}
25 {% if episode.url|is_youtube_video %}
26 <script type="text/javascript" src="/media/js/swfobject.js"></script>
27 <script type="text/javascript" src="/media/js/json2.js"></script>
28 <script type="text/javascript" src="/media/js/youtube-handler.js"></script>
29 {% endif %}
31 {% endblock head %}
33 {% block title %}
34 {{ episode.title|default:"Unnamed Episode"|striptags }} -
35 {{ podcast.title|default:"Unnamed Podcast"|striptags}}
36 {% endblock %}
38 {% block header %}
40 {% if podcast.logo_url %}
41 <div id="podcastlogo"><a href="{% podcast_link_target podcast %}">{{ podcast|podcast_logo_big }}</a></div>
42 {% endif %}
43 <h1>
44 {{ episode.title|default:"Unnamed Episode"|striptags }}
45 {% if episode.released %}
46 <small>{% trans "History" %}</small>
47 {% endif %}
48 </h1>
49 <small class="description">
50 {% trans "from" %} {% podcast_group_link podcast %}&middot;
51 {% if not episode.outdated or "hide-outdated-urls" not in podcast.restrictions %}
52 <a href="{{episode.url}}" title="{% trans "Download" %}">
53 <i class="icon-download"></i>
54 </a>
55 {% endif %}
56 {% if episode.link and episode.link != episode.url %}&middot;
57 <a href="{{episode.link}}" title="{% trans "Website" %}">
58 <i class="icon-external-link"></i>
59 </a>
60 {% endif %}
61 {% if episode.listeners %}&middot;
62 {{ episode.listeners }} {% trans "listeners" %}
63 {% endif %}
64 </small>
67 {% if episode.summary or episode.description %}
68 <div class="summary">
69 {{ episode.summary|default:episode.description|truncatewords:100|markdown }}
70 </div>
71 {% endif %}
73 {% endblock %}
77 {% block content %}
79 {% if user.is_authenticated or history %}
80 <h4>{% trans "History" %}</h4>
81 <table class="list">
82 <tr>
83 <th>{% trans "Time" %}</th>
84 <th>{% trans "Action" %}</th>
85 <th>{% trans "Device" %}</th>
86 <th></th>
87 </tr>
89 {% for s in history %}
90 <tr>
91 <td><abbr title="{{ s.timestamp }}">{{ s.timestamp|naturalday }}</abbr></td>
92 <td style="text-align: center;">{{ s|episode_status_icon }}</td>
93 <td>
94 {% if s.client %}
95 <a href="{% url "device" s.client.uid %}">{{ s.client|device_icon }} {{ s.client.name|striptags }}</a>
96 {% endif %}
97 </td>
98 <td>{% if s.started or s.playmark %}{{s.started|format_time }} - {% endif %}
99 {% if s.playmark %}{{ s.playmark|format_time }}{% endif %}
100 </td>
101 </tr>
102 {% endfor %}
104 {% if user.is_authenticated %}
105 <tr>
106 <form action="{% episode_link_target episode podcast "add-episode-action" %}" method="POST">
107 {% csrf_token %}
108 <td>
109 <input class="input" type="text" id="timestamp" name="timestamp" placeholder="empty = now" /></td>
110 <td>
111 <select class="input" name="action">
112 {% for action, str in actions %}
113 <option value="{{ action }}">{{ str }}</option>
114 {% endfor %}
115 </select>
116 </td>
117 <td>
118 <select class="input" name="device">
119 <option value=""></option>
120 {% for client in clients %}
121 <option value="{{ client.id.hex }}">{{ client.name }}</option>
122 {% endfor %}
123 </select>
124 </td>
125 <td>
126 <input class="btn" type="submit" value="{% trans "Add" %}" />
127 </td>
128 </form>
129 </tr>
130 {% endif %}
131 </table>
132 {% endif %}
134 {% endblock %}
136 {% block ads %}
137 {% comment %}disable ads on episode pages{% endcomment %}
138 {% endblock %}