Commit 03f6abf8 authored by Michal Čihař's avatar Michal Čihař

Add customizable whiteboard categories

Fixes #1088
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 38537638
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-25 17:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('trans', '0062_auto_20160419_1429'),
]
operations = [
migrations.AddField(
model_name='whiteboardmessage',
name='category',
field=models.CharField(choices=[(b'info', 'Info (light blue)'), (b'warning', 'Warning (yellow)'), (b'danger', 'Danger (red)'), (b'success', 'Success (green)'), (b'primary', 'Primary (dark blue)')], default=b'info', help_text='Category matches Bootstrap ones and defines color used for the message.', max_length=25, verbose_name='Category'),
),
]
......@@ -85,6 +85,22 @@ class WhiteboardMessage(models.Model):
null=True,
blank=True
)
category = models.CharField(
max_length=25,
verbose_name=ugettext_lazy('Category'),
help_text=ugettext_lazy(
'Category matches Bootstrap ones and '
'defines color used for the message.'
),
choices=(
('info', ugettext_lazy('Info (light blue)')),
('warning', ugettext_lazy('Warning (yellow)')),
('danger', ugettext_lazy('Danger (red)')),
('success', ugettext_lazy('Success (green)')),
('primary', ugettext_lazy('Primary (dark blue)')),
),
default='info',
)
objects = WhiteboardManager()
......
......@@ -603,7 +603,7 @@ def whiteboard_messages(project=None, subproject=None, language=None):
render_to_string(
'message.html',
{
'tags': 'info whiteboard',
'tags': ' '.join((whiteboard.category, 'whiteboard')),
'message': mark_safe(
urlize(whiteboard.message, autoescape=True)
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment