main.py 1.12 KB
Newer Older
Mathieu Rodic's avatar
Mathieu Rodic committed
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
from gargantext.util.http import *

import datetime
from gargantext.util.generators import paragraphs, credits


def home(request):
    '''
    Home describes the platform.
    A video draws the narratives.
    If not logged a project test is shown.
    '''
    t = get_template('pages/main/home.html')
    user = request.user
    date = datetime.datetime.now()
    html = t.render(Context({
        'debug': settings.DEBUG,
        'user': user,
        'date': date,
        'paragraph_gargantua': paragraphs.gargantua(),
        'paragraph_lorem' : paragraphs.lorem(),
        'paragraph_tutoreil': paragraphs.tutoreil(),
    }))
    return HttpResponse(html)


def about(request):
    '''About Gargantext, its team and sponsors
    '''
    template    = get_template('pages/main/about.html')
    user        = request.user
    date        = datetime.datetime.now()

    html = template.render(Context({
        'user': user,
        'date': date,
        'team': credits.members(),
        'institutions': credits.institutions(),
        'labos': credits.labs(),
        'grants': credits.grants(),
    }))

    return HttpResponse(html)