mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-21 19:58:22 +02:00
Rename video in solution since there will be multiple videos in one page
This commit is contained in:
@ -20,14 +20,14 @@
|
||||
<div id="solution-container">
|
||||
<dl class="row">
|
||||
{% trans "No video sent" as novideo %}
|
||||
<dt class="col-sm-2">{% trans "Video link:" %}</dt>
|
||||
<dt class="col-sm-2">{% trans "Proposed solution:" %}</dt>
|
||||
<dd class="col-sm-10"><a href="{{ participation.solution.link|default:"#" }}" target="_blank">
|
||||
{{ participation.solution.link|default:novideo }}</a>
|
||||
{% if current_phase.phase_number == 1 or participation.solution.link == "" %}
|
||||
<button class="btn btn-primary" data-toggle="modal" data-target="#uploadVideoModal">{% trans "Upload" %}</button>
|
||||
<button class="btn btn-primary" data-toggle="modal" data-target="#uploadSolutionModal">{% trans "Upload" %}</button>
|
||||
{% endif %}
|
||||
{% if participation.solution.link %}
|
||||
<button class="btn btn-info" data-toggle="modal" data-target="#displayVideoModal">{% trans "Display" %}</button>
|
||||
<button class="btn btn-info" data-toggle="modal" data-target="#displaySolutionModal">{% trans "Display" %}</button>
|
||||
{% endif %}
|
||||
</dd>
|
||||
</dl>
|
||||
@ -38,17 +38,17 @@
|
||||
{% trans "Upload video" as modal_title %}
|
||||
{% trans "Upload" as modal_button %}
|
||||
{% url "participation:upload_video" pk=participation.solution_id as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="uploadVideo" %}
|
||||
{% include "base_modal.html" with modal_id="uploadSolution" %}
|
||||
{% trans "Display solution" as modal_title %}
|
||||
{% trans "This video platform is not supported yet." as unsupported_platform %}
|
||||
{% include "base_modal.html" with modal_id="displayVideo" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.solution.as_iframe|default:unsupported_platform %}
|
||||
{% include "base_modal.html" with modal_id="displaySolution" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.solution.as_iframe|default:unsupported_platform %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('button[data-target="#uploadVideoModal"]').click(function() {
|
||||
let modalBody = $("#uploadVideoModal div.modal-body");
|
||||
$('button[data-target="#uploadSolutionModal"]').click(function() {
|
||||
let modalBody = $("#uploadSolutionModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:upload_video" pk=participation.solution_id %} #form-content");
|
||||
});
|
||||
|
Reference in New Issue
Block a user