Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #41 from pygraz/27-replace-google-maps
Browse files Browse the repository at this point in the history
#27 replace google maps
  • Loading branch information
roskakori authored Dec 6, 2022
2 parents cbb6be7 + 992667f commit ccb4652
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 45 deletions.
18 changes: 18 additions & 0 deletions pygraz_website/apps/meetups/migrations/0005_location_map_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.8 on 2022-12-06 19:11

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("meetups", "0004_alter_meetup_location_alter_rsvp_meetup_and_more"),
]

operations = [
migrations.AddField(
model_name="location",
name="map_image",
field=models.ImageField(blank=True, null=True, upload_to=""),
),
]
1 change: 1 addition & 0 deletions pygraz_website/apps/meetups/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Location(models.Model):
description = models.TextField(blank=True, null=True)
website = models.URLField(blank=True, null=True)
address = models.CharField(max_length=255, blank=True, null=True)
map_image = models.ImageField(null=True, blank=True)

def __str__(self):
return self.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@
</div>
</footer>
</div>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false&amp;key={{ GOOGLEMAPS_API_KEY }}"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/main.js"></script>
{% block tail %}{% endblock %}
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ <h1 class="iconb" data-icon="◉">Location: {{ meetup.location.name }}</h1>
{% if meetup.location.address %}
<p class="address">{{ meetup.location.address }}</p>
{% endif %}
{% if meetup.location.map_image %}
<img src="{{ meetup.location.map_image.url }}" alt="Birdview image to location {{ meetup.location.name }}" />
{% endif %}
<div class="description">{{ meetup.location.description }}</div>
{% else %}
{% if meetup.is_in_future %}
Expand Down
3 changes: 2 additions & 1 deletion pygraz_website/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ def googlemaps(request):
"""
Adds the Google Maps API key to the context.
"""
return {"GOOGLEMAPS_API_KEY": settings.GOOGLEMAPS_API_KEY}
assert False
# return {"GOOGLEMAPS_API_KEY": settings.GOOGLEMAPS_API_KEY}
3 changes: 0 additions & 3 deletions pygraz_website/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
"django.contrib.messages.context_processors.messages",
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.request",
"pygraz_website.context_processors.googlemaps",
"pygraz_website.context_processors.disqus",
]
),
Expand All @@ -147,7 +146,6 @@
"django.contrib.sites",
"django.contrib.messages",
"django.contrib.staticfiles",
"flat",
"django.contrib.admin",
"django_extensions",
"easy_thumbnails",
Expand Down Expand Up @@ -213,4 +211,3 @@
MEETUPCOM_API_KEY = os.environ.get("DJANGO_MEETUPCOM_API_KEY")
NOCAPTCHA = True
RECAPTCHA_USE_SSL = True
GOOGLEMAPS_API_KEY = os.environ.get("DJANGO_GOOGLEMAPS_API_KEY")
39 changes: 0 additions & 39 deletions pygraz_website/static/js/main.js

This file was deleted.

0 comments on commit ccb4652

Please sign in to comment.