uclouvain/osis-dissertation

View on GitHub
templates/proposition_dissertations_list_my.html

Summary

Maintainability
Test Coverage
{% extends "layout.html" %}
{% load static %}
{% 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 class="active">{% trans 'Dissertation subjects' %}</li>
{% endblock %}
{% block content %}
  <div class="page-header">
    <h2>{% trans 'Dissertation subjects' %}</h2>
  </div>
  <ul class="nav nav-tabs">
    <li class="active"><a href="#">{% trans 'My subjects' %}</a></li>
    <li><a href="{% url 'proposition_dissertations_created'%}">{% trans 'Subjects created' %}</a></li>
    <li><a href="{% url 'proposition_dissertations'%}">{% trans 'All subjects' %}</a></li>
  </ul>
  <div class="panel panel-default">
    <div class="panel-body">
      <form method="get" action="{% url 'proposition_dissertations_search'%}">
        <div class="row">
          <div class="col-md-1 pull-right">
            <a href="{% url 'proposition_dissertation_new' %}" id="lnk_proposition_dissertation_new" class="btn btn-default"
            role="button" title="{% trans 'Add dissertation subject'%}"><span class="glyphicon glyphicon-plus"
            aria-hidden="true"></span></a>
          </div>
        </div>
      </form>
    </div>
        {% if message %}
          <div>
              <label class="alert alert-warning" style="margin:5px">{{message}}</label>
          </div>
        {% else %}
          <div>
            {% if propositions_dissertations|length == 0 %}
              <br>
              <label class="alert alert-info" style="margin-left:10%;width:80%;text-align:center;">{% trans 'No result' %}</label>
            {% else %}
              <table class="table table-hover">
                <tr>
                  <th>{% trans 'Title' context 'dissertation' %}</th>
                  <th>{% trans 'Promotor'%}</th>
                  <th>{% trans 'Created by'%}</th>
                  <th>{% trans 'Visibility'%}</th>
                  <th>{% trans 'Maximum number of student'%}</th>
                  <th>{% trans 'Number of places remaining' %}</th>
                  <th>{% trans 'Programs'%}</th>
                </tr>
                {% for proposition_dissertation in propositions_dissertations %}
                  <tr>
                    <td><a href="{% url 'proposition_dissertation_detail' pk=proposition_dissertation.pk %}">{{ proposition_dissertation.title }}</a></td>
                    <td>{{ proposition_dissertation.author }}</td>
                    <td>{{ proposition_dissertation.creator|default_if_none:"" }}</td>
                    <td>
                      {% if proposition_dissertation.visibility == True %}
                        <span class="label label-success">{% trans 'Visible' %}</span>
                      {% else %}
                        <span class="label label-warning">{% trans 'Invisible' %}</span>
                      {% endif %}
                    </td>
                    <td>{{ proposition_dissertation.max_number_student }}</td>
                    {% if proposition_dissertation.remaining_places > 0 %}
                    <td> {{ proposition_dissertation.remaining_places }}</td>
                    {% else %}
                    <td> 0 </td>
                    {% endif %}
                    <td>
                        {% for offer_proposition in proposition_dissertation.offer_propositions.all %}
                        <span class="label label-default" >
                          {{ offer_proposition.last_acronym }}
                        </span>
                        &nbsp;
                        {% endfor %}
                    </td>
                  </tr>
                {% endfor %}
              </table>
            {% endif %}
          </div>
        {% endif %}
 </div>
{% endblock %}