diff --git a/comments/templates/comments.html b/comments/templates/comments.html index 94222bc..10ea9b8 100644 --- a/comments/templates/comments.html +++ b/comments/templates/comments.html @@ -24,7 +24,7 @@ {% endif %} {% empty %} -

(Aucun commentaire sur ce jeu)

+

(Aucun commentaire sur cet outil)

{% endfor %} {% if not edited_comment %} {% if request.user.is_authenticated %} diff --git a/inventory/models.py b/inventory/models.py index bd05a03..82f19e1 100644 --- a/inventory/models.py +++ b/inventory/models.py @@ -37,46 +37,9 @@ class Tag(models.Model): class Game(models.Model): - title = models.CharField(verbose_name="titre du jeu", max_length=256, unique=True) + title = models.CharField(verbose_name="Nom de l'outil", max_length=256, unique=True) slug = AutoSlugField(populate_from="title", unique=True) - nb_player_min = models.PositiveSmallIntegerField( - verbose_name="nombre de joueur·se·s minimum" - ) - nb_player_max = models.PositiveSmallIntegerField( - verbose_name="nombre de joueur·se·s maximum" - ) - player_range = models.CharField( - max_length=256, - blank=True, - help_text="Affichage personnalisé pour le nombre de joueur·se·s", - verbose_name="nombre de joueur·se·s", - ) - - duration_min = models.PositiveSmallIntegerField( - verbose_name="durée de partie minimale", - help_text="En minutes, telle qu'indiquée par l'éditeur", - ) - duration_max = models.PositiveSmallIntegerField( - verbose_name="durée de partie maximale", - help_text="En minutes, telle qu'indiquée par l'éditeur, identique à la durée minimale si laissée vide", - blank=True, - ) - duration = models.CharField( - max_length=256, - blank=True, - help_text="Affichage personnalisé pour la durée de la partie", - verbose_name="durée de partie", - ) - - game_designer = models.CharField( - max_length=256, blank=True, verbose_name="game designer" - ) - illustrator = models.CharField( - max_length=256, blank=True, verbose_name="illustrateur·trice" - ) - editor = models.CharField(max_length=256, blank=True, verbose_name="éditeur") - category = models.ForeignKey( Category, on_delete=models.RESTRICT, verbose_name="catégorie" ) @@ -95,45 +58,18 @@ class Game(models.Model): class Meta: ordering = ["title"] - verbose_name = "jeu" - verbose_name_plural = "jeux" + verbose_name = "outil" + verbose_name_plural = "outils" def __str__(self): return self.title - def clean(self): - if not self.nb_player_min or not self.nb_player_max or not self.duration_min: - return - if self.nb_player_min > self.nb_player_max: - raise ValidationError( - { - "nb_player_max": "Le nombre de joueur·se·s maximum doit être supérieur au nombre de joueur·se·s minimum" - } - ) - if self.duration_max is None: - self.duration_max = self.duration_min - if self.duration_min > self.duration_max: - raise ValidationError( - { - "duration_max": "La durée maximale doit être supérieure à la durée minimale" - } - ) def get_player_range(self): - if self.player_range: - return self.player_range - elif self.nb_player_min != self.nb_player_max: - return "{} à {} joueur·se·s".format(self.nb_player_min, self.nb_player_max) - else: - return "{} joueur·se·s".format(self.nb_player_min) + return "" def get_duration_range(self): - if self.duration: - return self.duration - elif self.duration_min != self.duration_max: - return "{} à {} min".format(self.duration_min, self.duration_max) - else: - return "{} min".format(self.duration_min) + return "" def get_absolute_url(self): return reverse("inventory:game", args=(self.slug,)) @@ -141,13 +77,13 @@ class Game(models.Model): class GameComment(AbstractComment): commented_object = models.ForeignKey( - Game, on_delete=models.CASCADE, related_name="comments", verbose_name="jeu" + Game, on_delete=models.CASCADE, related_name="comments", verbose_name="outil" ) class Meta: ordering = ["created_on"] - verbose_name = "commentaire sur un jeu" - verbose_name_plural = "commentaires sur des jeux" + verbose_name = "commentaire sur un outil" + verbose_name_plural = "commentaires sur des outils" def get_modification_url(self): return reverse( @@ -157,7 +93,7 @@ class GameComment(AbstractComment): class GameLoan(AbstractLoan): lent_object = models.ForeignKey( Game, on_delete=models.CASCADE, - verbose_name="jeu emprunté" + verbose_name="outil emprunté" ) class Meta(AbstractLoan.Meta): diff --git a/inventory/tables.py b/inventory/tables.py index d66e231..2b12a79 100644 --- a/inventory/tables.py +++ b/inventory/tables.py @@ -1,8 +1,10 @@ import django_tables2 as tables -from django.utils.html import format_html from django.urls import reverse +from django.utils.html import format_html + from .models import GameLoan + class LoanTable(tables.Table): next_pattern = "inventory:all_loans" @@ -10,24 +12,29 @@ class LoanTable(tables.Table): model = GameLoan sequence = ("lent_object", "borrow_date", "return_date", "mail") exclude = ("id",) + slug = tables.Column(verbose_name="Actions", orderable=False) def render_lent_object(self, value, record): - return format_html("{}", - reverse("inventory:game", args=[record.lent_object.slug]), value) + return format_html( + "{}", + reverse("inventory:game", args=[record.lent_object.slug]), + value, + ) def render_slug(self, value, record): res = "" if record.return_date == None: - res = format_html("Rendre le jeu", + res = format_html( + "Rendre l'outil", reverse("inventory:return_game", args=[value]), - reverse(self.next_pattern)) + reverse(self.next_pattern), + ) return res - + class OngoingLoansTable(LoanTable): next_pattern = "inventory:ongoing_loans" class Meta(LoanTable.Meta): exclude = ("return_date", "mail", "id") - diff --git a/inventory/templates/inventory/category.html b/inventory/templates/inventory/category.html index 700b559..1bbf033 100644 --- a/inventory/templates/inventory/category.html +++ b/inventory/templates/inventory/category.html @@ -4,7 +4,7 @@

{{ category.name }}

{% with game_list=category.game_set.all %} -

Il y a {{ game_list|length }} jeu{{ game_list|pluralize:"x" }} dans cette +

Il y a {{ game_list|length }} outil{{ game_list|pluralize:"s" }} dans cette étagère :

{% for game in game_list %} {% include "./partials/game_item.html" %} diff --git a/inventory/templates/inventory/category_list.html b/inventory/templates/inventory/category_list.html index 2a39175..7a87b9b 100644 --- a/inventory/templates/inventory/category_list.html +++ b/inventory/templates/inventory/category_list.html @@ -3,7 +3,7 @@ {% block "content" %}

Liste des étagères

-

Il y a {{ paginator.count }} étagère{{ paginator.count|pluralize }} de jeux :

+

Il y a {{ paginator.count }} étagère{{ paginator.count|pluralize }} d'outils :

{% include "partials/pagination.html" %} {% for category in category_list %} diff --git a/inventory/templates/inventory/game.html b/inventory/templates/inventory/game.html index 3ab6840..917c247 100644 --- a/inventory/templates/inventory/game.html +++ b/inventory/templates/inventory/game.html @@ -12,9 +12,6 @@

{{ game.category }}


-

{{ game.get_player_range }}

-

{{ game.get_duration_range }}

-

{% for tag in game.tags.all %} {{ tag }}{% if not forloop.last %},{% endif %} @@ -23,14 +20,11 @@ {% endfor %}


-

{{ game.game_designer|default:"(Game designer inconnu·e)" }}

-

{{ game.illustrator|default:"(Illustrateur·trice inconnu·e)" }}

-

{{ game.editor|default:"(Éditeur inconnu)" }}

{% if is_borrowed %} -

Ce jeu est emprunté depuis le {{ loan.borrow_date }}.

+

Cet outil est emprunté depuis le {{ loan.borrow_date }}.

{% endif %} @@ -45,7 +39,7 @@

{{ game.missing_elements|linebreaksbr }}

{% endif %} -

Commentaires et propositions de variantes

+

Commentaires

{% url "inventory:add_game_comment" game.slug as add_comment_url %} {% include "comments.html" with comments=game.comments.all %} {% endblock %} diff --git a/inventory/templates/inventory/game_list.html b/inventory/templates/inventory/game_list.html index b9b8f9c..526e161 100644 --- a/inventory/templates/inventory/game_list.html +++ b/inventory/templates/inventory/game_list.html @@ -1,9 +1,9 @@ {% extends "base.html" %} {% block "content" %} -

Liste des jeux

+

Liste des outils

-

Il y a {{ paginator.count }} jeu{{ paginator.count|pluralize:"x" }} en salle jeux :

+

Il y a {{ paginator.count }} outil{{ paginator.count|pluralize:"s" }} en Hackens :

{% include "partials/pagination.html" %} {% for game in game_list %} diff --git a/inventory/templates/inventory/inventory.html b/inventory/templates/inventory/inventory.html index aecadbf..0d564ec 100644 --- a/inventory/templates/inventory/inventory.html +++ b/inventory/templates/inventory/inventory.html @@ -1,9 +1,9 @@ {% extends "base.html" %} {% block "content" %} -

Inventaire du club Jeux

+

Inventaire d'HackENS

- Rechercher dans la ludothèque: + Rechercher dans les outils:
{% endblock %} diff --git a/inventory/templates/inventory/loans/game_loan.html b/inventory/templates/inventory/loans/game_loan.html index 62b7041..83c4b2e 100644 --- a/inventory/templates/inventory/loans/game_loan.html +++ b/inventory/templates/inventory/loans/game_loan.html @@ -30,7 +30,7 @@ Emprunter « {{ game.title }} »

- Si le jeu est emprunté par quelqu’un d’autre, il sera rendu + Si l'outil est emprunté par quelqu’un d’autre, il sera rendu automatiquement.

@@ -39,12 +39,12 @@ automatiquement. Rendre « {{ game.title }} »

- Ce jeu est emprunté depuis le {{ loan.borrow_date }}. + Ceit outil est emprunté depuis le {{ loan.borrow_date }}.

{% endif %} - Détails du jeu + Détails de l'outil {% endblock %} diff --git a/inventory/templates/inventory/tag.html b/inventory/templates/inventory/tag.html index 449f149..2ab1e5d 100644 --- a/inventory/templates/inventory/tag.html +++ b/inventory/templates/inventory/tag.html @@ -4,7 +4,7 @@

{{ tag.name }}

{% with game_list=tag.game_set.all %} -

Il y a {{ game_list|length }} jeu{{ game_list|pluralize:"x" }} marqué{{ game_list|pluralize }} avec ce tag :

+

Il y a {{ game_list|length }} outil{{ game_list|pluralize:"s" }} marqué{{ game_list|pluralize }} avec ce tag :

{% for game in game_list %} {% include "./partials/game_item.html" %} {% endfor %} diff --git a/website/static/img/favicon.ico b/website/static/img/favicon.ico new file mode 100644 index 0000000..72139e3 Binary files /dev/null and b/website/static/img/favicon.ico differ diff --git a/website/static/img/favicon.png b/website/static/img/favicon.png index c0b585d..d1a2410 100644 Binary files a/website/static/img/favicon.png and b/website/static/img/favicon.png differ diff --git a/website/static/img/logo.svg b/website/static/img/logo.svg index 87c93f5..0515079 100644 --- a/website/static/img/logo.svg +++ b/website/static/img/logo.svg @@ -2,60 +2,950 @@ + inkscape:export-xdpi="424.70047" + inkscape:export-ydpi="424.70047" + inkscape:export-filename="/home/xapantu/hackens/media/logo_carre.png" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id="metadata4361"> image/svg+xml - - - - + + + + + + + + h + a + c + k + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website/templates/partials/footer.html b/website/templates/partials/footer.html index 205b51e..126e114 100644 --- a/website/templates/partials/footer.html +++ b/website/templates/partials/footer.html @@ -1,3 +1,3 @@ diff --git a/website/templates/partials/head.html b/website/templates/partials/head.html index 550bf1e..3b48917 100644 --- a/website/templates/partials/head.html +++ b/website/templates/partials/head.html @@ -2,7 +2,7 @@ -GestioJeux +GestioHackens diff --git a/website/templates/partials/header.html b/website/templates/partials/header.html index 467ae9f..0de5ef6 100644 --- a/website/templates/partials/header.html +++ b/website/templates/partials/header.html @@ -1,5 +1,5 @@
-

GestioJeux

+

GestioHackens

Menu