Skip to content

Commit

Permalink
[DONE] General fixes for 3.5.x (#1037)
Browse files Browse the repository at this point in the history
* * Correct some english typos
* Add missing aria-hidden attributes
* Rename js function TriggerAlertClose-> triggerAlertClose
* Replace JQ scrollTop by `form.scrollIntoView();`
* Add missing fieldset legends
* Use page_title in some templates
* Code formatting
* Remove redundants titles

* + Replace MESRI by MESR + Correct Marianne img (previous was raising 404)
+ Add typography guides in contributing.md
+ `make starts`now run on :9090
+ Add colored border color for each enrichment type
+ Set page_title for edit_enrichment, event_delete
+ Move scripts to {% block more_script %} (edit_enrichment & live/event)
+ Replace `list-group-item` by fieldset border in event_edit, meeting_edit and playlist_edit
+ Code formatting (indent)
+ CSS : more contrasted bs-orange

* Reduce Marianne img size

* remove js debug
+ correct html typo
  • Loading branch information
Badatos authored Jan 31, 2024
1 parent 5488d5c commit 3962159
Show file tree
Hide file tree
Showing 47 changed files with 963 additions and 947 deletions.
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,18 @@ All JavaScript code is linted with [eslint](https://eslint.org/).

All python code is linted with [flake8](https://flake8.pycqa.org/en/latest/)

### Typography

Please use these typographic characters in all displayed strings:

* Use Apostrophe (’) instead of single quote (')
* English samples: don’t, it’s
* French samples : J’aime, l’histoire
* Use the ellipsis (…) instead of 3 dots (...)
* English sample: Loading…
* French sample : Chargement…
* Use typographic quotes (“ ”) instead of neutral quotes (" ")
* English sample: You can use the “Description” field below.
* French sample : Utilisez le champ « Description » ci-dessous


4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ start:
starts:
# nécessite les django-extensions
# cf https://timonweb.com/django/https-django-development-server-ssl-certificate/
(sleep 15 ; open https://localhost:8000) &
python3 manage.py runserver_plus --cert-file cert.pem --key-file key.pem
(sleep 15 ; open https://localhost:9090) &
python3 manage.py runserver_plus localhost:9090 --cert-file cert.pem --key-file key.pem

# Première installation de pod (BDD SQLite intégrée)
install:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ The project and the platform of the same name are aimed at users of our institut
### Technical documentation
* The documentation (to install, customize, etc…) is on the [ESUP Wiki](https://www.esup-portail.org/wiki/display/ES/esup-pod "Documentation")

<img src="https://www.univ-lille.fr/typo3conf/ext/ul2fpfb/Resources/Public/assets/img/UL-ROSE-dark-2014.svg" height="50"> | <img src="https://www.esup-portail.org/sites/default/files/logo-esupportail_1.png" height="50"> | <img src="http://cache.media.enseignementsup-recherche.gouv.fr/image/Global/35/8/Marianne_seule_MESRI_head_www_766358.jpg" height="50"> Ministère de lʼEnseignement supérieur, de la Recherche et de lʼInnovation
<img src="https://www.univ-lille.fr/typo3conf/ext/ul2fpfb/Resources/Public/assets/img/UL-ROSE-dark-2014.svg" height="50"> | <img src="https://www.esup-portail.org/sites/default/files/logo-esupportail_1.png" height="50"> | <img src="https://upload.wikimedia.org/wikipedia/fr/5/50/Bloc_Marianne.svg" height="30"> Ministère de lʼEnseignement supérieur et de la Recherche
:-----:|:-----:|:----:

2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
## Retrouvez toute la documentation à cette adresse : https://www.esup-portail.org/wiki/display/ES/esup-pod


[<img src="https://www.univ-lille.fr/typo3conf/ext/ul2fpfb/Resources/Public/assets/img/UL-ROSE-dark-2014.svg" height="50" loading="lazy">](https://www.univ-lille.fr "Université de Lille") | [<img src="https://www.esup-portail.org/sites/default/files/logo-esupportail_1.png" height="50" loading="lazy">](https://www.esup-portail.org "Esup Portail") | [<img src="http://cache.media.enseignementsup-recherche.gouv.fr/image/Global/35/8/Marianne_seule_MESRI_head_www_766358.jpg" height="50" loading="lazy"> Ministère de lʼEnseignement supérieur, de la Recherche et de lʼInnovation](http://www.enseignementsup-recherche.gouv.fr "Ministère de lʼEnseignement supérieur, de la Recherche et de lʼInnovation")
[<img src="https://www.univ-lille.fr/typo3conf/ext/ul2fpfb/Resources/Public/assets/img/UL-ROSE-dark-2014.svg" height="50" loading="lazy">](https://www.univ-lille.fr "Université de Lille") | [<img src="https://www.esup-portail.org/sites/default/files/logo-esupportail_1.png" height="50" loading="lazy">](https://www.esup-portail.org "Esup Portail") | [<img src="https://upload.wikimedia.org/wikipedia/fr/5/50/Bloc_Marianne.svg" height="30" loading="lazy"> Ministère de lʼEnseignement supérieur et de la Recherche](http://www.enseignementsup-recherche.gouv.fr "Ministère de lʼEnseignement supérieur et de la Recherche")
:-----:|:-----:|:----:
2 changes: 1 addition & 1 deletion pod/bbb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class Livestream(models.Model):
verbose_name=_("Save meeting in dashboard"),
help_text=_(
"Do you want to save the video of "
"this meeting, at the end of the live, directly in “Dashboard?"
"this meeting, at the end of the live, directly in “Dashboard?"
),
default=False,
)
Expand Down
4 changes: 2 additions & 2 deletions pod/completion/templates/video_caption_maker.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{% endfor %}
<script>
document.addEventListener('DOMContentLoaded',function () {
TriggerAlertClose();
triggerAlertClose();
});
</script>
</div>
Expand Down Expand Up @@ -221,5 +221,5 @@ <h2 class="modal-title" id="confirmSaveLabel">{% trans "Save captions file."%}</
</script>
<script src="{% static 'js/caption_maker.js' %}?ver={{VERSION}}"></script>
<script src="{% static 'js/completion.js' %}?ver={{VERSION}}"></script>
{% include 'videos/video-script.html'%}
{% include 'videos/video-script.html'%}
{% endblock more_script %}
8 changes: 3 additions & 5 deletions pod/dressing/templates/dressing_delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% endblock %}

{% block page_content %}
<p>{% trans "To delete the dressing, please check in and click “Delete”." %}</p>
<p>{% trans "To delete the dressing, please check the box and click “Delete”." %}</p>
<form method="post" action="{{ request.get_full_path }}" id="dressing_delete_form" class='needs-validation' novalidate>
{% csrf_token %}
<div class="list-group">
Expand Down Expand Up @@ -56,7 +56,5 @@
</form>
{% endblock page_content %}

{% block collapse_page_aside %}
{% endblock collapse_page_aside %}
{% block page_aside %}
{% endblock page_aside %}
{% block collapse_page_aside %}{% endblock collapse_page_aside %}
{% block page_aside %}{% endblock page_aside %}
24 changes: 24 additions & 0 deletions pod/enrichment/static/css/videojs-slides.css
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,27 @@ li[class^="enrich_"] {
li[class^="enrich_"]::marker {
font-size: 1.5em;
}

td[class^="enrich_"] {
border-left: 3px solid transparent;
}

td.enrich_image {
border-color: var(--bs-purple);
}

td.enrich_document {
border-color: var(--bs-orange);
}

td.enrich_richtext {
border-color: var(--bs-blue);
}

td.enrich_weblink {
border-color: var(--bs-red);
}

td.enrich_embed {
border-color: var(--bs-green);
}
87 changes: 36 additions & 51 deletions pod/enrichment/templates/enrichment/edit_enrichment.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,15 @@
{% load i18n %}
{% load static %}



{% block page_title %}
{% trans 'Enrichment of the video' %} "{{video.title}}"
{% endblock page_title %}



{% block page_extra_head %}
{{ block.super }}

<link
rel="stylesheet"
href="{% static 'css/enrichment.css' %}?ver={{VERSION}}"
>
<script src="{% static 'js/enrichment.js' %}?ver={{VERSION}}"></script>

<script>
let num = 0;
let name = '';
/*** For the form ***/;
let video_duration = {{video.duration}};
/*** For the Cancel button ***/

document.addEventListener("reset", (e) => {
if (e.target !== document.querySelector("#page-video form")) return
document.getElementById("form_enrich").innerHTML = "";
document.querySelectorAll("form").forEach((form)=>{
form.style.display = "block";
})
document.querySelectorAll("table tr").forEach((tr) => {
tr.classList.remove("info");
});

manageResize();
});
</script>
{% endblock page_extra_head %}



{% block page_content %}
<div id="video-player">
{% block video-element %}
Expand All @@ -56,21 +24,21 @@
{% endif %}
</div>
{% if not form_enrichment %}
<form
id="form_new"
class="get_form"
action="{% url 'enrichment:edit_enrichment' slug=video.slug %}"
method="POST"
>
{% csrf_token %}
<input type="hidden" name="action" value="new">
<input
type="submit"
id="add_new_enrichment"
value="{% trans 'Add a new enrichment' %}"
class="btn btn-primary btn-sm"
<form
id="form_new"
class="get_form"
action="{% url 'enrichment:edit_enrichment' slug=video.slug %}"
method="POST"
>
</form>
{% csrf_token %}
<input type="hidden" name="action" value="new">
<input
type="submit"
id="add_new_enrichment"
value="{% trans 'Add a new enrichment' %}"
class="btn btn-primary btn-sm"
>
</form>
{% endif %}
<hr>
<div class="d-flex justify-content-between">
Expand All @@ -93,9 +61,6 @@
</div>
{% endblock page_content %}




{% block page_aside %}
<div class="card" id="card-enrichment-edit-informations">
<h2 class="card-header card-title pod-card__title h4">
Expand All @@ -113,7 +78,7 @@ <h2 class="card-header card-title pod-card__title h4">
{% trans 'The title field is required and must contains from 2 to 100 characters.' %}
</p>
<p>
{% trans 'The fields “Start and “End must contain an indication value in seconds. Start playback of the video, pause the video and click on “Get time from the player to fill in the field untitled “Start. Then do the same to fill in the field untitled “End.' %}
{% trans 'The fields “Start and “End must contain an indication value in seconds. Start playback of the video, pause the video and click on “Get time from the player to fill in the field untitled “Start. Then do the same to fill in the field untitled “End.' %}
</p>
<p>{% trans 'You cannot overlap enrichments.' %}</p>
<p>{% trans 'You must save your enrichments to view the result.' %}</p>
Expand All @@ -122,9 +87,29 @@ <h2 class="card-header card-title pod-card__title h4">
{{ block.super }}
{% endblock page_aside %}

{% block more_script %}
<script src="{% static 'js/enrichment.js' %}?ver={{VERSION}}"></script>

<script>
let num = 0;
let name = '';
/*** For the form ***/;
let video_duration = {{video.duration}};
/*** For the Cancel button ***/

document.addEventListener("reset", (e) => {
if (e.target !== document.querySelector("#page-video form")) return
document.getElementById("form_enrich").innerHTML = "";
document.querySelectorAll("form").forEach((form)=>{
form.style.display = "block";
})
document.querySelectorAll("table tr").forEach((tr) => {
tr.classList.remove("info");
});

{% block more_script %}
manageResize();
});
</script>
{{block.super}}
<script>
player.on('play', function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{% load i18n %}

<h2 class="card-header card-title pod-card__title h4">
<i class="bi bi-info-circle" aria-hidden="true"></i>&nbsp;{% trans 'Informations' %}
<i class="bi bi-info-circle" aria-hidden="true"></i>&nbsp;{% trans 'Informations' %}
</h2>
<div class="card-body card-text">
<p>{% trans 'To help you, the different types of enrichments have specific colors:' %}</p>
<p>
<ul>
<li class="enrich_image">{% trans 'Image' %}</li>
<li class="enrich_document">{% trans 'Document' %}</li>
<li class="enrich_richtext">{% trans 'Richtext' %}</li>
<li class="enrich_weblink">{% trans 'Weblink' %}</li>
<li class="enrich_embed">{% trans 'Embed' %}</li>
</ul>
</p>
<p>{% trans 'They are visible on the video playback bar.' %}</p>
<div class="card-body card-text bg-body">
<p>{% trans 'To help you, the different types of enrichments have specific colors:' %}</p>
<p>
<ul>
<li class="enrich_image">{% trans 'Image' %}</li>
<li class="enrich_document">{% trans 'Document' %}</li>
<li class="enrich_richtext">{% trans 'Richtext' %}</li>
<li class="enrich_weblink">{% trans 'Weblink' %}</li>
<li class="enrich_embed">{% trans 'Embed' %}</li>
</ul>
</p>
<p>{% trans 'They are visible on the video playback bar.' %}</p>
</div>
76 changes: 38 additions & 38 deletions pod/enrichment/templates/enrichment/list_enrichment.html
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
{# HTML for enrichment list. Don't use this file alone it must be integrated into another template! #}
{% load i18n %}
<div class="container">
<div class="panel-heading">
<h4 class="card-title pod-card__title">{% trans 'List of the enrichments' %}&nbsp;({{list_enrichment|length}})</h4>
</div>
<table class="table table-striped table-condensed scroll" id="table_list_enrich">
<thead>
<tr>
<th scope="col">{% trans 'Title' %}</th>
<th scope="col">{% trans 'Type' %}</th>
<th scope="col" class="enrich_start">{% trans 'Start' %}</th>
<th scope="col" class="enrich_end">{% trans 'End' %}</th>
<th scope="col">{% trans 'Actions' %}</th>
</tr>
</thead>
<tbody>
{% for enrich in list_enrichment %}
<tr>
<td class="enrich_title">{{enrich.title}}</td>
<td class="enrich_type enrich_{{enrich.type}}">{% if enrich.type %}{% trans enrich.type %}{% endif %}</td>
<td class="enrich_start">{{enrich.start}}</td>
<td class="enrich_end">{{enrich.end}}</td>
<td>
<form class="get_form" action="{% url 'enrichment:video_enrichment' slug=video.slug %}" method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="modify">
<input type="hidden" name="id" value="{{enrich.id}}">
<input type="submit" title="{% blocktrans with enrich_title=enrich.title %}Modify the enrichment “{{ enrich_title }}”{% endblocktrans %}" value="{% trans 'Modify' %}" class="btn btn-primary btn-sm">
</form>
<form class="get_form" action="{% url 'enrichment:video_enrichment' slug=video.slug %}" method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="delete">
<input type="hidden" name="id" value="{{enrich.id}}">
<input type="submit" title="{% blocktrans with enrich_title=enrich.title %}Delete the enrichment “{{ enrich_title }}”{% endblocktrans %}" value="{% trans 'Delete' %}" class="btn btn-danger btn-sm">
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="panel-heading">
<h2 class="h3">{% trans 'List of the enrichments' %}&nbsp;({{list_enrichment|length}})</h2>
</div>
<table class="table table-striped table-condensed scroll" id="table_list_enrich">
<thead>
<tr>
<th scope="col">{% trans 'Title' %}</th>
<th scope="col">{% trans 'Type' %}</th>
<th scope="col" class="enrich_start">{% trans 'Start' %}</th>
<th scope="col" class="enrich_end">{% trans 'End' %}</th>
<th scope="col">{% trans 'Actions' %}</th>
</tr>
</thead>
<tbody>
{% for enrich in list_enrichment %}
<tr>
<td class="enrich_title">{{enrich.title}}</td>
<td class="enrich_type enrich_{{enrich.type}}">{% if enrich.type %}{% trans enrich.type %}{% endif %}</td>
<td class="enrich_start">{{enrich.start}}</td>
<td class="enrich_end">{{enrich.end}}</td>
<td>
<form class="get_form d-inline" action="{% url 'enrichment:video_enrichment' slug=video.slug %}" method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="modify">
<input type="hidden" name="id" value="{{enrich.id}}">
<input type="submit" title="{% blocktrans with enrich_title=enrich.title %}Modify the enrichment “{{ enrich_title }}”{% endblocktrans %}" value="{% trans 'Modify' %}" class="btn btn-primary btn-sm">
</form>
<form class="get_form d-inline" action="{% url 'enrichment:video_enrichment' slug=video.slug %}" method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="delete">
<input type="hidden" name="id" value="{{enrich.id}}">
<input type="submit" title="{% blocktrans with enrich_title=enrich.title %}Delete the enrichment “{{ enrich_title }}”{% endblocktrans %}" value="{% trans 'Delete' %}" class="btn btn-danger btn-sm">
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
4 changes: 3 additions & 1 deletion pod/enrichment/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def edit_enrichment(request, slug):
return render(
request,
"enrichment/edit_enrichment.html",
{"video": video, "list_enrichment": list_enrichment},
{"video": video,
"list_enrichment": list_enrichment,
"page_title": _("Enrichment of the video “%s”") % video.title},
)


Expand Down
3 changes: 2 additions & 1 deletion pod/import_video/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ class ExternalRecordingForm(forms.ModelForm):

fieldsets = (
(
None,
"general",
{
"legend": _("General settings"),
"fields": (
"name",
"type",
Expand Down
Loading

0 comments on commit 3962159

Please sign in to comment.