Skip to content

Commit

Permalink
Changed review formatting on room page
Browse files Browse the repository at this point in the history
  • Loading branch information
cjoc committed Oct 7, 2018
1 parent 39bc7e4 commit 3b65163
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 34 deletions.
17 changes: 5 additions & 12 deletions rooms/roomballot/templates/roomballot/create-review.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,8 @@ <h2>Review Your Room</h2>
the room below:
</p>
<div class="alert alert-info">
<div class="row">
<div style="max-width: 20%">
{% if image %}
<img class="img-thumbnail mb-3" src="/media/{{ image.thumbnail.url }}">
{% endif %}
</div>
<div class="ml-3">
<h4>{{ room }}</h4>
</div>
<div class="ml-3">
<h4>{{ room }}</h4>
</div>
</div>
<p>
Expand All @@ -121,7 +114,7 @@ <h4>{{ room }}</h4>
<div class="form-group">
<label for="layout_rating">How well laid out is your room?</label>
<select class="form-control" id="layout_rating" name="layout_rating" required>
<option disabled selected value> -- select an option -- </option>
<option disabled selected value> -- select an option --</option>
<option>1</option>
<option>2</option>
<option>3</option>
Expand All @@ -135,7 +128,7 @@ <h4>{{ room }}</h4>
<div class="form-group">
<label for="facilities_rating">How would you rate your room's facilities?</label>
<select class="form-control" id="facilities_rating" name="facilities_rating" required>
<option disabled selected value> -- select an option -- </option>
<option disabled selected value> -- select an option --</option>
<option>1</option>
<option>2</option>
<option>3</option>
Expand All @@ -146,7 +139,7 @@ <h4>{{ room }}</h4>
<div class="form-group">
<label for="overall_rating">How would you rate your room overall?</label>
<select class="form-control" id="overall_rating" name="overall_rating" required>
<option disabled selected value> -- select an option -- </option>
<option disabled selected value> -- select an option --</option>
<option>1</option>
<option>2</option>
<option>3</option>
Expand Down
110 changes: 88 additions & 22 deletions rooms/roomballot/templates/roomballot/room-detail-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"
type="text/javascript"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">


<!--Start of Tawk.to Script-->
<script type="text/javascript">
Expand Down Expand Up @@ -50,7 +52,8 @@
<div class="collapse navbar-collapse justify-content-end" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle d-none d-lg-block" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
<a class="nav-link dropdown-toggle d-none d-lg-block" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
{{ student }}
</a>
Expand All @@ -60,16 +63,16 @@
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/accounts/logout">Logout</a>
</div>
<li class="nav-item">
<a class="nav-link d-lg-none d-xl-none" href="/roomballot/dashboard">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link d-lg-none d-xl-none" href="/roomballot/staircases">Browse Rooms</a>
</li>
<div class="dropdown-divider-burgundy"></div>
<li class="nav-item">
<a class="nav-link d-lg-none d-xl-none" href="/accounts/logout">Logout</a>
</li>
<li class="nav-item">
<a class="nav-link d-lg-none d-xl-none" href="/roomballot/dashboard">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link d-lg-none d-xl-none" href="/roomballot/staircases">Browse Rooms</a>
</li>
<div class="dropdown-divider-burgundy"></div>
<li class="nav-item">
<a class="nav-link d-lg-none d-xl-none" href="/accounts/logout">Logout</a>
</li>
</li>
</ul>
</div>
Expand Down Expand Up @@ -102,7 +105,8 @@ <h2>{{ room }}</h2>
<div class="row mb-4">
<div class="col-md-6 mt-4">
{% for i in images %}
<a href="/media/{{ i.file.url }}" target="blank"><img class="img-thumbnail mb-3" src="/media/{{ i.thumbnail.url }}"></a>
<a href="/media/{{ i.file.url }}" target="blank"><img class="img-thumbnail mb-3"
src="/media/{{ i.thumbnail.url }}"></a>
{% endfor %}
</div>
<div class="col-md-6">
Expand Down Expand Up @@ -167,16 +171,78 @@ <h2>{{ room }}</h2>
</table>
</div>
{% if reviews %}
<div class="col-md-12">
<h3 class="border-bottom mb-3">Reviews</h3>
{% for review in reviews %}
<div class="alert alert-info">
<p>"{{ review.text }}"<br>
<i>- {{ review.author_name }}</i>
</p>
</div>
{% endfor %}
</div>
<div class="col-md-12">
<div class="border-bottom mb-4"><h3>Reviews</h3></div>
{% for review in reviews %}
<div class="row mb-5">
<div class="col-md-4">
<div class="row mb-2">
<div class="col-md-6">
<h5>Overall Rating</h5>
</div>
<div class="col-md-6 text-warning">
{% if review.overall_rating == 1 %}
<i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
{% elif review.overall_rating == 2 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
{% elif review.overall_rating == 3 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
{% elif review.overall_rating == 4 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i>
{% elif review.overall_rating == 5 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-md-6">
<p>Layout</p>
</div>
<div class="col-md-6 text-warning">
{% if review.layout_rating == 1 %}
<i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
<i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
{% elif review.layout_rating == 2 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
{% elif review.layout_rating == 3 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
{% elif review.layout_rating == 4 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i>
{% elif review.layout_rating == 5 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-md-6">
<p>Facilities</p>
</div>
<div class="col-md-6 text-warning">
{% if review.facilities_rating == 1 %}
<i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
<i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
{% elif review.facilities_rating == 2 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i>
<i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
{% elif review.facilities_rating == 3 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>
{% elif review.facilities_rating == 4 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i>
{% elif review.facilities_rating == 5 %}
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i>
{% endif %}
</div>
</div>
</div>
<div class="col-md-8">
<h4>{{ review.title }}</h4>
<p>{{ review.text }}</p>
<p><i>{{ review.author_name }}</i></p>

</div>
</div>
{% endfor %}
</div>
{% endif %}
</div>
</div>
Expand Down

0 comments on commit 3b65163

Please sign in to comment.