Initial Import.

This commit is contained in:
2013-03-31 23:15:07 +01:00
commit c19f2f5562
66 changed files with 1780 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
{{ object.name }}
{{ object.address.city }}
{{ object.address.county }}
{{ object.address.postcode }}
{{ object.long_description }}

View File

@@ -0,0 +1,72 @@
{% extends "base.html" %}
{% load markdown_deux_tags %}
{% load staticfiles %}
{% block title %}
{{ chain.name }}
{% endblock %}
{% block style %}
<style type="text/css">
#map-canvas-stores {
width: 100%;
height: 400px;
}
</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 chain.stores.all %}{% if store.address.geo_latitude %}['{{ store }}', {{ store.address.geo_latitude }}, {{ store.address.geo_longitude }}],{% endif %}
{% endfor %}
];
$(document).ready(function(){initialize_map(stores, document.getElementById('map-canvas-stores'))});
</script>
{% endblock %}
{% block content %}
<div class="page-header">
<h1>{{ chain }}</h1>
</div>
<div class="row-fluid">
<div class="span12">
{% if user.is_authenticated or not store.editor or user.is_superuser %}
<p>
{% if not chain.editor %}<a href="{% url "chain-claim" chain.slug %}" class="btn btn-small">Claim Chain</a>{% endif %}
{% if is_editor %}<a href="#" class="btn btn-small">Edit Chain</a>{% endif %}
{% if user.is_superuser %}<a href="{% url "admin:stores_chain_change" chain.pk %}" class="btn btn-small">Edit in Admin</a>{% endif %}
</p>
{% endif %}
{% if chain.website %}
<p><b>Website</b>: <a href="{{ chain.website }}" target="_blank">{{ chain.website }}</a></p>
{% endif %}
{{ chain.long_description|markdown }}
</div>
</div>
<div class="row-fluid">
<div class="span7">
<h3>Stores</h3>
<table class="table table-striped">
<tbody>
{% for store in chain.stores.all %}
<tr>
<td><a href="{% url "store-detail" store.slug %}">{{ store }}</a></td>
<td>{{ store.address.city }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</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 %}

View File

@@ -0,0 +1,30 @@
{% extends "base.html" %}
{% block title %}
Chains
{% endblock %}
{% block content %}
<div class="page-header">
<h1>Chains</h1>
</div>
<div class="row-fluid">
<div class="span12">
<table class="table table-striped">
<thead>
<tr><th>Name</th><th># of Stores</th></tr>
</thead>
<tbody>
{% for chain in chain_list %}
<tr>
<td><a href="{% url "chain-detail" chain.slug %}">{{ chain }}</a></td>
<td>{{ chain.stores.count }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% include "stores/paginator.html" %}
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,25 @@
{% extends "base.html" %}
{% load bootstrap %}
{% block content %}
<div class="page-header">
<h1>Claim Request - {{ target_obj }}</h1>
</div>
<p>This form is to submit a request to claim a store/chain and assign it to your login. If you are a store or chain manager for {{ target_obj }} please fill in the following note with proof of your claim. Once you submit the request it'll be reviewed by {{ site.name }} staff who may need to contact you to confirm your request.</p>
<p>In the note please submit as many of the following details you can.</p>
<ul>
<li>Full name.</li>
<li>Contact phone number.</li>
<li>Email address.</li>
<li>Links to your store's website or Facebook page with the store's details listed.</li>
</ul>
<form class="form form-horizontal" method="post">
{{ form|bootstrap }}
{% csrf_token %}
<input class="btn" type="submit">
</form>
{% endblock %}

View File

@@ -0,0 +1,28 @@
{% if is_paginated %}
{% load i18n %}
<div class="pagination">
<ul>
{% if page_obj.has_previous %}
<li><a href="?page={{ page_obj.previous_page_number }}{{ getvars }}{{ hashtag }}" class="prev">&lsaquo;&lsaquo; {% trans "previous" %}</a></li>
{% else %}
<li class="disabled prev"><a href="#">&lsaquo;&lsaquo; {% trans "previous" %}</a></li>
{% endif %}
{% for page in paginator.page_range %}
{% if page %}
{% ifequal page page_obj.number %}
<li class="current page active"><a href="#">{{ page }}</a></li>
{% else %}
<li><a href="?page={{ page }}{{ getvars }}{{ hashtag }}" class="page">{{ page }}</a></li>
{% endifequal %}
{% else %}
...
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<li><a href="?page={{ page_obj.next_page_number }}{{ getvars }}{{ hashtag }}" class="next">{% trans "next" %} &rsaquo;&rsaquo;</a></li>
{% else %}
<li class="disabled next"><a href="#">{% trans "next" %} &rsaquo;&rsaquo;</a></li>
{% endif %}
</ul>
</div>
{% endif %}

View File

@@ -0,0 +1,101 @@
{% extends "base.html" %}
{% load markdown_deux_tags %}
{% block title %}
{{ store.name }}
{% endblock %}
{% block style %}
<style type="text/css">
.vcard ul {
list-style-type: none;
}
#map-canvas-store {
width: 100%;
height: 300px;
}
</style>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize_map_store() {
var latlng = new google.maps.LatLng({{ store.address.geo_latitude }},{{ store.address.geo_longitude }});
var mapElem = document.getElementById("map-canvas-store");
var mapOptions = {
zoom: 16,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(mapElem, mapOptions);
var marker = new google.maps.Marker({
position: latlng,
map: map,
title: "{{ map.address }}"
});
}
$(document).ready(function(){initialize_map_store()});
</script>
{% endblock %}
{% block content %}
<div class="page-header">
<h1>{{ store.name }}</h1>
</div>
<div class="row-fluid">
<div class="span8">
{{ store.long_description|markdown }}
{% if store.brands.count %}
<h3>Brands Stocked</h3>
<ul>
{% for brand in store.brands.all %}
<li>{% if brand.website %}<a href="{{ brand.website }}">{{ brand }}</a>{% else %}{{ brand }}{% endif %}</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="span4">
{% if user.is_authenticated and not store.editor or user.is_superuser %}
<p>
{% if not store.editor %}<a href="{% url "store-claim" store.slug %}" class="btn btn-small">Claim Store</a>{% endif %}
{% if is_editor %}<a href="{% url "store-update" store.slug %}" class="btn btn-small">Edit Store</a>{% endif %}
{% if user.is_superuser %}<a href="{% url "admin:stores_store_change" store.pk %}" class="btn btn-small">Edit in Admin</a>{% endif %}
</p>
{% endif %}
{% if store.chain %}<p><b>Chain</b>: <a href="{% url "chain-detail" store.chain.slug %}">{{ store.chain }}</a></p>{% endif %}
<p><b>Type</b>: {{ store.get_store_type_display }}</p>
<div class="vcard">
<h3>Address</h3>
<ul class="adr">
<li class="fn">{{ store.name }}</li>
<li class="street-address">{{ store.address.address1 }}</li>
{% if store.address.address2 %}<li>{{ store.address.address2 }}</li>{% endif %}
{% if store.address.address3 %}<li>{{ store.address.address3 }}</li>{% endif %}
<li class="locality">{{ store.address.city }}</li>
<li class="region">{{ store.address.county }}</li>
<li class="postal-code">{{ store.address.postcode }}</li>
<li class="country-name">{{ store.address.country }}</li>
</ul>
<h3>Contact Details</h3>
<ul>
{% if store.website %}<li>Website: <a class="url" target="_new" href="{{ store.website }}">{{ store.website }}</a></li>{% endif %}
{% if store.email %}<li>Email: <a class="email" href="mailto:{{ store.email }}">{{ store.email }}</a></li>{% endif %}
{% if store.phone %}<li>Phone: <span class="tel">{{ store.phone }}</span></li>{% endif %}
</ul>
</div>
<div id="map-canvas-store" style="width: 300px; height: 300px;" class="map">
<noscript>
<img alt="Map of {{ store.address.address_string }}" src="https://maps.google.com/maps/api/staticmap?center={{ store.address.geo_latitude }},{{ store.address.geo_longitude }}&zoom=16&markers={{ store.address.geo_latitude }},{{ store.address.geo_longitude }}&size=300x300&sensor=false">
</noscript>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load bootstrap %}
{% block scripts %}
{{ form.media }}
{% endblock %}
{% block content %}
<div class="page-header">
<h1>Edit Store - {{ object }}</h1>
</div>
<form class="form form-horizontal" method="post">
{{ form|bootstrap }}
{% csrf_token %}
<input class="btn" type="submit">
</form>
{% endblock %}

View File

@@ -0,0 +1,76 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block title %}
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 }}],{% endif %}
{% endfor %}
];
$(document).ready(function(){initialize_map(stores, document.getElementById("map-canvas-stores"))});
</script>
{% endblock %}
{% block content %}
<div class="page-header">
<h1>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 }}">
<a href="#" class="btn btn-small">Advanced Search</a>
</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></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>
</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 %}

View File

@@ -0,0 +1,49 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block title %}
Stores
{% endblock %}
{% block style %}
<style type="text/css">
#map-canvas-stores {
width: 100%;
height: 600px;
}
#geolocation {
display: none;
}
</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" src="{% static "js/geolocation.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="jumbotron">
<p class="lead">
{{ site.name }} lists {{ store_count }} stores, and {{ chain_count }} chains across the UK and Ireland.
</p>
<p id="geolocation"><a class="btn btn-large">Find Stores Near Me.</a></p>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div id="map-canvas-stores" class="map">
<noscript>
You need Javascript enabled to view the map.
</noscript>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,73 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block title %}
Stores
{% endblock %}
{% block style %}
<style type="text/css">
#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 object_list %}{% if store.object.address.geo_latitude %}['{{ store }}', {{ store.object.address.geo_latitude }}, {{ store.object.address.geo_longitude }}, {{ store.object.store_type }}, '{% url "store-detail" store.object.pk %}'],{% endif %}
{% endfor %}
{% if location_geo %}['Search Location', {{ location_geo.0 }}, {{ location_geo.1 }}, 999, ''],{% endif %}
];
$(document).ready(function(){ initialize_map(stores, document.getElementById("map-canvas-stores")); });
</script>
{% endblock %}
{% block content %}
<div class="page-header">
<h1>Stores</h1>
</div>
<div class="row-fluid">
<div class="span7">
<form method="get">
<input type="text" name="location" class="search-query" placeholder="Location" value="{{ location }}">
<select name="distance">
<option value="10">10km</option>
<option value="30">20km</option>
<option value="30">30km</option>
</select>
</form>
{% if object_list.count %}
<table class="table table-striped">
<thead>
<tr><th>Name</th><th>Town/City</th><th>Distance</th></tr>
</thead>
<tbody>
{% for store in object_list %}
<tr>
<td><a href="{% url "store-detail" store.object.slug %}">{{ store.object }}</a></td>
<td>{{ store.object.address.city }}</td>
<td>{{ store.distance }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% include "stores/paginator.html" %}
{% else %}
<p>No results found.</p>
{% 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 %}

View File

@@ -0,0 +1,23 @@
{% extends "base.html" %}
{% load bootstrap %}
{% block style %}
{{ form.media }}
{% endblock %}
{% block content %}
<div class="page-header">
<h1>Add Store ({{ wizard.steps.step1 }} of {{ wizard.steps.count }})</h1>
</div>
<form class="form form-horizontal" method="post">
{{ wizard.management_form|bootstrap }}
{{ wizard.form|bootstrap }}
{% csrf_token %}
{% if wizard.steps.prev %}
<button name="wizard_goto_step" class="btn" type="submit" value="{{ wizard.steps.first }}">First Step</button>
<button name="wizard_goto_step" class="btn" type="submit" value="{{ wizard.steps.prev }}">Previous Step</button>
{% endif %}
<button name="wizard_goto_step" class="btn" type="submit" value="{{ wizard.steps.next }}">Next Step</button>
</form>
{% endblock %}