Skip to content

Commit

Permalink
[#866] Map slider on project main page
Browse files Browse the repository at this point in the history
Initial version of map slider on project main page, showing project and update pins. In this version, we use jQuery for the slider, because we'll have to rebuild the way we show maps if we don't adhere to this.
  • Loading branch information
KasperBrandt committed Oct 31, 2014
1 parent 10f81eb commit e115d65
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
8 changes: 4 additions & 4 deletions akvo/templates/partials/project_header.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{% load i18n %}
{% load i18n maps %}

<header>
<div class="container">
<div class="row">
<div class="col-sm-8 col-xs-8">
<h1>{{project.title}}</h1>
<p>{{project.subtitle}}</p>
<p class="small"><span class="glyphicon glyphicon-globe"></span> {{project.primary_location.country}}, {{project.primary_location.country.continent}} &nbsp; <a href="#" class="map-toggle">View map</a></p>
<p class="small"><span class="glyphicon glyphicon-globe"></span> {{project.primary_location.country}}, {{project.primary_location.country.continent}} &nbsp; <a href="#" onclick="maptoggle()" class="map-toggle">Show map +</a></p>
</div>
<div class="col-sm-4 col-xs-4">
Share <a href="#" class="btn btn-primary">Follow project</a>
</div>
</div>
<div class="row hidden">
MAP HERE WITH PROJECT PIN and UPDATE PINS
<div style="display: None" id="project-map" class="row initial">
{% project_map project.id '100%' '300px' %}
</div>
</div>
</header>
16 changes: 16 additions & 0 deletions akvo/templates/project_main.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@

{% block head_js %}
<script type="application/json" id="accordion-data">{{ accordion_data|safe }}</script>

<script type="text/javascript">
function maptoggle() {
if ($( "#project-map" ).css('display') == 'none') {
$( "#project-map" ).slideToggle('slow');
if ($('#project-map').hasClass('initial')) {
googleMap.load();
$( "#project-map" ).removeClass('initial');
}
$('.map-toggle').html('HIDE MAP -');
} else {
$( "#project-map" ).slideToggle('slow');
$('.map-toggle').html('SHOW MAP +');
}
};
</script>
{% endblock %}

{% block maincontent %}
Expand Down

0 comments on commit e115d65

Please sign in to comment.