]> git.parisson.com Git - mezzo.git/commitdiff
Fix organization order, rename context variable (no caps plz!)
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 5 Dec 2016 18:53:02 +0000 (19:53 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 5 Dec 2016 18:53:02 +0000 (19:53 +0100)
13 files changed:
app/organization/core/context_processors.py
app/organization/network/models.py
app/templates/agenda/event_list.html
app/templates/core/inc/linked_organization_content.html
app/templates/core/inc/linked_organization_footer.html
app/templates/home/inc/services.html
app/templates/includes/footer.html
app/templates/pages/custompage.html
app/templates/pages/departmentpage.html
app/templates/pages/projecttopicpage.html
app/templates/pages/teampage.html
app/templates/projects/project_detail.html
bin/pull.sh

index b5b3ad5ee4a786cde8999cc99b6e4eed60c2ecac..684b776bf861e5c9a0eaad41b81d4b834fac0b6b 100644 (file)
@@ -6,26 +6,26 @@ from organization.network.models import Organization
 def settings(request):
     date_now = datetime.now()
     # SEASON
-    CURRENT_SEASON = int(date_now.year) - 1 if datetime(date_now.year, 1,1) <= date_now and date_now <= datetime(date_now.year, 7, 31) else date_now.year
-    CURRENT_SEASON_STYLED = str(CURRENT_SEASON)[-2:]+"."+str(CURRENT_SEASON+1)[-2:]
+    current_season = int(date_now.year) - 1 if datetime(date_now.year, 1,1) <= date_now and date_now <= datetime(date_now.year, 7, 31) else date_now.year
+    current_season_styled = str(current_season)[-2:]+"."+str(current_season+1)[-2:]
 
     # NEWSLETTER
     newsletter_page = Page.objects.filter(slug="newsletter")
-    NEWSLETTER_SUBSCRIBING_URL = ""
+    newsletter_subscribing_url = ""
     if newsletter_page:
-        NEWSLETTER_SUBSCRIBING_URL = newsletter_page.first().get_absolute_url()
+        newsletter_subscribing_url = newsletter_page.first().get_absolute_url()
 
     # HOST ORGANIZATION
-    host_organization = Organization.objects.get(is_host=True)
-    linked_organizations_content = host_organization.organizations_content.filter(organizations_content__id=host_organization.id).order_by('organizations_content__order')
-    linked_organizations_footer = host_organization.organizations_footer.filter(organizations_footer__id=host_organization.id).order_by('organizations_footer__order')
+    host_org = Organization.objects.get(is_host=True)
+    linked_org_content = host_org.organizations_content.filter(organizations_content__id=host_org.id).order_by('organizations_content__order')
+    linked_org_footer = host_org.organizations_footer.filter(organizations_footer__id=host_org.id).order_by('organizations_footer__order')
     research_slug = "recherche"
 
-    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,
-            'RESEARCH_SLUG' : research_slug
+    return {'current_season': current_season,
+            'current_season_styled': current_season_styled,
+            'newsletter_subscribing_url': newsletter_subscribing_url,
+            'host_organization': host_org,
+            'linked_organization_content' : linked_org_content,
+            'linked_organization_footer' : linked_org_footer,
+            'research_slug' : research_slug
             }
index a023187245c4fc11bc555e69f1868c0b81da33fb..6d9111f58719c8a7e053373bd27b80c3d8ab8113 100644 (file)
@@ -73,8 +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")
+    organizations_content = models.ManyToManyField('self', verbose_name=_('Linked organizations (in content)'), related_name='organizations_content', blank=True, help_text="Usefull for host organization")
+    organizations_footer = models.ManyToManyField('self', verbose_name=_('Linked organizations (in footer)'), related_name='organizations_footer', blank=True, help_text="Usefull for host organization")
     order = models.IntegerField(_('order number'), default=10)
 
     admin_thumb_type = 'logo'
index 7fc15a49879be06a94a0e538d78ea7116119b2ae..f64ee271f14a2ba9d7169ccec2acbfcc5edcbf99 100644 (file)
@@ -52,7 +52,7 @@
                         {% if tag and not tag|tag_is_excluded or not tag and not is_archive %}
                         <a class="banner banner--light banner--sidebar hide-until-sm" href="{% url 'event_list_tag' 'tournees' %}" style="background-image:url({% static 'img/services/tours.jpg' %});">
                             <div class="banner__content">
-                                <div class="banner__title fsxxxl">{% trans "On tour" %} {{ CURRENT_SEASON_STYLED }}
+                                <div class="banner__title fsxxxl">{% trans "On tour" %} {{ current_season_styled }}
                                 </div>
                             </div>
                         </a>
 
                                     {% if not is_archive %}
                                         <li class="nav-tree__item">
-                                            <a class="nav-tree__link" href="{% url "event_list_year" CURRENT_SEASON %}" title="{% trans 'archive' %}">{% trans 'Archives' %}</a>
+                                            <a class="nav-tree__link" href="{% url "event_list_year" current_season %}" title="{% trans 'archive' %}">{% trans 'Archives' %}</a>
                                         </li>
                                     {% endif %}
                                 </ul>
                             {% if tag and not tag|tag_is_excluded or not tag and not is_archive %}
                             <a class="banner banner--light banner--sidebar hide-from-sm" href="{% url 'event_list_tag' 'tournees' %}" style="background-image:url({% static 'img/services/tours.jpg' %});">
                                 <div class="banner__content">
-                                    <div class="banner__title fsxxxl">{% trans "On tour" %} {{ CURRENT_SEASON_STYLED }}
+                                    <div class="banner__title fsxxxl">{% trans "On tour" %} {{ current_season_styled }}
                                     </div>
                                 </div>
                             </a>
index 22e9c4967ec055ea41bf2f3abb25f34ddbff0163..dd4b613c2c0bf364ab3cd472a97220e5ed7d81aa 100644 (file)
@@ -2,7 +2,7 @@
 <div class="row">
     <div class="pull-right">
         <ul class="linked-organizations">
-            {% for loc in LINKED_ORGA_CONTENT %}
+            {% for loc in linked_organization_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">
index e28a7fc7807ea419875d50652a4f15936afcf0c3..87e942e89b1c6ca47ef9d3ce6738ef35ef86c835 100644 (file)
@@ -1,5 +1,5 @@
 {% load organization_tags %}
-{% for lof in LINKED_ORGA_FOOTER %}
+{% for lof in linked_organization_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" />
index 4f16d83dca8547aa1e24df59000d1aef373ab8c2..d36317675e34b7fcd15cd1bf1e51ec1c33fe1571 100644 (file)
@@ -6,7 +6,7 @@
             <a class="banner banner--light" href="{% url 'event_list_tag' 'tournees' %}" style="background-image:url({% static 'img/services/tours.jpg' %});">
                 <div class="banner__content">
                     <div class="banner__title fsxxxl">
-                        {% trans 'On Tour' %} {{ CURRENT_SEASON_STYLED }}
+                        {% trans 'On Tour' %} {{ current_season_styled }}
                     </div>
                     <div class="banner__desc fss">
                         {% blocktrans %}Campo Santo, Songes et Métamorphoses, Providences, UM souverain moteur de toutes choses...{% endblocktrans %}
index ff0e8bec977cd717a5e97a340a997a117d11d4de..78a04161e0ab05d69ceb3e11d9dbf6ffb2a72923 100644 (file)
@@ -3,7 +3,7 @@
     <div class="container">
         <div class="row">
             <div class="col-sm-11 tar-sm tal-xs">
-                <a class="button button--small button--white mr3" href="{{ NEWSLETTER_SUBSCRIBING_URL }}">
+                <a class="button button--small button--white mr3" href="{{ newsletter_subscribing_url }}">
                     {% trans "Subscribe to our newsletter" %}
                 </a>
                 {% for link in host_organization.links.all %}
@@ -53,7 +53,7 @@
             <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 />
-                {% if LINKED_ORGA_FOOTER %}
+                {% if linked_organization_footer %}
                     {% include 'core/inc/linked_organization_footer.html' %}
                 {% endif %}
             </div>
index e8c93f872b0270d3b7bc87a2003f0442ab961d51..6473a7e523cba90ced8cbe80129e6115de72aca4 100644 (file)
@@ -23,7 +23,7 @@
     {% block page_content %}
 
         {% with page.get_ascendants|last as top_level_parent %}
-            {% if LINKED_ORGA_CONTENT and RESEARCH_SLUG == top_level_parent.slug %}
+            {% if linked_organization_content and research_slug == top_level_parent.slug %}
                 {% include 'core/inc/linked_organization_content.html' %}
             {% endif %}
         {% endwith %}
index 30b6a4639a92d778ade457a77cca8eda6e56f00d..c83813dd168d5103e4bf598f56a0e60573b92784 100644 (file)
@@ -25,7 +25,7 @@
             </div>
         {% endeditable %}
     {% endif %}-->
-    {% if LINKED_ORGA_CONTENT and RESEARCH_SLUG == page.departmentpage.slug %}
+    {% if linked_organization_content and research_slug == page.departmentpage.slug %}
         {% include 'core/inc/linked_organization_content.html' %}
     {% endif %}
 
index c4755d6ea89a5a335b81d4e7be3c1d0b87a427e1..e347dcbaaf02421feba35ee9165954b202e138e3 100644 (file)
@@ -35,7 +35,7 @@
 
 {% block page_content %}
     {% with page.get_ascendants|last as top_level_parent %}
-        {% if LINKED_ORGA_CONTENT and RESEARCH_SLUG == top_level_parent.slug %}
+        {% if linked_organization_content and research_slug == top_level_parent.slug %}
             {% include 'core/inc/linked_organization_content.html' %}
         {% endif %}
     {% endwith %}
index 46254fcf4433361bda2e98af312b019d2954a896..8a28ccb9057040c046a1b761e0c25b6609597ee1 100644 (file)
@@ -21,7 +21,7 @@
 
 {% block page_content %}
     {% with page.get_ascendants|last as top_level_parent %}
-        {% if LINKED_ORGA_CONTENT and RESEARCH_SLUG == top_level_parent.slug %}
+        {% if linked_organization_content and research_slug == top_level_parent.slug %}
             {% include 'core/inc/linked_organization_content.html' %}
         {% endif %}
     {% endwith %}
index ab4f945e2dae70ff7f2630b3c4b3e1f9aee94475..50f43bfb53c4272ce7c5f8206de54584810af174 100644 (file)
@@ -46,7 +46,7 @@
     {% endeditable %}
 
     {% with page.get_ascendants|last as top_level_parent %}
-        {% if LINKED_ORGA_CONTENT and RESEARCH_SLUG == top_level_parent.slug %}
+        {% if linked_organization_content and research_slug == top_level_parent.slug %}
             {% include 'core/inc/linked_organization_content.html' %}
         {% endif %}
     {% endwith %}
index 94555059fa17b08d6d9fdd86ae7f65cb03707fc5..8b6a0680cc8905469183624b648df3f4d98cc55a 100755 (executable)
@@ -5,4 +5,4 @@ sudo chown -R $USER var/backup
 git pull
 git submodule foreach git pull
 docker-compose run db /srv/bin/db/restore.sh
-gulp build
+docker-compose run app bash -c "cd /srv && bower --allow-root install && gulp build"