]> git.parisson.com Git - mezzo.git/commitdiff
hide event end date when > 3h
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 31 Mar 2016 16:22:22 +0000 (18:22 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 31 Mar 2016 16:22:22 +0000 (18:22 +0200)
app/deploy/start_app.sh
app/festival/templatetags/festival_tags.py
app/sandbox/local_settings.py
app/templates/agenda/includes/event_metainfo.html
docker-compose.yml
requirements-dev.txt
scripts/restore_db_eve.sh

index 664d9bfeeff33fd85861c200f5f8501739234b2a..320752d6256789410da3673649147f2b364f9468 100644 (file)
@@ -19,6 +19,7 @@ patterns='*.js;*.css;*.jpg;*.jpeg;*.gif;*.png;*.svg;*.ttf;*.eot;*.woff;*.woff2'
 
 # Staging
 # pip install psycopg2
+# pip install -U https://forge.ircam.fr/p/django-eve/source/download/dev/
 
 chown -R $uid:$gid $media
 
index 32351dab8cd8c12cc3a392b1cef39cea55d774da..956cc30298b532bcc221ec8e49734cfe0449b964 100644 (file)
@@ -24,3 +24,7 @@ def festival_event_featured(*args):
             if hasattr(obj, 'featured_image_header'):
                 featured.append(obj)
     return featured
+
+@register.filter
+def subtract(value, arg):
+    return value - arg
index 3cc0a20640ab50d095a4c09fe355c43933a48e75..dec4e3ecb3b742035b9fa5aaa9d87a3d455dee5a 100644 (file)
@@ -19,22 +19,22 @@ DATABASES = {
          'HOST': 'db',      # Set to empty string for localhost. Not used with sqlite3.
          'PORT': '3306',      # Set to empty string for default. Not used with sqlite3.
     },
-    # 'default': {
-    #     'ENGINE': 'django.db.backends.postgresql_psycopg2',  # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
-    #     'USER': 'postgres',      # Not used with sqlite3.
-    #     'PASSWORD': 'mysecretpassword',  # Not used with sqlite3.
-    #     'NAME': 'manifeste',
-    #     'HOST': 'db',      # Set to empty string for localhost. Not used with sqlite3.
-    #     'PORT': '5432',      # Set to empty string for default. Not used with sqlite3.
-    # },
     'eve': {
         'ENGINE': 'django.db.backends.postgresql_psycopg2',
         'NAME': 'eve',
-        'USER': 'postgres',
-        'PASSWORD': 'mysecretpassword',
+        'USER': 'eve',
+        'PASSWORD': 'HmazS2frT',
         'HOST': 'pgdb',
         'PORT': '5432',
     },
+    # 'eve': {
+    #     'ENGINE': 'django.db.backends.postgresql_psycopg2',
+    #     'NAME': 'eve',
+    #     'USER': 'django',
+    #     'PASSWORD': 'q2nqzt0WGnwWé,256',
+    #     'HOST': 'eve.ircam.fr',
+    #     'PORT': '5432',
+    # },
 
 }
 
@@ -96,3 +96,5 @@ warnings.filterwarnings(
         RuntimeWarning, r'django\.db\.models\.fields')
 
 EVENT_GOOGLE_MAPS_DOMAIN = 'maps.google.fr'
+
+DATABASE_ROUTERS = ['eve.routers.EveRouter',]
index 312be9428dc45f38a8ed77dba76802ee52363f85..462d02e16b8f7f94186744c69f3dc931e02cd64a 100644 (file)
@@ -1,11 +1,10 @@
-{% load i18n mezzanine_tags event_tags %}
+{% load i18n mezzanine_tags event_tags festival_tags %}
 {% editable event.start event.end event.location %}
 <div class="event__meta">
     <div class="event__meta__inner">
         {{ event.start }}
         {% if event.end %}
-        <br>
-        {% if event.end|date == event.start|date %}{{ event.end|time:"TIME_FORMAT" }}{% else %}{{ event.end }}{% endif %}
+        {% if event.end|date == event.start|date and event.end.hour|subtract:event.start.hour > 3 %}{{ event.end|time:"TIME_FORMAT" }}{% endif %}
         {% endif %}
         {% if event.location %}
         <a href="{% url "event_list_location" event.location.slug %}" class="event__meta__location">{{ event.location }}</a>
index 9df06a3c56c2bde136f6a19a00508ace71432dc8..e1a1d08d65f46b31e6836c4facf0237d62a6ce53 100644 (file)
@@ -38,6 +38,15 @@ db:
     - MYSQL_USER=manifeste
     - MYSQL_PASSWORD=Onukifsid7
 
+pgdb:
+  image: postgres
+  volumes_from:
+    - data
+  environment:
+    - POSTGRES_PASSWORD=HmazS2frT
+    - POSTGRES_USER=eve
+    - POSTGRES_DB=eve
+
 app:
   build: .
   command: /bin/sh deploy/start_app.sh
@@ -49,7 +58,8 @@ app:
     - "8000"
   links:
     - db
-    
+    - pgdb
+
 nginx:
   image: nginx
   ports:
index d6ec169062fabb219e653a37f15411c9083dc82a..420203dd193c10371729fecbe705fbb833baf148 100644 (file)
@@ -1,3 +1,3 @@
--e git+https://github.com/yomguy/mezzanine-agenda.git#egg=mezzanine-agenda-0.2.0
+-e git+https://github.com/yomguy/mezzanine-agenda.git#egg=mezzanine-agenda-0.2.1
 -e git+https://github.com/stephenmcd/mezzanine.git#egg=mezzanine-4.1-dev
--e git+https://github.com/yomguy/django-eve.git#egg=django-eve-1.0
+https://forge.ircam.fr/p/django-eve/source/download/dev/
index d29766d69513d1364cb2cac1e151ee586a55ec10..2c0f3403c2143e2188f8f24ca0113ac81dcaac8a 100755 (executable)
@@ -1,13 +1,14 @@
 #!/bin/bash
 
-export PGPASSWORD="mysecretpassword"
-db_exists=`psql -hpgdb -Upostgres -lqt  | cut -d \| -f 1 | grep -w eve | wc -l`
+export PGPASSWORD="HmazS2frT"
 
-if [ $db_exists == 0 ]; then
-    psql -hpgdb -Upostgres -c 'create role eve'
-else
-    psql -hpgdb -Upostgres  -c 'drop database eve'
+db_exists=`psql -hpgdb -Ueve -lqt  | cut -d \| -f 1 | grep -w eve | wc -l`
+
+if [ ! $db_exists == 0 ]; then
+    psql -hpgdb -Ueve  -c 'drop database eve'
 fi
 
-psql -hpgdb -Upostgres -c 'create database eve'
-gunzip -c /srv/backup/eve.sql.gz | psql -hpgdb -Upostgres -q eve
+psql -hpgdb -Ueve -c 'create role eve'
+psql -hpgdb -Ueve -c 'create role django'
+psql -hpgdb -Ueve -c 'create database eve'
+gunzip -c /srv/backup/eve.sql.gz | psql -hpgdb -Ueve -q eve