This repository has been archived by the owner on Sep 13, 2020. It is now read-only.
forked from simonw/djangopeople.net
/
country.html
66 lines (60 loc) · 2.9 KB
/
country.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{% extends "maps.html" %}
{% load url from future %}
{% load static %}
{% get_static_prefix as STATIC_URL %}
{% block title %}{{ country }} |{% endblock %}
{% block maps_code %}
<script type="text/javascript">
window.onload = function() {
var swBound = new google.maps.LatLng({{ country.bbox_south }}, {{ country.bbox_west }});
var neBound = new google.maps.LatLng({{ country.bbox_north }}, {{ country.bbox_east }});
var boundBox = new google.maps.LatLngBounds(swBound, neBound);
var gmap = new google.maps.Map(document.getElementById('gmap'), {
zoom: 9,
center: boundBox.getCenter(),
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false
});
gmap.fitBounds(boundBox);
// Plot the people as markers
plotPeopleOnMap(people, gmap);
};
</script>
{% endblock %}
{% block header %}
{% if country.iso_code or country.flag %}<img src="{% if country.iso_code %}{{ STATIC_URL }}djangopeople/img/flags/{{ country.iso_code|lower }}.gif{% else %}{{ STATIC_URL }}djangopeople/{{ country.flag }}{% endif %}" alt="{{ country }}" class="main">{% endif %}
<h1>{{ country }}</h1>
<p class="meta">{% if country.country %}<a href="{% url 'country_detail' country.country.iso_code|lower %}" class="nobg"><img src="{{ STATIC_URL }}djangopeople/img/flags/{{ country.country.iso_code|lower }}.gif" title="{{ country.country }}" alt="{{ country.country }}" class="flag"></a> {% endif %}{{ people_list.count }} Django {% ifequal people_list.count 1 %}person{% else %}people{% endifequal %}</p>
{% endblock %}
{% block map %}
<div class="mapContainer major">
<div id="gmap"> </div>
</div>
{% endblock %}
{% block content %}
{% with country.countrysite_set.all as sites %}
{% if sites %}
<div class="highlight">
<h2>Django community sites in {{ country }}</h2>
<ul>
{% for site in sites %}
<li><a href="{{ site.url }}" class="ext">{{ site.title }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endwith %}
<ul class="detailsList split">
{% load person_list_items %}{% person_list_items people_list %}
</ul>
{% if regions %}
<h2>Regions</h2>
<ul class="detailsList split">
{% for region in regions %}
<li>
{% if region.flag %}<a href="{% url "country_region" country.iso_code|lower region.code|lower %}" class="nobg"><img src="{{ STATIC_URL }}djangopeople/img/regions/{{ country.iso_code|lower }}/{{ region.code|lower }}.png" width="16" height="11" alt="{{ region }}" title="{{ region }}"></a> {% endif %}<a href="{% url 'country_region' country.iso_code|lower region.code|lower %}"><strong>{{ region }}</strong></a> {{ region.num_people }} {% ifequal region.num_people 1 %}person{% else %}people{% endifequal %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}