-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviews.py
51 lines (39 loc) · 1.21 KB
/
views.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
View classes for presenting Deis web pages.
"""
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.shortcuts import render
from api.models import Formation
@login_required
def account(request):
"""Return the user's account web page."""
return render(request, 'web/account.html', {
'page': 'account',
})
@login_required
def dashboard(request):
"""Return the user's dashboard web page."""
formations = Formation.objects.filter(owner=request.user)
return render(request, 'web/dashboard.html', {
'page': 'dashboard',
'formations': formations,
})
@login_required
def formations(request):
"""Return the user's formations web page."""
formations = Formation.objects.filter(owner=request.user)
return render(request, 'web/formations.html', {
'page': 'formations',
'formations': formations
})
@login_required
def docs(request):
"""Return the documentation index."""
return redirect('http://docs.deis.io/')
@login_required
def support(request):
"""Return the support ticket system home page."""
return render(request, 'web/support.html', {
'page': 'support',
})