0001-general-change-homepage-to-redirect-to-manage-11205.patch
passerelle/templates/passerelle/homepage.html | ||
---|---|---|
1 |
{% extends "passerelle/base.html" %} |
|
2 |
{% load i18n %} |
|
3 |
{% load url from future %} |
|
4 | ||
5 |
{% block page-title %} |
|
6 |
Passerelle |
|
7 |
{% endblock %} |
|
8 | ||
9 |
{% block appbar %} |
|
10 |
<h2>{% trans 'Welcome' %}</h2> |
|
11 |
{% endblock %} |
|
12 | ||
13 |
{% block content %} |
|
14 | ||
15 |
<p> |
|
16 |
{% blocktrans %} |
|
17 |
Passerelle provides an uniform access to multiple data sources and services. |
|
18 |
{% endblocktrans %} |
|
19 |
</p> |
|
20 | ||
21 |
<ul class="apps"> |
|
22 |
{% for a in apps %} |
|
23 |
<li class="{{ a.get_icon_class }}"><a href="{{ a.get_absolute_url }}">{{ a.get_verbose_name }}</a></li> |
|
24 |
{% endfor %} |
|
25 |
</ul> |
|
26 | ||
27 |
{% endblock %} |
passerelle/views.py | ||
---|---|---|
2 | 2 |
from django.contrib.auth import logout as auth_logout |
3 | 3 |
from django.contrib.auth import views as auth_views |
4 | 4 |
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseRedirect, Http404 |
5 |
from django.views.generic import View, TemplateView, CreateView, DeleteView, UpdateView |
|
5 |
from django.views.generic import View, RedirectView, TemplateView, CreateView, DeleteView, UpdateView
|
|
6 | 6 |
from django.views.generic.detail import SingleObjectMixin |
7 | 7 |
from django.conf import settings |
8 | 8 |
from django.db import models |
... | ... | |
44 | 44 |
return HttpResponseRedirect(next_page) |
45 | 45 | |
46 | 46 | |
47 |
class HomePageView(TemplateView): |
|
48 |
template_name = 'passerelle/homepage.html' |
|
49 | ||
50 |
def get_context_data(self, **kwargs): |
|
51 |
context = super(HomePageView, self).get_context_data(**kwargs) |
|
52 |
# get all app instances |
|
53 |
context['apps'] = [] |
|
54 |
for app in get_all_apps(): |
|
55 |
context['apps'].extend(app.objects.all()) |
|
56 |
return context |
|
47 |
class HomePageView(RedirectView): |
|
48 |
pattern_name = 'manage-home' |
|
57 | 49 | |
58 | 50 | |
59 | 51 |
class ManageView(TemplateView): |
60 |
- |