Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 25bdfa25 authored by Robin Tissot's avatar Robin Tissot
Browse files

Make homepage somewhat customisable.

parent f466d44b
Branches
Tags
1 merge request!65Feature/custom home
from django.conf import settings
def custom_homepage(request):
return {'CUSTOM_HOME': getattr(settings, 'CUSTOM_HOME', False)}
...@@ -39,3 +39,8 @@ DEBUG_TOOLBAR_PANELS = [ ...@@ -39,3 +39,8 @@ DEBUG_TOOLBAR_PANELS = [
] ]
# USE_CELERY = False # USE_CELERY = False
# CELERY_TASK_ALWAYS_EAGER = True
# LOGGING['loggers']['kraken']['level'] = 'DEBUG'
# CUSTOM_HOME = True
...@@ -41,6 +41,8 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') ...@@ -41,6 +41,8 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.getenv('DEBUG', False) DEBUG = os.getenv('DEBUG', False)
CUSTOM_HOME = os.getenv('CUSTOM_HOME', False)
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
ASGI_APPLICATION = "escriptorium.routing.application" ASGI_APPLICATION = "escriptorium.routing.application"
...@@ -87,7 +89,8 @@ ROOT_URLCONF = 'escriptorium.urls' ...@@ -87,7 +89,8 @@ ROOT_URLCONF = 'escriptorium.urls'
TEMPLATES = [ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(PROJECT_ROOT, 'templates')], 'DIRS': [os.path.join(PROJECT_ROOT, 'templates'),
os.path.join(BASE_DIR, 'homepage')], # custom homepage dir (volume in docker)
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {
'context_processors': [ 'context_processors': [
...@@ -95,6 +98,7 @@ TEMPLATES = [ ...@@ -95,6 +98,7 @@ TEMPLATES = [
'django.template.context_processors.request', 'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth', 'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages', 'django.contrib.messages.context_processors.messages',
'escriptorium.context_processors.custom_homepage'
], ],
}, },
}, },
...@@ -218,6 +222,7 @@ STATIC_URL = '/static/' ...@@ -218,6 +222,7 @@ STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = [ STATICFILES_DIRS = [
os.path.join(PROJECT_ROOT, 'static'), os.path.join(PROJECT_ROOT, 'static'),
os.path.join(BASE_DIR, 'homepage'), # custom homepage directory
FRONTEND_DIR FRONTEND_DIR
] ]
......
app/escriptorium/static/images/inria.png

7.93 KiB | W: | H:

app/escriptorium/static/images/inria.png

12.6 KiB | W: | H:

app/escriptorium/static/images/inria.png
app/escriptorium/static/images/inria.png
app/escriptorium/static/images/inria.png
app/escriptorium/static/images/inria.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
<div class="jumbotron text-center bg-light"> <div class="jumbotron text-center bg-light">
<h1 class="jumbotron-heading">eScriptorium</h1> <h1 class="jumbotron-heading">eScriptorium</h1>
<p class="lead text-muted">{% trans "A project providing digital recognition of handwritten documents using machine learning techniques." %}</p> <p class="lead text-muted">{% trans "A project providing digital recognition of handwritten documents using machine learning techniques." %}</p>
{% if CUSTOM_HOME %}
{% include "additional_heading.html" %}
{% endif %}
</div> </div>
<div class="container my-5"> <div class="container my-5">
...@@ -32,45 +35,56 @@ ...@@ -32,45 +35,56 @@
<hr/> <hr/>
</div> </div>
<div class="my-5 container-fluid text-center">
<a href="https://www.ephe.psl.eu">
<img src="{% static "images/ephe.png" "%}" alt="EPHE logo" height="100">
</a>
<a href="https://scripta.psl.eu/en/" class="pl-4">
<img src="{% static "images/pslscripta.png" "%}" alt="Scripta PSL logo" height="80">
</a>
<a href="https://ec.europa.eu/programmes/horizon2020/" class="pl-4"> <div class="row">
<img src="{% static "images/h2020.jpg" "%}" alt="Horizon 2020 logo" height="100"> <div class="my-5 container-fluid text-center">
</a> <a href="https://www.ephe.psl.eu" target="_blank">
<img src="{% static "images/ephe.png" "%}" alt="EPHE logo" height="100">
</a>
<a href="https://scripta.psl.eu/en/" class="pl-4" target="_blank">
<img src="{% static "images/pslscripta.png" "%}" alt="Scripta PSL logo" height="60">
</a>
<a href="https://www.openiti.org/" class="pl-4"> <a href="https://ec.europa.eu/programmes/horizon2020/" class="pl-4" target="_blank">
<img src="{% static "images/openiti.png" "%}" alt="DIM Region ile de france logo" height="100"> <img src="{% static "images/h2020.jpg" "%}" alt="Horizon 2020 logo" height="100">
</a> </a>
<a href="https://www.iledefrance.fr/des-aides-la-recherche-pour-13-domaines-dinteret-majeur" class="pl-4"> <a href="https://www.openiti.org/" class="pl-4" target="_blank">
<img src="{% static "images/regionidf.jpg" "%}" alt="DIM Region ile de france logo" height="100"> <img src="{% static "images/openiti.png" "%}" alt="DIM Region ile de france logo" height="90">
</a> </a>
<a href="https://inria.fr/fr" class="pl-4"> <a href="https://www.iledefrance.fr/des-aides-la-recherche-pour-13-domaines-dinteret-majeur" class="pl-4" target="_blank">
<img src="{% static "images/inria.png" "%}" alt="INRIA logo" height="100"> <img src="{% static "images/regionidf.jpg" "%}" alt="DIM Region ile de france logo" height="100">
</a> </a>
<a href="https://inria.fr/fr" class="pl-4" target="_blank">
<img src="{% static "images/inria.png" "%}" alt="INRIA logo" height="60">
</a>
</div>
{% if CUSTOM_HOME %}
{% include "additional_icons.html" %}
{% endif %}
</div> </div>
<footer class="bg-light"> <footer class="bg-light mt-5 pt-1">
<div class="container py-2"> <div class="container">
<div class="col-6"> <div class="row">
<h5>{% trans "Resources" %}</h5> <div class="col-6">
<ul class="list-unstyled" %} <h5>{% trans "Resources" %}</h5>
<li><a href="https://lectaurep.hypotheses.org/documentation/escriptorium-tutorial-en">{% trans "Tutorial" %}</a></li> <ul class="list-unstyled">
<li><a href="https://gitlab.inria.fr/scripta/escriptorium">{% trans "eScriptorium open source code" %}</a> Version {{ VERSION_DATE }}</li> <li><a href="https://lectaurep.hypotheses.org/documentation/escriptorium-tutorial-en" target="_blank">{% trans "Tutorial" %}</a></li>
<li><a href="https://escripta.hypotheses.org/">{% trans "Scripta Blog" %}</a></li> <li><a href="https://gitlab.inria.fr/scripta/escriptorium" target="_blank">{% trans "eScriptorium open source code" %}</a> Version {{ VERSION_DATE }}</li>
<li><a href="http://kraken.re/">{{ KRAKEN_VERSION|capfirst }}</a></li> <li><a href="https://escripta.hypotheses.org/" target="_blank">{% trans "Scripta Blog" %}</a></li>
<li><a href="https://gitlab.inria.fr/scripta/escriptorium/-/wikis/home">Wiki</a></li> <li><a href="http://kraken.re/" target="_blank">{{ KRAKEN_VERSION|capfirst }}</a></li>
</ul> <li><a href="https://gitlab.inria.fr/scripta/escriptorium/-/wikis/home" target="_blank">Wiki</a></li>
</ul>
</div>
{% if CUSTOM_HOME %}
{% include "additional_footer.html" %}
{% endif %}
</div> </div>
</div> </div>
</footer> </footer>
{% endblock %} {% endblock %}
{% load i18n %}
<div class="col-6">
<h5>{% trans "Powered by" %}</h5>
<ul class="list-unstyled">
<li><a href="https://www.python.org" target="_blank">Python</a></li>
<li><a href="https://www.djangoproject.com" target="_blank">Django</a></li>
<li><a href="https://vuejs.org" target="_blank">Vue.js</a></li>
</ul>
</div>
<p>eScriptorium accounts are created on invitation only for now. If your institution doesn't provide it, you can use the contact form to ask for access.</p>
{% load staticfiles %}
</div> <!-- example to create another row -->
<div class="row">
<div class="container-fluid text-center">
<a href="http://www.python.org" target="_blank">
<img src="{% static "python.png" %}" alt="custom logo" height="50">
</a>
<a href="http://www.djangoproject.com" target="_blank">
<img src="{% static "django.png" %}" alt="custom logo" height="50">
</a>
</div>
app/homepage_example/django.png

15 KiB

app/homepage_example/python.png

34.4 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment