Revision ec06b07c ui/views.py

b/ui/views.py
2 2
from django.utils.translation import gettext_lazy as _
3 3
from django.template import Context, loader
4 4
from django.http import HttpResponse
5
from django.utils.translation import get_language
5 6

  
6 7
DEFAULT_IMAGES = [
7 8
              {'id': 'ubuntu-10.10-x86_64-server', 'type':'standard', 'title': 'Ubuntu 10.10 server 64bit', 'description': _('Apache, MySQL, php5 preinstalled'), 'size': '834', 'logo':'ubuntu.png'}, 
......
28 29
    return HttpResponse(t.render(Context(context)))
29 30

  
30 31
def home(request):
31
    context = { 'project' : '+nefo', 'request': request }
32
    context = { 'project' : '+nefo', 'request': request, 'current_lang' : get_language() or 'en' }
32 33
    return template('home', context)
33 34

  
34 35
def instances(request):
35
    context = {'nodes': DEFAULT_NODES, 'images': DEFAULT_IMAGES}
36
    context = {}
36 37
    return template('instances', context)
37

  
38
def alt_instances(request):
39
    context = {'nodes': DEFAULT_NODES, 'images': DEFAULT_IMAGES}
40
    return template('alt_instances', context)
41 38
   
42 39
def instances_list(request):
43
    context = {'nodes': DEFAULT_NODES, 'images': DEFAULT_IMAGES}
40
    context = {}
44 41
    return template('list', context)
45 42

  
46 43
def images(request): 
47
    context = {'images': DEFAULT_IMAGES}
44
    context = {}
48 45
    return template('images', context)
49 46

  
50 47
def disks(request):
51
    context = { 'project' : '+nefo' }
48
    context = {}
52 49
    return template('disks', context)
53 50

  
54 51
def networks(request):
55
    context = { 'project' : '+nefo' }
52
    context = {}
56 53
    return template('networks', context)

Also available in: Unified diff