Merge branch 'master' into static-media
[mygpo.git] / mygpo / web / templates / episode-history.html
blobf1b55ea5d7d2803b917a4122e5cfdefb27615d6c
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 %}
13 {% load static %}
15 {% load menu %}
16 {% block mainmenu %}{{ "/podcast/"|main_menu }}{% endblock %}
17 {% block sectionmenu %}
18 {% if podcast.title %}
19 {{ "/podcast/"|section_menu:podcast.title }}
20 {% else %}
21 {{ "/podcast/"|section_menu:"Unnamed Podcast" }}
22 {% endif %}
23 {% endblock %}
25 {% block head %}
26 {% if episode.url|is_youtube_video %}
27 <script type="text/javascript" src="{% static "js/swfobject.js" %}"></script>
28 <script type="text/javascript" src="{% static "js/json2.js" %}"></script>
29 <script type="text/javascript" src="{% static "js/youtube-handler.js" %}"></script>
30 {% endif %}
32 {% endblock head %}
34 {% block title %}
35 {{ episode.title|default:"Unnamed Episode"|striptags }} -
36 {{ podcast.title|default:"Unnamed Podcast"|striptags}}
37 {% endblock %}
39 {% block header %}
41 {% if podcast.logo_url %}
42 <div id="podcastlogo"><a href="{% podcast_link_target podcast %}">{{ podcast|podcast_logo_big }}</a></div>
43 {% endif %}
44 <h1>
45 {{ episode.title|default:"Unnamed Episode"|striptags }}
46 {% if episode.released %}
47 <small>{% trans "History" %}</small>
48 {% endif %}
49 </h1>
50 <small class="description">
51 {% trans "from" %} {% podcast_group_link podcast %}&middot;
52 {% if not episode.outdated or "hide-outdated-urls" not in podcast.restrictions %}
53 <a href="{{episode.url}}" title="{% trans "Download" %}">
54 <i class="icon-download"></i>
55 </a>
56 {% endif %}
57 {% if episode.link and episode.link != episode.url %}&middot;
58 <a href="{{episode.link}}" title="{% trans "Website" %}">
59 <i class="icon-external-link"></i>
60 </a>
61 {% endif %}
62 {% if episode.listeners %}&middot;
63 {{ episode.listeners }} {% trans "listeners" %}
64 {% endif %}
65 </small>
68 {% if episode.summary or episode.description %}
69 <div class="summary">
70 {{ episode.summary|default:episode.description|truncatewords:100|markdown }}
71 </div>
72 {% endif %}
74 {% endblock %}
78 {% block content %}
80 {% if user.is_authenticated or history %}
81 <h4>{% trans "History" %}</h4>
82 <table class="list">
83 <tr>
84 <th>{% trans "Time" %}</th>
85 <th>{% trans "Action" %}</th>
86 <th>{% trans "Device" %}</th>
87 <th></th>
88 </tr>
90 {% for s in history %}
91 <tr>
92 <td><abbr title="{{ s.timestamp }}">{{ s.timestamp|naturalday }}</abbr></td>
93 <td style="text-align: center;">{{ s|episode_status_icon }}</td>
94 <td>
95 {% if s.client %}
96 <a href="{% url "device" s.client.uid %}">{{ s.client|device_icon }} {{ s.client.name|striptags }}</a>
97 {% endif %}
98 </td>
99 <td>{% if s.started or s.playmark %}{{s.started|format_time }} - {% endif %}
100 {% if s.playmark %}{{ s.playmark|format_time }}{% endif %}
101 </td>
102 </tr>
103 {% endfor %}
105 {% if user.is_authenticated %}
106 <tr>
107 <form action="{% episode_link_target episode podcast "add-episode-action" %}" method="POST">
108 {% csrf_token %}
109 <td>
110 <input class="input" type="text" id="timestamp" name="timestamp" placeholder="empty = now" /></td>
111 <td>
112 <select class="input" name="action">
113 {% for action, str in actions %}
114 <option value="{{ action }}">{{ str }}</option>
115 {% endfor %}
116 </select>
117 </td>
118 <td>
119 <select class="input" name="device">
120 <option value=""></option>
121 {% for client in clients %}
122 <option value="{{ client.id.hex }}">{{ client.name }}</option>
123 {% endfor %}
124 </select>
125 </td>
126 <td>
127 <input class="btn" type="submit" value="{% trans "Add" %}" />
128 </td>
129 </form>
130 </tr>
131 {% endif %}
132 </table>
133 {% endif %}
135 {% endblock %}
137 {% block ads %}
138 {% comment %}disable ads on episode pages{% endcomment %}
139 {% endblock %}