Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
panikdb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
panikdb
Commits
d4aaf49f
Commit
d4aaf49f
authored
Aug 30, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
real user facing frontend
parent
a6638edb
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
82 additions
and
12 deletions
+82
-12
panikdb/emissions/models.py
panikdb/emissions/models.py
+12
-0
panikdb/emissions/templates/emissions/category_list.html
panikdb/emissions/templates/emissions/category_list.html
+1
-1
panikdb/emissions/templates/emissions/days.html
panikdb/emissions/templates/emissions/days.html
+1
-1
panikdb/emissions/templates/emissions/emission_detail.html
panikdb/emissions/templates/emissions/emission_detail.html
+1
-1
panikdb/emissions/templates/emissions/emission_form.html
panikdb/emissions/templates/emissions/emission_form.html
+1
-1
panikdb/emissions/templates/emissions/emission_list.html
panikdb/emissions/templates/emissions/emission_list.html
+1
-1
panikdb/emissions/templates/emissions/episode_detail.html
panikdb/emissions/templates/emissions/episode_detail.html
+1
-1
panikdb/emissions/templates/emissions/episode_form.html
panikdb/emissions/templates/emissions/episode_form.html
+1
-1
panikdb/emissions/templates/emissions/soundfile_form.html
panikdb/emissions/templates/emissions/soundfile_form.html
+1
-2
panikdb/static/css/style.css
panikdb/static/css/style.css
+15
-0
panikdb/templates/base.html
panikdb/templates/base.html
+0
-0
panikdb/templates/home.html
panikdb/templates/home.html
+29
-0
panikdb/templates/registration/login.html
panikdb/templates/registration/login.html
+1
-1
panikdb/templates/search/search.html
panikdb/templates/search/search.html
+1
-1
panikdb/urls.py
panikdb/urls.py
+2
-1
panikdb/views.py
panikdb/views.py
+14
-0
No files found.
panikdb/emissions/models.py
View file @
d4aaf49f
...
...
@@ -80,6 +80,18 @@ class Emission(models.Model):
def
get_schedules
(
self
):
return
Schedule
.
objects
.
filter
(
emission
=
self
).
order_by
(
'datetime'
)
def
get_sorted_emissions
(
self
):
return
self
.
episode_set
.
select_related
().
extra
(
select
=
{
'first_diffusion'
:
'emissions_diffusion.datetime'
,
},
select_params
=
(
False
,
True
),
where
=
[
'''datetime = (SELECT MIN(datetime)
FROM emissions_diffusion
WHERE episode_id = emissions_episode.id)'''
],
tables
=
[
'emissions_diffusion'
],
).
order_by
(
'-first_diffusion'
)
class
Schedule
(
models
.
Model
,
WeekdayMixin
):
...
...
panikdb/emissions/templates/emissions/category_list.html
View file @
d4aaf49f
{% extends "
panikdb/
base.html" %}
{% extends "base.html" %}
{% block appbar %}
<h2>
Émissions
</h2>
...
...
panikdb/emissions/templates/emissions/days.html
View file @
d4aaf49f
{% extends "
panikdb/
base.html" %}
{% extends "base.html" %}
{% block appbar %}
<h2>
Émissions
</h2>
...
...
panikdb/emissions/templates/emissions/emission_detail.html
View file @
d4aaf49f
{% extends "
panikdb/
base.html" %}
{% extends "base.html" %}
{% block appbar %}
<h2>
{{ emission.title }}
...
...
panikdb/emissions/templates/emissions/emission_form.html
View file @
d4aaf49f
{% extends "
panikdb/
base.html" %}
{% extends "base.html" %}
{% block extrascripts %}
<script
src=
"{{ STATIC_URL }}ckeditor/ckeditor/ckeditor.js"
>
...
...
panikdb/emissions/templates/emissions/emission_list.html
View file @
d4aaf49f
{% extends "
panikdb/
base.html" %}
{% extends "base.html" %}
{% block appbar %}
<h2>
Émissions
</h2>
...
...
panikdb/emissions/templates/emissions/episode_detail.html
View file @
d4aaf49f
{% extends "
panikdb/
base.html" %}
{% extends "base.html" %}
{% block appbar %}
<h2>
{{ episode.emission.title }} — {{ episode.title }}
</h2>
...
...
panikdb/emissions/templates/emissions/episode_form.html
View file @
d4aaf49f
{% extends "
panikdb/
base.html" %}
{% extends "base.html" %}
{% block extrascripts %}
<script
src=
"{{ STATIC_URL }}ckeditor/ckeditor/ckeditor.js"
>
...
...
panikdb/emissions/templates/emissions/soundfile_form.html
View file @
d4aaf49f
{% extends "panikdb/base.html" %}
{% extends "base.html" %}
{% block extrascripts %}
<script
src=
"{{ STATIC_URL }}ckeditor/ckeditor/ckeditor.js"
>
...
...
panikdb/static/css/style.css
View file @
d4aaf49f
...
...
@@ -355,6 +355,21 @@ ul.episode-list {
border-width
:
1px
0
;
}
a
.big-friendly-button
{
text-decoration
:
none
;
display
:
inline-block
;
padding
:
1ex
;
margin
:
0
1em
;
color
:
#ffffff
;
background
:
#4690d6
;
border
:
1px
solid
#2a567f
;
font-weight
:
bold
;
}
a
.big-friendly-button
:hover
{
background
:
#2a567f
;
}
[
class
^=
"icon-"
]
:before
,
[
class
*=
" icon-"
]
:before
{
font-family
:
FontAwesome
;
font-weight
:
normal
;
...
...
panikdb/templates/
panikdb/
base.html
→
panikdb/templates/base.html
View file @
d4aaf49f
File moved
panikdb/templates/home.html
0 → 100644
View file @
d4aaf49f
{% extends "base.html" %}
{% block content %}
{% for emission in emissions %}
<h2>
{{ emission.title }}
</h2>
<a
class=
"big-friendly-button"
href=
"{% url 'episode-add' emission_slug=emission.slug %}"
>
Ajouter un épisode
</a>
<a
class=
"big-friendly-button"
href=
"#"
>
Ajouter une actu
</a>
<a
class=
"big-friendly-button"
href=
"{% url 'emission-update' slug=emission.slug %}"
>
Modifier description / image / etc.
</a>
<h4>
Épisodes récents
</h4>
<ul
class=
"episode-list"
>
{% for episode in emission.get_sorted_emissions|slice:":10" %}
<li>
{{ episode.diffusion_set.all.0.datetime|date:"d E o H:i"|lower }}
<br/>
<a
href=
"{% url 'episode-view' emission_slug=emission.slug slug=episode.slug %}"
>
{{ episode.title }}
</a>
{% if episode.has_sound %}
<span
class=
"icon-music"
/>
{%endif%}
</li>
{% endfor %}
</ul>
{% endfor %}
{% endblock %}
panikdb/templates/registration/login.html
View file @
d4aaf49f
{% extends "
panikdb/
base.html" %}
{% extends "base.html" %}
{% load url from future %}
{% block content %}
...
...
panikdb/templates/search/search.html
View file @
d4aaf49f
{% extends '
panikdb/
base.html' %}
{% extends 'base.html' %}
{% block content %}
<h2>
Recherche
</h2>
...
...
panikdb/urls.py
View file @
d4aaf49f
...
...
@@ -20,10 +20,11 @@ from urls_utils import decorated_includes
sqs
=
SearchQuerySet
().
facet
(
'categories'
).
facet
(
'tags'
)
urlpatterns
=
patterns
(
''
,
url
(
r'^$'
,
RedirectView
.
as_view
(
url
=
reverse_lazy
(
'emission-list'
))
),
url
(
r'^$'
,
'panikdb.views.home'
,
name
=
'home'
),
(
r'^ckeditor/'
,
include
(
'ckeditor.urls'
)),
url
(
r'^search/'
,
search_view_factory
(
view_class
=
FacetedSearchView
,
form_class
=
FacetedSearchForm
,
searchqueryset
=
sqs
),
name
=
'haystack_search'
),
url
(
r'^emissions/$'
,
RedirectView
.
as_view
(
url
=
reverse_lazy
(
'home'
))),
url
(
r'^emissions/'
,
decorated_includes
(
login_required
,
include
(
emissions_urlpatterns
))),
...
...
panikdb/views.py
0 → 100644
View file @
d4aaf49f
from
django.contrib.auth.decorators
import
login_required
from
django.views.generic.base
import
TemplateView
from
emissions.models
import
Emission
class
Home
(
TemplateView
):
template_name
=
'home.html'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Home
,
self
).
get_context_data
(
**
kwargs
)
context
[
'emissions'
]
=
self
.
request
.
user
.
emissions
.
all
()
return
context
home
=
login_required
(
Home
.
as_view
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment