-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from jeniaSakirko/add_avg_rating
Add average rating to the daycare profile
- Loading branch information
Showing
5 changed files
with
157 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,137 @@ | ||
{% extends "main/base_template.html" %} | ||
|
||
{% block stylesheets %} | ||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" | ||
integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> | ||
<style> | ||
/* Make the image fully responsive */ | ||
.img { | ||
float: left; | ||
width: 100px; | ||
height: 100px; | ||
object-fit:cover; | ||
} | ||
</style> | ||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" | ||
integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> | ||
<style> | ||
/* Make the image fully responsive */ | ||
.img { | ||
float: left; | ||
width: 100px; | ||
height: 100px; | ||
object-fit: cover; | ||
} | ||
</style> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="card mb-2"> | ||
<div class="row row-cols-md-2"> | ||
<div class="col-md-7"> | ||
<hr> | ||
<div class="mt-5 mb-5"> | ||
<h5> <i class="fas fa-user"></i> Hello {{ daycare.name }}</h5> | ||
<h6>This is where you can manage your daycare. | ||
<br> You will be able:</h6> | ||
<p class="text-muted"># Manage your booking schedule</p> | ||
<p class="text-muted"># Set filters of approved dogs and services you provide</p> | ||
<p class="text-muted"># Read / write reviews of dog owners and their dogs</p> | ||
<p class="text-muted"># Chat with dog owners</p> | ||
</div> | ||
<hr> | ||
<div class="mt-5"> | ||
<h5>Have a look at your reviews</h5> | ||
<table class="table table-hover table-bordered table-responsive"> | ||
<thead class="table-dark"> | ||
<tr> | ||
<th scope="col">#</th> | ||
<th scope="col">Name</th> | ||
<th scope="col">Date</th> | ||
<th scope="col">Review</th> | ||
<th scope="col">Rating</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for review in reviews %} | ||
<tr> | ||
<th scope="row">{{ forloop.counter }}</th> | ||
<td>{{ review.dogowner_id }}</td> | ||
<td>{{ review.creation_date }}</td> | ||
<td>{{ review.review }}</td> | ||
<td>{{ review.rating }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
<div class="card mb-2"> | ||
<div class="row row-cols-md-2"> | ||
<div class="col-md-7"> | ||
<hr> | ||
<div class="mt-5 mb-5"> | ||
<h5><i class="fas fa-user"></i> Hello {{ daycare.name }}</h5> | ||
<h6>This is where you can manage your daycare. | ||
<br> You will be able:</h6> | ||
<p class="text-muted"># Manage your booking schedule</p> | ||
<p class="text-muted"># Set filters of approved dogs and services you provide</p> | ||
<p class="text-muted"># Read / write reviews of dog owners and their dogs</p> | ||
<p class="text-muted"># Chat with dog owners</p> | ||
</div> | ||
<hr> | ||
<div class="mt-5"> | ||
<h5>Have a look at your reviews</h5> | ||
<table class="table table-hover table-bordered table-responsive"> | ||
<thead class="table-dark"> | ||
<tr> | ||
<th scope="col">#</th> | ||
<th scope="col">Name</th> | ||
<th scope="col">Date</th> | ||
<th scope="col">Review</th> | ||
<th scope="col">Rating</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for review in reviews %} | ||
<tr> | ||
<th scope="row">{{ forloop.counter }}</th> | ||
<td>{{ review.dogowner_id }}</td> | ||
<td>{{ review.creation_date }}</td> | ||
<td>{{ review.review }}</td> | ||
<td>{{ review.rating }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
|
||
</div> | ||
</div> | ||
<div class="col-md-5"> | ||
<div class="card h-100"> | ||
<ul class="nav nav-pills" id="myTab" role="tablist"> | ||
<li class="nav-item"> | ||
<a class="nav-link active" id="apt-tab-{{daycare.id}}" data-toggle="tab" | ||
href="#apt-{{daycare.id}}" role="tab" aria-controls="apt-{{daycare.id}}" | ||
aria-selected="true">Daycare Profile Details</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="col-md-5"> | ||
<div class="card h-100"> | ||
<ul class="nav nav-pills" id="myTab" role="tablist"> | ||
<li class="nav-item"> | ||
<a class="nav-link active" id="apt-tab-{{ daycare.id }}" data-toggle="tab" | ||
href="#apt-{{ daycare.id }}" role="tab" aria-controls="apt-{{ daycare.id }}" | ||
aria-selected="true">Daycare Profile Details</a> | ||
</li> | ||
</ul> | ||
|
||
<div class="tab-content" id="card-tab-content"> | ||
<div class="tab-pane fade show active" id="apt-{{daycare.id}}" role="tabpanel" | ||
aria-labelledby="apt-tab-{{daycare.id}}"> | ||
<div class="tab-content" id="card-tab-content"> | ||
<div class="tab-pane fade show active" id="apt-{{ daycare.id }}" role="tabpanel" | ||
aria-labelledby="apt-tab-{{ daycare.id }}"> | ||
|
||
<div id="imageSlides" class="carousel slide" data-ride="carousel"> | ||
<!-- Indicators --> | ||
<ul class="carousel-indicators"> | ||
{% for image in images %} | ||
{% if forloop.counter == 1 %} | ||
<li data-target="#imageSlides" data-slide-to={{image.id}} class="active"></li> | ||
{% else %} | ||
<li data-target="#imageSlides" data-slide-to={{image.id}}></li> | ||
{% endif %} | ||
{% endfor%} | ||
</ul> | ||
<div id="imageSlides" class="carousel slide" data-ride="carousel"> | ||
<!-- Indicators --> | ||
<ul class="carousel-indicators"> | ||
{% for image in images %} | ||
{% if forloop.counter == 1 %} | ||
<li data-target="#imageSlides" | ||
data-slide-to={{ image.id }} class="active"></li> | ||
{% else %} | ||
<li data-target="#imageSlides" data-slide-to={{ image.id }}></li> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
|
||
|
||
<!-- The slideshow --> | ||
<div class="carousel-inner"> | ||
{% for image in images %} | ||
{% if forloop.counter == 1 %} | ||
<div class="carousel-item active"> | ||
<img src={{image.url}} class="img-fluid" width="900" height="400"> | ||
</div> | ||
{% else %} | ||
<div class="carousel-item"> | ||
<img src={{image.url}} class="img-fluid" width="900" height="400"> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
<!-- The slideshow --> | ||
<div class="carousel-inner"> | ||
{% for image in images %} | ||
{% if forloop.counter == 1 %} | ||
<div class="carousel-item active"> | ||
<img src={{ image.url }} class="img-fluid" width="900" height="400"> | ||
</div> | ||
{% else %} | ||
<div class="carousel-item"> | ||
<img src={{ image.url }} class="img-fluid" width="900" height="400"> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
|
||
<!-- Left and right controls --> | ||
<a class="carousel-control-prev" href="#imageSlides" data-slide="prev"> | ||
<span class="carousel-control-prev-icon"></span> | ||
</a> | ||
<a class="carousel-control-next" href="#imageSlides" data-slide="next"> | ||
<span class="carousel-control-next-icon"></span> | ||
</a> | ||
</div> | ||
<div class="card-body"> | ||
<h5 class="card-title">{{daycare.address}}, {{daycare.city}}</h5> | ||
<br> | ||
<h6><i class="fas fa-dog"></i> Capacity: {{daycare.capacity}} | ||
<br> | ||
<br> | ||
<i class="fas fa-coins"></i> Price: {{daycare.price_per_day}} | ||
</h6> | ||
<br> | ||
<h6><strong>About</strong></h6> | ||
<p class="card-text">{{daycare.description}}</p> | ||
</div> | ||
<!-- Left and right controls --> | ||
<a class="carousel-control-prev" href="#imageSlides" data-slide="prev"> | ||
<span class="carousel-control-prev-icon"></span> | ||
</a> | ||
<a class="carousel-control-next" href="#imageSlides" data-slide="next"> | ||
<span class="carousel-control-next-icon"></span> | ||
</a> | ||
</div> | ||
<div class="card-body"> | ||
<h5 class="card-title">{{ daycare.address }}, {{ daycare.city }}</h5> | ||
<br> | ||
<h6> | ||
<i class="fas fa-dog"></i> Capacity: {{ daycare.capacity }} | ||
<br> | ||
<br> | ||
<i class="fas fa-coins"></i> Price: {{ daycare.price_per_day }} | ||
<br> | ||
<br> | ||
<i class="fas fa-star"></i> Rating: {{ rating }} | ||
</h6> | ||
<br> | ||
<h6><strong>About</strong></h6> | ||
<p class="card-text">{{ daycare.description }}</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
{% endblock %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters