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
fb504721
Commit
fb504721
authored
Sep 08, 2013
by
fred
Browse files
update to reflect the change from newsitem datetime to a simple date
parent
4dba776c
Changes
6
Hide whitespace changes
Inline
Side-by-side
panikweb/views.py
View file @
fb504721
...
...
@@ -68,7 +68,7 @@ class EmissionDetailView(DetailView, EmissionMixin):
context
=
super
(
EmissionDetailView
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"Emissions"
context
[
'schedules'
]
=
Schedule
.
objects
.
select_related
().
filter
(
emission
=
self
.
object
).
order_by
(
'datetime'
)
context
[
'news'
]
=
NewsItem
.
objects
.
all
().
filter
(
emission
=
self
.
object
.
id
).
order_by
(
'-date
time
'
)[:
3
]
context
[
'news'
]
=
NewsItem
.
objects
.
all
().
filter
(
emission
=
self
.
object
.
id
).
order_by
(
'-date'
)[:
3
]
context
.
update
(
self
.
get_emission_context
(
self
.
object
))
return
context
emission
=
EmissionDetailView
.
as_view
()
...
...
@@ -376,7 +376,7 @@ class Home(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Home
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"Home"
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
().
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date
time
'
)[
0
:
5
])
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
().
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
0
:
5
])
context
[
'emissions'
]
=
list
(
Emission
.
objects
.
filter
(
archived
=
False
).
order_by
(
'title'
))
schedules
=
Schedule
.
objects
.
select_related
().
order_by
(
'datetime'
)
days
=
[]
...
...
@@ -415,7 +415,7 @@ class NewsItemView(DetailView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
NewsItemView
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"News"
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
().
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date
time
'
)[
0
:
9
])
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
().
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
0
:
9
])
context
[
'categories'
]
=
NewsCategory
.
objects
.
all
()
return
context
newsitemview
=
NewsItemView
.
as_view
()
...
...
@@ -425,8 +425,8 @@ class News(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
News
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"News"
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
().
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date
time
'
)[
0
:
9
])
context
[
'news'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date
time
'
)[
3
:
45
])
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
().
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
0
:
9
])
context
[
'news'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
3
:
45
])
context
[
'categories'
]
=
NewsCategory
.
objects
.
all
()
return
context
...
...
@@ -437,8 +437,8 @@ class NewsArchives(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
NewsArchives
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"News"
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date
time
'
)[
0
:
6
])
context
[
'news'
]
=
list
(
NewsItem
.
objects
.
all
().
order_by
(
'-date
time
'
)[
0
:
600
])
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
0
:
6
])
context
[
'news'
]
=
list
(
NewsItem
.
objects
.
all
().
order_by
(
'-date'
)[
0
:
600
])
context
[
'categories'
]
=
NewsCategory
.
objects
.
all
()
return
context
...
...
panikweb_templates/templates/emissions/newsitem_detail.html
View file @
fb504721
...
...
@@ -7,8 +7,8 @@
<div
class=
"wrapper text"
>
<div
class=
"leftPart"
>
<header>
{% if newsitem.date
time
%}
<div
class=
"date cf center label"
>
{{ newsitem.date
time
|date:"D m/M" }}
</div>
{% if newsitem.date %}
<div
class=
"date cf center label"
>
{{ newsitem.date|date:"D m/M" }}
</div>
{% endif %}
<h3
class=
"squashed title"
>
{{ newsitem.title }}
...
...
panikweb_templates/templates/news.html
View file @
fb504721
...
...
@@ -40,7 +40,7 @@
{% for NewsItem in newsAll %}
<li
class=
"item ellipsis small "
>
<a
href=
"{% url 'news-view' slug=NewsItem.slug %}"
>
<span
class=
"title"
><strong>
{{ NewsItem.date
time
|date:"D m/M" }}
</strong>
-
{{ NewsItem.title }}
</span>
<span
class=
"title"
><strong>
{{ NewsItem.date|date:"D m/M" }}
</strong>
-
{{ NewsItem.title }}
</span>
</a>
</li>
{% endfor %}
...
...
panikweb_templates/templates/news/inline.html
View file @
fb504721
...
...
@@ -9,8 +9,8 @@
{% else %}
<img
class=
"logo left"
width=
"60"
height=
"60"
src=
"{% static "
img
/
defaultLogo.png
"
%}"
/>
{% endif %}
{% if content.date
time
%}
<div
class=
"smooth {% if class == "
special
"
%}
center
marged
{%
endif
%}"
>
{{ content.date
time
|date:"D m/M"|lower }}
</div>
{% if content.date %}
<div
class=
"smooth {% if class == "
special
"
%}
center
marged
{%
endif
%}"
>
{{ content.date|date:"D m/M"|lower }}
</div>
{% endif %}
<div
class=
"content"
>
<h5
class=
"title {% if not class %}ellipsis{% endif %}"
>
{{ content.title }}
</h5>
...
...
panikweb_templates/templates/news/roll.html
View file @
fb504721
...
...
@@ -10,7 +10,7 @@
<a
title=
"{{content.title|striptags|addslashes}}"
class=
"block news relative"
href=
"{% url 'news-view' slug=content.slug %}"
>
{% if content.image %}
<div
class=
"absolute"
>
<h5
class=
"title ellipsis"
>
{{ content.date
time
|date:"D m/m" }}
</h5>
<h5
class=
"title ellipsis"
>
{{ content.date|date:"D m/m" }}
</h5>
</div>
<img
class=
"logo"
src=
"{{ content.image|thumbnail:'240x320' }}"
/>
{% endif %}
...
...
panikweb_templates/templates/news/search_result.html
View file @
fb504721
<a
href=
"{% url 'news-view' slug=result.object.slug %}"
>
<span
class=
"icon-bullhorn"
></span>
<strong>
{{ result.object.title }}
</strong>
{% if result.object.date
time
%}
<div
class=
"smooth"
>
{{ result.object.date
time
|date:"D m/M"|lower }}
</div>
{% if result.object.date %}
<div
class=
"smooth"
>
{{ result.object.date|date:"D m/M"|lower }}
</div>
{% endif %}
</a>
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