Ejemplo n.º 1
0
def sandom(request):
    c = dict(feedback_form=forms.FeedbackForm(),
             sliders=models.SliderItem.objects.all(),
             title='Санаторий на дому',
             tours=models.Tour.objects.filter(active_for_right=True),
             articles=models.Article.objects.filter(active_for_right=True))
    return render(request, 'elittour/sandom.html', c)
Ejemplo n.º 2
0
def strashovka(request):
    c = dict(feedback_form=forms.FeedbackForm(),
             sliders=models.SliderItem.objects.all(),
             title='Туристическое страхование',
             tours=models.Tour.objects.filter(active_for_right=True),
             articles=models.Article.objects.filter(active_for_right=True))
    return render(request, 'elittour/strashovka.html', c)
Ejemplo n.º 3
0
def kredit(request):
    c = dict(feedback_form=forms.FeedbackForm(),
             sliders=models.SliderItem.objects.all(),
             title='Продажа туров в кредит',
             tours=models.Tour.objects.filter(active_for_right=True),
             articles=models.Article.objects.filter(active_for_right=True))
    return render(request, 'elittour/kredit.html', c)
Ejemplo n.º 4
0
def transfer(request):
    c = dict(feedback_form=forms.FeedbackForm(),
             sliders=models.SliderItem.objects.all(),
             title='Трансфер в аэропорт и на железнодорожный вокзал',
             tours=models.Tour.objects.filter(active_for_right=True),
             articles=models.Article.objects.filter(active_for_right=True))
    return render(request, 'elittour/transfer.html', c)
Ejemplo n.º 5
0
def avia(request):
    c = dict(feedback_form=forms.FeedbackForm(),
             sliders=models.SliderItem.objects.all(),
             title='Регистрация на рейс',
             tours=models.Tour.objects.filter(active_for_right=True),
             articles=models.Article.objects.filter(active_for_right=True))
    return render(request, 'elittour/avia.html', c)
Ejemplo n.º 6
0
def bilet(request):
    c = dict(feedback_form=forms.FeedbackForm(),
             sliders=models.SliderItem.objects.all(),
             title='Продажа авиа и железнодорожных билетов',
             tours=models.Tour.objects.filter(active_for_right=True),
             articles=models.Article.objects.filter(active_for_right=True))
    return render(request, 'elittour/bilet.html', c)
Ejemplo n.º 7
0
def viza(request):
    c = dict(feedback_form=forms.FeedbackForm(),
             sliders=models.SliderItem.objects.all(),
             title='Оформление визы',
             tours=models.Tour.objects.filter(active_for_right=True),
             articles=models.Article.objects.filter(active_for_right=True))
    return render(request, 'elittour/viza.html', c)
Ejemplo n.º 8
0
def zagranpasport(request):
    c = dict(feedback_form=forms.FeedbackForm(),
             sliders=models.SliderItem.objects.all(),
             title='Оформление загранпаспорта',
             tours=models.Tour.objects.filter(active_for_right=True),
             articles=models.Article.objects.filter(active_for_right=True))
    return render(request, 'elittour/zagranpasport.html', c)
Ejemplo n.º 9
0
def create_person_request(request):
    """ Ajax """
    c = {}
    form = forms.FeedbackForm(request.POST or None)
    if form.is_valid():
        # print form.cleaned_data
        name = form.cleaned_data.get('name')
        email = form.cleaned_data.get('email')
        phone_number = form.cleaned_data.get('phone_number')
        message = form.cleaned_data.get('message')
        models.PersonRequest.objects.create(
            name=name,
            email=email,
            phone_number=phone_number,
            message=message,
        )
        subject = u'ЗАЯВКА С САЙТА'
        message = u'телефон: %s \n Имя: %s \n Email: %s \n Сообщение: %s' % (
            phone_number, name, email, message)
        send_mail(subject,
                  message,
                  '*****@*****.**',
                  ['*****@*****.**', '*****@*****.**'],
                  fail_silently=False)
        return HttpResponse('Ok')
    c['feedback_form'] = form
    return render(request, 'elittour/items/feedbackform.html', c)
Ejemplo n.º 10
0
 def get_context_data(self, **kwargs):
     c = {
         u'feedback_form':
         forms.FeedbackForm(),
         u'sliders':
         models.SliderItem.objects.all(),
         u'title':
         self.title,
         u'tours':
         models.Tour.objects.filter(
             active_for_right=True).order_by('number'),
         u'articles':
         models.Article.objects.filter(
             active_for_right=True).order_by('number')
     }
     try:
         self.category = models.Category.objects.get(
             name=self.category_name)
         article = models.Article.objects.filter(category=self.category,
                                                 show=True)[0]
         c[u'article'] = article
         print self.category
     finally:
         return c