Stop emails falling of the end of the world #122

This commit is contained in:
Tom Price
2015-05-29 00:36:47 +01:00
parent e72b76f972
commit e684ee0b2d
2 changed files with 10 additions and 4 deletions

View File

@@ -2,8 +2,8 @@
<button title="Changes to {{ change.field.verbose_name }}" type="button" class="btn btn-default btn-xs" data-container="body" data-html="true" data-trigger='hover' data-toggle="popover" data-content='
{% if change.new %}<div class="alert alert-success">{{change.new|linebreaksbr}}</div>{% endif %}
{% if change.old %}<div class="alert alert-danger">{{change.old|linebreaksbr}}</div>{% endif %}
{% if change.new %}<div class="alert alert-success {% if change.long %}overflow-ellipsis{% endif %}">{{change.new|linebreaksbr}}</div>{% endif %}
{% if change.old %}<div class="alert alert-danger {% if change.long %}overflow-ellipsis{% endif %}">{{change.old|linebreaksbr}}</div>{% endif %}
'>{{ change.field.verbose_name }}</button>

View File

@@ -16,7 +16,7 @@ import simplejson
from reversion.models import Version
from django.contrib.contenttypes.models import ContentType # Used to lookup the content_type
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db.models import ForeignKey, IntegerField
from django.db.models import ForeignKey, IntegerField, EmailField
from RIGS import models, forms
import datetime
@@ -50,7 +50,13 @@ def model_compare(oldObj, newObj, excluded_keys=[]):
@property
def new(self):
return self.display_value(self._new)
return self.display_value(self._new)
@property
def long(self):
if isinstance(self.field, EmailField):
return True
return False
changes = []