From 0656d0daa599b7cb5c4889583b70a2bf24f953fe Mon Sep 17 00:00:00 2001
From: Henrik Levkowetz <henrik@levkowetz.com>
Date: Tue, 25 Oct 2016 00:13:03 +0000
Subject: [PATCH] Changed the agenda template to provide links to video
 recordings on youtube if available, instead of pointing at meetecho's
 archive.  - Legacy-Id: 12209

---
 ietf/templates/meeting/agenda.html | 38 ++++++++++++++++++++++++++----
 1 file changed, 34 insertions(+), 4 deletions(-)

diff --git a/ietf/templates/meeting/agenda.html b/ietf/templates/meeting/agenda.html
index 38c2ebb01..21b249d47 100644
--- a/ietf/templates/meeting/agenda.html
+++ b/ietf/templates/meeting/agenda.html
@@ -386,10 +386,40 @@
 			{% endif %}
 			<!-- Video recording -->
 		        {% if schedule.meeting.number|add:"0" >= 80 %}
-		        <a class="btn btn-default btn-xs"
-			  href="http://www.meetecho.com/ietf{{schedule.meeting.number}}/recordings#{{item.session.historic_group.acronym.upper}}"
-			  title="Meetecho video recording"><span class="fa fa-file-video-o"></span>
-			</a>
+			  {% with item.session.recordings as recordings %}
+			    {% if recordings %}
+			      <!-- There's no guaranteed order, so this is a bit messy: -->
+			      <!-- First, the audio recordings, if any -->
+			      {% for r in recordings %}
+				{% if r.href and 'audio' in r.href %}
+				  <a class="btn btn-default btn-xs" href="{{ r.href }}" title="{{ r.title}}">
+				     <span class="fa fa-file-audio-o">
+				  </a>
+				{% endif %}
+			      {% endfor %}
+			      <!-- Then the youtube recordings -->
+			      {% for r in recordings %}
+				{% if r.href and 'youtu' in r.href %}
+				  <a class="btn btn-default btn-xs" href="{{ r.href }}" title="{{ r.title }}">
+				     <span class="fa fa-file-video-o"></span>
+				  </a>
+				{% endif %}
+			      {% endfor %}
+			      <!-- Finally, any other recordings -->
+			      {% for r in recordings %}
+			        {% if r.href and not 'audio' in r.href and not 'youtu' in r.href %}
+				  <a class="btn btn-default btn-xs" href="{{ r.href }}" title="{{ r.title }}">
+				    <span class="fa fa-file-o"></span>
+				  </a>
+				{% endif %}
+			      {% endfor %}
+			    {% else %}
+			      <a class="btn btn-default btn-xs"
+				  href="http://www.meetecho.com/ietf{{schedule.meeting.number}}/recordings#{{item.session.historic_group.acronym.upper}}"
+				 title="Meetecho video recording"><span class="fa fa-file-video-o"></span>
+			      </a>
+			    {% endif %}
+			  {% endwith %}
 			{% endif %}
 			<!-- Audio recording -->
 			{# <a class="btn btn-default btn-xs" href="" title="Audio recording"><span class="fa fa-file-audio-o"></span></a>#}