--- a/README.md Tue Jun 05 11:34:52 2018 +0200
+++ b/README.md Tue Jun 05 18:36:39 2018 +0200
@@ -35,19 +35,19 @@
to create an admin user
+
- Collect static files
python manage.py collectstatic
-
+
- Use Docker adress for HOST in settings
-- don't use os.path.join(BASE_DIR, 'media') in settings
+- don't use os.path.join(BASE_DIR, 'media') in settings
- make JS_DEV_MODE afalse (if not, it will not connect correctly on server)
-
### Iconolab to Iconolab-mcc
- Create uploads and cache repertories
@@ -90,7 +90,7 @@
- Add help and footer templates
iconolab-mcc/src/iconolab_mcc/templates/misc/help.html
- iconolab-mcc/src/iconolab_mcc/templates/partials/footer.html
+ iconolab-mcc/src/iconolab_mcc/templates/partials/footer.html
@@ -119,7 +119,6 @@
python manage.py rebuild_index
-
### 2. Python server
- cd into the iconolab/src folder and run
--- a/docker-compose.yml Tue Jun 05 11:34:52 2018 +0200
+++ b/docker-compose.yml Tue Jun 05 18:36:39 2018 +0200
@@ -3,15 +3,17 @@
services:
elasticsearch:
- image: elasticsearch:1.7-alpine
+ image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
environment:
- - "transport.host=127.0.0.1"
- - "http.cors.enabled=true"
- - "http.cors.allow-origin=*"
- - "http.cors.allow-headers=Authorization"
+ # - "transport.host=127.0.0.1"
+ # - "http.cors.enabled=true"
+ # - "http.cors.allow-origin=*"
+ # - "http.cors.allow-headers=Authorization"
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
+ - "discovery.type=single-node"
ports:
- 9200:9200
+ - 9300:9300
volumes:
- /usr/share/elasticsearch/data
@@ -22,3 +24,4 @@
volumes:
- /var/lib/postgresql/data
+
--- a/src/iconolab_mcc/settings/__init__.py Tue Jun 05 11:34:52 2018 +0200
+++ b/src/iconolab_mcc/settings/__init__.py Tue Jun 05 18:36:39 2018 +0200
@@ -12,6 +12,7 @@
import os, logging, sys
+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -95,11 +96,14 @@
'django.core.context_processors.i18n',
'iconolab.utils.context_processors.env',
],
+ 'libraries': {
+ 'iconolab_mcc_tags':'iconolab_mcc.templatetags.iconolab_mcc_tags'
+ }
},
},
]
-WSGI_APPLICATION = 'iconolab.wsgi.application'
+WSGI_APPLICATION = 'iconolab_mcc.wsgi.application'
# Database
--- a/src/iconolab_mcc/settings/dev.py.tmpl Tue Jun 05 11:34:52 2018 +0200
+++ b/src/iconolab_mcc/settings/dev.py.tmpl Tue Jun 05 18:36:39 2018 +0200
@@ -86,11 +86,14 @@
'django.template.context_processors.i18n',
'iconolab.utils.context_processors.env',
],
+ 'libraries': {
+ 'iconolab_mcc_tags':'iconolab_mcc.templatetags.iconolab_mcc_tags'
+ }
},
},
]
-WSGI_APPLICATION = 'iconolab.wsgi.application'
+WSGI_APPLICATION = 'iconolab_mcc.wsgi.application'
# Database
@@ -171,7 +174,7 @@
}
}
-ELASTICSEARCH_DSL={
+ELASTICSEARCH_DSL = {
'default': {
'hosts': 'localhost:9200'
},
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab_mcc/templates/iconolab/metadatas/detail_image_metadatas.html Tue Jun 05 18:36:39 2018 +0200
@@ -0,0 +1,22 @@
+{% load iconolab_mcc_tags %}
+
+<dl class="dl-horizontal">
+ {% if item.metadatas.metadata_obj.designation %}<dt>Désignation</dt><dd>{{item.metadatas.metadata_obj.designation}}</dd>{% endif %}
+ {% if item.metadatas.metadata_obj.authors %}<dt>Auteur(s)</dt><dd>{{item.metadatas.metadata_obj.authors}}</dd>{% endif %}
+ {% if item.metadatas.metadata_obj.field %}<dt>Domaine</dt><dd>{{item.metadatas.metadata_obj.field}}</dd>{% endif %}
+ {% if item.metadatas.metadata_obj.conservation_location %}<dt>Conservé à</dt><dd>{{item.metadatas.metadata_obj.conservation_location}}</dd>{% endif %}
+ {% if item.metadatas.metadata_obj.datation %}<dt>Datation</dt><dd>{{item.metadatasmetadata_obj..datation}}</dd>{% endif %}
+ {% if item.metadatas.metadata_obj.technics %}<dt>Techniques</dt><dd>{{item.metadatas.metadata_obj.technics}}</dd>{% endif %}
+ {% if item.metadatas.metadata_obj.measurements %}<dt>Mesures : {{item.metadatas.metadata_obj.measurements}}</h5>{% endif %}
+ {% if item.metadatas.metadata_obj.create_or_usage_location %}<dt>Lieu de création/utilisation</dt><dd>{{item.metadatas.metadata_obj.create_or_usage_location}}</dd>{% endif %}
+ {% if item.metadatas.metadata_obj.discovery_context %}<dt>Contexte de découverte</dt><dd>{{item.metadatas.metadata_obj.discovery_context}}</dd>{% endif %}
+ {% if item.metadatas.metadata_obj.photo_credits %}<dt>Crédits photographiques</dt><dd>{{item.metadatas.metadata_obj.photo_credits}}</dd>{% endif %}
+ {% if item.metadatas.metadata_obj.inventory_number %}<dt>Numéro d'inventaire</dt><dd>{{item.metadatas.metadata_obj.inventory_number}}</dd>{% endif %}
+</dl>
+{% if item.metadatas.metadata_obj.joconde_ref %}
+<p class="text-center">
+ <a href= "{% joconde_link item.metadatas %}" target="_blank">
+ Cet objet dans Joconde catalogue collectif des collections des musées de France
+ </a>
+</p>
+{% endif %}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab_mcc/templates/iconolab/metadatas/detail_item_metadatas.html Tue Jun 05 18:36:39 2018 +0200
@@ -0,0 +1,15 @@
+{% load iconolab_mcc_tags %}
+
+{% if item.metadatas.metadata_obj.designation %}<h3>Désignation : <small>{{item.metadatas.metadata_obj.designation}}</small></h3>{% endif %}
+{% if item.metadatas.metadata_obj.authors %}<h4>Auteur(s) : <small>{{item.metadatas.metadata_obj.authors}}</small></h4>{% endif %}
+{% if item.metadatas.metadata_obj.field %}<h4>Domaine : <small>{{item.metadatas.metadata_obj.field}}</small></h4>{% endif %}
+{% if item.metadatas.metadata_obj.conservation_location %}<h4>Conservé à : <small>{{item.metadatas.metadata_obj.conservation_location}}</small></h4>{% endif %}
+{% if item.metadatas.metadata_obj.datation %}<h4>Datation : <small>{{item.metadatas.metadata_obj.datation}}</small></h4>{% endif %}
+{% if item.metadatas.metadata_obj.technics %}<h5>Techniques : <small>{{item.metadatas.metadata_obj.technics}}</small></h5>{% endif %}
+{% if item.metadatas.metadata_obj.measurements %}<h5>Mesures : {{item.metadatas.metadata_obj.measurements}}</h5>{% endif %}
+{% if item.metadatas.metadata_obj.create_or_usage_location %}<h5>Lieu de création/utilisation : <small>{{item.metadatas.metadata_obj.create_or_usage_location}}</small></h5>{% endif %}
+{% if item.metadatas.metadata_obj.discovery_context %}<h5>Contexte de découverte : <small>{{item.metadatas.metadata_obj.discovery_context}}</small></h5>{% endif %}
+{% if item.metadatas.metadata_obj.photo_credits %}<h5>Crédits photographiques : <small>{{item.metadatas.metadata_obj.photo_credits}}</small></h5>{% endif %}
+{% if item.metadatas.metadata_obj.inventory_number %}<h5>Numéro d'inventaire : <small>{{item.metadatas.metadata_obj.inventory_number}}</small></h5>{% endif %}
+{% if item.metadatas.metadata_obj.joconde_ref %}<h5><a href="{% joconde_link item.metadatas %}" target="_blank">Cet objet dans Joconde, catalogue collectif des collections des musées de France</a></h5>{% endif %}
+<br>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab_mcc/templates/iconolab/metadatas/image_search_metadatas.html Tue Jun 05 18:36:39 2018 +0200
@@ -0,0 +1,10 @@
+{% if item.object.metadatas.metadata_obj.designation %}<h3>Désignation : <small>{{item.object.metadatas.metadata_obj.designation}}</small></h3>{% endif %}
+{% if item.object.metadatas.metadata_obj.authors %}<h4>Auteur(s) : <small>{{item.object.metadatas.metadata_obj.authors}}</small></h4>{% endif %}
+{% if item.object.metadatas.metadata_obj.conservation_location %}<h4>Conservé à : <small>{{item.object.metadatas.metadata_obj.conservation_location}}</small></h4>{% endif %}
+{% if item.object.metadatas.metadata_obj.datation %}<h4>Datation : <small>{{item.object.metadatas.metadata_obj.datation}}</small></h4>{% endif %}
+{% if item.object.metadatas.metadata_obj.technics %}<h5>Techniques : <small>{{item.object.metadatas.metadata_obj.technics}}</small></h5>{% endif %}
+{% if item.object.metadatas.metadata_obj.measurements %}<h5>Mesures : {{item.object.metadatas.metadata_obj.measurements}}</h5>{% endif %}
+{% if item.object.metadatas.metadata_obj.create_or_usage_location %}<h5>Lieu de création/utilisation : <small>{{item.object.metadatas.metadata_obj.create_or_usage_location}}</small></h5>{% endif %}
+{% if item.object.metadatas.metadata_obj.discovery_context %}<h5>Contexte de découverte : <small>{{item.object.metadatas.metadata_obj.discovery_context}}</small></h5>{% endif %}
+{% if item.object.metadatas.metadata_obj.photo_credits %}<h5>Crédits photographiques : <small>{{item.object.metadatas.metadata_obj.photo_credits}}</small></h5>{% endif %}
+{% if item.object.metadatas.metadata_obj.inventory_number %}<h5>Numéro d'inventaire : <small>{{item.object.metadatas.metadata_obj.inventory_number}}</small></h5>{% endif %}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab_mcc/templates/iconolab/search/indexes/iconolab/item_text.txt Tue Jun 05 18:36:39 2018 +0200
@@ -0,0 +1,9 @@
+{{ object.metadatas.metadata_obj.meschool }}
+{{ object.metadatas.metadata_obj.authors }}
+{{ object.metadatas.metadata_obj.designation }}
+{{ object.metadatas.metadata_obj.datation }}
+{{ object.metadatas.metadata_obj.technics }}
+{{ object.metadatas.metadata_obj.measurements }}
+{{ object.metadatas.metadata_obj.create_or_usage_location }}
+{{ object.metadatas.metadata_obj.discovery_context }}
+{{ object.metadatas.metadata_obj.conservation_location }}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab_mcc/templatetags/iconolab_mcc_tags.py Tue Jun 05 18:36:39 2018 +0200
@@ -0,0 +1,8 @@
+from django.template import Library
+from django.conf import settings
+
+register = Library()
+
+@register.simple_tag
+def joconde_link(item_metadata):
+ return settings.JOCONDE_NOTICE_BASE_URL + item_metadata.metadata_obj.get('joconde_ref', '').rjust(11, '0')