Esempio n. 1
0
 def get(self, request, *args, **kwargs):
     client_instance = client_check(request.user)
     response = {
         'client_img': load_client_img(client_instance),
         'data': cv_page_get(client_instance),
     }
     return render(request, self.template_name, response)
Esempio n. 2
0
 def get(self, request, *args, **kwargs):
     recruit_instance = recruit_check(request.user)
     response = {
         'recruit_img': load_client_img(recruit_instance),
         "data": recruit_experience_page_get(recruit_instance),
     }
     return render(request, self.template_name, response)
Esempio n. 3
0
def recruit_main_page(request):  # TeamRome
    recruit_instance = recruit_check(request.user)
    response = {'recruit_img': load_client_img(recruit_instance),
                'data': 'foo()',
                }
    return render(request, template_name='recruit/recruit_main_template.html',
                  context=response)
Esempio n. 4
0
 def get(self, request, *args, **kwargs):
     recruit_instance = recruit_check(request.user)
     response = {'recruit_img': load_client_img(recruit_instance),
                 'form': RecruitUploadImgForm(),
                 }
     return render(request=request, template_name=self.template_name,
                   context=response)
Esempio n. 5
0
 def get(self, request):
     client = get_object_or_404(Client, user_client=request.user)
     resumes = CV.objects.filter(client_cv=client)
     client_instance = client_check(request.user)
     return render(request, 'client/client_resumes.html',
                   context={'resumes': resumes,
                            'client_img': load_client_img(client_instance)})
Esempio n. 6
0
def client_main_page(request):  # !!!!!!!!!!!!!!!!!!!!!Alert
    response = csrf(request)

    readtask = len(Tasks.objects.filter(user=request.user, readtask=False))
    chat = Chat.objects.get(members=request.user)
    unread_messages = len(
        Message.objects.filter(chat=chat,
                               is_read=False).exclude(author=request.user))
    settings = Settings.objects.get(user=request.user)
    context = {
        'unread_messages': unread_messages,
        'readtask': readtask,
        'settings': settings
    }

    # Poland
    resumes = Resume.objects.all()
    suggestions = 0
    for resume in resumes:
        suggestions += resume.notification.count()
    response['unread_suggestions'] = suggestions
    client_instance = client_check(request.user)
    response['client_img'] = load_client_img(client_instance)
    context.update(response)
    print(context['unread_suggestions'])
    return render(request=request,
                  template_name='client/main_template_client.html',
                  context=context)
Esempio n. 7
0
def settings_menu(request):
    settings = Settings.objects.get(user=request.user)
    context = {'settings': settings, }
    client_instance = client_check(request.user)
    context['client_img'] = load_client_img(client_instance)
    return render(request=request, template_name='client/client_settings.html',
                  context=context)
Esempio n. 8
0
def client_main_page(request):  # !!!!!!!!!!!!!!!!!!!!!Alert
    response = csrf(request)
    # Poland
    try:
        client = Client.objects.get(user_client=request.user)
    except Client.DoesNotExist:
        Client.objects.create(user_client=request.user)
        client = Client.objects.get(user_client=request.user)
    resumes = CV.objects.filter(client_cv=client)  # Poland
    suggestions = 0  # Poland
    for resume in resumes:  # Poland
        suggestions += resume.notification.count()
    readtask = len(Tasks.objects.filter(user=request.user, readtask=False))
    readinterview = len(
        JobInterviews.objects.filter(client=client, readinterview=False))
    chat = Chat.objects.get(members=request.user)
    unread_messages = len(
        Message.objects.filter(chat=chat, is_read=False).exclude(
            author=request.user))
    settings = Settings.objects.get(user=request.user)
    context = {'unread_messages': unread_messages, 'readtask': readtask,
               'settings': settings,
               'readinterview': readinterview}

    # Poland
    response['unread_suggestions'] = suggestions
    client_instance = client_check(request.user)
    response['client_img'] = load_client_img(client_instance)
    context.update(response)
    # print(context['unread_suggestions'])
    return render(request=request,
                  template_name='client/main_template_client.html',
                  context=context)
Esempio n. 9
0
 def get(self, request, *args, **kwargs):
     client_instance = client_check(request.user)
     response = {'client_img': load_client_img(client_instance),
                 'data': cv_page_get(client_instance),
                 }  # сюда влетел словарь который сформировался в pages_get
     return render(request, self.template_name,
                   response)  # а здесь он залетел в соответствующий
Esempio n. 10
0
 def get(self, request, *args, **kwargs):
     recruit_instance = recruit_check(request.user)
     response = {'recruit_img': load_client_img(recruit_instance),
                 'data': skills_page_get(recruit_instance),
                 }
     return render(request=request, template_name=self.template_name,
                   context=response)
Esempio n. 11
0
 def get(self, request, *args, **kwargs):
     client_instance = client_check(request.user)
     response = {'client_img': load_client_img(client_instance),
                 'data': show_profile(client_instance)
                 }
     return render(request=request, template_name=self.template_name,
                   context=response)
Esempio n. 12
0
def client_profile(request):
    client_instance = client_check(request.user)
    response = {
        'client_img': load_client_img(client_instance),
    }
    return render(request=request,
                  template_name='client/client_profile.html',
                  context=response)
Esempio n. 13
0
def tasks(request):
    task = Tasks.objects.filter(user=request.user, status=False)
    task_false = Tasks.objects.filter(user=request.user, status=True)  # status=False)
    task_false = sorted(task_false, key=lambda x: x.endtime, reverse=True)
    client_instance = client_check(request.user)
    return render(request, 'client/tasks.html', context={'task': task,
                                                         'task_false': task_false,
                                                         'client_img': load_client_img(client_instance)})
Esempio n. 14
0
 def get(self, request):
     opinions = Opinion.objects.all()
     form = OpinionForm()
     client_instance = client_check(request.user)
     return render(request, 'opinion/opinion_create.html',
                   context={'form': form,
                            'client_img': load_client_img(client_instance),
                            'opinions': opinions})
Esempio n. 15
0
def resumes_list(request):
    resumes = Resume.objects.all()
    client_instance = client_check(request.user)
    return render(request,
                  'client/client_resumes.html',
                  context={
                      'resumes': resumes,
                      'client_img': load_client_img(client_instance)
                  })
Esempio n. 16
0
def help_list(request):
    faqs = Help.objects.all()
    client_instance = client_check(request.user)
    return render(request,
                  'client/help.html',
                  context={
                      'faqs': faqs,
                      'client_img': load_client_img(client_instance)
                  })
Esempio n. 17
0
    def get(self, request, *args, **kwargs):
        client_instance = client_check(request.user)
        load_data = education_page_get(client_instance)['cl_edu']

        response = {'client_img': load_client_img(client_instance),
                    'edu_form': EducationFormSet(initial=load_data),
                    'certificate': CertificateFormSet(initial=load_data),
                    # 'certificate': CertificateForm(initial=load_data[0]),
                    'sab_class_form': SabClassFormSet(initial=load_data),
                    }
        return render(request, self.template_name, response)
Esempio n. 18
0
    def post(self, request):
        form = OpinionForm(request.POST)

        if form.is_valid():
            new_opinion = form.save(commit=False)
            new_opinion.user = request.user
            new_opinion.save()
            return redirect('opinion_detail', pk=new_opinion.pk)
        client_instance = client_check(request.user)
        return render(request, 'opinion/opinion_create.html', context={'form': form,
                                                                       'client_img': load_client_img(client_instance)})
Esempio n. 19
0
def interviews_list(request):
    client = get_object_or_404(Client, user_client=request.user)
    interviews = JobInterviews.objects.filter(client=client, status=False)
    interviews_false = JobInterviews.objects.filter(client=client,
                                                    status=True)  # False
    interviews_false = sorted(interviews_false,
                              key=lambda x: x.period_of_execution,
                              reverse=True)
    client_instance = client_check(request.user)

    return render(request, 'client/interviews.html',
                  context={'interviews': interviews,
                           'interviews_false': interviews_false,
                           'client_img': load_client_img(client_instance)})
Esempio n. 20
0
    def get(self, request):
        try:
            chat = Chat.objects.get(members=request.user)
            if request.user in chat.members.all():
                chat.message_set.filter(is_read=False).exclude(author=request.user).update(is_read=True)
            else:
                chat = None
        except Chat.DoesNotExist:
            chat = None

        unread_messages = len(Message.objects.filter(chat=chat, is_read=False).exclude(author=request.user))
        context = {'user_profile': request.user,
                   'unread_messages': unread_messages,
                   'chat': chat,
                   'form': MessageForm()}
        client_instance = client_check(request.user)
        context['client_img'] = load_client_img(client_instance)
        return render(request, 'client/client_chat.html', context)
Esempio n. 21
0
 def get(self, request, *args, **kwargs):
     recruit_instance = recruit_check(request.user)
     response = {'recruit_img': load_client_img(recruit_instance),
                 'data': 'foo()',
                 }
     return render(request, self.template_name, response)