@@ -1,33 +1,45 @@
{% extends "layout.html" %}

{% block content %}
<div class="container">


<br>
<br>
<br>
<div class="container">
<h2>Result of {{ location }} for {{ category }}</h2>
</div>
<br>
<br>
<div id="map" style="height: 500px;"></div>

<script type="text/javascript">
// The first parameter are the coordinates of the center of the map
// The second parameter is the zoom level
var map = L.map('map').setView([40.712, -74.006], 11);
<script type="text/javascript">
// The first parameter are the coordinates of the center of the map
// The second parameter is the zoom level
var map = L.map('map').setView([40.712, -74.006], 11);

var layer = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
});
var layer = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
});

// Now add the layer onto the map
map.addLayer(layer);
// Now add the layer onto the map
map.addLayer(layer);

// It even opens up a popup when you click it!
{% for row in recommendation %}
// It even opens up a popup when you click it!
{% for row in recommendation %}

L.marker([{{ row['reco']['latitude'] }}, {{ row['reco']['longitude'] }}]).addTo(map)
.bindPopup("<strong>{{ row['reco']['shopName'] }}</strong>").openPopup();
L.marker([{{ row['reco']['latitude'] }}, {{ row['reco']['longitude'] }}]).addTo(map)
.bindPopup("<strong>{{ row['reco']['shopName'] }}</strong>").openPopup();

{% endfor %}

</script>
{% endfor %}

</script>
<div class="container">
<br>
<br>
<h2>Restaurants Suggestions</h2>
<br>
<br>

<div class="card-deck">
{% for row in recommendation %}
@@ -48,20 +60,20 @@ <h6 class="card-title">{{ row['reco']['shopName'] }}</h6>
</a>
{% endfor %}
</div>
{# <div>#}
{# {% for row in recommendation %}#}
{# <p>#}
{# name:{{ row['reco']['shopName'] }},#}
{# add:{{ row['reco']['SDAddress'] }},#}
{# lat:{{ row['reco']['latitude'] }},#}
{# lon:{{ row['reco']['longitude'] }},#}
{# SDRate:{{ row['reco'['SDRate']] }}#}
{# cat:{{ row['SDCategory'] }},#}
{# distance:{{ row['distance'] }}#}
{# price:{{ row['reco']['price'] }}#}
{# <a href="{{ url_for('res_detail', shopId=row['reco']['shopId']) }}">detail</a>#}
{# </p>#}
{# {% endfor %}#}
{# </div>#}
{# <div>#}
{# {% for row in recommendation %}#}
{# <p>#}
{# name:{{ row['reco']['shopName'] }},#}
{# add:{{ row['reco']['SDAddress'] }},#}
{# lat:{{ row['reco']['latitude'] }},#}
{# lon:{{ row['reco']['longitude'] }},#}
{# SDRate:{{ row['reco'['SDRate']] }}#}
{# cat:{{ row['SDCategory'] }},#}
{# distance:{{ row['distance'] }}#}
{# price:{{ row['reco']['price'] }}#}
{# <a href="{{ url_for('res_detail', shopId=row['reco']['shopId']) }}">detail</a>#}
{# </p>#}
{# {% endfor %}#}
{# </div>#}
</div>
{% endblock %}
@@ -210,7 +210,8 @@ def show():
if len(recommendation) > 0:
session['item'] = recommendation[0]['reco']
# reco=RecoEngine.more2(location,category,month,user)
return render_template("show_reco.html", recommendation=recommendation)
return render_template("show_reco.html", recommendation=recommendation, location=location, category=category,
month=month)

season = rec.currentSeason()
category = rec.getCategory()