Repository: svthalia/concrexit

Issue:
Set a placeholder image for the location 'online'
### Is your feature request related to a problem? Please describe.
So many events are online now and it is confusing for me that the location on the Map shows this location in Arkansas, USA
![online](https://camo.githubusercontent.com/ff65878980eb1aa7c57ab1eb98b6aebc7e96283b542668b88cd8a9700853aa57/68747470733a2f2f6d6170732e676f6f676c65617069732e636f6d2f6d6170732f6170692f7374617469636d61703f63656e7465723d6f6e6c696e65267a6f6f6d3d31332673697a653d34353078323530266d61726b6572733d6f6e6c696e65266b65793d41497a615379424f5136694834373348532d5970557261585f576c416e35564f7859364b747730267369676e61747572653d4179716d4d5776313262374c4a4536635770574545793873634d343d)

### Describe the solution you'd like
We should have a nice online image that we can show if the location is 'online'. And maybe also an image for the location 'discord'?

![discord](https://user-images.githubusercontent.com/1799914/102193210-16aad400-3ebc-11eb-9190-055ff32ad040.png)
![Artboard 19](https://user-images.githubusercontent.com/1799914/102194936-304d1b00-3ebe-11eb-97f6-dba7454176db.png)


### Motivation
Nice to have.

### Describe alternatives you've considered
Not doing anything.




Discussion:

Resolving patch:
diff --git a/website/events/migrations/0043_auto_20201215_1436.py b/website/events/migrations/0043_auto_20201215_1436.py
new file mode 100644
--- /dev/null
+++ b/website/events/migrations/0043_auto_20201215_1436.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.1.4 on 2020-12-15 13:36
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('events', '0042_auto_20200907_1835'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='event',
+            name='map_location',
+            field=models.CharField(help_text="Location of Huygens: Heyendaalseweg 135, Nijmegen. Location of Mercator 1: Toernooiveld 212, Nijmegen. Use the input 'discord' or 'online' for special placeholders. Not shown as text!!", max_length=255, verbose_name='location for minimap'),
+        ),
+    ]
diff --git a/website/events/models/event.py b/website/events/models/event.py
--- a/website/events/models/event.py
+++ b/website/events/models/event.py
@@ -107,6 +107,7 @@ class Event(models.Model, metaclass=ModelTranslateMeta):
         help_text=_(
             "Location of Huygens: Heyendaalseweg 135, Nijmegen. "
             "Location of Mercator 1: Toernooiveld 212, Nijmegen. "
+            "Use the input 'discord' or 'online' for special placeholders. "
             "Not shown as text!!"
         ),
     )
diff --git a/website/utils/snippets.py b/website/utils/snippets.py
--- a/website/utils/snippets.py
+++ b/website/utils/snippets.py
@@ -7,6 +7,7 @@
 
 from django.conf import settings
 from django.template.defaultfilters import urlencode
+from django.templatetags.static import static
 from django.utils import timezone, dateparse
 from rest_framework.exceptions import ParseError
 
@@ -42,6 +43,11 @@ def datetime_to_lectureyear(date):
 
 
 def create_google_maps_url(location, zoom, size):
+    if location.lower().strip() == "online":
+        return static("img/locations/online.png")
+    if location.lower().strip() == "discord":
+        return static("img/locations/discord.png")
+
     maps_url = (
         f"/maps/api/staticmap?"
         f"center={ urlencode(location) }&"


Test patch: