-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Location+page search, favorite add and delete
- Loading branch information
1 parent
1d05307
commit adce94b
Showing
51 changed files
with
1,160 additions
and
244 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
var RestaurantListPage = { | ||
init: function() { | ||
this.$container = $('.resto-container'); | ||
this.bindEvents(); | ||
}, | ||
|
||
|
||
bindEvents: function() { | ||
$('.btn-favorite', this.$container).on('click', function(e) { | ||
e.preventDefault(); | ||
|
||
var self = $(this); | ||
var url = $(this).attr('href'); | ||
$.getJSON(url, function(result) { | ||
if (result.success) { | ||
$('.glyphicon-bookmark', self).toggleClass('active'); | ||
} | ||
}); | ||
|
||
return false; | ||
}); | ||
} | ||
}; | ||
|
||
$(document).ready(function() { | ||
RestaurantListPage.init(); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{% extends 'home/base_logged_in.html' %} | ||
|
||
{% block body %} | ||
|
||
<div class="container-fluid resto-container"> | ||
|
||
{% if restaurants %} | ||
<!-- Houses --> | ||
<div class="row"> | ||
{% for rest in restaurants %} | ||
<div class="col-sm-6 col-lg-3"> | ||
<div class="thumbnail"> | ||
<a href="#"> | ||
<img src="{{ rest.restaurant_thumb }}" style="height:200px;width:300px;"> | ||
</a> | ||
<div class="caption"> | ||
<h4>{{ rest.restaurant_name }}</h4> | ||
<h6>{{ rest.restaurant_cuisine }}</h6> | ||
<h6>{{ rest.restaurant_avgcostfor2 }}</h6> | ||
<h4>{{ rest.user_rating_agg }}</h4> | ||
|
||
<!-- View Details --> | ||
<a href="#" class="btn btn-danger btn-sm" role="button"> | ||
View Details | ||
</a> | ||
|
||
<!-- Delete Album --> | ||
<form action="{% url 'restaurants:delete_rest' rest.id %}" method="post" style="display: inline;"> | ||
{% csrf_token %} | ||
<input type="hidden" name="rest_id" value="{{ rest.id }}" /> | ||
<button type="submit" class="btn btn-default btn-sm"> | ||
<span class="glyphicon glyphicon-trash"></span> | ||
</button> | ||
</form> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
{% else %} | ||
<h3>No Restaurants available</h3> | ||
|
||
{% endif %} | ||
</div> | ||
|
||
<div class="container-fluid resto-container"> | ||
|
||
{% if houses %} | ||
<!-- Houses --> | ||
<div class="row"> | ||
{% for house in houses %} | ||
<div class="col-sm-6 col-lg-3"> | ||
<div class="thumbnail"> | ||
<a href="{% url 'houseonrent:detail' house.id %}"> | ||
<img src="{{ house.house_pic }}" style="height:200px;width:300px;"> | ||
</a> | ||
<div class="caption"> | ||
<h4>{{ house.house_title }}</h4> | ||
<h6>{{ house.rent_price }}</h6> | ||
<h4>{{ house.config }}</h4> | ||
|
||
<!-- View Details --> | ||
<a href=" {% url 'houseonrent:detail' house.id %}" class="btn btn-danger btn-sm" role="button"> | ||
View Details | ||
</a> | ||
|
||
<!-- Delete Album --> | ||
<form action="{% url 'houseonrent:delete_house' house.id %}" method="post" style="display: inline;"> | ||
{% csrf_token %} | ||
<input type="hidden" name="house_id" value="{{ house.id }}" /> | ||
<button type="submit" class="btn btn-default btn-sm"> | ||
<span class="glyphicon glyphicon-trash"></span> | ||
</button> | ||
</form> | ||
|
||
|
||
</div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
{% else %} | ||
<h3>No Houses available</h3> | ||
|
||
{% endif %} | ||
</div> | ||
|
||
{% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
{% for field in form %} | ||
<div class="form-group"> | ||
<label class="control-label col-sm-2" for="ssstitle">{{ field.label_tag }}</label> | ||
<div class="col-sm-10">{{ field }}</div> | ||
<div class="col-sm-offset-2 col-sm-10"> | ||
<span class="text-danger small">{{ field.errors }}</span> | ||
</div> | ||
<label class="control-label col-sm-2" for="ssstitle">{{ field.label_tag }}</label> | ||
<div class="col-sm-10">{{ field }}</div> | ||
</div> | ||
{% endfor %} | ||
{% endfor %} | ||
|
||
<!--|addclass:'form-control'--> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<h3> | ||
Square Feet : {{ house.sqft_area }} | ||
Square Feet : {{ house.address }} | ||
</h3> | ||
|
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
Oops, something went wrong.