Compare commits

...

5 Commits

7 changed files with 108 additions and 76 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Aircox 0.1\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"
"Last-Translator: Aarys\n"
"Language-Team: Aircox's translators team\n"
@ -22,7 +22,7 @@ msgstr ""
msgid "start"
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"
msgstr "fin"
@ -38,7 +38,7 @@ msgstr "Depuis"
msgid "Until"
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"
msgstr "Aucun"
@ -88,7 +88,7 @@ msgstr "temps"
msgid "Search"
msgstr "Chercher"
#: filters.py:36 models/episode.py:131
#: filters.py:36 models/episode.py:135
msgid "Podcast"
msgstr "Podcast"
@ -140,31 +140,33 @@ msgstr "éditer les dates de diffusion"
msgid "rerun"
msgstr "rediffusion"
#: models/episode.py:60 templates/aircox/dashboard/statistics.html:29
#: models/episode.py:61 templates/aircox/dashboard/statistics.html:29
msgid "Episode"
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"
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"
msgstr "ordre"
#: models/episode.py:120 models/track.py:37
#: models/episode.py:124 models/track.py:37
msgid "position in the playlist"
msgstr "position dans la playlist"
#: models/episode.py:123 models/sound.py:59
#: models/episode.py:127 models/sound.py:59
msgid "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"
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
msgid "Podcasts"
msgstr "Podcasts"
@ -213,7 +215,7 @@ msgstr "stop"
msgid "other"
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
msgid "station"
msgstr "station"
@ -255,7 +257,7 @@ msgstr "Log"
msgid "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"
msgstr "titre"
@ -271,7 +273,8 @@ msgstr "Catégorie"
msgid "Categories"
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"
msgstr "brouillon"
@ -291,107 +294,107 @@ msgstr "statut"
msgid "cover"
msgstr "couverture"
#: models/page.py:103 models/page.py:329
#: models/page.py:102 models/page.py:322
msgid "content"
msgstr "contenu"
#: models/page.py:202
#: models/page.py:195
msgid "category"
msgstr "catégorie"
#: models/page.py:207
#: models/page.py:200
msgid "publication date"
msgstr "date de publication"
#: models/page.py:209
#: models/page.py:202
msgid "featured"
msgstr "en avant"
#: models/page.py:213
#: models/page.py:206
msgid "allow comments"
msgstr "autoriser les commentaires"
#: models/page.py:228
#: models/page.py:221
msgid "Publication"
msgstr "Publication"
#: models/page.py:229
#: models/page.py:222
msgid "Publications"
msgstr "Publications"
#: models/page.py:290
#: models/page.py:283
msgid "Home Page"
msgstr "Page d'accueil"
#: models/page.py:291
#: models/page.py:284
msgid "Timetable"
msgstr "Horaires"
#: models/page.py:292
#: models/page.py:285
msgid "Programs list"
msgstr "Liste des émissions"
#: models/page.py:293
#: models/page.py:286
msgid "Episodes list"
msgstr "Liste des épisodes"
#: models/page.py:294
#: models/page.py:287
msgid "Articles list"
msgstr "Liste des articles"
#: models/page.py:295
#: models/page.py:288
msgid "Publications list"
msgstr "Publications"
#: models/page.py:296
#: models/page.py:289
msgid "Podcasts list"
msgstr "Podcasts"
#: models/page.py:299
#: models/page.py:292
msgid "attach to"
msgstr "attacher à"
#: models/page.py:304
#: models/page.py:297
msgid "display this page content to related element"
msgstr "Afficher le contenu de cette page pour l'élément sélectionné"
#: models/page.py:322
#: models/page.py:315
msgid "related page"
msgstr "page liée"
#: models/page.py:326
#: models/page.py:319
msgid "nickname"
msgstr "pseudo"
#: models/page.py:327
#: models/page.py:320
msgid "email"
msgstr "email"
#: models/page.py:342
#: models/page.py:335
msgid "Comment"
msgstr "Commentaire"
#: models/page.py:343 templates/aircox/page_detail.html:51
#: models/page.py:336 templates/aircox/page_detail.html:51
msgid "Comments"
msgstr "Commentaires"
#: models/page.py:350
#: models/page.py:343
msgid "menu"
msgstr "menu"
#: models/page.py:353
#: models/page.py:346
msgid "url"
msgstr "url"
#: models/page.py:358
#: models/page.py:351
msgid "page"
msgstr "page"
#: models/page.py:364
#: models/page.py:357
msgid "Menu item"
msgstr "Élément du menu"
#: models/page.py:365
#: models/page.py:358
msgid "Menu items"
msgstr "Éléments de menu"
@ -411,7 +414,7 @@ msgstr "synchroniser"
msgid "update later diffusions according to schedule changes"
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"
msgstr "éditeurs"
@ -420,23 +423,23 @@ msgstr "éditeurs"
msgid "Programs"
msgstr "Émissions"
#: models/program.py:157 models/rerun.py:42
#: models/program.py:167 models/rerun.py:42
msgid "related program"
msgstr "émission apparentée"
#: models/program.py:160
#: models/program.py:170
msgid "delay"
msgstr "délai"
#: models/program.py:163
#: models/program.py:173
msgid "minimal delay between two sound plays"
msgstr "délai minimum entre deux sons joués"
#: models/program.py:166
#: models/program.py:176
msgid "begin"
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"
msgstr "utilisé pour définir une période durant lequel ce stream est joué"
@ -550,8 +553,6 @@ msgid "downloadable"
msgstr "téléchargeable"
#: models/sound.py:55
#, fuzzy
#| msgid "sound can be downloaded by visitors"
msgid "Sound can be downloaded by website visitors."
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 "
msgstr "Par %(filter_title)s "
#: templates/aircox/base.html:70
#: templates/aircox/base.html:71
msgid "Main menu"
msgstr "Menu principal"
@ -735,8 +736,7 @@ msgid "Last Comments"
msgstr "Derniers commentaires"
#: templates/aircox/dashboard/statistics.html:4
#: templates/aircox/widgets/nav.html:41 tests/test_admin_site.py:40
#: views/admin.py:35
#: templates/aircox/widgets/nav.html:41 views/admin.py:35
msgid "Statistics"
msgstr "Statistiques"
@ -905,53 +905,56 @@ msgid "Post comment"
msgstr "Commenter"
#: templates/aircox/page_form.html:14
#, fuzzy, python-format
#| msgid "Create a %(model)s"
#, python-format
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"
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?"
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"
msgstr "Changer de couverture"
#: templates/aircox/page_form.html:125
#: templates/aircox/page_form.html:135
msgid "Update"
msgstr "Mise à jour"
#: templates/aircox/program_detail.html:24
#: templates/aircox/program_detail.html:26
#, python-format
msgid "Rerun of %(date)s"
msgstr "Rediffusion du %(date)s"
#: templates/aircox/program_detail.html:25
#: templates/aircox/program_detail.html:27
msgid "Rerun"
msgstr "Rediffusion"
#: templates/aircox/program_detail.html:41
#: templates/aircox/program_detail.html:48
msgid "Last Episodes"
msgstr "Derniers Épisodes"
#: templates/aircox/program_detail.html:42
#: templates/aircox/program_detail.html:49
msgid "All episodes"
msgstr "Tous les épisodes"
#: templates/aircox/program_detail.html:49
#: templates/aircox/program_detail.html:56
msgid "Last Articles"
msgstr "Derniers articles"
#: templates/aircox/program_detail.html:50
#: templates/aircox/program_detail.html:57
msgid "All 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"
msgstr "Éditeurs"
@ -1021,7 +1024,7 @@ msgstr "Prochain"
msgid "Dashboard"
msgstr "Tableau de bord"
#: templates/aircox/widgets/nav.html:47
#: templates/aircox/widgets/nav.html:50
msgid "Disconnect"
msgstr "Déconnexion"
@ -1244,31 +1247,35 @@ msgstr "dashboard/"
msgid "dashboard/program/<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>/"
msgstr "dashboard/episodes/<pk>/"
#: urls.py:131
#: urls.py:134
msgid "dashboard/statistics/"
msgstr "dashboard/statistiques/"
#: urls.py:132
#: urls.py:135
msgid "dashboard/statistics/<date:date>/"
msgstr "dashboard/statistiques/<date:date>/"
#: urls.py:133
#: urls.py:136
msgid "dashboard/users/"
msgstr "dashboard/utilisateurs/"
#: urls.py:135
#: urls.py:138
msgid "errors/no-station/"
msgstr "erreurs/pas-de-station/"
#: views/page.py:89
#: views/page.py:100
#, python-brace-format
msgid "{model}"
msgstr "{model}"
#: views/page.py:204
#: views/page.py:210
msgid "comments are not allowed"
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.db import models
from django.urls import reverse
from django.utils.functional import cached_property
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)
def get_absolute_url(self):
return reverse(self.detail_url_name, kwargs={"slug": self.slug})
class EpisodeSoundQuerySet(models.QuerySet):
def episode(self, episode):

View File

@ -7,7 +7,11 @@
{% endblock %}
{% 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 %}
&nbsp;
<button type="button"
class="button secondary"
@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
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>/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/statistics/"), 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.shortcuts import get_object_or_404
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from aircox.models import Episode, Program, StaticPage, Track
from aircox import forms, filters, permissions
@ -12,6 +14,7 @@ __all__ = (
"EpisodeDetailView",
"EpisodeListView",
"PodcastListView",
"EpisodeCreateView",
"EpisodeUpdateView",
)
@ -139,3 +142,9 @@ class EpisodeUpdateView(UserPassesTestMixin, VueFormDataMixin, PageUpdateView):
if invalid:
return self.get(request, **formsets)
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

@ -19,9 +19,14 @@
<div class="media-content flex-column">
{% if object|model_name == "Episode" %}
<div class="episode-date">
{{ object.pub_date|date:"d/m/Y" }}<Br/>
</div>
<div class="episode-date">
{% if object.status %}
{{ object.pub_date|date:"d/m/Y" }}
{% else %}
{% trans "Draft" %}
{% endif %}
<br/>
</div>
{% endif %}
<a href="{{ url|escape }}" class="heading title {% block title-class %}{% endblock %}">
{% block title %}{{ title|default:"" }}{% endblock %}