]> git.parisson.com Git - teleforma.git/commitdiff
Script service URL in settings:wq
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 25 Jan 2018 23:28:46 +0000 (00:28 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 25 Jan 2018 23:28:46 +0000 (00:28 +0100)
teleforma/exam/templates/exam/script_detail.html
teleforma/exam/views.py

index d18fc5cb2bea154eca12ac64b36c762db9541bbc..7e27aba6a91aa0dc5fd51c79a59e0076b8e9043c 100644 (file)
 <br /><br />
 <div class="media">
  <div class="script">
-    <iframe id="box-iframe" style="position:fixed; top:14%; left:0px; bottom:0px; right:0px; width:100%; height:85%; border:none; margin:0; padding:0; z-index:0;" src="{% if user.quotas.all or user.is_superuser %}http://teleforma.parisson.com/webview/teleforma.html?url={{ script.safe_url }}?username=Examinator{% else %}http://teleforma.parisson.com/webviewer/teleforma.html?url={{ script.safe_url }}?username={{ user.username }}{% endif %}">
+    <iframe id="box-iframe" style="position:fixed; top:14%; left:0px; bottom:0px; right:0px; width:100%; height:85%; border:none; margin:0; padding:0; z-index:0;" src="{% if user.quotas.all or user.is_superuser %}{{ script_service_url }}?url={{ script.safe_url }}?username=Examinator{% else %}{{ script_service_url }}?url={{ script.safe_url }}?username={{ user.username }}{% endif %}">
     </iframe>
  </div>
 </div>
index 5c2f75922d1d8b66c6a5cd47a93b04ed2f8814a5..4e847395379ecd87526b288c6fbfe6ad333be023 100644 (file)
@@ -19,6 +19,7 @@ class ScriptMixinView(View):
         context = super(ScriptMixinView, self).get_context_data(**kwargs)
         self.period = Period.objects.get(id=self.kwargs['period_id'])
         context['period'] = self.period
+        context['script_service_url'] = getattr(settings, 'TELEFORMA_EXAM_SCRIPT_SERVICE_URL'
         if getattr(settings, 'TELEFORMA_EXAM_SCRIPT_UPLOAD', True) and self.period.date_exam_end:
             context['upload'] = datetime.datetime.now() <= self.period.date_exam_end
         else: