diff --git a/README.rst b/README.rst
index 6225497..2dd4ee6 100644
--- a/README.rst
+++ b/README.rst
@@ -154,6 +154,20 @@ pass ``auto`` as the etherpad URL::
#keystone etherpad auto
+url
+---
+
+A URL can be associated to a track, for example pointing to where the video
+meeting happens. By default the bot points to the URL associated to the room,
+if any. You can override it using the ``url`` command::
+
+ #keystone url https://meet.jit.si/awesome-keystone-meeting
+
+If you set a track-specific URL and would like to remove it, you can pass
+``none`` as the URL::
+
+ #keystone url none
+
color
-----
@@ -244,7 +258,7 @@ Join that channel and load base JSON data from a public URL (see base.json
for an example). You can use the pastebin service as a quick way to publish
that data::
- ~fetchdb http://paste.openstack.org/raw/793036/
+ ~fetchdb http://paste.openstack.org/raw/793040/
Then you can give other commands to the bot, like::
diff --git a/base.json b/base.json
index ee8cdd9..18195a3 100644
--- a/base.json
+++ b/base.json
@@ -170,6 +170,7 @@
"WedP2": ""
},
"Ballroom A": {
+ "url": "http://meet.jit.si/DEN-ptg-BallroomA",
"FriA1": "nova",
"FriA2": "nova",
"FriP1": "nova",
diff --git a/html/ptg.html b/html/ptg.html
index 83179ec..1e2f872 100644
--- a/html/ptg.html
+++ b/html/ptg.html
@@ -53,7 +53,7 @@
{{#each tracks as |track| }}
{{#if (lookup @root.now track) }}
- {{trackbadge track}} |
+ {{trackbadge @root.urls @root.location @root.schedule track}} |
{{#trackContentLine}}{{lookup @root.now track}}{{/trackContentLine}} |
{{lookup @root.location track}}
{{#if (checkins track)}}
@@ -80,7 +80,7 @@
{{#each tracks as |track| }}
{{#if (lookup @root.next track) }}
|
- {{trackbadge track}} |
+ {{trackbadge @root.urls @root.location @root.schedule track}} |
{{#each (lookup @root.next track) as |item|}}
{{#trackContentLine}}{{item}}{{/trackContentLine}}
@@ -121,7 +121,7 @@
{{/if}} |
{{#each (lookup @root.slots day) as |time|}}
- {{ roomcode @root.schedule room time.name 0 }} |
+ {{ roomcode @root.urls @root.schedule room time.name 0 }} |
{{/each}}
{{/if}}
diff --git a/html/ptg.js b/html/ptg.js
index 835321b..e9cce88 100644
--- a/html/ptg.js
+++ b/html/ptg.js
@@ -57,20 +57,31 @@ function checkins_tooltip(track) {
}
}
-function track_badge(track) {
+function track_badge(track, roomurl) {
var title = checkins_tooltip(track);
+ if (roomurl != undefined) {
+ return '' + track;
+ }
return '' + track;
}
Handlebars.registerHelper('trackbadge',
- function(track) {
- return new Handlebars.SafeString(track_badge(track));
+ function(urls, locations, schedule, track) {
+ if (urls[track] != undefined) {
+ roomurl = urls[track];
+ } else {
+ roomurl = schedule[locations[track]]['url'];
+ }
+ return new Handlebars.SafeString(track_badge(track, roomurl));
});
Handlebars.registerHelper('roomcode',
- function(schedule, room, timecode, s) {
+ function(urls, schedule, room, timecode, s) {
var cell = '';
if (schedule[room][timecode] != undefined) {
if (schedule[room][timecode] == "") {
@@ -80,7 +91,12 @@ Handlebars.registerHelper('roomcode',
cell = '' + room + "-" + timecode + '';
}
} else {
- cell = track_badge(schedule[room][timecode]);
+ if (urls[schedule[room][timecode]] != undefined) {
+ url = urls[schedule[room][timecode]];
+ } else {
+ url = schedule[room]['url']
+ }
+ cell = track_badge(schedule[room][timecode], url);
}
}
return new Handlebars.SafeString(cell);
diff --git a/ptgbot/bot.py b/ptgbot/bot.py
index 158a4ac..16eb6fb 100644
--- a/ptgbot/bot.py
+++ b/ptgbot/bot.py
@@ -313,6 +313,8 @@ class PTGBot(SASL, SSL, irc.bot.SingleServerIRCBot):
self.data.clean_tracks([track])
elif adverb == 'etherpad':
self.data.add_etherpad(track, params)
+ elif adverb == 'url':
+ self.data.add_url(track, params)
elif adverb == 'color':
self.data.add_color(track, params)
elif adverb == 'location':
diff --git a/ptgbot/db.py b/ptgbot/db.py
index 560bd71..38eedf3 100644
--- a/ptgbot/db.py
+++ b/ptgbot/db.py
@@ -36,6 +36,7 @@ class PTGDataBase():
'eventid': '',
'motd': {'message': '', 'level': 'info'},
'links': OrderedDict(),
+ 'urls': OrderedDict(),
# Keys for last_check_in are lower-cased nicks;
# values are in the same format as BASE_CHECK_IN
'last_check_in': OrderedDict(),
@@ -64,7 +65,7 @@ class PTGDataBase():
# Add tracks mentioned in configuration that are not in track list
for room, bookings in self.data['schedule'].items():
for time, track in bookings.items():
- if time in ['cap_icon', 'cap_desc']:
+ if time in ['cap_icon', 'cap_desc', 'url']:
continue
if track and track not in self.data['tracks']:
self.add_tracks([track])
@@ -89,6 +90,13 @@ class PTGDataBase():
self.data['etherpads'][track] = etherpad
self.save()
+ def add_url(self, track, url):
+ if url == 'none':
+ del(self.data['urls'][track])
+ else:
+ self.data['urls'][track] = url
+ self.save()
+
def add_color(self, track, color):
self.data['colors'][track] = color
self.save()