Browse Source

Add new event statuses and adjust the calendar status display colors

stable/2.1
Sesostris Vieira 9 years ago
parent
commit
790e316820
  1. 7
      sigi/apps/eventos/models.py
  2. 9
      sigi/apps/eventos/templates/eventos/calendario.html

7
sigi/apps/eventos/models.py

@ -39,12 +39,13 @@ class TipoEvento(models.Model):
class Evento(models.Model):
STATUS_CHOICES = (
('P', _(u"Programado")),
('A', _(u"Autorizado")),
('P', _(u"Previsão")),
('A', _(u"A confirmar")),
('O', _(u"Confirmado")),
('R', _(u"Realizado")),
('C', _(u"Cancelado"))
)
tipo_evento = models.ForeignKey(TipoEvento)
nome = models.CharField(_(u"Nome do evento"), max_length=100)
descricao = models.TextField(_(u"Descrição do evento"))

9
sigi/apps/eventos/templates/eventos/calendario.html

@ -9,6 +9,13 @@
text-align: center !important;
vertical-align: bottom !important;
}
.status-P { background-color: #ffffb0}
.status-A { background-color: #a6ebff}
.status-O { background-color: #c2ffc2}
.status-R { background-color: #ffdaa6}
.status-C { background-color: #d98f8d}
</style>
{{ block.super }}
{% endblock %}
@ -49,7 +56,7 @@
<td colspan="{{ evento.start }}">&nbsp;</td>
{% endif %}
<td colspan="{{ evento.duration }}" class="{% if evento.evento.status == 'P' %}active{% endif %}{% if evento.evento.status == 'A' %}success{% endif %}{% if evento.evento.status == 'R' %}info{% endif %}{% if evento.evento.status == 'C' %}danger{% endif %}">
<td colspan="{{ evento.duration }}" class="status-{{ evento.evento.status }}">
<h5><a href="{% url 'admin:eventos_evento_change' evento.evento.pk %}">{{ evento.evento.nome }}</a></h5>
<h6>({{ evento.evento.tipo_evento }})</h6>
<dl class="dl-horizontal">

Loading…
Cancel
Save