from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required


@login_required
def index(request):
    return render_to_response('members/index.html')


@login_required
def infos(request):
    if hasattr(request.user, 'member'):
        member = request.user.member
    else:
        #TODO: logger: ce cas ne devrait pas exister
        member = None

    return render_to_response('members/infos.html', {'member': member},
                              context_instance=RequestContext(request))


@login_required
def abos(request):
    return render_to_response('members/abo.html')


@login_required
def contact(request):
    return render_to_response('members/contact.html')

