Compare commits

..

5 Commits

7 changed files with 108 additions and 76 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Aircox 0.1\n" "Project-Id-Version: Aircox 0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-28 18:57+0000\n" "POT-Creation-Date: 2024-11-07 08:18+0100\n"
"PO-Revision-Date: 2016-10-10 16:00+02\n" "PO-Revision-Date: 2016-10-10 16:00+02\n"
"Last-Translator: Aarys\n" "Last-Translator: Aarys\n"
"Language-Team: Aircox's translators team\n" "Language-Team: Aircox's translators team\n"
@ -22,7 +22,7 @@ msgstr ""
msgid "start" msgid "start"
msgstr "début" msgstr "début"
#: admin/diffusion.py:31 models/diffusion.py:127 models/program.py:172 #: admin/diffusion.py:31 models/diffusion.py:127 models/program.py:182
msgid "end" msgid "end"
msgstr "fin" msgstr "fin"
@ -38,7 +38,7 @@ msgstr "Depuis"
msgid "Until" msgid "Until"
msgstr "Jusque" msgstr "Jusque"
#: admin/filters.py:28 models/page.py:289 tests/admin/test_filters.py:53 #: admin/filters.py:28 models/page.py:282 tests/admin/test_filters.py:53
msgid "None" msgid "None"
msgstr "Aucun" msgstr "Aucun"
@ -88,7 +88,7 @@ msgstr "temps"
msgid "Search" msgid "Search"
msgstr "Chercher" msgstr "Chercher"
#: filters.py:36 models/episode.py:131 #: filters.py:36 models/episode.py:135
msgid "Podcast" msgid "Podcast"
msgstr "Podcast" msgstr "Podcast"
@ -140,31 +140,33 @@ msgstr "éditer les dates de diffusion"
msgid "rerun" msgid "rerun"
msgstr "rediffusion" msgstr "rediffusion"
#: models/episode.py:60 templates/aircox/dashboard/statistics.html:29 #: models/episode.py:61 templates/aircox/dashboard/statistics.html:29
msgid "Episode" msgid "Episode"
msgstr "Épisode" msgstr "Épisode"
#: models/episode.py:61 #: models/episode.py:62
#: templates/aircox/dashboard/widgets/program_episodes.html:4
#: templates/aircox/program_form.html:10
msgid "Episodes" msgid "Episodes"
msgstr "Épisodes" msgstr "Épisodes"
#: models/episode.py:118 models/page.py:351 models/track.py:35 #: models/episode.py:122 models/page.py:344 models/track.py:35
msgid "order" msgid "order"
msgstr "ordre" msgstr "ordre"
#: models/episode.py:120 models/track.py:37 #: models/episode.py:124 models/track.py:37
msgid "position in the playlist" msgid "position in the playlist"
msgstr "position dans la playlist" msgstr "position dans la playlist"
#: models/episode.py:123 models/sound.py:59 #: models/episode.py:127 models/sound.py:59
msgid "Broadcast" msgid "Broadcast"
msgstr "Broadcast" msgstr "Broadcast"
#: models/episode.py:125 models/sound.py:61 #: models/episode.py:129 models/sound.py:61
msgid "The sound is broadcasted on air" msgid "The sound is broadcasted on air"
msgstr "Le son est radiodiffusé" msgstr "Le son est radiodiffusé"
#: models/episode.py:132 templates/aircox/episode_detail.html:16 #: models/episode.py:136 templates/aircox/episode_detail.html:16
#: templates/aircox/episode_form.html:11 templates/aircox/episode_list.html:8 #: templates/aircox/episode_form.html:11 templates/aircox/episode_list.html:8
msgid "Podcasts" msgid "Podcasts"
msgstr "Podcasts" msgstr "Podcasts"
@ -213,7 +215,7 @@ msgstr "stop"
msgid "other" msgid "other"
msgstr "autre" msgstr "autre"
#: models/log.py:89 models/page.py:349 models/program.py:55 #: models/log.py:89 models/page.py:342 models/program.py:55
#: models/station.py:146 #: models/station.py:146
msgid "station" msgid "station"
msgstr "station" msgstr "station"
@ -255,7 +257,7 @@ msgstr "Log"
msgid "Logs" msgid "Logs"
msgstr "Logs" msgstr "Logs"
#: models/page.py:43 models/page.py:352 models/track.py:45 #: models/page.py:43 models/page.py:345 models/track.py:45
msgid "title" msgid "title"
msgstr "titre" msgstr "titre"
@ -271,7 +273,8 @@ msgstr "Catégorie"
msgid "Categories" msgid "Categories"
msgstr "Catégories" msgstr "Catégories"
#: models/page.py:84 #: models/page.py:84 templates/aircox/dashboard/widgets/program_episodes.html:6
#: views/episode.py:150
msgid "draft" msgid "draft"
msgstr "brouillon" msgstr "brouillon"
@ -291,107 +294,107 @@ msgstr "statut"
msgid "cover" msgid "cover"
msgstr "couverture" msgstr "couverture"
#: models/page.py:103 models/page.py:329 #: models/page.py:102 models/page.py:322
msgid "content" msgid "content"
msgstr "contenu" msgstr "contenu"
#: models/page.py:202 #: models/page.py:195
msgid "category" msgid "category"
msgstr "catégorie" msgstr "catégorie"
#: models/page.py:207 #: models/page.py:200
msgid "publication date" msgid "publication date"
msgstr "date de publication" msgstr "date de publication"
#: models/page.py:209 #: models/page.py:202
msgid "featured" msgid "featured"
msgstr "en avant" msgstr "en avant"
#: models/page.py:213 #: models/page.py:206
msgid "allow comments" msgid "allow comments"
msgstr "autoriser les commentaires" msgstr "autoriser les commentaires"
#: models/page.py:228 #: models/page.py:221
msgid "Publication" msgid "Publication"
msgstr "Publication" msgstr "Publication"
#: models/page.py:229 #: models/page.py:222
msgid "Publications" msgid "Publications"
msgstr "Publications" msgstr "Publications"
#: models/page.py:290 #: models/page.py:283
msgid "Home Page" msgid "Home Page"
msgstr "Page d'accueil" msgstr "Page d'accueil"
#: models/page.py:291 #: models/page.py:284
msgid "Timetable" msgid "Timetable"
msgstr "Horaires" msgstr "Horaires"
#: models/page.py:292 #: models/page.py:285
msgid "Programs list" msgid "Programs list"
msgstr "Liste des émissions" msgstr "Liste des émissions"
#: models/page.py:293 #: models/page.py:286
msgid "Episodes list" msgid "Episodes list"
msgstr "Liste des épisodes" msgstr "Liste des épisodes"
#: models/page.py:294 #: models/page.py:287
msgid "Articles list" msgid "Articles list"
msgstr "Liste des articles" msgstr "Liste des articles"
#: models/page.py:295 #: models/page.py:288
msgid "Publications list" msgid "Publications list"
msgstr "Publications" msgstr "Publications"
#: models/page.py:296 #: models/page.py:289
msgid "Podcasts list" msgid "Podcasts list"
msgstr "Podcasts" msgstr "Podcasts"
#: models/page.py:299 #: models/page.py:292
msgid "attach to" msgid "attach to"
msgstr "attacher à" msgstr "attacher à"
#: models/page.py:304 #: models/page.py:297
msgid "display this page content to related element" msgid "display this page content to related element"
msgstr "Afficher le contenu de cette page pour l'élément sélectionné" msgstr "Afficher le contenu de cette page pour l'élément sélectionné"
#: models/page.py:322 #: models/page.py:315
msgid "related page" msgid "related page"
msgstr "page liée" msgstr "page liée"
#: models/page.py:326 #: models/page.py:319
msgid "nickname" msgid "nickname"
msgstr "pseudo" msgstr "pseudo"
#: models/page.py:327 #: models/page.py:320
msgid "email" msgid "email"
msgstr "email" msgstr "email"
#: models/page.py:342 #: models/page.py:335
msgid "Comment" msgid "Comment"
msgstr "Commentaire" msgstr "Commentaire"
#: models/page.py:343 templates/aircox/page_detail.html:51 #: models/page.py:336 templates/aircox/page_detail.html:51
msgid "Comments" msgid "Comments"
msgstr "Commentaires" msgstr "Commentaires"
#: models/page.py:350 #: models/page.py:343
msgid "menu" msgid "menu"
msgstr "menu" msgstr "menu"
#: models/page.py:353 #: models/page.py:346
msgid "url" msgid "url"
msgstr "url" msgstr "url"
#: models/page.py:358 #: models/page.py:351
msgid "page" msgid "page"
msgstr "page" msgstr "page"
#: models/page.py:364 #: models/page.py:357
msgid "Menu item" msgid "Menu item"
msgstr "Élément du menu" msgstr "Élément du menu"
#: models/page.py:365 #: models/page.py:358
msgid "Menu items" msgid "Menu items"
msgstr "Éléments de menu" msgstr "Éléments de menu"
@ -411,7 +414,7 @@ msgstr "synchroniser"
msgid "update later diffusions according to schedule changes" msgid "update later diffusions according to schedule changes"
msgstr "met à jour les dates de diffusion à venir lorsque l'horaire change" msgstr "met à jour les dates de diffusion à venir lorsque l'horaire change"
#: models/program.py:66 permissions.py:17 #: models/program.py:66 permissions.py:18
msgid "editors" msgid "editors"
msgstr "éditeurs" msgstr "éditeurs"
@ -420,23 +423,23 @@ msgstr "éditeurs"
msgid "Programs" msgid "Programs"
msgstr "Émissions" msgstr "Émissions"
#: models/program.py:157 models/rerun.py:42 #: models/program.py:167 models/rerun.py:42
msgid "related program" msgid "related program"
msgstr "émission apparentée" msgstr "émission apparentée"
#: models/program.py:160 #: models/program.py:170
msgid "delay" msgid "delay"
msgstr "délai" msgstr "délai"
#: models/program.py:163 #: models/program.py:173
msgid "minimal delay between two sound plays" msgid "minimal delay between two sound plays"
msgstr "délai minimum entre deux sons joués" msgstr "délai minimum entre deux sons joués"
#: models/program.py:166 #: models/program.py:176
msgid "begin" msgid "begin"
msgstr "début" msgstr "début"
#: models/program.py:169 models/program.py:175 #: models/program.py:179 models/program.py:185
msgid "used to define a time range this stream is played" msgid "used to define a time range this stream is played"
msgstr "utilisé pour définir une période durant lequel ce stream est joué" msgstr "utilisé pour définir une période durant lequel ce stream est joué"
@ -550,8 +553,6 @@ msgid "downloadable"
msgstr "téléchargeable" msgstr "téléchargeable"
#: models/sound.py:55 #: models/sound.py:55
#, fuzzy
#| msgid "sound can be downloaded by visitors"
msgid "Sound can be downloaded by website visitors." msgid "Sound can be downloaded by website visitors."
msgstr "Le son peut être téléchargé par les visiteurs du site." msgstr "Le son peut être téléchargé par les visiteurs du site."
@ -706,7 +707,7 @@ msgstr "Séparateur de l'éditeur de playlist"
msgid " By %(filter_title)s " msgid " By %(filter_title)s "
msgstr "Par %(filter_title)s " msgstr "Par %(filter_title)s "
#: templates/aircox/base.html:70 #: templates/aircox/base.html:71
msgid "Main menu" msgid "Main menu"
msgstr "Menu principal" msgstr "Menu principal"
@ -735,8 +736,7 @@ msgid "Last Comments"
msgstr "Derniers commentaires" msgstr "Derniers commentaires"
#: templates/aircox/dashboard/statistics.html:4 #: templates/aircox/dashboard/statistics.html:4
#: templates/aircox/widgets/nav.html:41 tests/test_admin_site.py:40 #: templates/aircox/widgets/nav.html:41 views/admin.py:35
#: views/admin.py:35
msgid "Statistics" msgid "Statistics"
msgstr "Statistiques" msgstr "Statistiques"
@ -905,53 +905,56 @@ msgid "Post comment"
msgstr "Commenter" msgstr "Commenter"
#: templates/aircox/page_form.html:14 #: templates/aircox/page_form.html:14
#, fuzzy, python-format #, python-format
#| msgid "Create a %(model)s"
msgid "Create a %(model)s" msgid "Create a %(model)s"
msgstr "Ajouter %(models)s" msgstr "Ajouter un %(model)s"
#: templates/aircox/page_form.html:28 #: templates/aircox/page_form.html:34
msgid "Select an image" msgid "Select an image"
msgstr "Sélectionner une image" msgstr "Sélectionner une image"
#: templates/aircox/page_form.html:44 #: templates/aircox/page_form.html:50
msgid "Are you sure you want to remove this item from server?" msgid "Are you sure you want to remove this item from server?"
msgstr "Êtes-vous sûr de vouloir retirer ce fichier du serveur?" msgstr "Êtes-vous sûr de vouloir retirer ce fichier du serveur?"
#: templates/aircox/page_form.html:91 #: templates/aircox/page_form.html:97
msgid "Change cover" msgid "Change cover"
msgstr "Changer de couverture" msgstr "Changer de couverture"
#: templates/aircox/page_form.html:125 #: templates/aircox/page_form.html:135
msgid "Update" msgid "Update"
msgstr "Mise à jour" msgstr "Mise à jour"
#: templates/aircox/program_detail.html:24 #: templates/aircox/program_detail.html:26
#, python-format #, python-format
msgid "Rerun of %(date)s" msgid "Rerun of %(date)s"
msgstr "Rediffusion du %(date)s" msgstr "Rediffusion du %(date)s"
#: templates/aircox/program_detail.html:25 #: templates/aircox/program_detail.html:27
msgid "Rerun" msgid "Rerun"
msgstr "Rediffusion" msgstr "Rediffusion"
#: templates/aircox/program_detail.html:41 #: templates/aircox/program_detail.html:48
msgid "Last Episodes" msgid "Last Episodes"
msgstr "Derniers Épisodes" msgstr "Derniers Épisodes"
#: templates/aircox/program_detail.html:42 #: templates/aircox/program_detail.html:49
msgid "All episodes" msgid "All episodes"
msgstr "Tous les épisodes" msgstr "Tous les épisodes"
#: templates/aircox/program_detail.html:49 #: templates/aircox/program_detail.html:56
msgid "Last Articles" msgid "Last Articles"
msgstr "Derniers articles" msgstr "Derniers articles"
#: templates/aircox/program_detail.html:50 #: templates/aircox/program_detail.html:57
msgid "All articles" msgid "All articles"
msgstr "Tous les articles" msgstr "Tous les articles"
#: templates/aircox/program_form.html:13 #: templates/aircox/program_form.html:12
msgid "New episode"
msgstr "Nouvel épisode"
#: templates/aircox/program_form.html:17
msgid "Editors" msgid "Editors"
msgstr "Éditeurs" msgstr "Éditeurs"
@ -1021,7 +1024,7 @@ msgstr "Prochain"
msgid "Dashboard" msgid "Dashboard"
msgstr "Tableau de bord" msgstr "Tableau de bord"
#: templates/aircox/widgets/nav.html:47 #: templates/aircox/widgets/nav.html:50
msgid "Disconnect" msgid "Disconnect"
msgstr "Déconnexion" msgstr "Déconnexion"
@ -1244,31 +1247,35 @@ msgstr "dashboard/"
msgid "dashboard/program/<pk>/" msgid "dashboard/program/<pk>/"
msgstr "dashboard/emissions/<pk>/" msgstr "dashboard/emissions/<pk>/"
#: urls.py:130 #: urls.py:131
msgid "dashboard/program/<pk>/add-episode/"
msgstr "dashboard/emissions/<pk>/nouvel-episode/"
#: urls.py:133
msgid "dashboard/episodes/<pk>/" msgid "dashboard/episodes/<pk>/"
msgstr "dashboard/episodes/<pk>/" msgstr "dashboard/episodes/<pk>/"
#: urls.py:131 #: urls.py:134
msgid "dashboard/statistics/" msgid "dashboard/statistics/"
msgstr "dashboard/statistiques/" msgstr "dashboard/statistiques/"
#: urls.py:132 #: urls.py:135
msgid "dashboard/statistics/<date:date>/" msgid "dashboard/statistics/<date:date>/"
msgstr "dashboard/statistiques/<date:date>/" msgstr "dashboard/statistiques/<date:date>/"
#: urls.py:133 #: urls.py:136
msgid "dashboard/users/" msgid "dashboard/users/"
msgstr "dashboard/utilisateurs/" msgstr "dashboard/utilisateurs/"
#: urls.py:135 #: urls.py:138
msgid "errors/no-station/" msgid "errors/no-station/"
msgstr "erreurs/pas-de-station/" msgstr "erreurs/pas-de-station/"
#: views/page.py:89 #: views/page.py:100
#, python-brace-format #, python-brace-format
msgid "{model}" msgid "{model}"
msgstr "{model}" msgstr "{model}"
#: views/page.py:204 #: views/page.py:210
msgid "comments are not allowed" msgid "comments are not allowed"
msgstr "les commentaires ne sont pas autorisés" msgstr "les commentaires ne sont pas autorisés"

View File

@ -2,6 +2,7 @@ import os
from django.conf import settings as d_settings from django.conf import settings as d_settings
from django.db import models from django.db import models
from django.urls import reverse
from django.utils.functional import cached_property from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
@ -85,6 +86,9 @@ class Episode(ChildPage):
) )
return super().get_init_kwargs_from(page, title=title, program=page, **kwargs) return super().get_init_kwargs_from(page, title=title, program=page, **kwargs)
def get_absolute_url(self):
return reverse(self.detail_url_name, kwargs={"slug": self.slug})
class EpisodeSoundQuerySet(models.QuerySet): class EpisodeSoundQuerySet(models.QuerySet):
def episode(self, episode): def episode(self, episode):

View File

@ -7,7 +7,11 @@
{% endblock %} {% endblock %}
{% block page-form-actions %} {% block page-form-actions %}
<a class="button secondary" href="{% url 'episode-list' parent_slug=object.slug %}">{% trans "Episodes" %}</a>
&nbsp;
<a class="button secondary" href="{% url 'program-add-episode' object.pk %}">{% trans "New episode" %}</a>
{% if object and object.pk and request.user.is_superuser %} {% if object and object.pk and request.user.is_superuser %}
&nbsp;
<button type="button" <button type="button"
class="button secondary" class="button secondary"
@click="$refs['group-users-modal'].open({id: {{ object.editors_group_id }}, name: '{{ object.editors_group.name }}' })">{% translate "Editors" %}</button> @click="$refs['group-users-modal'].open({id: {{ object.editors_group_id }}, name: '{{ object.editors_group.name }}' })">{% translate "Editors" %}</button>

View File

@ -127,6 +127,9 @@ urls = [
# ---- dashboard # ---- dashboard
path(_("dashboard/"), views.dashboard.DashboardView.as_view(), name="dashboard"), path(_("dashboard/"), views.dashboard.DashboardView.as_view(), name="dashboard"),
path(_("dashboard/program/<pk>/"), views.program.ProgramUpdateView.as_view(), name="program-edit"), path(_("dashboard/program/<pk>/"), views.program.ProgramUpdateView.as_view(), name="program-edit"),
path(
_("dashboard/program/<pk>/add-episode/"), views.episode.EpisodeCreateView.as_view(), name="program-add-episode"
),
path(_("dashboard/episodes/<pk>/"), views.episode.EpisodeUpdateView.as_view(), name="episode-edit"), path(_("dashboard/episodes/<pk>/"), views.episode.EpisodeUpdateView.as_view(), name="episode-edit"),
path(_("dashboard/statistics/"), views.dashboard.StatisticsView.as_view(), name="dashboard-statistics"), path(_("dashboard/statistics/"), views.dashboard.StatisticsView.as_view(), name="dashboard-statistics"),
path(_("dashboard/statistics/<date:date>/"), views.dashboard.StatisticsView.as_view(), name="dashboard-statistics"), path(_("dashboard/statistics/<date:date>/"), views.dashboard.StatisticsView.as_view(), name="dashboard-statistics"),

View File

@ -1,5 +1,7 @@
from django.contrib.auth.mixins import UserPassesTestMixin from django.contrib.auth.mixins import UserPassesTestMixin
from django.shortcuts import get_object_or_404
from django.urls import reverse from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from aircox.models import Episode, Program, StaticPage, Track from aircox.models import Episode, Program, StaticPage, Track
from aircox import forms, filters, permissions from aircox import forms, filters, permissions
@ -12,6 +14,7 @@ __all__ = (
"EpisodeDetailView", "EpisodeDetailView",
"EpisodeListView", "EpisodeListView",
"PodcastListView", "PodcastListView",
"EpisodeCreateView",
"EpisodeUpdateView", "EpisodeUpdateView",
) )
@ -139,3 +142,9 @@ class EpisodeUpdateView(UserPassesTestMixin, VueFormDataMixin, PageUpdateView):
if invalid: if invalid:
return self.get(request, **formsets) return self.get(request, **formsets)
return resp return resp
class EpisodeCreateView(EpisodeUpdateView):
def get_object(self):
program = get_object_or_404(Program, pk=self.kwargs["pk"])
return Episode.objects.create(program=program, title="%s (%s)" % (program.title, _("draft")))

View File

@ -20,7 +20,12 @@
{% if object|model_name == "Episode" %} {% if object|model_name == "Episode" %}
<div class="episode-date"> <div class="episode-date">
{{ object.pub_date|date:"d/m/Y" }}<Br/> {% if object.status %}
{{ object.pub_date|date:"d/m/Y" }}
{% else %}
{% trans "Draft" %}
{% endif %}
<br/>
</div> </div>
{% endif %} {% endif %}
<a href="{{ url|escape }}" class="heading title {% block title-class %}{% endblock %}"> <a href="{{ url|escape }}" class="heading title {% block title-class %}{% endblock %}">