Revision fe505764
Added by Serghei Mihai over 9 years ago
| corbo/templates/corbo/homepage.html | ||
|---|---|---|
|
{% extends 'corbo/base.html' %}
|
||
|
{% load i18n %}
|
||
|
|
||
|
{% block content %}
|
||
|
<ul class="announces">
|
||
|
{% for object in object_list %}
|
||
|
<li class="{% cycle 'bright' 'bluesky' %}">
|
||
|
<h2>{{ object.title }}</h2>
|
||
|
<div class="text">
|
||
|
{{ object.text|safe }}
|
||
|
</div>
|
||
|
<div class="pub_time">
|
||
|
{% if object.publication_time %}
|
||
|
{% blocktrans with pub_date=object.publication_time|date:'DATETIME_FORMAT' %}
|
||
|
Published on {{ pub_date }}
|
||
|
{% endblocktrans %}
|
||
|
{% endif %}
|
||
|
</div>
|
||
|
<div class="clear"></div>
|
||
|
</li>
|
||
|
{% empty %}
|
||
|
{% trans "No announces published yet" %}
|
||
|
{% endfor %}
|
||
|
</ul>
|
||
|
{% endblock %}
|
||
| corbo/views.py | ||
|---|---|---|
|
from django.core import signing
|
||
|
from django.core.urlresolvers import reverse
|
||
|
from django.views.generic import CreateView, UpdateView, DeleteView, \
|
||
|
ListView, TemplateView
|
||
|
ListView, TemplateView, RedirectView
|
||
|
from django.contrib.syndication.views import Feed
|
||
|
from django.shortcuts import resolve_url
|
||
|
from django.utils.encoding import force_text
|
||
| ... | ... | |
|
return HttpResponseRedirect(next_page)
|
||
|
|
||
|
|
||
|
class HomepageView(ListView):
|
||
|
model = models.Announce
|
||
|
template_name = 'corbo/homepage.html'
|
||
|
class HomepageView(RedirectView):
|
||
|
pattern_name = 'manage'
|
||
|
|
||
|
homepage = HomepageView.as_view()
|
||
|
|
||
Also available in: Unified diff
homepage redirect to backoffice (#12545)