Repository: svthalia/concrexit

Issue:
Add support for multiple local partners
### Is your feature request related to a problem? Please describe.
We really want to be able to have multiple local partners at Thalia. And the website current does not support this.

### Describe the solution you'd like
We would like the ability to add multiple local partners.

### Motivation
We think it's useful to have multiple local partners so we can show our students what is available in Nijmegen.

### Describe alternatives you've considered
Only having one local partner, which does not make sense in the current partner climate.

### Additional context
The local partner is also shown in the newsletter.


Discussion:
I know you're not going to agree with me and therefore I am very sorry to say this.
But this is _not_ a bug.

The local partner functionality was implemented with the idea in mind that there is only 1 and it specifically [has code](https://github.com/svthalia/concrexit/blob/5550bc58b5d687c99e1c0dbbb922bd77d605f9d9/website/partners/models.py#L76) (like the main partner) that disables the option for any other partners.

Since you created the issue as a bug with a high priority I am assuming this was only found out when trying to enter info into the website and thus we currently officially have 2 local partners?

If we were to decide to change this to a feature request (and I suppose we have to?) the following things need to be considered:
- If there are multiple local partners we probably need to give them equal exposure on the partners page. Are we going to limit the number of local partners? How will we make sure the partners page looks decent with any number of local partners?
- The newsletter currently contains a [hardcoded url](https://github.com/svthalia/concrexit/blob/de45579808684c9a0b6ebd037afb93188f87a096/website/newsletters/templates/newsletters/email.html#L196) to a partner logo that is in the codebase
  - These logos will need to be replaced/added etc
  - Maybe it is time to find a solution for those images that is dynamic and still allows us to save the newsletter HTML without the image ever disappearing. Maybe we should start using base64 embeds? Does that work in emails? No idea.
My idea was also that there should only be one local partner. However, Michiel and Jen have told me that this is not the case and the idea was always to have multiple local partners. We also already have signed contracts for two local partners. Yes, I know this was programmed so that only 1 local partner can be set, but this needs to be changed. 

I suggest for now that we can have up to three (although preferably one or two) local partners and that they are located below the main partner, like so:
```
                 [ main partner ]

[ local partner] [ local partner] [ local partner ]
```

I think it'd be a good idea to change the newsletter template and make this dynamic. I may work on vacancies in the newsletter in the future, so it will probably be a good exercise to do this properly this time.


Resolving patch:
diff --git a/website/newsletters/emails.py b/website/newsletters/emails.py
--- a/website/newsletters/emails.py
+++ b/website/newsletters/emails.py
@@ -40,7 +40,7 @@ def send_newsletter(newsletter):
     text_template = get_template("newsletters/email.txt")
 
     main_partner = Partner.objects.filter(is_main_partner=True).first()
-    local_partner = Partner.objects.filter(is_local_partner=True).first()
+    local_partners = Partner.objects.filter(is_local_partner=True)
 
     with mail.get_connection() as connection:
         language = ("en", "English")
@@ -52,7 +52,7 @@ def send_newsletter(newsletter):
             "newsletter": newsletter,
             "agenda_events": events,
             "main_partner": main_partner,
-            "local_partner": local_partner,
+            "local_partners": local_partners,
             "lang_code": language[0],
         }
 
diff --git a/website/newsletters/views.py b/website/newsletters/views.py
--- a/website/newsletters/views.py
+++ b/website/newsletters/views.py
@@ -49,7 +49,7 @@ def preview(request, pk, lang=None):
             "newsletter": newsletter,
             "agenda_events": events,
             "main_partner": Partner.objects.filter(is_main_partner=True).first(),
-            "local_partner": Partner.objects.filter(is_local_partner=True).first(),
+            "local_partners": Partner.objects.filter(is_local_partner=True),
             "lang_code": lang_code,
         },
     )


Test patch: