From ab4922e895dda6ce778f2cce785dc69f8d210288 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 5 Sep 2016 19:10:39 +0200 Subject: Random image feature (refs #2958) --- ishtar_common/models.py | 3 +- ishtar_common/static/media/style.css | 5 ++++ ishtar_common/templates/welcome.html | 1 + ishtar_common/utils.py | 53 +++++++++++++++++++++++++++++++++++- ishtar_common/views.py | 6 ++++ 5 files changed, 66 insertions(+), 2 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 4e46693de..087e772e7 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -954,7 +954,8 @@ class IshtarSiteProfile(models.Model, Cached): homepage = models.TextField( _(u"Home page"), null=True, blank=True, help_text=_(u"Homepage of Ishtar - if not defined a default homepage " - u"will appear. Use the markdown syntax.")) + u"will appear. Use the markdown syntax. {random_image} " + u"can be used to display a random image.")) file_external_id = models.TextField( _(u"File external id"), default="{settings__ISHTAR_LOCAL_PREFIX}{year}-{numeric_reference}", diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 7dd424974..c6a151dc8 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -920,6 +920,11 @@ a.photo{ margin-right:auto; } +.welcome-image{ + padding: 1em; + text-align: center; +} + .dashboard table.resume th{ text-align:center; padding:0.5em; diff --git a/ishtar_common/templates/welcome.html b/ishtar_common/templates/welcome.html index 42935d8f9..eb9de475e 100644 --- a/ishtar_common/templates/welcome.html +++ b/ishtar_common/templates/welcome.html @@ -2,6 +2,7 @@ {% load url from future %}

{% trans "Welcome in Ishtar, open source software for management and inventory of archaeological data" %}

+{{random_image}}

{% trans "Some useful links:" %}