]> git.parisson.com Git - teleforma.git/commitdiff
fix RPC conference pull
authoryomguy <yomguy@parisson.com>
Wed, 30 Jan 2013 10:14:30 +0000 (11:14 +0100)
committeryomguy <yomguy@parisson.com>
Wed, 30 Jan 2013 10:14:30 +0000 (11:14 +0100)
teleforma/templates/teleforma/conferences.html [new file with mode: 0644]
teleforma/urls.py
teleforma/views/core.py

diff --git a/teleforma/templates/teleforma/conferences.html b/teleforma/templates/teleforma/conferences.html
new file mode 100644 (file)
index 0000000..e160f51
--- /dev/null
@@ -0,0 +1,119 @@
+{% extends "telemeta/base.html" %}
+{% load teleforma_tags %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+
+{% block extra_javascript %}
+{% endblock extra_javascript %}
+
+
+{% block content %}
+
+<div id="module-set-left" style="width: 18%">
+
+{% block modules %}
+<div class="module">
+
+<h3><a href="{% url teleforma-desk %}"><img src="{{ STATIC_URL }}telemeta/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% trans "My courses" %}</a></h3>
+<div style="background: white;">
+<ul>
+{% block courses %}
+{% for c in all_courses %}
+  {% with c.course as course %}
+   <li><a href="{% url teleforma-course-detail course.id %}">{{ course.title }}</a></li>
+  {% endwith %}
+ {% endfor %}
+{% endblock courses %}
+</ul>
+</div>
+</div>
+
+{% block module-action %}
+{% get_telecaster as telecaster %}
+{%  if telecaster %}
+<div class="module_action">
+<a href="{% url teleforma-conference-record %}" class="component_icon button" id="action_red">{% trans "New conference" %}</a>
+</div>
+{% endif %}
+{% endblock module-action %}
+
+{% block notes %}
+<!--<div class="module">
+<h3><img src="{{ STATIC_URL }}telemeta/images/view-pim-notes.png" alt="playlists" style="vertical-align:middle" />{% trans "My notes" %}</h3>
+<div style="background: white;">
+<ul>
+{% for note in notes %}
+<li>{{ note.content }}</li>
+{% endfor %}
+</ul>
+</div>
+</div>
+<div class="module_action">
+<a href="#" class="component_icon button" id="action_violet">{% trans "New note" %}</a>
+</div>-->
+{% endblock notes %}
+
+</div>
+{% endblock modules %}
+
+
+{% block course %}
+<div class="desk_center">
+    {% for c in object_list %}
+     {% with c.course as course %}
+      {% for type in c.types %}
+      <div class="course">
+        <div class="course_title">
+         <a href="{% url teleforma-course-detail course.id %}" style="color: #000;">{{ course.title }} - {{ type }}{% if course.description %} - {{ course.description }}{% endif %}</a>
+        </div>
+
+        {% 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 %}
+
+      </div>
+     {% endfor %}
+    {% endwith %}
+   {% endfor %}
+</div>
+{% endblock course %}
+
+
+<div id="module-set" style="width: 22%">
+
+{% block status %}
+{% get_telecaster as telecaster %}
+{%  if telecaster %}
+<div class="module">
+ <h3><img src="{{STATIC_URL}}teleforma/images/status.png" alt="status" style="vertical-align:middle" /> {% trans "Status" %}</h3>
+ <div id="server_status_table_wrapper" class="status"></div>
+</div>
+
+<script type="text/javascript">
+server_status_callback();
+</script>
+{% endif %}
+{% endblock status %}
+
+{% block chat %}
+{% if room %}
+{% with "General tweeter" as title %}
+{% include "teleforma/inc/chat_room.html" %}
+{% endwith %}
+{% endif %}
+{% endblock chat %}
+
+</div>
+
+{% endblock content %}
index 6ccde4d51272975887341cfe2792f3e51ff0b2ee..c0bbe3b790cb64f5d8cc8eec08cc56704cb12119 100644 (file)
@@ -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')),
index 431ce9b07e985dca576b176e1eadae5c368e486b..d4fda2c17938d4d4ee9de7441894a32725dd6698 100644 (file)
@@ -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):