Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
radiopanik
panikweb
Commits
10bd9017
Commit
10bd9017
authored
Aug 26, 2013
by
Simon Daron
Browse files
BuNews & Program on Home
parent
e472d6bd
Changes
5
Hide whitespace changes
Inline
Side-by-side
panikweb/views.py
View file @
10bd9017
...
@@ -240,8 +240,16 @@ class Home(TemplateView):
...
@@ -240,8 +240,16 @@ class Home(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Home
,
self
).
get_context_data
(
**
kwargs
)
context
=
super
(
Home
,
self
).
get_context_data
(
**
kwargs
)
context
[
'newsImaged'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-datetime'
)[:
10
])
context
[
'newsImaged'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-datetime'
)[:
3
])
context
[
'newsImaged2'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-datetime'
)[:
10
])
context
[
'news'
]
=
list
(
NewsItem
.
objects
.
all
().
order_by
(
'-datetime'
)[:
36
])
context
[
'emissions'
]
=
list
(
Emission
.
objects
.
filter
(
archived
=
False
).
order_by
(
'title'
))
context
[
'emissions'
]
=
list
(
Emission
.
objects
.
filter
(
archived
=
False
).
order_by
(
'title'
))
schedules
=
Schedule
.
objects
.
select_related
().
order_by
(
'datetime'
)
days
=
[]
for
day
in
range
(
7
):
days
.
append
({
'schedules'
:
[
x
for
x
in
schedules
if
x
.
is_on_weekday
(
day
+
1
)],
'datetime'
:
datetime
(
2007
,
1
,
day
+
1
)})
context
[
'days'
]
=
days
return
context
return
context
home
=
Home
.
as_view
()
home
=
Home
.
as_view
()
...
...
panikweb_templates/static/css/specifics.css
View file @
10bd9017
...
@@ -105,7 +105,6 @@ body{
...
@@ -105,7 +105,6 @@ body{
color
:
white
;
color
:
white
;
}
}
#Main
{
#Main
{
min-height
:
30em
;
color
:
#333
;
color
:
#333
;
background-color
:
white
;
background-color
:
white
;
}
}
...
@@ -494,24 +493,24 @@ body{
...
@@ -494,24 +493,24 @@ body{
/****************************************************/
/****************************************************/
/**** Home ****/
/**** Home ****/
@media
screen
and
(
max-width
:
800px
){
@media
screen
and
(
max-width
:
800px
){
#Home
.news
.logo
{
#Home
.news
Roll
.logo
{
max-width
:
100px
;
max-width
:
100px
;
}
}
}
}
@media
screen
and
(
max-width
:
600px
){
@media
screen
and
(
max-width
:
600px
){
#Home
.news
.logo
{
#Home
.news
Roll
.logo
{
max-width
:
50px
;
max-width
:
50px
;
}
}
}
}
/****************************************************/
/****************************************************/
/**** PROGRAM ****/
/**** PROGRAM ****/
#P
rogram
.tabs
nav
ul
li
{
.p
rogram.tabs
nav
ul
li
{
display
:
table-cell
;
display
:
table-cell
;
width
:
14%
;
width
:
14%
;
text-align
:
center
;
text-align
:
center
;
}
}
#P
rogram
.dateBloc
{
.p
rogram
.dateBloc
{
float
:
left
;
float
:
left
;
padding-top
:
1em
;
padding-top
:
1em
;
}
}
...
...
panikweb_templates/templates/home.html
View file @
10bd9017
{% extends "base.html" %}
{% extends "base.html" %}
{% load thumbnails %}
{% load thumbnails %}
{% load paniktags %}
{% block bodyID %}Home{% endblock %}
{% block bodyID %}Home{% endblock %}
{% block nav %}{% endblock %}
{% block nav %}{% endblock %}
{% block title %}{% endblock %}
{% block title %}{% endblock %}
{% block main %}
{% block main %}
<div
class=
"news"
>
{% if program %}dfsdfsdf
<div
class=
"wrapper padded news"
>
{{ program }}
{% endif %}
<div
class=
"news padded"
>
<div
class=
"wrapper"
>
<h2
class=
""
>
News
</h2>
<h2
class=
""
>
News
</h2>
</div>
<div
class=
"wrapper"
>
<ul
class=
"custom list news cf"
>
{% for NewsItem in newsImaged %}
<li
class=
"item num-{{forloop.counter}}"
>
{% if NewsItem.slug == newsImaged.0.slug %}
{% news_inline content=NewsItem klass="special" logo="large" %}
{% elif NewsItem.slug == newsImaged.1.slug or NewsItem.slug == newsImaged.2.slug%}
{% news_inline content=NewsItem klass="special" logo="medium"%}
{% else %}
{% endif %}
</li>
{% endfor %}
</ul>
</div>
<hr
/>
<div
class=
"wrapper padded news newsRoll"
>
<ul
class=
"custom inline ellipsis"
>
<ul
class=
"custom inline ellipsis"
>
{% for content in newsImaged %}
{% for content in newsImaged
2
%}
<li
class=
"item"
>
<li
class=
"item"
>
<a
class=
"inBlock news"
href=
"{% url 'news-view' slug=content.slug %}"
>
<a
class=
"inBlock news"
href=
"{% url 'news-view' slug=content.slug %}"
>
{% if content.image %}
{% if content.image %}
<img
class=
"logo"
src=
"{{ content.image|thumbnail:'1
5
0x1
5
0' }}"
/>
<img
class=
"logo"
src=
"{{ content.image|thumbnail:'1
0
0x1
0
0' }}"
/>
{% endif %}
{% endif %}
</a>
</a>
</li>
</li>
{% endfor %}
{% endfor %}
</ul>
</ul>
</div>
</div>
<hr
/>
<div
class=
"wrapper"
>
<ul
class=
"news columns padded"
>
{% for NewsItem in news %}
<li
class=
"item ellipsis small "
>
<a
href=
"{% url 'news-view' slug=NewsItem.slug %}"
>
<span
class=
"title"
><strong>
{{ NewsItem.datetime|date:"D m/M" }}
</strong>
-
{{ NewsItem.title }}
</span>
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
<div
class=
"program padded"
>
<div
class=
"wrapper"
>
<h2>
Cette semaine sur Panik
</h2>
<div
class=
"program tabs"
data-tab-about=
"#ProgramContent"
>
<nav
class=
""
>
<ul
class=
"days custom distributed"
>
{% for day in days %}
<li
class=
""
><button
data-tab=
"#Program-tabs-{{ day.datetime|date:"
w
"
}}"
>
{{ day.datetime|date:"D d" }}
</button></li>
{% endfor %}
</ul>
</nav>
</div>
<div
id=
"ProgramContent"
>
{% for day in days %}
<div
data-tabbed=
"true"
class=
"content padded"
id=
"Program-tabs-{{ day.datetime|date:"
w
"
}}"
>
<ul
class=
"custom emission-list list"
>
{% if day.schedules %}
{% for schedule in day.schedules %}
<li>
<div
class=
"date dateBloc"
>
<div
class=
"time"
>
{{ schedule.datetime|date:"H:i" }}
</div>
</div>
<div
style=
"margin-left:7em;"
>
{% include "emissions/inline.html" with emission=schedule.emission %}
</div>
</li>
{% endfor %}
{% else %}
<li>
Non stop
</li>
{% endif %}
</ul>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% endblock %}
{% endblock %}
{% block links %}
{% block links %}
<div
class=
"wrapper padded"
>
<div
class=
"wrapper padded"
>
...
...
panikweb_templates/templates/news.html
View file @
10bd9017
...
@@ -41,8 +41,8 @@
...
@@ -41,8 +41,8 @@
<li
class=
"item ellipsis small "
>
<li
class=
"item ellipsis small "
>
<a
href=
"{% url 'news-view' slug=NewsItem.slug %}"
>
<a
href=
"{% url 'news-view' slug=NewsItem.slug %}"
>
<span
class=
"title"
><strong>
{{ NewsItem.datetime|date:"D m/M" }}
</strong>
-
{{ NewsItem.title }}
</span>
<span
class=
"title"
><strong>
{{ NewsItem.datetime|date:"D m/M" }}
</strong>
-
{{ NewsItem.title }}
</span>
</a>
</a>
</li>
</li>
{% endfor %}
{% endfor %}
</ul>
</ul>
</div>
</div>
...
...
panikweb_templates/templates/search/search.html
View file @
10bd9017
...
@@ -55,10 +55,11 @@
...
@@ -55,10 +55,11 @@
{% block main %}
{% block main %}
<div
class=
"wrapper
padded
"
>
<div
class=
"wrapper"
>
{% if not query %}
{% if not query %}
{% else %}
{% else %}
<div
class=
"padded"
>
{% if not page.object_list %}
{% if not page.object_list %}
<div
class=
"big error padded center"
>
Sorry, no result with your query!
</div>
<div
class=
"big error padded center"
>
Sorry, no result with your query!
</div>
{% endif %}
{% endif %}
...
@@ -84,6 +85,7 @@
...
@@ -84,6 +85,7 @@
<a
class=
"button big right"
href=
"?q={{ query }}&page={{ page.next_page_number }}"
>
Résultats suivants
»
</a>
<a
class=
"button big right"
href=
"?q={{ query }}&page={{ page.next_page_number }}"
>
Résultats suivants
»
</a>
</div>
</div>
{% endif %}
{% endif %}
</div>
{% endif %}
{% endif %}
</div>
</div>
{% endblock %}
{% endblock %}
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