]> git.parisson.com Git - teleforma.git/commitdiff
WIP
authorYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 19 May 2020 08:54:43 +0000 (10:54 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 19 May 2020 08:54:43 +0000 (10:54 +0200)
teleforma/models/core.py
teleforma/static/teleforma/css/teleforma.css
teleforma/templates/teleforma/course_webclass.html
teleforma/templates/teleforma/course_webclass_record.html
teleforma/templates/teleforma/seminar_detail.html
teleforma/views/core.py
teleforma/views/pro.py

index 68624d41ccc8c35f83b169a7ec7c1f339ced73c1..53b6c9e0800d698b0f1569a0c1d61ef265f1c78d 100755 (executable)
@@ -66,6 +66,7 @@ from django.template.defaultfilters import date
 from bigbluebutton_api_python.exception import BBBException
 from django.db.models.signals import pre_save
 from django.dispatch import receiver
+from jxmlease import XMLListNode, XMLDictNode
 
 from teleforma.bbb_utils import bbb, register_web_hook
 
@@ -621,6 +622,8 @@ class WebclassMixin(Model):
         recordings_xml = bbb.get_recordings(self.webclass_id).get_field('recordings')
         if hasattr(recordings_xml, 'get'):
             recordings = recordings_xml['recording']
+        if type(recordings) is XMLDictNode:
+            recordings = [recordings]
         for recording in recordings:
             recording.prettyprint()
             url = recording.get('playback', {}).get('format', {}).get('url')
index 2a098561b4b4425f98e9cb206a975c81764189a7..7a8053efda813d8d229394f0d5d79547440c93e6 100644 (file)
@@ -1767,6 +1767,10 @@ input,textarea{
     font-size: 1.2em;
     }
 
+.conference-big-button {
+    line-height:3em;
+}
+
 .messages {
     padding: 0em 1em 1em 1em;
 }
index 667d52dbc3cd0f297c50cdab3bff67f95ab7ebbc..3ab264a8ccc01373ad4808500deb157841da9636 100644 (file)
@@ -16,7 +16,7 @@
     </a>{% if type.name != "None" %} - {{ type }}{% endif %}{% if conference.session %} - {% trans "Session" %} {{ conference.session }}{% endif %}
 </div>
 
-{% if not seminar %}
+{% if not seminar and user.is_superuser %}
 <p class="warning">Attention, aucun séminaire n'est associé à cette conférence.</p>
 {% endif %}
 
 {% if webclass_status == 'past' %}
     {% if record %}
         <p>La conférence est terminée, vous pouvez la revoir ci-dessous.
-        <div class="media">
-        <a href="{% url teleforma-conference-webclass-record conference.id%}">Voir l'enregistrement</a>
-        </div>
+        <a href="{% url teleforma-conference-webclass-record conference.id%}" class="conference-big-button component_icon button icon_next">Voir l'enregistrement</a>
     {% else %}
         <p>La conférence est terminée. L'enregistrement n'est pas encore ligne.
     {% endif %}
 {% elif webclass_status == 'ingoing' %}
     <p>La conférence est en cours.</p>
-    <a href="{% url teleforma-conference-join conference.id %}" target="_blank">Cliquez ici pour rejoindre la conférence</a>
+    <a href="{% url teleforma-conference-join conference.id %}" target="_blank" class="conference-big-button component_icon button icon_next">Cliquez ici pour rejoindre la conférence</a>
 {% elif webclass_status == 'almost' %}
     <p>La conférence va bientôt démarrer. </p>
-    <a href="{% url teleforma-conference-join conference.id %}" target="_blank">Cliquez ici pour rejoindre la conférence</a>
+    <a href="{% url teleforma-conference-join conference.id %}" target="_blank" class="conference-big-buttoncomponent_icon button icon_next">Cliquez ici pour rejoindre la conférence</a>
 {% elif webclass_status == 'future' %}
     <p>La conférence est prévue pour le {{ conference.date_begin }}. Revenez ici à ce moment là pour pouvoir la rejoindre.</p>
 {% endif %}
 
 
-
+{% if user.is_superuser %}
+<div style="border:1px solid grey">
 <h3>Liens de test</h3>
 <p>
 Utilisateur courant : <a href="{% url teleforma-conference-join conference.id %}" target="_blank">Cliquez ici pour rejoindre la conférence en tant que <strong>{{ request.user.username }}</strong></a>
@@ -53,6 +52,9 @@ Utilisateur courant : <a href="{% url teleforma-conference-join conference.id %}
 <li><a href="{% url teleforma-conference-join conference.id %}?username=test{{i}}" target="_blank">Cliquez ici pour rejoindre la conférence en tant que <strong>test{{i}}</strong></a></li>
 {% endfor %}
 </ul>
+</div>
+{% endif %}
+
 
 {% block general_info %}
 <div class="course_content" id="media_infos">
index 07a324ce777b38c72c148688345bc2377c9b6628..e9960a3f432671e1aa330a8aaa82bff6062983f4 100644 (file)
@@ -6,6 +6,18 @@
 
 {% block infra_javascript %}
 
+<style>
+iframe {
+    position: fixed;
+    background: #000;
+    border: none;
+    top: 40px; right: 0;
+    bottom: 100px; left: 0;
+    width: 100%;
+    height: 90%;
+}
+</style>
+
 <script type="text/javascript">
 {% if show_record %}
 $(document).ready(function(){
@@ -25,6 +37,6 @@ $(window).ready(function(){
 
 
 {% block content %}
-<iframe src="{{record.url}}" width="100%" height="1000"></iframe>
+<iframe src="{{record.url}}" width="100%"></iframe>
 {% endblock content %}
 
index f86b0abee4bfed9d36edbcefb6910421fd2829d1..9332314e078cb6033b94f3059a880a0e82baff97 100644 (file)
@@ -166,7 +166,7 @@ $(window).ready(function( ){
        </div>
       {% endwith %}
 
-   {% if not seminar.conference in user.auditor.get.conferences.all %}
+   {% if seminar.conference.webclass or not seminar.conference in user.auditor.get.conferences.all %}
 
      {% with seminar.question as questions %}
        <div class="course_content">
index 9540595b90801b6cd1a7c42a6169016bd220c787..787f560e8023f226dffd3aa307adc820e5f67c40 100644 (file)
@@ -474,6 +474,7 @@ class ConferenceView(DetailView):
                 webclass_status = "almost"
             else:
                 webclass_status = "ingoing"
+            context['record'] = conference.get_record()
             context['webclass_status'] = webclass_status
         else:
             content_type = ContentType.objects.get(app_label="teleforma", model="conference")
index 367eed3b6e9179c92d11d4e0e08426a78c20edfd..5639489b6868c11f2e3951edbf8561e67ad9654d 100644 (file)
@@ -139,6 +139,7 @@ class SeminarAccessMixin(object):
         m = (totsec%3600) // 60
         sec =(totsec%3600)%60
         context['timer'] = "%d:%d:%d" %(h,m,sec)
+        context['conferences'] = all_conferences(self.request)
         return context
 
     def render_to_response(self, context):
@@ -314,7 +315,8 @@ class AnswerView(SeminarAccessMixin, SeminarRevisionMixin, FormView):
         self.question = Question.objects.get(pk=self.kwargs['pk'])
         self.user = self.get_user()
 
-        if self.question.seminar.conference in self.user.auditor.get().conferences.all():
+        conference = self.question.seminar.conference
+        if conference in self.user.auditor.get().conferences.all() and not conference.webclass:
             raise PermissionDenied
         
         answers = Answer.objects.filter(user=self.user,