]> git.parisson.com Git - mezzo.git/commitdiff
Linked orga : content + footer
authorEmilie <zawadzki@ircam.fr>
Thu, 1 Dec 2016 15:37:56 +0000 (16:37 +0100)
committerEmilie <zawadzki@ircam.fr>
Thu, 1 Dec 2016 15:37:56 +0000 (16:37 +0100)
15 files changed:
app/migrations/shop/0010_remove_product_content_model.py [new file with mode: 0644]
app/organization/core/context_processors.py
app/organization/core/models.py
app/organization/network/admin.py
app/organization/network/migrations/0063_auto_20161201_1154.py [new file with mode: 0644]
app/organization/network/models.py
app/static/src/sass/modules/_all.scss
app/static/src/sass/modules/_linked-organizations.scss [new file with mode: 0644]
app/templates/core/inc/linked_organization_content.html [new file with mode: 0644]
app/templates/core/inc/linked_organization_footer.html [new file with mode: 0644]
app/templates/includes/footer.html
app/templates/pages/departmentpage.html
app/templates/pages/projecttopicpage.html
app/templates/pages/teampage.html
app/templates/projects/project_detail.html

diff --git a/app/migrations/shop/0010_remove_product_content_model.py b/app/migrations/shop/0010_remove_product_content_model.py
new file mode 100644 (file)
index 0000000..54a9ff0
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.11 on 2016-12-01 10:54
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('shop', '0009_product_content_model'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='product',
+            name='content_model',
+        ),
+    ]
index f0cc3e061ba09ad9a02b6c5568e7dd48f2c34294..85c6d3749076a48da6baf7560b7469d8d3458d02 100644 (file)
@@ -17,9 +17,12 @@ def settings(request):
 
     # HOST ORGANIZATION
     host_organization = Organization.objects.get(is_host=True)
-
+    linked_organizations_content = host_organization.organizations_content.all()
+    linked_organizations_footer = host_organization.organizations_footer.all()
     return {'CURRENT_SEASON': CURRENT_SEASON,
             'CURRENT_SEASON_STYLED': CURRENT_SEASON_STYLED,
             'NEWSLETTER_SUBSCRIBING_URL': NEWSLETTER_SUBSCRIBING_URL,
             'host_organization': host_organization,
+            'LINKED_ORGA_CONTENT' : linked_organizations_content,
+            'LINKED_ORGA_FOOTER' : linked_organizations_footer
             }
index e1ed5f313f3c81bda71e63b1d2049b2c45169a54..a6cede871a7cb2d1ae02c18ac0a7309de34c625f 100644 (file)
@@ -14,7 +14,7 @@ from django_countries.fields import CountryField
 
 COLOR_CHOICES = (('black', _('black')), ('yellow', _('yellow')), ('red', _('red')))
 ALIGNMENT_CHOICES = (('left', _('left')), ('center', _('center')), ('right', _('right')))
-IMAGE_TYPE_CHOICES = (('logo', _('logo')), ('slider', _('slider')), ('card', _('card')), ('page_slider', _('page - slider')), ('page_featured', _('page - featured')))
+IMAGE_TYPE_CHOICES = (('logo', _('logo')), ('logo_white', _('logo white')), ('logo_black', _('logo black')), ('slider', _('slider')), ('card', _('card')), ('page_slider', _('page - slider')), ('page_featured', _('page - featured')))
 
 
 class Description(models.Model):
index fc183a48e1a9aa8769e179c6573fc67ae69dff47..caa0bc7e0408a039853ed0aebc09e095978d74d3 100644 (file)
@@ -40,6 +40,7 @@ class OrganizationAdmin(BaseTranslationModelAdmin):
                 OrganizationImageInline,
                 OrganizationBlockInline,
                 OrganizationLinkInline ]
+    filter_horizontal = ['organizations_content', 'organizations_footer']
     list_display = ['name', 'type', 'admin_thumb']
     list_filter = ['is_on_map',]
     search_fields = ['name',]
diff --git a/app/organization/network/migrations/0063_auto_20161201_1154.py b/app/organization/network/migrations/0063_auto_20161201_1154.py
new file mode 100644 (file)
index 0000000..75c5307
--- /dev/null
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.11 on 2016-12-01 10:54
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-network', '0062_auto_20161114_1842'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='organization',
+            name='organizations_content',
+            field=models.ManyToManyField(blank=True, help_text='Usefull for host organization', related_name='_organization_organizations_content_+', to='organization-network.Organization', verbose_name='Linked organizations (in content)'),
+        ),
+        migrations.AddField(
+            model_name='organization',
+            name='organizations_footer',
+            field=models.ManyToManyField(blank=True, help_text='Usefull for host organization', related_name='_organization_organizations_footer_+', to='organization-network.Organization', verbose_name='Linked organizations (in footer)'),
+        ),
+    ]
index b81c4170a164c6ef9dd7ad95b08392f42dbc09f4..8d5863d49cd6e3a2c8cddfe8d8d67ab464526da9 100644 (file)
@@ -73,6 +73,8 @@ class Organization(Named, Address, URL, AdminThumbRelatedMixin):
     telephone = models.CharField(_('telephone'), max_length=64, blank=True, null=True)
     opening_times = models.TextField(_('opening times'), blank=True)
     subway_access = models.TextField(_('subway access'), blank=True)
+    organizations_content = models.ManyToManyField('self', verbose_name=_('Linked organizations (in content)'), related_name='organization_main', blank=True, help_text="Usefull for host organization")
+    organizations_footer = models.ManyToManyField('self', verbose_name=_('Linked organizations (in footer)'), related_name='organization_main', blank=True, help_text="Usefull for host organization")
 
     admin_thumb_type = 'logo'
 
index e1387fa6521101d986ee3ea9ad7d90b21dc9e65b..12359cf490a63c4b110a7ec9fe9b9caa15425f93 100755 (executable)
@@ -43,7 +43,7 @@
 @import 'project-details';
 @import 'map-infowindow';
 @import 'map-legend';
-
+@import 'linked-organizations';
 // Typography modules
 @import 'dashed';
 @import 'dotted';
diff --git a/app/static/src/sass/modules/_linked-organizations.scss b/app/static/src/sass/modules/_linked-organizations.scss
new file mode 100644 (file)
index 0000000..e1dd078
--- /dev/null
@@ -0,0 +1,27 @@
+$module: ".linked-organizations";
+
+#{$module} {
+
+    list-style-type: none;
+    padding: 0;
+    margin: 0;
+
+    &__item {
+
+        display: inline-block;
+        width: 30px;
+        height: 30px;
+        background-size: contain;
+        background-position: center center;
+        background-repeat: no-repeat;
+
+        @include margin(1 1 0 0);
+        
+        a {
+            width : 30px;
+            height : 30px;
+        }
+
+    }
+
+}
diff --git a/app/templates/core/inc/linked_organization_content.html b/app/templates/core/inc/linked_organization_content.html
new file mode 100644 (file)
index 0000000..22e9c49
--- /dev/null
@@ -0,0 +1,16 @@
+{% load organization_tags %}
+<div class="row">
+    <div class="pull-right">
+        <ul class="linked-organizations">
+            {% for loc in LINKED_ORGA_CONTENT %}
+                {% with loc.images|get_type:"logo_black"|first as img %}
+                <li class="linked-organizations__item">
+                    <a href="{{ loc.url }}" title="{{ loc.title }}" target="_blank">
+                        <img src="{{ MEDIA_URL }}{{ img }}" title="{{ img.title }}" />
+                    </a>
+                </li>
+                {% endwith %}
+            {% endfor %}
+        </ul>
+    </div>
+</div>
diff --git a/app/templates/core/inc/linked_organization_footer.html b/app/templates/core/inc/linked_organization_footer.html
new file mode 100644 (file)
index 0000000..e28a7fc
--- /dev/null
@@ -0,0 +1,8 @@
+{% load organization_tags %}
+{% for lof in LINKED_ORGA_FOOTER %}
+    <a href="{{ lof.url }}" target="_blank" title="{{ lof.name }}">
+        {% with lof.images|get_type:"logo_white"|first as img %}
+            <img class="footer__partner" src="{{ MEDIA_URL }}{{ img }}" title="{{ img.title }}" width="120" height="66" />
+        {% endwith %}
+    </a>
+{% endfor %}
index 2f0c1e0298b5efde7c7fe46d5037b4881180493f..ff0e8bec977cd717a5e97a340a997a117d11d4de 100644 (file)
             <div class="col-xs-4 col-sm-5 col-sm-push-1 tal">
                 <strong>{{ host_organization.description }}</strong><br/ >{% trans 'under the tutelage of' %} :<br />
                 <br />
-                <a href="http://www.culturecommunication.gouv.fr/" target="_blank" title="Ministère de la Culture et de la Communication"><img class="footer__partner" width="120" height="66" src="{% static "img/partners/logo-ministere-culture.png" %}" /></a>
-                <a href="http://www.cnrs.fr/" target="_blank" title="Centre National de la Recherche Scientifique"><img class="footer__partner" width="120" height="66" src="{% static "img/partners/logo-cnrs.png" %}" /></a>
-                <a href="http://www.upmc.fr/" target="_blank" title="Université Pierre et Marie Curie"><img class="footer__partner" width="120" height="66" src="{% static "img/partners/logo-upmc.png" %}" /></a>
-                <a href="http://www.inria.fr/" target="_blank" title="Inria"><img class="footer__partner" width="120" height="66" src="{% static "img/partners/logo-inria.png" %}" /></a>
+                {% if LINKED_ORGA_FOOTER %}
+                    {% include 'core/inc/linked_organization_footer.html' %}
+                {% endif %}
             </div>
 
             <div class="col-xs-4 col-sm-2 col-sm-push-1 tal">
index c122ccdb42fd5011f73f98c2684ca6538d4aa375..8c8b3688593c4e88e95c417364062dad6fc8a49f 100644 (file)
         {% endeditable %}
     {% endif %}-->
 
+    {% if LINKED_ORGA_CONTENT %}
+        {% include 'core/inc/linked_organization_content.html' %}
+    {% endif %}
+
     {% if page.departmentpage.content %}
      {% editable page.departmentpage.content %}
         {{ page.departmentpage.content|richtext_filters|safe }}
index 370a8a648b30c59045b439ea07eeeb63f148fcac..3f6448451f4bf2474b58db658bea84682ec48068 100644 (file)
 {% endblock %}
 
 {% block page_content %}
-
+    {% if LINKED_ORGA_CONTENT %}
+        {% include 'core/inc/linked_organization_content.html' %}
+    {% endif %}
+    
     {% if page.projecttopicpage.sub_title %}
         {% editable page.projecttopicpage.sub_title %}
             <div class="chapo">
index fce3cb8b559e4a35ed730b4677dabc92534c734b..2e90fc671f49bc725c4789e548648bce489a188c 100644 (file)
 
 {% block page_content %}
 
+    {% if LINKED_ORGA_CONTENT %}
+        {% include 'core/inc/linked_organization_content.html' %}
+    {% endif %}
+
     {% if page.teampage.sub_title %}
         {% editable page.teampage.sub_title %}
             <div class="chapo">
index c1caaca450ee751d3fb3f844800bfaa8c4c57069..61cec702b9a4c6385064de929839a1eb07787c00 100644 (file)
         <h1 class="dotted">{{ project.title }}</h1>
     {% endeditable %}
 
+    {% if LINKED_ORGA_CONTENT %}
+        {% include 'core/inc/linked_organization_content.html' %}
+    {% endif %}
+
     {% if project.description %}
         {% editable project.description %}
             <div class="chapo">