forked from rc/aircox
radiocampus/homepage: add recently played
This commit is contained in:
parent
6615ebe5da
commit
86e0b1a7a0
|
@ -90,7 +90,7 @@ body.yellow.home #grandlogo img {
|
||||||
content: url('/static/radiocampus/logos/logo-RC-bleu2.png');
|
content: url('/static/radiocampus/logos/logo-RC-bleu2.png');
|
||||||
}
|
}
|
||||||
body.yellow .nav .nav-item.active {
|
body.yellow .nav .nav-item.active {
|
||||||
color: #7E6B64 !important;
|
color: #738EF2 !important;
|
||||||
}
|
}
|
||||||
body.blue #grandlogo img, body.yellow #grandlogo img {
|
body.blue #grandlogo img, body.yellow #grandlogo img {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
|
@ -150,7 +150,7 @@ a.heading.title:hover {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.nav.secondary .nav-item {
|
.nav.secondary .nav-item {
|
||||||
color: #7E6B64 !important;
|
color: black !important;
|
||||||
}
|
}
|
||||||
.nav-item:hover {
|
.nav-item:hover {
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
|
|
103
radiocampus/templates/aircox/home.html
Normal file
103
radiocampus/templates/aircox/home.html
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
{% 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 %}
|
||||||
|
<nav class="nav secondary">
|
||||||
|
<div class="nav-menu nav-categories">
|
||||||
|
<a class="nav-item" id="recent-link"
|
||||||
|
href="#" onclick="javascript:display('recentdisplay');">
|
||||||
|
Derniers titres diffusés
|
||||||
|
</a>
|
||||||
|
<a class="nav-item active" id="home-link"
|
||||||
|
href="#" onclick="javascript:display('homedisplay');">
|
||||||
|
Aujourd'hui
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<a-switch class="button burger"
|
||||||
|
el=".nav-categories" group="nav" icon="fas fa-tags"
|
||||||
|
aria-label="{% translate "Categories" %}">
|
||||||
|
</a-switch>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function display(id) {
|
||||||
|
|
||||||
|
var h = document.getElementsByClassName('homedisplay');
|
||||||
|
var r = document.getElementsByClassName('recentdisplay');
|
||||||
|
|
||||||
|
if (id == "homedisplay") {
|
||||||
|
for(var i = 0; i < h.length; i++) { h[i].setAttribute('style', 'display:inline !important'); }
|
||||||
|
for(var i = 0; i < h.length; i++) { r[i].setAttribute('style', 'display:none !important'); }
|
||||||
|
} else {
|
||||||
|
for(var i = 0; i < h.length; i++) { h[i].setAttribute('style', 'display:none !important'); }
|
||||||
|
for(var i = 0; i < h.length; i++) { r[i].setAttribute('style', 'display:inline !important'); }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block breadcrumbs %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block list-container %}
|
||||||
|
<br />
|
||||||
|
<div class="homedisplay">
|
||||||
|
<section class="container" style="display:flex;justify-content:flex-end;min-height:600px">
|
||||||
|
<div>
|
||||||
|
<!-- <a href="{% url "timetable-list" date=date %}">{{ date|date:"l d F Y" }}</a> -->
|
||||||
|
<section class="clear-both list grid radiocampus-grid" role="list">
|
||||||
|
</section>
|
||||||
|
{% with list_class="radiocampus-grid" %}
|
||||||
|
{{ block.super }}
|
||||||
|
{% endwith %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<div class="recentdisplay" style="display:none">
|
||||||
|
<section class="container" style="min-height:600px">
|
||||||
|
<div>
|
||||||
|
<!-- <a href="{% url "timetable-list" date=date %}">{{ date|date:"l d F Y" }}</a> -->
|
||||||
|
<section class="clear-both list grid radiocampus-grid" role="list">
|
||||||
|
</section>
|
||||||
|
{% with list_class="radiocampus-grid" %}
|
||||||
|
{{ block.super }}
|
||||||
|
{% endwith %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block list %}
|
||||||
|
{% with object_list=object_list timetable=True %}
|
||||||
|
{% with widget|default:"item" as widget %}
|
||||||
|
|
||||||
|
{% for object in object_list %}
|
||||||
|
{% if object.episode %}
|
||||||
|
<div class="homedisplay">
|
||||||
|
{% page_widget widget object.episode diffusion=object timetable=True %}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="preview list-item logs">
|
||||||
|
<div class="media d-block content recentdisplay" style="display:none !important;">
|
||||||
|
{% for obj in object %}
|
||||||
|
{% include "aircox/widgets/track_item.html" with object=obj.track log=obj timetable=True %}
|
||||||
|
<br />
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% endwith %}
|
||||||
|
{% endwith %}
|
||||||
|
{% endblock %}
|
|
@ -1,33 +0,0 @@
|
||||||
{% 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 %}
|
|
|
@ -1,19 +1,3 @@
|
||||||
"""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 import settings
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
@ -22,7 +6,7 @@ from django.urls import include, path
|
||||||
import aircox.urls
|
import aircox.urls
|
||||||
import aircox_streamer.urls
|
import aircox_streamer.urls
|
||||||
|
|
||||||
from radiocampus.views.diffusion import TimeTableView
|
from radiocampus.views import TimeTableView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
*aircox.urls.urls,
|
*aircox.urls.urls,
|
||||||
|
|
7
radiocampus/views.py
Normal file
7
radiocampus/views.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
from aircox.views.diffusion import TimeTableView as AircoxTimeTableView
|
||||||
|
|
||||||
|
__all__ = "TimeTableView"
|
||||||
|
|
||||||
|
|
||||||
|
class TimeTableView(AircoxTimeTableView):
|
||||||
|
template_name = "aircox/home.html"
|
|
@ -1,13 +0,0 @@
|
||||||
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"
|
|
Loading…
Reference in New Issue
Block a user