uclouvain/osis-dissertation

View on GitHub
templates/manager_proposition_dissertation_new.html

Summary

Maintainability
Test Coverage
{% extends "layout.html" %}
{% load static bootstrap3 %}
{% load i18n %}

{% comment "License" %}
 * OSIS stands for Open Student Information System. It's an application
 * designed to manage the core business of higher education institutions,
 * such as universities, faculties, institutes and professional schools.
 * The core business involves the administration of students, teachers,
 * courses, programs and so on.
 *
 * Copyright (C) 2015-2019 Université catholique de Louvain (http://www.uclouvain.be)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * A copy of this license - GNU General Public License - is available
 * at the root of the source code of this program.  If not,
 * see http://www.gnu.org/licenses/.
{% endcomment %}

{% block breadcrumb %}
    <li><a href="{% url 'studies' %}" id="lnk_studies">{% trans "Students' path" %}</a></li>
    <li id="lnk_cohorts_management"><a href="{% url 'cohorts_management' %}">{% trans "Cohorts management" %}</a></li>
    <li><a href="{% url 'dissertations' %}" id="lnk_dissertations">{% trans 'Dissertations' %}</a></li>
    <li><a href="{% url 'manager_proposition_dissertations' %}" id="lnk_propositions">{% trans 'Dissertation subjects' %}</a></li>
    <li class="active">{% trans 'New dissertation subject' %}</li>
{% endblock %}
{% block content %}
  <div class="page-header">
    <h2>{% trans 'New dissertation subject' %}</h2>
  </div>
  <div class="panel panel-default">
    <div class="panel-body">
       <form method="POST" class="post-form">
        {% csrf_token %}
        {{ form.media }}
        <div class="panel-group">
            {% bootstrap_field form.author %}
            {% trans 'If the concerned teacher is not in the list, you can' %}
            <a href="{% url 'manager_informations_add' %}" id="lnk_manager_informations_add" class=""
                role="button" title="{% trans 'Add teacher'%}">{% trans 'Add teacher' %}</a>
        </div>
        <div class="panel-group">
            {% bootstrap_field form.title %}
        </div>
        <div class="panel-group">
            {% bootstrap_field form.visibility %}
        </div>
        <div class="panel-group">
            {% bootstrap_field form.description %}
        </div>
        <div class="panel-group">
            {% bootstrap_field form.type %}
        </div>
        <div class="form-group">
            {% bootstrap_field form.level %}
        </div>
        <div class="panel-group">
            {% bootstrap_field form.collaboration %}
        </div>
        <div class="panel-group">
            {% bootstrap_field form.max_number_student %}
        </div>
        <div class="panel-group">
            <label for="txt_level" {% if offer_propositions_error %} style="color:red;" {% endif %}>
                {% trans 'Check the programs related to this topic' %}
                {% if offer_propositions_error %}
                    <br>{% trans offer_propositions_error %}
                {% endif %}
            </label>
            <br>
            <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
                    {% for offer_proposition_g in offer_proposition_group %}
                     <div class="panel panel-default">

                        <div class="panel-heading" role="tab" id="heading_{{ offer_proposition_g }}">
                          <h4 class="panel-title">
                            <a id="test_{{ offer_proposition_g }}" class="collapse_{{ offer_proposition_g }}" role="button" onclick="display_hide_div_child('collapse_{{ offer_proposition_g }}','statut_bouton_{{ offer_proposition_g }}');">
                            {{ offer_proposition_g }} <span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> </label>
                            </a>
                              <input type="hidden" id="statut_bouton_{{ offer_proposition_g }}" name="statut_bouton_{{ offer_proposition_g }}"  value="OK">
                          </h4>
                        </div>

                        <div id="collapse_{{ offer_proposition_g}}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading_{{ offer_proposition_g }}" style="display:none;">
                            {% for offer_proposition in offer_propositions %}
                                {% if offer_proposition.offer_proposition_group == offer_proposition_g %}

                                  <div class="list-group">
                                      &nbsp;
                                    <input id="txt_checkbox_{{ offer_proposition.id }}" name="txt_checkbox_{{ offer_proposition.id }}"
                                    type="checkbox" onclick="block_div(this,'test_{{ offer_proposition_g }}','statut_bouton_{{ offer_proposition_g }}','collapse_{{ offer_proposition_g }}');" class="test_{{ offer_proposition_g }}">
                                    <label for="txt_checkbox_{{ offer_proposition.id }}">&nbsp; {{ offer_proposition.full_offer_proposition_title }}</label>
                                  </div>
                                {% endif %}
                            {% endfor %}
                        </div>
                    </div>

                    {% endfor %}
            </div>
        <div style="text-align: right;">
            <button type="submit" class="save btn btn-primary">
                {% trans 'Save' %}
            </button>
        </div>
      </form>
    </div>
  </div>
{% endblock %}
{% block script %}
<script type="text/javascript" src="{% static "js/dissertation.js" %} ">
</script>
{% endblock %}