Exemplo n.º 1
0
def contacts(request):
    context = {}
    if request.POST:
        form = LeaveMessageForm(request.POST)
        print form
        if form.is_valid():
            form.save()
            context['notifications_messages']=[_(u"Thank you, we received your message.")]
            form = LeaveMessageForm()
        else:
            context['notifications_messages']=[_(u"Form is not valid!\nPlease correct your errors bellow.")]
    else:
        form = LeaveMessageForm()
    context['form'] = form
    context.update(dict(contacts=[{
                                 "contact": employee,
                                 "skypes": SkypeName.objects.filter(contact=employee),
                                 "numbers": TelephoneNumber.objects.filter(contact=employee),
                                 "emails": Email.objects.filter(contact=employee)}
                                for employee in Employee.objects.all()],
                   office_contacts=[dict(contact=office, skypes=SkypeName.objects.filter(contact=office),
                                         numbers=TelephoneNumber.objects.filter(contact=office),
                                         emails=Email.objects.filter(contact=office),
                                         faxs=FaxNumber.objects.filter(contact=office))
                                    for office in OfficeContact.objects.all()])
    )
    context.update(set_required_data(request))

    return render_to_response('contacts.html',
                          context,
                          context_instance=RequestContext(request))
Exemplo n.º 2
0
def certificates(request):
    list_certificates = Certificate.objects.all()
    context = {
        "certificates": zip(range(list_certificates.__len__()),
                            list_certificates)
    }
    context.update(set_required_data(request))
    return render_to_response('certificates.html',
                              context,
                              context_instance=RequestContext(request))
Exemplo n.º 3
0
def main(request):
    photos = PhotoGallery.objects.filter(add_this_photo_to_slide=True)
    context = {
        "partners": Partner.objects.all(),
        "slides": photos,
        "main_page": MainPage.objects.all()[0]
    }
    context.update(set_required_data(request))
    return render_to_response('index.html',
                              context,
                              context_instance=RequestContext(request))
Exemplo n.º 4
0
def main(request):
    photos = PhotoGallery.objects.filter(add_this_photo_to_slide=True)
    context = {
        "partners": Partner.objects.all(),
        "slides": photos,
        "main_page": MainPage.objects.all()[0]
    }
    context.update(set_required_data(request))
    return render_to_response(
        'index.html',
        context,
        context_instance=RequestContext(request))
Exemplo n.º 5
0
def services(request):
    points = list(TransportationsGeography.objects.all())
    context = {
        "main_services": Service.objects.filter(is_fundamental_service=True),
        "extra_services": Service.objects.filter(is_fundamental_service=False),
        "transporation_points": zip(range(points.__len__()), points),
        "center_points": settings.GOOGLE_MAPS_SETTINGS,
    }
    context.update(settings.GOOGLE_MAPS_SETTINGS)
    context.update(set_required_data(request))
    return render_to_response('services.html',
                          context,
                          context_instance=RequestContext(request))
Exemplo n.º 6
0
def gallery(request):
    photos = PhotoGallery.objects.filter(add_this_photo_to_gallery=True)
    videos = []
    for i in VideoGallery.objects.all():
        i_to_dict = i.to_dict()
        x = VideoFile.objects.filter(video=i).values()
        i_to_dict.update({'videos': x})
        videos += [i_to_dict]

    context = {
        "photos": zip(range(1, len(photos)+1), photos),
        "videos": videos
    }
    print context
    context.update(set_required_data(request))
    return render_to_response('gallery.html',
                          context,
                          context_instance=RequestContext(request))
Exemplo n.º 7
0
def gallery(request):
    photos = PhotoGallery.objects.filter(add_this_photo_to_gallery=True)
    videos = []
    for i in VideoGallery.objects.all():
        i_to_dict = i.to_dict()
        x = VideoFile.objects.filter(video=i).values()
        i_to_dict.update({'videos': x})
        videos += [i_to_dict]

    context = {
        "photos": zip(range(1,
                            len(photos) + 1), photos),
        "videos": videos
    }
    print context
    context.update(set_required_data(request))
    return render_to_response('gallery.html',
                              context,
                              context_instance=RequestContext(request))
Exemplo n.º 8
0
def certificates(request):
    list_certificates = Certificate.objects.all()
    context = {"certificates" : zip(range(list_certificates.__len__()), list_certificates)}
    context.update(set_required_data(request))
    return render_to_response('certificates.html', context,
                          context_instance=RequestContext(request))