Statistics
| Branch: | Tag: | Revision:

root / snf-pithos-webclient / pithos_webclient / views.py @ e4ac2d18

History | View | Annotate | Download (2.3 kB)

1 f9fee161 Antony Chazapis
# Copyright 2011-2012 GRNET S.A. All rights reserved.
2 1d23c377 Kostas Papadimitriou
#
3 f9fee161 Antony Chazapis
# Redistribution and use in source and binary forms, with or
4 f9fee161 Antony Chazapis
# without modification, are permitted provided that the following
5 f9fee161 Antony Chazapis
# conditions are met:
6 1d23c377 Kostas Papadimitriou
#
7 f9fee161 Antony Chazapis
#   1. Redistributions of source code must retain the above
8 f9fee161 Antony Chazapis
#      copyright notice, this list of conditions and the following
9 f9fee161 Antony Chazapis
#      disclaimer.
10 1d23c377 Kostas Papadimitriou
#
11 f9fee161 Antony Chazapis
#   2. Redistributions in binary form must reproduce the above
12 f9fee161 Antony Chazapis
#      copyright notice, this list of conditions and the following
13 f9fee161 Antony Chazapis
#      disclaimer in the documentation and/or other materials
14 f9fee161 Antony Chazapis
#      provided with the distribution.
15 1d23c377 Kostas Papadimitriou
#
16 f9fee161 Antony Chazapis
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17 f9fee161 Antony Chazapis
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 f9fee161 Antony Chazapis
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 f9fee161 Antony Chazapis
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20 f9fee161 Antony Chazapis
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 f9fee161 Antony Chazapis
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 f9fee161 Antony Chazapis
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 f9fee161 Antony Chazapis
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 f9fee161 Antony Chazapis
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 f9fee161 Antony Chazapis
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 f9fee161 Antony Chazapis
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 f9fee161 Antony Chazapis
# POSSIBILITY OF SUCH DAMAGE.
28 1d23c377 Kostas Papadimitriou
#
29 f9fee161 Antony Chazapis
# The views and conclusions contained in the software and
30 f9fee161 Antony Chazapis
# documentation are those of the authors and should not be
31 f9fee161 Antony Chazapis
# interpreted as representing official policies, either expressed
32 f9fee161 Antony Chazapis
# or implied, of GRNET S.A.
33 f9fee161 Antony Chazapis
34 1b6fcccf Kostas Papadimitriou
from django.views.generic.simple import direct_to_template
35 f9fee161 Antony Chazapis
36 28adfa0f Kostas Papadimitriou
from pithos_webclient import settings
37 a5f5da3c Kostas Papadimitriou
from pithos_webclient.version import  __version__
38 e4ac2d18 Kostas Papadimitriou
39 1d23c377 Kostas Papadimitriou
from django.conf import settings as django_settings
40 f9fee161 Antony Chazapis
41 e4ac2d18 Kostas Papadimitriou
from synnefo_branding.utils import get_branding_dict
42 e4ac2d18 Kostas Papadimitriou
43 1d23c377 Kostas Papadimitriou
MEDIA_URL = getattr(settings, "PITHOS_WEB_CLIENT_MEDIA_URL", \
44 1d23c377 Kostas Papadimitriou
        getattr(django_settings, "MEDIA_URL", "/static/"))
45 f9fee161 Antony Chazapis
46 e4ac2d18 Kostas Papadimitriou
47 f9fee161 Antony Chazapis
def index(request):
48 e4ac2d18 Kostas Papadimitriou
    branding_settings = get_branding_dict("")
49 28adfa0f Kostas Papadimitriou
    return direct_to_template(request, 'pithos_webclient/index.html', \
50 a5f5da3c Kostas Papadimitriou
            {'settings': settings,
51 a5f5da3c Kostas Papadimitriou
             'MEDIA_URL': MEDIA_URL,
52 a5f5da3c Kostas Papadimitriou
             'CLIENT_VERSION': __version__,
53 e4ac2d18 Kostas Papadimitriou
             'PITHOS_UI_CLOUDBAR_ACTIVE_SERVICE':
54 e4ac2d18 Kostas Papadimitriou
                 settings.CLOUDBAR_ACTIVE_SERVICE,
55 e4ac2d18 Kostas Papadimitriou
             'branding_settings': branding_settings
56 a5f5da3c Kostas Papadimitriou
            })