-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
877 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{% load captureas %} | ||
|
||
{% captureas performer_href %}{% url "member-detail" event.performer.username %}{% endcaptureas %} | ||
|
||
|
||
{% if event.type == "authors_management" %} | ||
{% captureas author_href %}{% url "member-detail" event.author.username %}{% endcaptureas %} | ||
{% if event.action == "add" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a ajouté <a href="{{ author_href }}">{{ event.author }}</a> à la liste des auteurs. | ||
{% elif event.action == "remove" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a supprimé <a href="{{ author_href }}">{{ event.author }}</a> de la liste des auteurs. | ||
{% else %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a effectué une action de type « {{ event.action }} » sur la liste des auteurs. | ||
{% endif %} | ||
|
||
|
||
{% elif event.type == "contributors_management" %} | ||
{% captureas contributor_href %}{% url "member-detail" event.contributor.username %}{% endcaptureas %} | ||
{% if event.action == "add" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a ajouté <a href="{{ contributor_href }}">{{ event.contributor }}</a> à la liste des contributeurs. | ||
{% elif event.action == "remove" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a supprimé <a href="{{ contributor_href }}">{{ event.contributor }}</a> de la liste des contributeurs. | ||
{% else %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a effectué une action de type « {{ event.action }} » sur la liste des contributeurs. | ||
{% endif %} | ||
|
||
|
||
{% elif event.type == "beta_management" %} | ||
{% captureas version_href %}{% url "content:view" event.content.pk event.content.slug %}?version={{ event.version }}{% endcaptureas %} | ||
{% if event.action == "activate" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a mis une <a href="{{ version_href }}">version du contenu</a> en bêta. | ||
{% elif event.action == "deactivate" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a désactivé la bêta. | ||
{% else %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a effectué une action de type « {{ event.action }} » sur la bêta. | ||
{% endif %} | ||
|
||
|
||
{% elif event.type == "validation_management" %} | ||
{% captureas version_href %}{% url "content:view" event.content.pk event.content.slug %}?version={{ event.version }}{% endcaptureas %} | ||
{% if event.action == "request" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a demandé la validation d'une <a href="{{ version_href }}">version du contenu</a>. | ||
{% elif event.action == "cancel" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a annulé la demande de validation du contenu. | ||
{% elif event.action == "accept" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a accepté le contenu pour publication. | ||
{% elif event.action == "reject" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a refusé le contenu pour publication. | ||
{% elif event.action == "revoke" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a dépublié le contenu. | ||
{% elif event.action == "reserve" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a réservé le contenu pour validation. | ||
{% elif event.action == "unreserve" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a annulé la réservation du contenu pour validation. | ||
{% else %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a effectué une action de validation de type « {{ event.action }} ». | ||
{% endif %} | ||
|
||
|
||
{% elif event.type == "tags_management" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a modifié les tags du contenu. | ||
|
||
|
||
{% elif event.type == "suggestions_management" %} | ||
{% if event.action == "add" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a ajouté une suggestion de contenu. | ||
{% elif event.action == "remove" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a supprimé une suggestion de contenu. | ||
{% else %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a effectué une action de type « {{ event.action }} » sur les suggestions de contenu. | ||
{% endif %} | ||
|
||
|
||
{% elif event.type == "help_management" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a modifié les demandes d'aide. | ||
|
||
|
||
{% elif event.type == "jsfiddle_management" %} | ||
{% if event.action == "activate" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a activé JSFiddle. | ||
{% elif event.action == "deactivate" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a désactivé JSFiddle. | ||
{% else %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a effectué une action de type « {{ event.action }} » sur la gestion de JS Fiddle. | ||
{% endif %} | ||
|
||
|
||
{% elif event.type == "opinions_management" %} | ||
{% if event.action == "publish" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a publié le billet. | ||
{% elif event.action == "unpublish" %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a dépublié le billet. | ||
{% else %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a effectué une action de type « {{ event.action }} » sur le billet. | ||
{% endif %} | ||
|
||
|
||
{% else %} | ||
<a href="{{ performer_href }}">{{ event.performer }}</a> a déclenché un événement de type « {{ event.type }} ». | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{% extends "tutorialv2/base.html" %} | ||
{% load profile %} | ||
{% load thumbnail %} | ||
{% load date %} | ||
{% load i18n %} | ||
|
||
|
||
{% block title %} | ||
{% blocktrans with title=content.title %} | ||
Journal des événements de "{{ title }}" | ||
{% endblocktrans %} | ||
{% endblock %} | ||
|
||
|
||
|
||
{% block breadcrumb %} | ||
<li><a href="{{ content.get_absolute_url }}">{{ content.title }}</a></li> | ||
<li>{% trans "Journal des événements" %}</li> | ||
{% endblock %} | ||
|
||
|
||
|
||
{% block headline %} | ||
{% if content.licence %} | ||
<p class="license"> | ||
{{ content.licence }} | ||
</p> | ||
{% endif %} | ||
|
||
<h1 {% if content.image %}class="illu"{% endif %}> | ||
{% if content.image %} | ||
<img src="{{ content.image.physical.tutorial_illu.url }}" alt=""> | ||
{% endif %} | ||
{% blocktrans with title=content.title %} | ||
Journal des événements de "{{ title }}" | ||
{% endblocktrans %} | ||
</h1> | ||
|
||
{% if content.description %} | ||
<h2 class="subtitle"> | ||
{{ content.description }} | ||
</h2> | ||
{% endif %} | ||
|
||
{% include 'tutorialv2/includes/tags_authors.part.html' with content=content online=False %} | ||
{% endblock %} | ||
|
||
|
||
|
||
{% block content %} | ||
{% if events %} | ||
{% include "misc/paginator.html" with position="top" %} | ||
|
||
<table class="fullwidth commits-list"> | ||
<thead> | ||
<tr> | ||
<th width="20%">{% trans "Date" %}</th> | ||
<th>{% trans "Description" %}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for e in events %} | ||
<tr> | ||
<td>{{ e.date | format_date:True }}</td> | ||
<td>{% include 'tutorialv2/events/descriptions.part.html' with event=e %}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% include "misc/paginator.html" with position="bottom" %} | ||
{% else %} | ||
<p>{% trans "Aucun événement n'a été enregistré pour ce contenu." %}</p> | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default_app_config = "zds.notification.apps.NotificationConfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class NotificationConfig(AppConfig): | ||
name = "zds.notification" | ||
|
||
def ready(self): | ||
from . import receivers # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Generated by Django 2.2.24 on 2021-10-03 17:48 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
("tutorialv2", "0031_source_is_url"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Event", | ||
fields=[ | ||
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("date", models.DateTimeField(auto_now_add=True)), | ||
("type", models.CharField(max_length=100)), | ||
("action", models.CharField(max_length=100)), | ||
("version", models.CharField(max_length=80, null=True)), | ||
( | ||
"author", | ||
models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="event_author", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
( | ||
"content", | ||
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="tutorialv2.PublishableContent"), | ||
), | ||
( | ||
"contributor", | ||
models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="event_contributor", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
( | ||
"performer", | ||
models.ForeignKey( | ||
null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Événement sur un contenu", | ||
"verbose_name_plural": "Événements sur un contenu", | ||
}, | ||
), | ||
] |
Oops, something went wrong.