rename UV to UE

This commit is contained in:
Thomas Girod
2025-04-08 13:48:10 +02:00
committed by imperosol
parent 32570ee03d
commit 775a3282dc
28 changed files with 783 additions and 699 deletions

View File

@@ -23,10 +23,10 @@
{% endblock head %}
{% block content %}
{% if user.has_perm("pedagogy.add_uv") %}
{% if user.has_perm("pedagogy.add_ue") %}
<div class="action-bar">
<p>
<a href="{{ url('pedagogy:uv_create') }}">{% trans %}Create UV{% endtrans %}</a>
<a href="{{ url('pedagogy:ue_create') }}">{% trans %}Create UE{% endtrans %}</a>
</p>
<p>
<a href="{{ url('pedagogy:moderation') }}">{% trans %}Moderate comments{% endtrans %}</a>
@@ -34,7 +34,7 @@
</div>
<br/>
{% endif %}
<div class="pedagogy" x-data="uv_search" x-cloak>
<div class="pedagogy" x-data="ue_search" x-cloak>
<form id="search_form">
<div class="search-form-container">
<div class="search-bar">
@@ -89,43 +89,43 @@
</div>
</div>
</form>
<table id="uv-list">
<table id="ue-list">
<thead>
<tr>
<td>{% trans %}UV{% endtrans %}</td>
<td>{% trans %}UE{% 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 user.has_perm("pedagogy.change_uv") -%}
{%- if user.has_perm("pedagogy.change_ue") -%}
<td>{% trans %}Edit{% endtrans %}</td>
{%- endif -%}
{%- if user.has_perm("pedagogy.delete_uv") -%}
{%- if user.has_perm("pedagogy.delete_ue") -%}
<td>{% trans %}Delete{% endtrans %}</td>
{% endif %}
</tr>
</thead>
<tbody :aria-busy="loading">
<template x-for="uv in uvs.results" :key="uv.id">
<template x-for="ue in ues.results" :key="ue.id">
<tr
@click="window.location.href = `/pedagogy/uv/${uv.id}`"
@click="window.location.href = `/pedagogy/ue/${ue.id}`"
class="clickable"
:class="{closed: uv.semester === 'CLOSED'}"
:class="{closed: ue.semester === 'CLOSED'}"
>
<td><a :href="`/pedagogy/uv/${uv.id}`" x-text="uv.code"></a></td>
<td><a :href="`/pedagogy/ue/${ue.id}`" x-text="ue.code"></a></td>
<td class="title"
x-text="uv.title + (uv.semester === 'CLOSED' ? ' ({% trans %}closed uv{% endtrans %})' : '')"
x-text="ue.title + (ue.semester === 'CLOSED' ? ' ({% trans %}closed ue{% endtrans %})' : '')"
></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 user.has_perm("pedagogy.change_uv") -%}
<td><a :href="`/pedagogy/uv/${uv.id}/edit`">{% trans %}Edit{% endtrans %}</a></td>
<td x-text="ue.department"></td>
<td x-text="ue.credit_type"></td>
<td><i :class="ue.semester.includes('AUTUMN') && 'fa fa-leaf'"></i></td>
<td><i :class="ue.semester.includes('SPRING') && 'fa-regular fa-sun'"></i></td>
{%- if user.has_perm("pedagogy.change_ue") -%}
<td><a :href="`/pedagogy/ue/${ue.id}/edit`">{% trans %}Edit{% endtrans %}</a></td>
{%- endif -%}
{%- if user.has_perm("pedagogy.delete_uv") -%}
<td><a :href="`/pedagogy/uv/${uv.id}/delete`">{% trans %}Delete{% endtrans %}</a></td>
{%- if user.has_perm("pedagogy.delete_ue") -%}
<td><a :href="`/pedagogy/ue/${ue.id}/delete`">{% trans %}Delete{% endtrans %}</a></td>
{%- endif -%}
</tr>
</template>

View File

@@ -1,7 +1,7 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}UV comment moderation{% endtrans %}
{% trans %}UE comment moderation{% endtrans %}
{% endblock title %}
{% block content %}
@@ -9,7 +9,7 @@
<table>
<thead>
<tr>
<td>{% trans %}UV{% endtrans %}</td>
<td>{% trans %}UE{% endtrans %}</td>
<td>{% trans %}Comment{% endtrans %}</td>
<td>{% trans %}Reason{% endtrans %}</td>
<td>{% trans %}Action{% endtrans %}</td>
@@ -22,7 +22,7 @@
<form action="{{ url('pedagogy:moderation') }}" method="post" enctype="multipart/form-data">
{% csrf_token %}
<tr>
<td><a href="{{ url('pedagogy:uv_detail', uv_id=report.comment.uv.id) }}#{{ report.comment.uv.id }}">{{ report.comment.uv }}</a></td>
<td><a href="{{ url('pedagogy:ue_detail', ue_id=report.comment.ue_id) }}#{{ report.comment.ue_id }}">{{ report.comment.ue }}</a></td>
<td>{{ report.comment.comment|markdown }}</td>
<td>{{ report.reason|markdown }}</td>
<td>

View File

@@ -7,12 +7,12 @@
{% endblock %}
{% block title %}
{% trans %}UV Details{% endtrans %}
{% trans %}UE Details{% endtrans %}
{% endblock %}
{% block content %}
<div class="pedagogy">
<div id="uv_detail">
<div id="ue_detail">
<button onclick='(function(){
// If comes from the guide page, go back with history
if (document.referrer.replace(/\?(.+)/gm,"").endsWith(`{{ url("pedagogy:guide") }}`)){
@@ -25,7 +25,7 @@
<h1>{{ object.code }} - {{ object.title }}</h1>
<br>
<div class="uv-quick-info-container">
<div class="ue-quick-info-container">
<div class="hours-cm">
<b>{% trans %}CM: {% endtrans %}</b>{{ object.hours_CM }}
</div>
@@ -55,7 +55,7 @@
<br>
<div class="uv-details-container">
<div class="ue-details-container">
<div class="grade">
<p>{% trans %}Global grade{% endtrans %}</p>
<p>{% trans %}Utility{% endtrans %}</p>
@@ -70,7 +70,7 @@
<p>{{ display_star(object.grade_teaching_average) }}</p>
<p>{{ display_star(object.grade_work_load_average) }}</p>
</div>
<div class="uv-infos">
<div class="ue-infos">
<p><b>{% trans %}Objectives{% endtrans %}</b></p>
<p>{{ object.objectives|markdown }}</p>
<p><b>{% trans %}Program{% endtrans %}</b></p>
@@ -86,21 +86,21 @@
<br>
{% if object.has_user_already_commented(user) %}
<div id="leave_comment_not_allowed">
<p>{% trans %}You already posted a comment on this UV. If you want to comment again, please modify or delete your previous comment.{% endtrans %}</p>
<p>{% trans %}You already posted a comment on this UE. If you want to comment again, please modify or delete your previous comment.{% endtrans %}</p>
</div>
{% elif user.has_perm("pedagogy.add_uvcomment") %}
{% elif user.has_perm("pedagogy.add_uecomment") %}
<details class="accordion" id="leave_comment">
<summary>{% trans %}Leave comment{% endtrans %}</summary>
<div class="accordion-content">
<form action="{{ url('pedagogy:uv_detail', uv_id=object.id) }}" method="post" enctype="multipart/form-data">
<form action="{{ url('pedagogy:ue_detail', ue_id=object.id) }}" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="leave-comment-grid-container">
<div class="form-stars">
{{ form.author.errors }}
{{ form.uv.errors }}
{{ form.ue.errors }}
{{ form.author }}
{{ form.uv }}
{{ form.ue }}
<div class="input-stars">
<label for="{{ form.grade_global.id_for_label }}">{{ form.grade_global.label }} :</label>
@@ -170,7 +170,7 @@
<div class="comment">
<div class="anchor">
<a href="{{ url('pedagogy:uv_detail', uv_id=uv.id) }}#{{ comment.id }}"><i class="fa fa-paragraph"></i></a>
<a href="{{ url('pedagogy:ue_detail', ue_id=ue.id) }}#{{ comment.id }}"><i class="fa fa-paragraph"></i></a>
</div>
{{ comment.comment|markdown }}
</div>