summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2011-05-12 09:34:35 +0200
committerLeif Johansson <leifj@sunet.se>2011-05-12 09:34:35 +0200
commit3869743100b1db40007666e47167a7ad7bcbbb1b (patch)
treea1cce4274f6b6367d2e95c0a2d083d6b9ccb9e29
parent13783dd92342bb175dea483d7e869ef701f01de6 (diff)
rss and widget testing
-rw-r--r--src/site-media/js/jquery.meetingtools.js28
-rw-r--r--src/templates/apps/room/rss2.xml23
-rw-r--r--src/templates/apps/room/widget-test.html8
3 files changed, 59 insertions, 0 deletions
diff --git a/src/site-media/js/jquery.meetingtools.js b/src/site-media/js/jquery.meetingtools.js
new file mode 100644
index 0000000..5bed8f3
--- /dev/null
+++ b/src/site-media/js/jquery.meetingtools.js
@@ -0,0 +1,28 @@
+/*
+ *
+ *
+ *
+ */
+
+jQuery.fn.meetingtools = function(options) {
+
+ this.each(function() {
+ var tags = options.tags;
+ var url = options.url;
+ if (!url) {
+ url = 'http://localhost:8000';
+ }
+ var url = url+'/room/+'+tags+'.json'
+ var div = $(this)
+ $.getJSON(url,function(data) {
+ div.append("<ul style=\"list-style: none;\">")
+ $.each(data,function(room) {
+ div.append("<li style=\"display: list-item; list-style: none; padding: 2px; 5px;\" class=\"ui-helper-reset ui-widget ui-state-highlight ui-corner-all\">");
+ div.append(room['url']);
+ div.append("</li>");
+ });
+ div.append("</ul>")
+ });
+
+ });
+} \ No newline at end of file
diff --git a/src/templates/apps/room/rss2.xml b/src/templates/apps/room/rss2.xml
new file mode 100644
index 0000000..c5b3016
--- /dev/null
+++ b/src/templates/apps/room/rss2.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rss version="2.0"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/">
+ <channel>
+ <title>{{title}}</title>
+ <description>{{description}}</description>
+ <!-- {{tags}} -->
+ <lastBuildDate>{{date}}</lastBuildDate>
+ {% if rooms %}
+ {% for room in rooms %}
+ <item>
+ <title>{{room.name}}</title>
+ {% if room.description %}
+ <description>{{room.description}}</description>
+ {% endif %}
+ <link>{{room.go_url}}</link>
+ <guid isPermaLink="true">{{room.go_url_internal}}</guid>
+ </item>
+ {% endfor %}
+ {% endif %}
+ </channel>
+</rss> \ No newline at end of file
diff --git a/src/templates/apps/room/widget-test.html b/src/templates/apps/room/widget-test.html
new file mode 100644
index 0000000..2d1af29
--- /dev/null
+++ b/src/templates/apps/room/widget-test.html
@@ -0,0 +1,8 @@
+{% extends "base.html" %}
+{% load prefix %}
+{% block widgets %}
+$("#meetings").meetingtools({tags: 'aka'});
+{% endblock %}
+{% block content %}
+<div id="meetings">
+{% endblock %} \ No newline at end of file