From 9a63dea0cbaf370eb3e6178201a899b34784b2e7 Mon Sep 17 00:00:00 2001 From: krek0 Date: Fri, 24 Apr 2026 21:53:44 +0200 Subject: [PATCH] Rennes rebranding --- README.md | 4 ++- photo21/forms.py | 9 ++---- photo21/templates/account/login.html | 2 +- photo21/templates/base.html | 22 ++++++------- photo21/templates/index.html | 29 +++++++---------- photologue/static/gallery_detail.js | 32 +++++++++---------- .../lightgallery/plugins/admin/lg-admin.js | 7 ++-- .../templates/photologue/gallery_detail.html | 1 + 8 files changed, 52 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index d8e6581..58d8206 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Photo server 2021-2023 +This project is a fork of [Photo21](https://gitlab.crans.org/bde/photo21/) developped at ENS Paris-Saclay. + [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.txt) This is the source code for the webserver hosting pictures from the @@ -25,7 +27,7 @@ run and to maintain. In production, we usually use `/var/www/photos/` as the `root` user. ```bash - git clone https://gitlab.crans.org/bde/photo21.git && cd photo21 + git clone https://codeberg.org/krek0/photo21.git && cd photo21 ``` 3. **Configuration (production only).** diff --git a/photo21/forms.py b/photo21/forms.py index 7c15e1e..253fab3 100644 --- a/photo21/forms.py +++ b/photo21/forms.py @@ -13,8 +13,7 @@ class CustomSignupForm(SignupForm): # Add description on email field self.fields["email"].help_text = _( - "Please enter a valid email address ending with `@crans.org` or " - "`@ens-paris-saclay.fr`." + "Please enter a valid email address ending with `@ens-rennes.fr`" ) def clean_email(self): @@ -22,10 +21,8 @@ class CustomSignupForm(SignupForm): Check that the email address ends with a trusted domain. """ email = super().clean_email() - if not email.endswith("@crans.org") and not email.endswith( - "@ens-paris-saclay.fr" - ): + if not email.endswith("@ens-rennes.fr"): raise forms.ValidationError( - _("Must end with `@crans.org` or `@ens-paris-saclay.fr`.") + _("Must end with `@ens-rennes.fr`.") ) return email diff --git a/photo21/templates/account/login.html b/photo21/templates/account/login.html index 1e7723f..a2bc666 100644 --- a/photo21/templates/account/login.html +++ b/photo21/templates/account/login.html @@ -39,5 +39,5 @@ SPDX-License-Identifier: GPL-3.0-or-later {% trans "Forgot Password?" %} -

{% trans "If any problem, please contact the server owners at" %} photos[at]crans.org.

+ {% endblock %} diff --git a/photo21/templates/base.html b/photo21/templates/base.html index eeca7fd..602ee57 100644 --- a/photo21/templates/base.html +++ b/photo21/templates/base.html @@ -13,7 +13,7 @@ SPDX-License-Identifier: GPL-3.0-or-later {% block title %}{{ title }}{% endblock title %} - {{ request.site.name }} - + @@ -118,16 +118,16 @@ SPDX-License-Identifier: GPL-3.0-or-later {% if request.user.is_authenticated %} {% trans "Connected as" %} {{ request.user.username }} · {% endif %} - {% trans "Source code" %} · - + {% trans "Source code" %} · + + + + + + + + +

diff --git a/photo21/templates/index.html b/photo21/templates/index.html index b7fa2e9..d4db262 100644 --- a/photo21/templates/index.html +++ b/photo21/templates/index.html @@ -12,7 +12,7 @@ SPDX-License-Identifier: GPL-3.0-or-later

{% blocktrans trimmed %} This website aims to collect the pictures and movies taken in the student - life of ENS Paris-Saclay or involving its students. + life of ENS Rennes or involving its students. {% endblocktrans %}

@@ -25,21 +25,16 @@ SPDX-License-Identifier: GPL-3.0-or-later {% endblocktrans %}

-

- {% blocktrans trimmed %} - If you want a photo to be deleted, please let us know: - Abuse request - {% endblocktrans %} -

- {% if not perms.photologue.add_photo %} + {% if not perms.photologue.add_photo %}

{% blocktrans trimmed %} If you want to obtain the right to upload pictures, please let us know: - Become a photograph + Become a photograph {% endblocktrans %}

{% endif %} +

{% trans "Last galleries" %}

{% for gallery in object_list %} @@ -52,15 +47,15 @@ SPDX-License-Identifier: GPL-3.0-or-later

{% trans "Behind the scene" %}

{% blocktrans trimmed %} + This project if a fork of Photo21. Because we value your privacy, we do not sell the data on this site, unlike many free online platforms. - The dedicated server running this website is kindly hosted by the - Crans at the ENS Paris-Saclay - basement. - It is not managed by the Crans. Current active administrators are: - {% endblocktrans %} - {% for user in superusers %} {{ user.username }}{% endfor %}. - {% trans "They should be contacted at" %} - photos@crans.org. + + + + + + +

{% endblock %} diff --git a/photologue/static/gallery_detail.js b/photologue/static/gallery_detail.js index b9fad3a..03c187a 100644 --- a/photologue/static/gallery_detail.js +++ b/photologue/static/gallery_detail.js @@ -34,20 +34,20 @@ lgContainer.addEventListener('lgAfterOpen', () => { const downloadUrl = this.getAttribute('href'); - // Affichage de la modale stylisée - Swal.fire({ - title: gettext('Download'), - text: gettext("This image is free to download, but permission from the photographer and the people in the photo is required before republishing it on another website. Furthermore, it is good practice to credit L[ENS] and the photographers in any republications."), - icon: 'info', - showCancelButton: true, - confirmButtonColor: '#3085d6', - cancelButtonColor: '#d33', - confirmButtonText: gettext('Download'), - cancelButtonText: gettext('Cancel'), - background: '#1a1a1a', // Optionnel : pour matcher le thème sombre de LightGallery - color: '#fff' - }).then((result) => { - if (result.isConfirmed) { + // // Affichage de la modale stylisée + // Swal.fire({ + // title: gettext('Download'), + // text: gettext("This image is free to download, but permission from the photographer and the people in the photo is required before republishing it on another website. Furthermore, it is good practice to credit L[ENS] and the photographers in any republications."), + // icon: 'info', + // showCancelButton: true, + // confirmButtonColor: '#3085d6', + // cancelButtonColor: '#d33', + // confirmButtonText: gettext('Download'), + // cancelButtonText: gettext('Cancel'), + // background: '#1a1a1a', // Optionnel : pour matcher le thème sombre de LightGallery + // color: '#fff' + // }).then((result) => { + // if (result.isConfirmed) { // Si validé, on déclenche le téléchargement const link = document.createElement('a'); link.href = downloadUrl; @@ -55,8 +55,8 @@ lgContainer.addEventListener('lgAfterOpen', () => { document.body.appendChild(link); link.click(); document.body.removeChild(link); - } - }); + // } + // }); }, true); // Utilisation du mode capture pour intercepter avant le script interne } }); diff --git a/photologue/static/lightgallery/plugins/admin/lg-admin.js b/photologue/static/lightgallery/plugins/admin/lg-admin.js index 5b198c9..aa0214d 100644 --- a/photologue/static/lightgallery/plugins/admin/lg-admin.js +++ b/photologue/static/lightgallery/plugins/admin/lg-admin.js @@ -13,6 +13,7 @@ class lgAdmin { this.isStaff = document.querySelector('[name=is_staff]').value === "true"; this.userId = document.querySelector('[name=user_id]').value; this.canResolveCensorship = document.querySelector('[name=can_resolve_censorship]').value === "true"; + this.guestMode = document.querySelector('[name=guest_mode]').value === "true"; this.csrfToken = document.querySelector('[name=csrfmiddlewaretoken]').value; this.photoId = 0; return this; @@ -33,7 +34,8 @@ class lgAdmin { document.getElementById("lg-delete").addEventListener('click', this.onDelete.bind(this)); // Add button to report photo - this.core.$toolbar.append(`${reportIcon}`); + this.core.$toolbar.append(`${deleteIcon}`); + document.getElementById("lg-report").style.display = 'none'; document.getElementById("lg-report").addEventListener('click', this.onReport.bind(this)); // Add button to restore a censored photo @@ -53,6 +55,7 @@ class lgAdmin { const ownerId = el ? el.dataset.ownerId : null; const canDelete = this.isStaff || (ownerId && ownerId === this.userId); document.getElementById("lg-delete").style.display = canDelete ? 'block' : 'none'; + document.getElementById("lg-report").style.display = canDelete ? 'none' : 'block'; const isCensored = el ? el.dataset.isPublic === 'false' : false; document.getElementById("lg-restore").style.display = (this.canResolveCensorship && isCensored) ? 'block' : 'none'; } @@ -135,7 +138,7 @@ class lgAdmin { // Event called when user click on report button onReport(event) { event.preventDefault(); - if(confirm("Are you sure to report this photo?")) { + if(confirm("Are you sure to ask removal for this photo?")) { // Build form request const photoId = this.photoId; const currentIndex = this.core.index; diff --git a/photologue/templates/photologue/gallery_detail.html b/photologue/templates/photologue/gallery_detail.html index 155f86a..ea5c671 100755 --- a/photologue/templates/photologue/gallery_detail.html +++ b/photologue/templates/photologue/gallery_detail.html @@ -20,6 +20,7 @@ SPDX-License-Identifier: GPL-3.0-or-later +