From 50df2accfafc747158f802c258d8e565a72b93f4 Mon Sep 17 00:00:00 2001 From: yomguy Date: Wed, 30 Jan 2013 11:14:30 +0100 Subject: [PATCH] fix RPC conference pull --- .../templates/teleforma/conferences.html | 119 ++++++++++++++++++ teleforma/urls.py | 2 + teleforma/views/core.py | 19 ++- 3 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 teleforma/templates/teleforma/conferences.html diff --git a/teleforma/templates/teleforma/conferences.html b/teleforma/templates/teleforma/conferences.html new file mode 100644 index 00000000..e160f51f --- /dev/null +++ b/teleforma/templates/teleforma/conferences.html @@ -0,0 +1,119 @@ +{% extends "telemeta/base.html" %} +{% load teleforma_tags %} +{% load telemeta_utils %} +{% load i18n %} + + +{% block extra_javascript %} +{% endblock extra_javascript %} + + +{% block content %} + +
+ +{% block modules %} +
+ +

playlists{% trans "My courses" %}

+
+
    +{% block courses %} +{% for c in all_courses %} + {% with c.course as course %} +
  • {{ course.title }}
  • + {% endwith %} + {% endfor %} +{% endblock courses %} +
+
+
+ +{% block module-action %} +{% get_telecaster as telecaster %} +{% if telecaster %} + +{% endif %} +{% endblock module-action %} + +{% block notes %} + +{% endblock notes %} + +
+{% endblock modules %} + + +{% block course %} +
+ {% for c in object_list %} + {% with c.course as course %} + {% for type in c.types %} +
+ + + {% block conference %} + {% include "teleforma/inc/conference_list.html" %} + {% endblock %} + + {% block media %} + {% include "teleforma/inc/media_list.html" %} + {% endblock %} + + {% block document %} + {% with forloop.counter as type_counter %} + {% include "teleforma/inc/document_list.html" %} + {% endwith %} + {% endblock %} + +
+ {% endfor %} + {% endwith %} + {% endfor %} +
+{% endblock course %} + + +
+ +{% block status %} +{% get_telecaster as telecaster %} +{% if telecaster %} +
+

status {% trans "Status" %}

+
+
+ + +{% endif %} +{% endblock status %} + +{% block chat %} +{% if room %} +{% with "General tweeter" as title %} +{% include "teleforma/inc/chat_room.html" %} +{% endwith %} +{% endif %} +{% endblock chat %} + +
+ +{% endblock content %} diff --git a/teleforma/urls.py b/teleforma/urls.py index 6ccde4d5..c0bbe3b7 100644 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@ -81,6 +81,8 @@ urlpatterns = patterns('', name="teleforma-conference-audio"), url(r'^desk/conference_record/$', ConferenceRecordView.as_view(), name="teleforma-conference-record"), + url(r'^desk/conferences/$', ConferenceListView.as_view(), + name="teleforma-conferences"), # Postman url(r'^messages/', include('postman.urls')), diff --git a/teleforma/views/core.py b/teleforma/views/core.py index 431ce9b0..d4fda2c1 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -397,17 +397,26 @@ class ConferenceView(DetailView): class ConferenceListView(ListView): model = Conference + template_name='teleforma/conferences.html' + + def get_queryset(self): + conferences = Conference.objects.all() + return conferences @jsonrpc_method('teleforma.get_conference_list') def get_conference_list(request): - return [c.to_json_dict() for c in self.get_queryset()] + conferences = Conference.objects.all() + return [c.to_json_dict() for c in conferences] - def pull(self, conference): + def pull(request): url = 'http://' + settings.TELECASTER_MASTER_SERVER + '/json/' s = ServiceProxy(url) - list = s.teleforma.get_conference_list() - for conf_dict in list: - conference.from_json_dict(conf_dict) + result = s.teleforma.get_conference_list() + for conf_dict in result['result']: + conference = Conference.objects.filter(public_id=conf_dict['id']) + if not conference: + conference = Conference() + conference.from_json_dict(conf_dict) class ConferenceRecordView(FormView): -- 2.39.5