28# added statistics

This commit is contained in:
Eligiusz Kurzawa 2021-01-16 09:20:59 +01:00
parent 52d74c36be
commit cd4a4f95e7
4 changed files with 33 additions and 8 deletions

View File

@ -9,6 +9,7 @@ from django.views.generic import TemplateView, ListView, CreateView, DetailView,
from jobs.forms import CreateJobForm, ApplyJobForm, UpdateJobForm from jobs.forms import CreateJobForm, ApplyJobForm, UpdateJobForm
from jobs.models import Job, Category from jobs.models import Job, Category
from users.models import Account, Profile
class HomeView(ListView): class HomeView(ListView):
@ -20,6 +21,10 @@ class HomeView(ListView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(HomeView, self).get_context_data(**kwargs) context = super(HomeView, self).get_context_data(**kwargs)
context['categories'] = Category.objects.all() context['categories'] = Category.objects.all()
context['all_jobs'] = Job.objects.all().count()
context['candidates'] = Account.objects.filter(is_employee=True).count()
context['resumes'] = Profile.objects.exclude(resume="").count()
context['employers'] = Account.objects.filter(is_employer=True).count()
return context return context

View File

@ -7,11 +7,11 @@
<div class="container"> <div class="container">
<div class="row no-gutters slider-text js-fullheight align-items-center justify-content-start" data-scrollax-parent="true"> <div class="row no-gutters slider-text js-fullheight align-items-center justify-content-start" data-scrollax-parent="true">
<div class="col-xl-10 ftco-animate mb-5 pb-5" data-scrollax=" properties: { translateY: '70%' }"> <div class="col-xl-10 ftco-animate mb-5 pb-5" data-scrollax=" properties: { translateY: '70%' }">
<p class="mb-4 mt-5 pt-5" data-scrollax="properties: { translateY: '30%', opacity: 1.6 }">We have <span class="number" data-number="850000">0</span> great job offers you deserve!</p> <p class="mb-4 mt-5 pt-5" data-scrollax="properties: { translateY: '30%', opacity: 1.6 }">We have <span class="number" data-number="{{ all_jobs }}">0</span> great job offers you deserve!</p>
<h1 class="mb-5" data-scrollax="properties: { translateY: '30%', opacity: 1.6 }">Your Dream <br><span>Job is Waiting</span></h1> <h1 class="mb-5" data-scrollax="properties: { translateY: '30%', opacity: 1.6 }">Your Dream <br><span>Job is Waiting</span></h1>
<div class="ftco-search"> <div class="ftco-search">
<div class="row"> <div class="row">
<div class="col-md-12 nav-link-wrap"> <div class="col-md-12 nav-link-wrap">
<div class="nav nav-pills text-center" id="v-pills-tab" role="tablist" aria-orientation="vertical"> <div class="nav nav-pills text-center" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<a class="nav-link active mr-md-1" id="v-pills-1-tab" data-toggle="pill" href="#v-pills-1" role="tab" aria-controls="v-pills-1" aria-selected="true">Find a Job</a> <a class="nav-link active mr-md-1" id="v-pills-1-tab" data-toggle="pill" href="#v-pills-1" role="tab" aria-controls="v-pills-1" aria-selected="true">Find a Job</a>
@ -276,7 +276,7 @@
<div class="col-md-3 d-flex justify-content-center counter-wrap ftco-animate"> <div class="col-md-3 d-flex justify-content-center counter-wrap ftco-animate">
<div class="block-18 text-center"> <div class="block-18 text-center">
<div class="text"> <div class="text">
<strong class="number" data-number="1350000">0</strong> <strong class="number" data-number="{{ all_jobs }}">0</strong>
<span>Jobs</span> <span>Jobs</span>
</div> </div>
</div> </div>
@ -284,7 +284,7 @@
<div class="col-md-3 d-flex justify-content-center counter-wrap ftco-animate"> <div class="col-md-3 d-flex justify-content-center counter-wrap ftco-animate">
<div class="block-18 text-center"> <div class="block-18 text-center">
<div class="text"> <div class="text">
<strong class="number" data-number="40000">0</strong> <strong class="number" data-number="{{ candidates }}">0</strong>
<span>Members</span> <span>Members</span>
</div> </div>
</div> </div>
@ -292,7 +292,7 @@
<div class="col-md-3 d-flex justify-content-center counter-wrap ftco-animate"> <div class="col-md-3 d-flex justify-content-center counter-wrap ftco-animate">
<div class="block-18 text-center"> <div class="block-18 text-center">
<div class="text"> <div class="text">
<strong class="number" data-number="30000">0</strong> <strong class="number" data-number="{{ resumes }}">0</strong>
<span>Resume</span> <span>Resume</span>
</div> </div>
</div> </div>
@ -300,7 +300,7 @@
<div class="col-md-3 d-flex justify-content-center counter-wrap ftco-animate"> <div class="col-md-3 d-flex justify-content-center counter-wrap ftco-animate">
<div class="block-18 text-center"> <div class="block-18 text-center">
<div class="text"> <div class="text">
<strong class="number" data-number="10500">0</strong> <strong class="number" data-number="{{ employers }}">0</strong>
<span>Company</span> <span>Company</span>
</div> </div>
</div> </div>
@ -325,7 +325,7 @@
<div class="carousel-testimony owl-carousel ftco-owl"> <div class="carousel-testimony owl-carousel ftco-owl">
<div class="item"> <div class="item">
<div class="testimony-wrap py-4 pb-5"> <div class="testimony-wrap py-4 pb-5">
<div class="user-img mb-4" style="background-image: url(images/person_1.jpg)"> <div class="user-img mb-4" style="background-image: url('{% static 'images/person_1.jpg' %}')">
<span class="quote d-flex align-items-center justify-content-center"> <span class="quote d-flex align-items-center justify-content-center">
<i class="icon-quote-left"></i> <i class="icon-quote-left"></i>
</span> </span>

View File

@ -0,0 +1,19 @@
# Generated by Django 3.1.4 on 2021-01-16 08:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jobs', '0009_auto_20210114_1950'),
('users', '0004_invite'),
]
operations = [
migrations.AddField(
model_name='profile',
name='wish_list',
field=models.ManyToManyField(blank=True, default=None, related_name='wish_list', to='jobs.Job'),
),
]

View File

@ -69,6 +69,7 @@ class Profile(models.Model):
location = models.CharField(max_length=100, blank=True) location = models.CharField(max_length=100, blank=True)
resume = RichTextField(blank=True) resume = RichTextField(blank=True)
company = models.CharField(max_length=250, blank=True) company = models.CharField(max_length=250, blank=True)
wish_list = models.ManyToManyField(Job, default=None, blank=True, related_name="wish_list")
def __str__(self): def __str__(self):
return self.user.first_name + " " + self.user.last_name + " " + self.user.email return self.user.first_name + " " + self.user.last_name + " " + self.user.email