uclouvain/osis-dissertation

View on GitHub
templates/proposition_dissertations_list.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><a href="{% url 'my_dissertation_propositions' %}">{% trans 'My subjects' %}</a></li>
    <li><a href="{% url 'proposition_dissertations_created' %}">{% trans 'Subjects created' %}</a></li>
    <li class="active"><a href="#">{% 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-10">
            <input class="form-control" id="txt_search" placeholder="{% trans 'Search' %}" name="search"
            value="{{ request.GET.search }}">
          </div>
          <div class="col-md-1">
            <button type="submit" id="bt_submit_proposition_dissertation_search" class="btn btn-primary" role="button"
            title="{% trans 'Search dissertation subject' %}"><span class="glyphicon glyphicon-search"
            aria-hidden="true"></span></button>
          </div>
          <div class="col-md-1">
            <a href="{% url 'proposition_dissertation_new' %}" id="lnk_proposition_dissertation_new" class="btn btn-default"
            role="button" title="{% trans 'Add dissertation subject'%}" style="margin-left:1em;"><span class="glyphicon glyphicon-plus"
            aria-hidden="true"></span></a>
          </div>
        </div>
      </form>
      </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 '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>
                        {% 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>
{% endblock %}