mirror of
https://github.com/ae-utbm/sith.git
synced 2025-01-09 16:41:12 +00:00
123 lines
4.4 KiB
Django/Jinja
123 lines
4.4 KiB
Django/Jinja
{% extends "core/base.jinja" %}
|
|
{% from 'core/macros.jinja' import paginate_alpine %}
|
|
|
|
{% block title %}
|
|
{% trans %}UV Guide{% endtrans %}
|
|
{% endblock %}
|
|
|
|
{% block additional_css %}
|
|
<link rel="stylesheet" href="{{ static('pedagogy/css/pedagogy.scss') }}">
|
|
{% endblock %}
|
|
|
|
{% block additional_js %}
|
|
<script type="module" src="{{ static('bundled/pedagogy/guide-index.js') }}"></script>
|
|
{% endblock %}
|
|
|
|
{% block head %}
|
|
{{ super() }}
|
|
<meta name="viewport" content="width=device-width, initial-scale=0.6, maximum-scale=2">
|
|
{% endblock head %}
|
|
|
|
{% block content %}
|
|
{% if can_create_uv %}
|
|
<div class="action-bar">
|
|
<p>
|
|
<a href="{{ url('pedagogy:uv_create') }}">{% trans %}Create UV{% endtrans %}</a>
|
|
</p>
|
|
<p>
|
|
<a href="{{ url('pedagogy:moderation') }}">{% trans %}Moderate comments{% endtrans %}</a>
|
|
</p>
|
|
</div>
|
|
<br/>
|
|
{% endif %}
|
|
<div class="pedagogy" x-data="uv_search" x-cloak>
|
|
<form id="search_form">
|
|
<div class="search-form-container">
|
|
<div class="search-bar">
|
|
<input
|
|
id="search_input"
|
|
class="search-bar-input"
|
|
type="text"
|
|
name="search"
|
|
x-model.debounce.500ms="search"
|
|
/>
|
|
</div>
|
|
<div class="radio-department">
|
|
<div class="radio-guide">
|
|
{% set departments = [
|
|
("EDIM", "EDIM"), ("ENERGIE", "EE"), ("IMSI", "IMSI"),
|
|
("INFO", "GI"), ("GMC", "MC"), ("HUMA", "HUMA"), ("TC", "TC")
|
|
] %}
|
|
{% for (display_name, real_name) in departments %}
|
|
<input
|
|
type="checkbox"
|
|
name="department"
|
|
id="radio{{ real_name }}"
|
|
value="{{ real_name }}"
|
|
x-model="department"
|
|
/>
|
|
<label for="radio{{ real_name }}">{% trans %}{{ display_name }}{% endtrans %}</label>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
<div class="radio-credit-type">
|
|
<div class="radio-guide">
|
|
{% for credit_type in ["CS", "TM", "EC", "QC", "OM"] %}
|
|
<input
|
|
type="checkbox"
|
|
name="credit_type"
|
|
id="radio{{ credit_type }}"
|
|
value="{{ credit_type }}"
|
|
x-model="credit_type"
|
|
/>
|
|
<label for="radio{{ credit_type }}">{% trans %}{{ credit_type }}{% endtrans %}</label>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="radio-semester">
|
|
<div class="radio-guide">
|
|
<input type="checkbox" name="semester" id="radioAUTUMN" value="AUTUMN" x-model="semester"/>
|
|
<label for="radioAUTUMN"><i class="fa fa-leaf"></i></label>
|
|
<input type="checkbox" name="semester" id="radioSPRING" value="SPRING" x-model="semester"/>
|
|
<label for="radioSPRING"><i class="fa-regular fa-sun"></i></label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<table id="dynamic_view">
|
|
<thead>
|
|
<tr>
|
|
<td>{% trans %}UV{% endtrans %}</td>
|
|
<td>{% trans %}Title{% endtrans %}</td>
|
|
<td>{% trans %}Department{% endtrans %}</td>
|
|
<td>{% trans %}Credit type{% endtrans %}</td>
|
|
<td><i class="fa fa-leaf"></i></td>
|
|
<td><i class="fa-regular fa-sun"></i></td>
|
|
{% if can_create_uv %}
|
|
<td>{% trans %}Edit{% endtrans %}</td>
|
|
<td>{% trans %}Delete{% endtrans %}</td>
|
|
{% endif %}
|
|
</tr>
|
|
</thead>
|
|
<tbody id="dynamic_view_content" :aria-busy="loading">
|
|
<template x-for="uv in uvs.results" :key="uv.id">
|
|
<tr @click="window.location.href = `/pedagogy/uv/${uv.id}`" class="clickable">
|
|
<td><a :href="`/pedagogy/uv/${uv.id}`" x-text="uv.code"></a></td>
|
|
<td x-text="uv.title"></td>
|
|
<td x-text="uv.department"></td>
|
|
<td x-text="uv.credit_type"></td>
|
|
<td><i :class="uv.semester.includes('AUTUMN') && 'fa fa-leaf'"></i></td>
|
|
<td><i :class="uv.semester.includes('SPRING') && 'fa-regular fa-sun'"></i></td>
|
|
{% if can_create_uv -%}
|
|
<td><a :href="`/pedagogy/uv/${uv.id}/edit`">{% trans %}Edit{% endtrans %}</a></td>
|
|
<td><a :href="`/pedagogy/uv/${uv.id}/delete`">{% trans %}Delete{% endtrans %}</a></td>
|
|
{%- endif -%}
|
|
</tr>
|
|
</template>
|
|
</tbody>
|
|
</table>
|
|
{{ paginate_alpine("page", "maxPage()") }}
|
|
</div>
|
|
{% endblock content %}
|