mirror of
https://github.com/nikdoof/vapemap.git
synced 2025-12-14 06:42:17 +00:00
Update templates for Retail/Online.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block title %}
|
||||
Stores
|
||||
Online Stores
|
||||
{% endblock %}
|
||||
|
||||
{% block style %}
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1>Stores</h1>
|
||||
<h1>Online Stores</h1>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
76
app/stores/templates/stores/store_retail_list.html
Normal file
76
app/stores/templates/stores/store_retail_list.html
Normal file
@@ -0,0 +1,76 @@
|
||||
{% extends "base.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block title %}
|
||||
Retail Stores
|
||||
{% endblock %}
|
||||
|
||||
{% block style %}
|
||||
<style type="text/css" xmlns="http://www.w3.org/1999/html">
|
||||
#map-canvas-stores {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
|
||||
<script type="text/javascript" src="{% static "js/gmap.js" %}"></script>
|
||||
<script type="text/javascript">
|
||||
var stores = [
|
||||
{% for store in store_list %}{% if store.address.geo_latitude %}['{{ store }}', {{ store.address.geo_latitude }}, {{ store.address.geo_longitude }}, {{ store.store_type }}, '{% url "store-detail" store.slug %}'],{% endif %}
|
||||
{% endfor %}
|
||||
];
|
||||
$(document).ready(function(){initialize_map(stores, document.getElementById("map-canvas-stores"))});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1>Retail Stores</h1>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span7">
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<form method="get">
|
||||
<input type="text" name="q" class="search-query" placeholder="Search" value="{{ search_query }}">
|
||||
</form>
|
||||
</div>
|
||||
<div class="span4">
|
||||
<a href="{% url "store-create" %}" class="btn btn-small pull-right">Submit A Store</a>
|
||||
</div>
|
||||
</div>
|
||||
{% if store_list.count %}
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Town/City</th><th>Country</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for store in store_list %}
|
||||
<tr>
|
||||
<td><a href="{% url "store-detail" store.slug %}">{{ store }}</a></td>
|
||||
<td>{{ store.address.city }}</td>
|
||||
<td>{{ store.address.country }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "stores/paginator.html" %}
|
||||
{% else %}
|
||||
{% if search_query %}
|
||||
<p>No results found for the search "{{ search_query }}".</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="span5">
|
||||
<div id="map-canvas-stores" class="map">
|
||||
<noscript>
|
||||
You need Javascript enabled to view the map.
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -36,6 +36,7 @@ class OnlineStoreListView(StoreListView):
|
||||
|
||||
|
||||
class RetailStoreListView(StoreListView):
|
||||
template_name_suffix = '_retail_list'
|
||||
|
||||
def get_queryset(self):
|
||||
qs = super(RetailStoreListView, self).get_queryset()
|
||||
|
||||
Reference in New Issue
Block a user