Repository: akvo/akvo-rsr

Issue:
Add tag to project page to show part of larger consortium/campaign
See https://github.com/akvo/akvo-product-design/issues/94

To clarify:
- Add setting on keywords: logo and boolean for showing logo
- Only for core RSR (not on Akvo Pages): 
  - Add logo on project page (in the header?) if the project is linked to keyword, and the keyword has a logo and the boolean for showing logo is true.
  - In case of multiple keywords, multiple logos should be shown
## Test plan
1. In the Keyword admin, there should be the possibility to add a logo
2. If a project is linked to a keyword that has a logo selected, this logo should be displayed in the project header on core RSR
3. **(updated)** The logo should only be displayed in the project header on Akvo Pages if this is set in the Akvo Page admin.
4. If a project is linked to > 2 keywords with logos, only 2 logos should be shown



Discussion:
@lauraroverts I've now implemented it like this, with a maximum of 2 logos, you think that's ok?

![screen shot 2015-06-16 at 09 46 57](https://cloud.githubusercontent.com/assets/1497367/8178278/c8763ed0-140c-11e5-827d-5b46543fa6ba.png)

In theory it's possible that a project is part of more than 2 campaigns/consortia, but let's do it like this with a maximum of 2 logos. 

Lissy raised an issue: Aqua for All has got an Akvo Page showing all their projects. Amongst these projects, there are also Walking for Water projects. However, the logos are not visible at Akvo Pages, and therefore she had to create a new sponsor partner in order to show that some of the Aqua for All projects are part of the Walking for Water campaign. If we are going to remove the sponsor partners in the future, there is no way to show these logos at Pages. Is it easy to add logos to Pages too with the possibility to turn them on/off?


Resolving patch:
diff --git a/akvo/rsr/admin.py b/akvo/rsr/admin.py
--- a/akvo/rsr/admin.py
+++ b/akvo/rsr/admin.py
@@ -1044,7 +1044,7 @@ class PartnerSiteAdmin(TimestampsAdminDisplayMixin, admin.ModelAdmin):
                                'piwik_id',))),
         (u'Style and content',
             dict(fields=('all_maps', 'about_box', 'about_image', 'custom_css', 'custom_logo',
-                         'custom_favicon',))),
+                         'custom_favicon', 'show_keyword_logos',))),
         (u'Languages and translation', dict(fields=('google_translation',))),
         (u'Social', dict(fields=('twitter_button', 'facebook_button', 'facebook_app_id',))),
         (_(u'Project selection'), {
diff --git a/akvo/rsr/migrations/0012_partnersite_show_keyword_logos.py b/akvo/rsr/migrations/0012_partnersite_show_keyword_logos.py
new file mode 100644
--- /dev/null
+++ b/akvo/rsr/migrations/0012_partnersite_show_keyword_logos.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('rsr', '0011_auto_20150630_0823'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='partnersite',
+            name='show_keyword_logos',
+            field=models.BooleanField(default=False, verbose_name='Show keyword logos on project pages'),
+            preserve_default=True,
+        ),
+    ]
diff --git a/akvo/rsr/models/partner_site.py b/akvo/rsr/models/partner_site.py
--- a/akvo/rsr/models/partner_site.py
+++ b/akvo/rsr/models/partner_site.py
@@ -90,6 +90,8 @@ def show_keywords(self):
             u'location bar, on tabs and in the bookmark menu.</p>'
         )
     )
+    show_keyword_logos = models.BooleanField(_(u'Show keyword logos on project pages'),
+                                             default=False)
     about_box = ValidXMLTextField(
         _(u'about box text'), max_length=500, blank=True, help_text=_(
             u'Enter HTML that will make up the top left box of the home page. (500 characters)'


Test patch: