layerindex-web/layerindex/migrations/0014_sitenotice.py
Paul Eggleton 49981aebf6 Add site-wide notice support
Add the ability to show a notice at the top of every page; this provides
the ability for admins to display a message to visitors in the case of
infrastructure or index data issues. Notices can have an expiry date and
can be disabled and re-enabled if needed. A subset of HTML can be used
for formatting the text, URLs will be made into clickable links, and
four "levels" are supported (info, success, warning and error).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-07-09 13:50:15 +02:00

25 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('layerindex', '0013_patch'),
]
operations = [
migrations.CreateModel(
name='SiteNotice',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('text', models.TextField(help_text='Text to show in the notice. A limited subset of HTML is supported for formatting.')),
('level', models.CharField(choices=[('I', 'Info'), ('S', 'Success'), ('W', 'Warning'), ('E', 'Error')], help_text='Level of notice to display', default='I', max_length=1)),
('disabled', models.BooleanField(verbose_name='Disabled', help_text='Use to temporarily disable this notice', default=False)),
('expires', models.DateTimeField(blank=True, help_text='Optional date/time when this notice will stop showing', null=True)),
],
),
]