mirror of
				https://gitlab.com/animath/si/plateforme-corres2math.git
				synced 2025-11-04 08:22:16 +01:00 
			
		
		
		
	Send synthesis button
This commit is contained in:
		@@ -75,7 +75,15 @@
 | 
			
		||||
                            {% endblocktrans %}
 | 
			
		||||
                        </div>
 | 
			
		||||
                    {% elif current_phase.phase_number == 4 %}
 | 
			
		||||
                        {# TODO View synthesis #}
 | 
			
		||||
                        <dl class="row">
 | 
			
		||||
                            <dt class="col-xl-5 text-right">{% trans "Synthesis from the other team:" %}</dt>
 | 
			
		||||
                            <dd class="col-sm-7"><a href="{{ participation.received_participation.synthesis.link|default:"#" }}"{% if participation.received_participation.synthesis.link %} target="_blank"{% endif %}>
 | 
			
		||||
                                {{ participation.received_participation.synthesis.link|default:novideo }}</a>
 | 
			
		||||
                                {% if participation.received_participation.synthesis.link %}
 | 
			
		||||
                                    <button class="btn btn-info" data-toggle="modal" data-target="#displayOtherSynthesisModal">{% trans "Display" %}</button>
 | 
			
		||||
                                {% endif %}
 | 
			
		||||
                            </dd>
 | 
			
		||||
                        </dl>
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
@@ -99,7 +107,7 @@
 | 
			
		||||
                        <dd class="col-sm-7"><a href="{{ participation.received_participation.solution.link|default:"#" }}"{% if participation.received_participation.solution.link %} target="_blank"{% endif %}>
 | 
			
		||||
                            {{ participation.received_participation.solution.link|default:novideo }}</a>
 | 
			
		||||
                            {% if participation.received_participation.solution.link %}
 | 
			
		||||
                                <button class="btn btn-info" data-toggle="modal" data-target="#displaySolutionModal">{% trans "Display" %}</button>
 | 
			
		||||
                                <button class="btn btn-info" data-toggle="modal" data-target="#displayOtherSolutionModal">{% trans "Display" %}</button>
 | 
			
		||||
                            {% endif %}
 | 
			
		||||
                        </dd>
 | 
			
		||||
 | 
			
		||||
@@ -137,7 +145,19 @@
 | 
			
		||||
                            {% endblocktrans %}
 | 
			
		||||
                        </div>
 | 
			
		||||
                    {% elif current_phase.phase_number == 4 %}
 | 
			
		||||
                        {# TODO Send synthesis #}
 | 
			
		||||
                        <div id="solution-container">
 | 
			
		||||
                            <dl class="row">
 | 
			
		||||
                                {% trans "No video sent" as novideo %}
 | 
			
		||||
                                <dt class="col-sm-5 text-right">{% trans "Your synthesis of the exchange:" %}</dt>
 | 
			
		||||
                                <dd class="col-sm-7"><a href="{{ participation.synthesis.link|default:"#" }}"{% if participation.synthesis.link %} target="_blank"{% endif %}>
 | 
			
		||||
                                    {{ participation.synthesis.link|default:novideo }}</a>
 | 
			
		||||
                                    <button class="btn btn-primary" data-toggle="modal" data-target="#uploadSynthesisModal">{% trans "Upload" %}</button>
 | 
			
		||||
                                    {% if participation.synthesis.link %}
 | 
			
		||||
                                        <button class="btn btn-info" data-toggle="modal" data-target="#displaySynthesisModal">{% trans "Display" %}</button>
 | 
			
		||||
                                    {% endif %}
 | 
			
		||||
                                </dd>
 | 
			
		||||
                            </dl>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                    </dl>
 | 
			
		||||
                </div>
 | 
			
		||||
@@ -162,6 +182,7 @@
 | 
			
		||||
{% trans "Upload" as modal_button %}
 | 
			
		||||
{% url "participation:upload_video" pk=participation.solution_id as modal_action %}
 | 
			
		||||
{% 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="displaySolution" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.solution.as_iframe|default:unsupported_platform %}
 | 
			
		||||
@@ -171,7 +192,7 @@
 | 
			
		||||
    {% if participation.received_participation.solution.link %}
 | 
			
		||||
        {% trans "Display solution" as modal_title %}
 | 
			
		||||
        {% trans "This video platform is not supported yet." as unsupported_platform %}
 | 
			
		||||
        {% include "base_modal.html" with modal_id="displaySolution" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.received_participation.solution.as_iframe|default:unsupported_platform %}
 | 
			
		||||
        {% include "base_modal.html" with modal_id="displayOtherSolution" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.received_participation.solution.as_iframe|default:unsupported_platform %}
 | 
			
		||||
    {% endif %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
@@ -201,6 +222,25 @@
 | 
			
		||||
        {% endwith %}
 | 
			
		||||
    {% endfor %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{% if current_phase.phase_number >= 4 %}
 | 
			
		||||
    {% if participation.received_participation.synthesis.link %}
 | 
			
		||||
        {% trans "Display synthesis" as modal_title %}
 | 
			
		||||
        {% trans "This video platform is not supported yet." as unsupported_platform %}
 | 
			
		||||
        {% include "base_modal.html" with modal_id="displayOtherSynthesis" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.received_participation.synthesis.as_iframe|default:unsupported_platform %}
 | 
			
		||||
    {% endif %}
 | 
			
		||||
 | 
			
		||||
    {% trans "Upload video" as modal_title %}
 | 
			
		||||
    {% trans "Upload" as modal_button %}
 | 
			
		||||
    {% url "participation:upload_video" pk=participation.synthesis_id as modal_action %}
 | 
			
		||||
    {% include "base_modal.html" with modal_id="uploadSynthesis" %}
 | 
			
		||||
 | 
			
		||||
    {% if participation.synthesis.link %}
 | 
			
		||||
        {% trans "Display synthesis" as modal_title %}
 | 
			
		||||
        {% trans "This video platform is not supported yet." as unsupported_platform %}
 | 
			
		||||
        {% include "base_modal.html" with modal_id="displaySynthesis" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.synthesis.as_iframe|default:unsupported_platform %}
 | 
			
		||||
    {% endif %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block extrajavascript %}
 | 
			
		||||
@@ -247,6 +287,14 @@
 | 
			
		||||
                if (!modalBody.html().trim())
 | 
			
		||||
                    modalBody.load("{% url "participation:upload_video" pk=participation.solution_id %} #form-content");
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            {% if current_phase.phase_number == 4 %}
 | 
			
		||||
                $('button[data-target="#uploadSynthesisModal"]').click(function() {
 | 
			
		||||
                    let modalBody = $("#uploadSynthesisModal div.modal-body");
 | 
			
		||||
                    if (!modalBody.html().trim())
 | 
			
		||||
                        modalBody.load("{% url "participation:upload_video" pk=participation.synthesis_id %} #form-content");
 | 
			
		||||
                });
 | 
			
		||||
            {% endif %}
 | 
			
		||||
        });
 | 
			
		||||
    </script>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user