summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ishtar_common/migrations/0113_auto_20191209_1334.py25
-rw-r--r--ishtar_common/models.py2
-rw-r--r--ishtar_common/templates/base.html31
-rw-r--r--scss/custom.scss16
4 files changed, 74 insertions, 0 deletions
diff --git a/ishtar_common/migrations/0113_auto_20191209_1334.py b/ishtar_common/migrations/0113_auto_20191209_1334.py
new file mode 100644
index 000000000..9e4a60cf6
--- /dev/null
+++ b/ishtar_common/migrations/0113_auto_20191209_1334.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.18 on 2019-12-09 13:34
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0112_document_qrcode'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='ishtarsiteprofile',
+ name='warning_message',
+ field=models.TextField(blank=True, verbose_name='Warning message'),
+ ),
+ migrations.AddField(
+ model_name='ishtarsiteprofile',
+ name='warning_name',
+ field=models.TextField(blank=True, verbose_name='Warning name'),
+ ),
+ ]
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 946e88703..03eda4781 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -2724,6 +2724,8 @@ class IshtarSiteProfile(models.Model, Cached):
experimental_feature = models.BooleanField(
_("Activate experimental feature"), default=False)
description = models.TextField(_("Description"), null=True, blank=True)
+ warning_name = models.TextField(_("Warning name"), blank=True)
+ warning_message = models.TextField(_("Warning message"), blank=True)
config = models.CharField(
_("Alternate configuration"), max_length=200,
choices=ALTERNATE_CONFIGS_CHOICES,
diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html
index bb53092ca..5fb935eb5 100644
--- a/ishtar_common/templates/base.html
+++ b/ishtar_common/templates/base.html
@@ -117,6 +117,37 @@
</head>
<body data-spy="scroll" data-target="#window-fixed-menu"{% if current_theme%} id='{{current_theme}}'{%endif%}>
{% include "navbar.html" %}
+ {% if SITE_PROFILE.warning_name %}
+ <div id="warning-banner">
+ <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
+ {{SITE_PROFILE.warning_name }}
+ {% if SITE_PROFILE.warning_message %}
+ <a href="#warning-message" data-toggle="modal">
+ <i class="fa fa-info-circle" aria-hidden="true"></i>
+ </a>
+ {% endif %}
+ </div>
+
+ {% if SITE_PROFILE.warning_message %}
+ <div class="modal" id='warning-message' tabindex="-1" role="dialog"
+ data-backdrop="static" data-keyboard="false" aria-hidden="true">
+ <div class="modal-dialog modal-sm modal-dialog-centered">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h3>{% trans "Warning" %}</h3>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"
+ onclick="closed_wait = true;return true;">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ </div>
+ <div class="modal-body">
+ {{SITE_PROFILE.warning_message}}
+ </div>
+ </div>
+ </div>
+ </div>
+ {% endif %}
+ {% endif %}
<div id="context-menu" class="navbar navbar-expand-lg">
<div class="navbar-collapse collapse justify-content-between">
<span id="alert-list">
diff --git a/scss/custom.scss b/scss/custom.scss
index 3bb2a229f..b00664552 100644
--- a/scss/custom.scss
+++ b/scss/custom.scss
@@ -379,6 +379,22 @@ textarea {
padding-left: 0.1em;
}
+#warning-banner{
+ font-size: 1.5em;
+ background-color: #8c2525;
+ color: #fff;
+ padding: 0 0.6em;
+ text-align: right;
+}
+
+#warning-banner a{
+ color: #888;
+}
+
+#warning-banner a:hover{
+ color: #fff;
+}
+
.form h4, .form h3, .collapse-form .card-header, #window h3{
background-color: $gray-400;
}