Skip to content

Commit 5211480

Browse files
committed
Added code to show a call-in button on the agenda page if the session agenda-note contains and IETF webex URL.
- Legacy-Id: 17427
1 parent c6b2e8e commit 5211480

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

ietf/templates/meeting/agenda.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,9 @@ <h2>
320320
<span class="label label-danger pull-right">CANCELLED</span>
321321
{% endif %}
322322

323-
{% if item.session.agenda_note %}
323+
{% if item.session.agenda_note|first_url %}
324+
<br><a href={{item.session.agenda_note|first_url}}>{{item.session.agenda_note|slice:":23"}}</a>
325+
{% elif item.session.agenda_note %}
324326
<br><span class="text-danger">{{item.session.agenda_note}}</span>
325327
{% endif %}
326328

ietf/templates/meeting/session_buttons_include.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
href="xmpp:{{item.session.jabber_room_name}}@jabber.ietf.org?join"
2525
title="Jabber room for {{item.session.jabber_room_name}}"><span class="fa fa-lightbulb-o"></span>
2626
</a>
27-
27+
{% if "https://ietf.webex.com" in item.session.agenda_note|first_url %}
28+
<a class="btn btn-default btn-xs"
29+
href="{{ item.session.agenda_note|first_url }}"
30+
title="Webex session"><span class="fa fa-phone"></span>
31+
</a>
32+
{% else %}
2833
<!-- Video stream (meetecho) -->
2934
{% if item.timeslot.location.video_stream_url %}
3035
<a class="btn btn-default btn-xs"
@@ -39,7 +44,7 @@
3944
title="Audio stream"><span class="glyphicon glyphicon-headphones"></span>
4045
</a>
4146
{% endif %}
42-
47+
{% endif %}
4348
{% else %}
4449

4550
<!-- Jabber logs -->

ietf/utils/templatetags/textfilters.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# Copyright The IETF Trust 2016-2019, All Rights Reserved
1+
# Copyright The IETF Trust 2016-2020, All Rights Reserved
22
# -*- coding: utf-8 -*-
33

44

55
from __future__ import absolute_import, print_function, unicode_literals
66

7+
import re
78
import bleach
89

910
from django import template
@@ -78,3 +79,10 @@ def texescape_filter(value):
7879
def linkify(value):
7980
text = mark_safe(bleach.linkify(escape(value)))
8081
return text
82+
83+
@register.filter
84+
@stringfilter
85+
def first_url(value):
86+
urls = re.findall(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value)
87+
url = urls[0] if urls else None
88+
return url

0 commit comments

Comments
 (0)