Revision fe505764
Added by Serghei Mihai over 8 years ago
corbo/templates/corbo/homepage.html | ||
---|---|---|
1 |
{% extends 'corbo/base.html' %} |
|
2 |
{% load i18n %} |
|
3 |
|
|
4 |
{% block content %} |
|
5 |
<ul class="announces"> |
|
6 |
{% for object in object_list %} |
|
7 |
<li class="{% cycle 'bright' 'bluesky' %}"> |
|
8 |
<h2>{{ object.title }}</h2> |
|
9 |
<div class="text"> |
|
10 |
{{ object.text|safe }} |
|
11 |
</div> |
|
12 |
<div class="pub_time"> |
|
13 |
{% if object.publication_time %} |
|
14 |
{% blocktrans with pub_date=object.publication_time|date:'DATETIME_FORMAT' %} |
|
15 |
Published on {{ pub_date }} |
|
16 |
{% endblocktrans %} |
|
17 |
{% endif %} |
|
18 |
</div> |
|
19 |
<div class="clear"></div> |
|
20 |
</li> |
|
21 |
{% empty %} |
|
22 |
{% trans "No announces published yet" %} |
|
23 |
{% endfor %} |
|
24 |
</ul> |
|
25 |
{% endblock %} |
corbo/views.py | ||
---|---|---|
6 | 6 |
from django.core import signing |
7 | 7 |
from django.core.urlresolvers import reverse |
8 | 8 |
from django.views.generic import CreateView, UpdateView, DeleteView, \ |
9 |
ListView, TemplateView |
|
9 |
ListView, TemplateView, RedirectView
|
|
10 | 10 |
from django.contrib.syndication.views import Feed |
11 | 11 |
from django.shortcuts import resolve_url |
12 | 12 |
from django.utils.encoding import force_text |
... | ... | |
44 | 44 |
return HttpResponseRedirect(next_page) |
45 | 45 |
|
46 | 46 |
|
47 |
class HomepageView(ListView): |
|
48 |
model = models.Announce |
|
49 |
template_name = 'corbo/homepage.html' |
|
47 |
class HomepageView(RedirectView): |
|
48 |
pattern_name = 'manage' |
|
50 | 49 |
|
51 | 50 |
homepage = HomepageView.as_view() |
52 | 51 |
|
Also available in: Unified diff
homepage redirect to backoffice (#12545)