Compare commits
	
		
			3 Commits
		
	
	
		
			070af46ef1
			...
			2513d9eff5
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2513d9eff5 | |||
| b7429e11f0 | |||
| a0be3c0fda | 
@ -181,3 +181,8 @@ def is_checkbox(field):
 | 
			
		||||
def is_select(field):
 | 
			
		||||
    """Return True if field is a select."""
 | 
			
		||||
    return isinstance(field.widget, forms.Select)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@register.filter
 | 
			
		||||
def model_name(instance):
 | 
			
		||||
    return instance.__class__.__name__
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										136
									
								
								radiocampus/aircox_urls.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										136
									
								
								radiocampus/aircox_urls.py
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,136 @@
 | 
			
		||||
from django.urls import include, path, register_converter
 | 
			
		||||
from django.utils.translation import gettext_lazy as _
 | 
			
		||||
from rest_framework.routers import DefaultRouter
 | 
			
		||||
 | 
			
		||||
from . import models, views, viewsets
 | 
			
		||||
from .converters import DateConverter, PagePathConverter, WeekConverter
 | 
			
		||||
 | 
			
		||||
__all__ = ["api", "urls"]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
register_converter(PagePathConverter, "page_path")
 | 
			
		||||
register_converter(DateConverter, "date")
 | 
			
		||||
register_converter(WeekConverter, "week")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# urls = [
 | 
			
		||||
#    path('on_air', views.on_air, name='aircox.on_air'),
 | 
			
		||||
#    path('monitor', views.Monitor.as_view(), name='aircox.monitor'),
 | 
			
		||||
#    path('stats', views.StatisticsView.as_view(), name='aircox.stats'),
 | 
			
		||||
# ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
router = DefaultRouter()
 | 
			
		||||
router.register("user", viewsets.UserViewSet, basename="user")
 | 
			
		||||
router.register("group", viewsets.GroupViewSet, basename="group")
 | 
			
		||||
router.register("usergroup", viewsets.UserGroupViewSet, basename="usergroup")
 | 
			
		||||
 | 
			
		||||
router.register("images", viewsets.ImageViewSet, basename="image")
 | 
			
		||||
router.register("sound", viewsets.SoundViewSet, basename="sound")
 | 
			
		||||
router.register("track", viewsets.TrackROViewSet, basename="track")
 | 
			
		||||
router.register("comment", viewsets.CommentViewSet, basename="comment")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
api = [
 | 
			
		||||
    path("logs/", views.log.LogListAPIView.as_view(), name="live"),
 | 
			
		||||
    path(
 | 
			
		||||
        "user/settings/",
 | 
			
		||||
        viewsets.UserSettingsViewSet.as_view({"get": "retrieve", "post": "update", "put": "update"}),
 | 
			
		||||
        name="user-settings",
 | 
			
		||||
    ),
 | 
			
		||||
] + router.urls
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
urls = [
 | 
			
		||||
    path("", views.home.HomeView.as_view(), name="home"),
 | 
			
		||||
    path("api/", include((api, "aircox"), namespace="api")),
 | 
			
		||||
    # ---- ---- objects views
 | 
			
		||||
    # ---- articles
 | 
			
		||||
    path(
 | 
			
		||||
        _("articles/<slug:slug>/"),
 | 
			
		||||
        views.article.ArticleDetailView.as_view(),
 | 
			
		||||
        name="article-detail",
 | 
			
		||||
    ),
 | 
			
		||||
    path(
 | 
			
		||||
        _("articles/"),
 | 
			
		||||
        views.article.ArticleListView.as_view(model=models.article.Article),
 | 
			
		||||
        name="article-list",
 | 
			
		||||
    ),
 | 
			
		||||
    path(
 | 
			
		||||
        _("articles/c/<slug:category_slug>/"),
 | 
			
		||||
        views.article.ArticleListView.as_view(model=models.article.Article),
 | 
			
		||||
        name="article-list",
 | 
			
		||||
    ),
 | 
			
		||||
    # ---- timetable
 | 
			
		||||
    path(_("timetable/"), views.diffusion.TimeTableView.as_view(), name="timetable-list"),
 | 
			
		||||
    path(
 | 
			
		||||
        _("timetable/<date:date>/"),
 | 
			
		||||
        views.diffusion.TimeTableView.as_view(),
 | 
			
		||||
        name="timetable-list",
 | 
			
		||||
    ),
 | 
			
		||||
    # ---- pages
 | 
			
		||||
    path(
 | 
			
		||||
        _("publications/"),
 | 
			
		||||
        views.PageListView.as_view(model=models.Page, attach_to_value=models.StaticPage.Target.PAGES),
 | 
			
		||||
        name="page-list",
 | 
			
		||||
    ),
 | 
			
		||||
    path(
 | 
			
		||||
        _("publications/c/<slug:category_slug>/"),
 | 
			
		||||
        views.PageListView.as_view(model=models.Page, attach_to_value=models.StaticPage.Target.PAGES),
 | 
			
		||||
        name="page-list",
 | 
			
		||||
    ),
 | 
			
		||||
    path(
 | 
			
		||||
        _("pages/<slug:slug>/"),
 | 
			
		||||
        views.BasePageDetailView.as_view(
 | 
			
		||||
            model=models.StaticPage,
 | 
			
		||||
            queryset=models.StaticPage.objects.filter(attach_to__isnull=True),
 | 
			
		||||
        ),
 | 
			
		||||
        name="static-page-detail",
 | 
			
		||||
    ),
 | 
			
		||||
    path(
 | 
			
		||||
        _("pages/"),
 | 
			
		||||
        views.BasePageListView.as_view(
 | 
			
		||||
            model=models.StaticPage,
 | 
			
		||||
            queryset=models.StaticPage.objects.filter(attach_to__isnull=True),
 | 
			
		||||
        ),
 | 
			
		||||
        name="static-page-list",
 | 
			
		||||
    ),
 | 
			
		||||
    # ---- programs
 | 
			
		||||
    path(_("programs/"), views.program.ProgramListView.as_view(), name="program-list"),
 | 
			
		||||
    path(_("programs/c/<slug:category_slug>/"), views.program.ProgramListView.as_view(), name="program-list"),
 | 
			
		||||
    path(
 | 
			
		||||
        _("programs/<slug:slug>/"),
 | 
			
		||||
        views.program.ProgramDetailView.as_view(),
 | 
			
		||||
        name="program-detail",
 | 
			
		||||
    ),
 | 
			
		||||
    path(_("programs/<slug:parent_slug>/articles/"), views.article.ArticleListView.as_view(), name="article-list"),
 | 
			
		||||
    path(_("programs/<slug:parent_slug>/podcasts/"), views.episode.PodcastListView.as_view(), name="podcast-list"),
 | 
			
		||||
    path(_("programs/<slug:parent_slug>/episodes/"), views.episode.EpisodeListView.as_view(), name="episode-list"),
 | 
			
		||||
    path(
 | 
			
		||||
        _("programs/<slug:parent_slug>/diffusions/"), views.diffusion.DiffusionListView.as_view(), name="diffusion-list"
 | 
			
		||||
    ),
 | 
			
		||||
    path(
 | 
			
		||||
        _("programs/<slug:parent_slug>/publications/"),
 | 
			
		||||
        views.PageListView.as_view(model=models.Page, attach_to_value=models.StaticPage.Target.PAGES),
 | 
			
		||||
        name="page-list",
 | 
			
		||||
    ),
 | 
			
		||||
    # ---- episodes
 | 
			
		||||
    path(_("programs/episodes/"), views.episode.EpisodeListView.as_view(), name="episode-list"),
 | 
			
		||||
    path(_("programs/episodes/c/<slug:category_slug>/"), views.episode.EpisodeListView.as_view(), name="episode-list"),
 | 
			
		||||
    path(
 | 
			
		||||
        _("programs/episodes/<slug:slug>/"),
 | 
			
		||||
        views.episode.EpisodeDetailView.as_view(),
 | 
			
		||||
        name="episode-detail",
 | 
			
		||||
    ),
 | 
			
		||||
    path(_("podcasts/"), views.episode.PodcastListView.as_view(), name="podcast-list"),
 | 
			
		||||
    path(_("podcasts/c/<slug:category_slug>/"), views.episode.PodcastListView.as_view(), name="podcast-list"),
 | 
			
		||||
    # ---- dashboard
 | 
			
		||||
    path(_("dashboard/"), views.dashboard.DashboardView.as_view(), name="dashboard"),
 | 
			
		||||
    path(_("dashboard/program/<pk>/"), views.program.ProgramUpdateView.as_view(), name="program-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/<date:date>/"), views.dashboard.StatisticsView.as_view(), name="dashboard-statistics"),
 | 
			
		||||
    path(_("dashboard/users/"), views.auth.UserListView.as_view(), name="user-list"),
 | 
			
		||||
    # ---- others
 | 
			
		||||
    path(_("errors/no-station/"), views.errors.NoStationErrorView.as_view(), name="errors-no-station"),
 | 
			
		||||
]
 | 
			
		||||
@ -11,13 +11,14 @@
 | 
			
		||||
    --a-sound-bg: #f6ed80;
 | 
			
		||||
    --body-bg: unset;
 | 
			
		||||
    --break-color: transparent;
 | 
			
		||||
    --button-bg: #F4F88D;
 | 
			
		||||
    --button-bg: #e9e9ed;
 | 
			
		||||
    --button-fg: #222;
 | 
			
		||||
    --button-hv-bg: #F4F88D;
 | 
			
		||||
    --button-hv-fg: #1d3cab;
 | 
			
		||||
    --button-active-fg: white;
 | 
			
		||||
    --button-active-bg: #738ef2;
 | 
			
		||||
    --heading-font-family: "campus_grotesk";
 | 
			
		||||
    --header-height: 320px;
 | 
			
		||||
    --heading-link-hv-fg: #aa217b;
 | 
			
		||||
    --heading-hg-fg: #fff;
 | 
			
		||||
    --link-fg: #3b47ff;
 | 
			
		||||
@ -29,6 +30,7 @@
 | 
			
		||||
    --nav-hv-bg: unset;
 | 
			
		||||
    --nav-active-bg: unset;
 | 
			
		||||
    --nav-active-fg: white;
 | 
			
		||||
    --preview-title-sz: 21px;
 | 
			
		||||
    --text-color: #75124e;
 | 
			
		||||
    --text-color-light: #bbb;
 | 
			
		||||
}
 | 
			
		||||
@ -61,6 +63,9 @@ body.home .nav.primary {
 | 
			
		||||
body.yellow {
 | 
			
		||||
    background: url(/static/radiocampus/backgrounds/degrade-jaune.jpg) repeat-x top fixed;
 | 
			
		||||
}
 | 
			
		||||
body.yellow :root {
 | 
			
		||||
    --nav-active-fg: #f4f88d;
 | 
			
		||||
}
 | 
			
		||||
body.yellow.home {
 | 
			
		||||
    background: url(/static/radiocampus/backgrounds/photo-degrade-02.jpg) no-repeat center/cover;
 | 
			
		||||
    background-attachment: fixed;
 | 
			
		||||
@ -117,9 +122,30 @@ body.blue.home #grandlogo img , body.yellow.home #grandlogo img {
 | 
			
		||||
.a-switch-nav span:hover {
 | 
			
		||||
    color: #333;
 | 
			
		||||
}
 | 
			
		||||
a.heading.title {
 | 
			
		||||
    color: black;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
a.heading.title:hover {
 | 
			
		||||
    color: var(--link-hv-fg);
 | 
			
		||||
}
 | 
			
		||||
.button, a.button, button.button {
 | 
			
		||||
  border: 0;
 | 
			
		||||
}
 | 
			
		||||
.header-cover:not(:only-child) {
 | 
			
		||||
    float: left;
 | 
			
		||||
    margin: 0 1.2rem 1.2rem 0;
 | 
			
		||||
}
 | 
			
		||||
.header.has-cover {
 | 
			
		||||
    min-height: unset;
 | 
			
		||||
}
 | 
			
		||||
.today {
 | 
			
		||||
   color:  yellow;
 | 
			
		||||
   font-size: 1.4em !important;
 | 
			
		||||
}
 | 
			
		||||
.mt-3 {
 | 
			
		||||
    margin-top: unset !important;
 | 
			
		||||
}
 | 
			
		||||
.nav.primary .nav-brand {
 | 
			
		||||
    display: none;
 | 
			
		||||
}
 | 
			
		||||
@ -135,9 +161,55 @@ body.blue.home #grandlogo img , body.yellow.home #grandlogo img {
 | 
			
		||||
}
 | 
			
		||||
.page section.container {
 | 
			
		||||
    margin-top: 0;
 | 
			
		||||
    padding-top: 0.6rem;
 | 
			
		||||
}
 | 
			
		||||
.radiocampus-grid {
 | 
			
		||||
    display: block;
 | 
			
		||||
}
 | 
			
		||||
.radiocampus-grid article div.media {
 | 
			
		||||
    line-height: 1;
 | 
			
		||||
    padding: 0;
 | 
			
		||||
}
 | 
			
		||||
.radiocampus-grid article.active div.media div.media-content a, .radiocampus-grid article.active div.media div.media-content span {
 | 
			
		||||
    color: yellow;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.radiocampus-grid article.active div.media a:before {
 | 
			
		||||
    content: "\2192";
 | 
			
		||||
    margin-right: 6px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.radiocampus-grid article div.media a.preview-cover {
 | 
			
		||||
    display: none;
 | 
			
		||||
}
 | 
			
		||||
.radiocampus-grid article div.media div.media-content.flex-column {
 | 
			
		||||
    display: unset;
 | 
			
		||||
}
 | 
			
		||||
.radiocampus-grid article div.media div.media-content section.content {
 | 
			
		||||
    display: none;
 | 
			
		||||
}
 | 
			
		||||
.radiocampus-grid article div.media div.media-content div.episode-date {
 | 
			
		||||
    display: none;
 | 
			
		||||
}
 | 
			
		||||
.radiocampus-grid article div.media div.media-content span.heading.subtitle {
 | 
			
		||||
    float: right;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.schedule {
 | 
			
		||||
    background-color: unset;
 | 
			
		||||
    font-size: 0.9em;
 | 
			
		||||
    margin: 0 0.2rem;
 | 
			
		||||
    opacity: 0.6;
 | 
			
		||||
    padding: 0 0.2rem 0.2rem 0.2rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.schedules {
 | 
			
		||||
    margin-bottom: 0.4rem !important;
 | 
			
		||||
}
 | 
			
		||||
.title, .preview .title, .preview .title:not(:last-child) {
 | 
			
		||||
    text-transform: unset;
 | 
			
		||||
    font-weight: unset;
 | 
			
		||||
    font-size: 1.2em;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media screen and (max-width: 400px) {
 | 
			
		||||
    body {
 | 
			
		||||
@ -146,6 +218,9 @@ body.blue.home #grandlogo img , body.yellow.home #grandlogo img {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media screen and (max-width: 1024px) {
 | 
			
		||||
    :root {
 | 
			
		||||
        --header-height: 200px;
 | 
			
		||||
    }
 | 
			
		||||
    .page {
 | 
			
		||||
        margin-top: 0;
 | 
			
		||||
        padding-top: var(--nav-primary-height);
 | 
			
		||||
@ -171,18 +246,9 @@ body.blue.home #grandlogo img , body.yellow.home #grandlogo img {
 | 
			
		||||
    .nav .nav-item {
 | 
			
		||||
        color: white !important;
 | 
			
		||||
    }
 | 
			
		||||
    body.yellow .nav .nav-item.active {
 | 
			
		||||
    .nav .nav-item.active {
 | 
			
		||||
        color: white !important;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* yellow theme is not implemented for small screens */
 | 
			
		||||
    body.yellow {
 | 
			
		||||
        background: url(/static/radiocampus/backgrounds/degrade-bleu.jpg) repeat-x top/auto 520px;
 | 
			
		||||
    }
 | 
			
		||||
    body.yellow.home {
 | 
			
		||||
        background: url(/static/radiocampus/backgrounds/photo-degrade-01.jpg) no-repeat center/cover;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .navs .nav + .nav {
 | 
			
		||||
        flex-grow: 1 !important;
 | 
			
		||||
    }
 | 
			
		||||
@ -210,6 +276,10 @@ body.blue.home #grandlogo img , body.yellow.home #grandlogo img {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.list-item .headings {
 | 
			
		||||
    margin-bottom: .2rem !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.list-item:nth-child(3n+1):not(.wide) .media {
 | 
			
		||||
  border-color: transparent !important;
 | 
			
		||||
}
 | 
			
		||||
@ -218,6 +288,13 @@ body.blue.home #grandlogo img , body.yellow.home #grandlogo img {
 | 
			
		||||
  border-color: transparent !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.list-item:not(.wide) .media {
 | 
			
		||||
    padding: 0.2rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.media-content .content p, .episode-date {
 | 
			
		||||
    opacity: 0.7;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
.nav-urls .urls a, .nav-urls .urls span {
 | 
			
		||||
@ -262,7 +339,6 @@ body.blue.home #grandlogo img , body.yellow.home #grandlogo img {
 | 
			
		||||
    padding-left: 12px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.nav.secondary {
 | 
			
		||||
    opacity: 0.9;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										33
									
								
								radiocampus/templates/aircox/home_timetable_list.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								radiocampus/templates/aircox/home_timetable_list.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,33 @@
 | 
			
		||||
{% extends "aircox/page_list.html" %}
 | 
			
		||||
{% comment %}List of diffusions as a timetable{% endcomment %}
 | 
			
		||||
{% load i18n aircox humanize %}
 | 
			
		||||
 | 
			
		||||
{% block subtitle %}{{ date|date:"l d F Y" }}{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block secondary-nav %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{% block breadcrumbs %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{% block list-container %}
 | 
			
		||||
<br />
 | 
			
		||||
<br />
 | 
			
		||||
<div style="display: flex; justify-content: flex-end;height:100%;">
 | 
			
		||||
<div style="min-width:300px;margin-right:12%">
 | 
			
		||||
<!-- <a href="{% url "timetable-list" date=date %}">{{ date|date:"l d F Y" }}</a> -->
 | 
			
		||||
<section class="clear-both list grid radiocampus-grid" role="list">
 | 
			
		||||
    <span class="title today">Aujourd'hui</span>
 | 
			
		||||
</section>
 | 
			
		||||
{% with list_class="radiocampus-grid" %}
 | 
			
		||||
{{ block.super }}
 | 
			
		||||
{% endwith %}
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block list %}
 | 
			
		||||
{% include "./widgets/logs.html" with object_list=object_list timetable=True  %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
							
								
								
									
										98
									
								
								radiocampus/templates/aircox/page_detail.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										98
									
								
								radiocampus/templates/aircox/page_detail.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,98 @@
 | 
			
		||||
{% extends "aircox/public.html" %}
 | 
			
		||||
{% load static i18n humanize honeypot aircox %}
 | 
			
		||||
{% comment %}
 | 
			
		||||
Base template used to display a Page
 | 
			
		||||
 | 
			
		||||
Context:
 | 
			
		||||
- page: page
 | 
			
		||||
- parent: parent page
 | 
			
		||||
- related_objects: list of object to display as related publications
 | 
			
		||||
- related_url: url to the full list of related_objects
 | 
			
		||||
{% endcomment %}
 | 
			
		||||
 | 
			
		||||
{% block breadcrumbs %}
 | 
			
		||||
{% if parent %}
 | 
			
		||||
    {% include "./widgets/breadcrumbs.html" with page=parent %}
 | 
			
		||||
    {% if page %}
 | 
			
		||||
    <a href="{% url page.list_url_name parent_slug=parent.slug %}">
 | 
			
		||||
        {{ page|verbose_name:True }}
 | 
			
		||||
    </a>
 | 
			
		||||
    {% endif %}
 | 
			
		||||
{% elif page %}
 | 
			
		||||
    {% include "./widgets/breadcrumbs.html" with page=page no_title=True %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block title-container %}
 | 
			
		||||
{{ block.super }}
 | 
			
		||||
{% block page-actions %}
 | 
			
		||||
    {% include "aircox/widgets/page_actions.html" %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block main %}
 | 
			
		||||
{{ block.super }}
 | 
			
		||||
 | 
			
		||||
{% block episodes %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block related %}
 | 
			
		||||
{% if related_objects %}
 | 
			
		||||
<section class="container">
 | 
			
		||||
    {% with models=object|verbose_name:True %}
 | 
			
		||||
    <h2 class="title is-2">{% blocktranslate %}Related {{models}}{% endblocktranslate %}</h2>
 | 
			
		||||
 | 
			
		||||
    {% include "./widgets/carousel.html" with objects=related_objects url_name=object.list_url_name url_category=object.category %}
 | 
			
		||||
    {% endwith %}
 | 
			
		||||
</section>
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block comments %}
 | 
			
		||||
{% if comments %}
 | 
			
		||||
<section class="container">
 | 
			
		||||
    <h2 class="title is-2">{% translate "Comments" %}</h2>
 | 
			
		||||
 | 
			
		||||
    {% for object in comments %}
 | 
			
		||||
    {% page_widget "item" object %}
 | 
			
		||||
    {% endfor %}
 | 
			
		||||
</section>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{% if comment_form %}
 | 
			
		||||
<section class="container">
 | 
			
		||||
    <h2 class="title is-2">{% translate "Post a comment" %}</h2>
 | 
			
		||||
    <form method="POST">
 | 
			
		||||
        {% csrf_token %}
 | 
			
		||||
        {% render_honeypot_field "website" %}
 | 
			
		||||
 | 
			
		||||
        <div class="field">
 | 
			
		||||
            <div class="control">
 | 
			
		||||
                {{ comment_form.content }}
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        {% for field in comment_form %}
 | 
			
		||||
        {% if field.name != "content" %}
 | 
			
		||||
        <div class="field is-horizontal">
 | 
			
		||||
            <label class="label">{{ field.label }}</label>
 | 
			
		||||
            <div class="control">{{ field }}</div>
 | 
			
		||||
        </div>
 | 
			
		||||
        {% if field.errors %}
 | 
			
		||||
        <p class="help is-danger">{{ field.errors }}</p>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        {% if field.help_text %}
 | 
			
		||||
        <p class="help">{{ field.help_text|safe }}</p>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
 | 
			
		||||
        <div class="has-text-right">
 | 
			
		||||
            <button type="submit" class="button">{% translate "Post comment" %}</button>
 | 
			
		||||
        </div>
 | 
			
		||||
    </form>
 | 
			
		||||
</section>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{% endblock %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
							
								
								
									
										27
									
								
								radiocampus/templates/aircox/page_list.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								radiocampus/templates/aircox/page_list.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
{% extends "aircox/page_list.html" %}
 | 
			
		||||
{% comment %}Display a list of Pages{% endcomment %}
 | 
			
		||||
{% load i18n aircox %}
 | 
			
		||||
 | 
			
		||||
{% block breadcrumbs %}
 | 
			
		||||
{% if parent and model.list_url_name %}
 | 
			
		||||
    {% include "./widgets/breadcrumbs.html" with page=parent %}
 | 
			
		||||
    <a href="{% url model.list_url_name %}">{{ model|verbose_name:True }}</a>
 | 
			
		||||
{% elif page.title == "Podcasts" and not category %}
 | 
			
		||||
{% elif page and model.list_url_name %}
 | 
			
		||||
    <a href="{% url model.list_url_name %}">{{ page.title }}</a>
 | 
			
		||||
    {% if category %}
 | 
			
		||||
    <a href="{% url request.resolver_match.url_name category_slug=category.slug %}">
 | 
			
		||||
        {{ category.title }}
 | 
			
		||||
    </a>
 | 
			
		||||
    {% endif %}
 | 
			
		||||
{% else %}
 | 
			
		||||
    <a href="{% url request.resolver_match.url_name %}">{{ model|verbose_name:True }}</a>
 | 
			
		||||
    {% if category %}
 | 
			
		||||
    <a href="{% url request.resolver_match.url_name category_slug=category.slug %}">
 | 
			
		||||
        {{ category.title }}
 | 
			
		||||
    </a>
 | 
			
		||||
    {% endif %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block content-container %}{% endblock %}
 | 
			
		||||
							
								
								
									
										61
									
								
								radiocampus/templates/aircox/program_detail.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								radiocampus/templates/aircox/program_detail.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,61 @@
 | 
			
		||||
{% extends "aircox/page_detail.html" %}
 | 
			
		||||
{% comment %}Detail page of a show{% endcomment %}
 | 
			
		||||
{% load i18n aircox %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
 | 
			
		||||
{% with schedules=object.schedule_set.all %}
 | 
			
		||||
{% if object.active and schedules %}
 | 
			
		||||
<header class="schedules mt-3">
 | 
			
		||||
    {% for schedule in schedules %}
 | 
			
		||||
    <div class="schedule">
 | 
			
		||||
        <div class="heading">
 | 
			
		||||
            <span class="day">{{ schedule.get_frequency_display }}</span>
 | 
			
		||||
            {% with schedule.start|date:"H:i" as start %}
 | 
			
		||||
            {% with schedule.end|date:"H:i" as end %}
 | 
			
		||||
            <time datetime="{{ start }}">{{ start }}</time>
 | 
			
		||||
            —
 | 
			
		||||
            <time datetime="{{ end }}">{{ end }}</time>
 | 
			
		||||
            {% endwith %}
 | 
			
		||||
            {% endwith %}
 | 
			
		||||
            <small>
 | 
			
		||||
                {% if schedule.is_rerun %}
 | 
			
		||||
                {% with schedule.initial.date as date %}
 | 
			
		||||
                <span title="{% blocktranslate %}Rerun of {{ date }}{% endblocktranslate %}">
 | 
			
		||||
                    ({% translate "Rerun" %})
 | 
			
		||||
                </span>
 | 
			
		||||
                {% endwith %}
 | 
			
		||||
                {% endif %}
 | 
			
		||||
            </small>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    {% endfor %}
 | 
			
		||||
</header>
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endwith %}
 | 
			
		||||
 | 
			
		||||
{{ block.super }}
 | 
			
		||||
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{% block episodes %}
 | 
			
		||||
{% if episodes %}
 | 
			
		||||
<section class="container">
 | 
			
		||||
    <h2 class="title is-2">{% translate "Last Episodes" %}</h2>
 | 
			
		||||
    {% include "./widgets/carousel.html" with objects=episodes url_name="episode-list" url_parent=object url_label=_("All episodes") %}
 | 
			
		||||
</section>
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block main %}
 | 
			
		||||
{{ block.super }}
 | 
			
		||||
 | 
			
		||||
{% if articles %}
 | 
			
		||||
<section class="container">
 | 
			
		||||
    <h2 class="title is-2">{% translate "Last Articles" %}</h2>
 | 
			
		||||
    {% include "./widgets/carousel.html" with objects=articles url_name="article-list" url_parent=object url_label=_("All articles") %}
 | 
			
		||||
</section>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{% endblock %}
 | 
			
		||||
							
								
								
									
										71
									
								
								radiocampus/templates/aircox/widgets/episode.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								radiocampus/templates/aircox/widgets/episode.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,71 @@
 | 
			
		||||
{% extends "./page.html" %}
 | 
			
		||||
{% load i18n humanize aircox %}
 | 
			
		||||
 | 
			
		||||
{% block outer %}
 | 
			
		||||
{% with diffusion.is_now as is_active %}
 | 
			
		||||
    {{ block.super }}
 | 
			
		||||
{% endwith %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block subtitle %}
 | 
			
		||||
{% if diffusion %}
 | 
			
		||||
    {% if timetable %}
 | 
			
		||||
        {{ diffusion.start|date:"H:i" }}
 | 
			
		||||
        —
 | 
			
		||||
        {{ diffusion.end|date:"H:i" }}
 | 
			
		||||
    {% else %}
 | 
			
		||||
        {{ diffusion.start|naturalday }},
 | 
			
		||||
        {{ diffusion.start|date:"H:i" }}
 | 
			
		||||
    {% endif %}
 | 
			
		||||
{% else %}
 | 
			
		||||
    {{ block.super }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{% block actions-container %}
 | 
			
		||||
{% if admin and diffusion %}
 | 
			
		||||
<div class="flex-row">
 | 
			
		||||
    <div class="flex-grow-1">
 | 
			
		||||
        {% if diffusion.type == diffusion.TYPE_ON_AIR %}
 | 
			
		||||
        <span class="tag is-info">
 | 
			
		||||
            <span class="icon is-small">
 | 
			
		||||
                {% if diffusion.is_live %}
 | 
			
		||||
                <i class="fa fa-microphone"
 | 
			
		||||
                    title="{% translate "Live diffusion" %}"></i>
 | 
			
		||||
                {% else %}
 | 
			
		||||
                <i class="fa fa-music"
 | 
			
		||||
                    title="{% translate "Differed diffusion" %}"></i>
 | 
			
		||||
                {% endif %}
 | 
			
		||||
            </span>
 | 
			
		||||
             
 | 
			
		||||
            {{ diffusion.get_type_display }}
 | 
			
		||||
        </span>
 | 
			
		||||
        {% elif diffusion.type == diffusion.TYPE_CANCEL %}
 | 
			
		||||
        <span class="tag is-danger">
 | 
			
		||||
            {{ diffusion.get_type_display }}</span>
 | 
			
		||||
        {% elif diffusion.type == diffusion.TYPE_UNCONFIRMED %}
 | 
			
		||||
        <span class="tag is-warning">
 | 
			
		||||
            {{ diffusion.get_type_display }}</span>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
    </div>
 | 
			
		||||
    {{ block.super }}
 | 
			
		||||
</div>
 | 
			
		||||
{% else %}
 | 
			
		||||
{{ block.super }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block actions %}
 | 
			
		||||
{{ block.super }}
 | 
			
		||||
{% if object.episodesound_set.available.public.count %}
 | 
			
		||||
<button type="button" class="button action" @click="player.playButtonClick($event)"
 | 
			
		||||
        data-sounds="{{ object.podcasts|json }}">
 | 
			
		||||
    <span class="icon is-small">
 | 
			
		||||
        <span class="fas fa-play" title="{% translate "Listen" %}"></span>
 | 
			
		||||
    </span>
 | 
			
		||||
    <!--<label>{% translate "Listen" %}</label> -->
 | 
			
		||||
</button>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{% endblock %}
 | 
			
		||||
							
								
								
									
										42
									
								
								radiocampus/templates/aircox/widgets/item.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								radiocampus/templates/aircox/widgets/item.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,42 @@
 | 
			
		||||
{% extends "./preview.html" %}
 | 
			
		||||
{% load i18n aircox %}
 | 
			
		||||
 | 
			
		||||
{% block tag-class %}{{ block.super }} list-item is-fullwidth{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block headings %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block inner %}
 | 
			
		||||
{% block headings-container %}{{ block.super }}{% endblock %}
 | 
			
		||||
{% block content-container %}
 | 
			
		||||
<div class="media">
 | 
			
		||||
    {% if object.cover and not no_cover %}
 | 
			
		||||
    <a href="{{ object.get_absolute_url }}"
 | 
			
		||||
        class="media-left preview-cover small"
 | 
			
		||||
        style="background-image: url({{ object.cover.url }})">
 | 
			
		||||
    </a>
 | 
			
		||||
    {% endif %}
 | 
			
		||||
    <div class="media-content flex-column">
 | 
			
		||||
 | 
			
		||||
        {% if object|model_name == "Episode" %}
 | 
			
		||||
        <div class="episode-date">
 | 
			
		||||
        {{ object.pub_date|date:"d/m/Y" }}<Br/>
 | 
			
		||||
        </div>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
    <a href="{{ url|escape }}" class="heading title {% block title-class %}{% endblock %}">
 | 
			
		||||
        {% block title %}{{ title|default:"" }}{% endblock %}
 | 
			
		||||
    </a>
 | 
			
		||||
    <span class="heading subtitle {% block subtitle-class %}{% endblock %}">
 | 
			
		||||
        {% block subtitle %}{{ subtitle|default:"" }}{% endblock %}
 | 
			
		||||
    </span>
 | 
			
		||||
    </br>
 | 
			
		||||
 | 
			
		||||
        <section class="content flex-grow-1">
 | 
			
		||||
            {% block content %}{{ block.super }}{% endblock %}
 | 
			
		||||
        </section>
 | 
			
		||||
        {% block actions-container %}{{ block.super }}{% endblock %}
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% endblock %}
 | 
			
		||||
							
								
								
									
										35
									
								
								radiocampus/templates/aircox/widgets/page.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								radiocampus/templates/aircox/widgets/page.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,35 @@
 | 
			
		||||
{% extends widget_template %}
 | 
			
		||||
{% load i18n aircox %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{% block outer %}
 | 
			
		||||
{% with cover|default:object.cover_url as cover %}
 | 
			
		||||
{% with url|default:object.get_absolute_url as url %}
 | 
			
		||||
{{ block.super }}
 | 
			
		||||
{% endwith %}
 | 
			
		||||
{% endwith %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{% block title %}
 | 
			
		||||
{% if title %}
 | 
			
		||||
    {{ block.super }}
 | 
			
		||||
{% elif object %}
 | 
			
		||||
    {{ object.display_title }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
{% if not content and object %}
 | 
			
		||||
    {% with object.display_headline as content %}
 | 
			
		||||
        {{ block.super }}
 | 
			
		||||
    {% endwith %}
 | 
			
		||||
{% else %}
 | 
			
		||||
    {{ block.super }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block actions %}
 | 
			
		||||
{{ block.super }}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
							
								
								
									
										47
									
								
								radiocampus/urls.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										47
									
								
								radiocampus/urls.py
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,47 @@
 | 
			
		||||
"""Aircox URL Configuration.
 | 
			
		||||
 | 
			
		||||
The `urlpatterns` list routes URLs to views. For more information please see:
 | 
			
		||||
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
 | 
			
		||||
Examples:
 | 
			
		||||
Function views
 | 
			
		||||
    1. Add an import:  from my_app import views
 | 
			
		||||
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
 | 
			
		||||
Class-based views
 | 
			
		||||
    1. Add an import:  from other_app.views import Home
 | 
			
		||||
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
 | 
			
		||||
Including another URLconf
 | 
			
		||||
    1. Add an import:  from blog import urls as blog_urls
 | 
			
		||||
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
 | 
			
		||||
"""
 | 
			
		||||
# from django.conf.urls.i18n import i18n_patterns
 | 
			
		||||
from django.conf import settings
 | 
			
		||||
from django.conf.urls.static import static
 | 
			
		||||
from django.contrib import admin
 | 
			
		||||
from django.urls import include, path
 | 
			
		||||
 | 
			
		||||
from debug_toolbar.toolbar import debug_toolbar_urls
 | 
			
		||||
 | 
			
		||||
import aircox.urls
 | 
			
		||||
import aircox_streamer.urls
 | 
			
		||||
 | 
			
		||||
from radiocampus.views.diffusion import TimeTableView
 | 
			
		||||
 | 
			
		||||
urlpatterns = [
 | 
			
		||||
    *aircox.urls.urls,
 | 
			
		||||
    path("streamer/", include((aircox_streamer.urls.urls, "aircox_streamer"), namespace="streamer")),
 | 
			
		||||
    path("admin/", admin.site.urls),
 | 
			
		||||
    path("accounts/", include("django.contrib.auth.urls")),
 | 
			
		||||
    path("filer/", include("filer.urls")),
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
for i, pa in enumerate(urlpatterns):
 | 
			
		||||
    if "name" in pa.__dict__.keys() and pa.name == "home":
 | 
			
		||||
        urlpatterns.pop(i)
 | 
			
		||||
 | 
			
		||||
urlpatterns.append(path("", TimeTableView.as_view(), name="home"))
 | 
			
		||||
 | 
			
		||||
if settings.DEBUG:
 | 
			
		||||
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(
 | 
			
		||||
        settings.MEDIA_URL, document_root=settings.MEDIA_ROOT
 | 
			
		||||
    )
 | 
			
		||||
    urlpatterns += debug_toolbar_urls()
 | 
			
		||||
							
								
								
									
										13
									
								
								radiocampus/views/diffusion.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								radiocampus/views/diffusion.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
from aircox.models import Diffusion, StaticPage
 | 
			
		||||
from aircox.views.page import attach
 | 
			
		||||
from aircox.views.diffusion import TimeTableView as AircoxTimeTableView
 | 
			
		||||
 | 
			
		||||
__all__ = "TimeTableView"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@attach
 | 
			
		||||
class TimeTableView(AircoxTimeTableView):
 | 
			
		||||
    model = Diffusion
 | 
			
		||||
    redirect_date_url = "timetable-list"
 | 
			
		||||
    attach_to_value = StaticPage.Target.TIMETABLE
 | 
			
		||||
    template_name = "aircox/home_timetable_list.html"
 | 
			
		||||
		Reference in New Issue
	
	Block a user