diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/migrations/0113_auto_20191209_1334.py | 25 | ||||
| -rw-r--r-- | ishtar_common/models.py | 2 | ||||
| -rw-r--r-- | ishtar_common/templates/base.html | 31 | 
3 files changed, 58 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">×</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">  | 
