mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2024-12-13 18:31:10 +01:00
Fixes Issue #117 thanks to hgeerts. Corrects usage of blocktrans tag,
and properly concatenates strings together in models.py
This commit is contained in:
parent
ea1610e837
commit
2705880f82
@ -13,3 +13,6 @@ being used, no change is visible to the user.
|
||||
2009-10-13 r141 Issue #118 Incorrect locale handling on email templates
|
||||
Patch courtesy of hgeerts. Corrects the handling of locale on email
|
||||
templaets, defaulting to English if no locale is provided.
|
||||
|
||||
2009-10-13 r142 Issue #117 Incorrect I18N usage in a few spots
|
||||
Patch thanks to hgeerts.
|
||||
|
20
models.py
20
models.py
@ -12,7 +12,7 @@ from datetime import datetime
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ugettext_lazy as _, ugettext
|
||||
from helpdesk.settings import HAS_TAG_SUPPORT
|
||||
|
||||
if HAS_TAG_SUPPORT:
|
||||
@ -536,16 +536,16 @@ class TicketChange(models.Model):
|
||||
)
|
||||
|
||||
def __unicode__(self):
|
||||
str = u'%s ' % field
|
||||
if not new_value:
|
||||
str += _('removed')
|
||||
elif not old_value:
|
||||
str += _('set to %s' % new_value)
|
||||
str = u'%s ' % self.field
|
||||
if not self.new_value:
|
||||
str += ugettext('removed')
|
||||
elif not self.old_value:
|
||||
str += ugettext('set to %s') % self.new_value
|
||||
else:
|
||||
str += _('changed from "%(old_value)s" to "%(new_value)s"' % {
|
||||
'old_value': old_value,
|
||||
'new_value': new_value
|
||||
})
|
||||
str += ugettext('changed from "%(old_value)s" to "%(new_value)s"') % {
|
||||
'old_value': self.old_value,
|
||||
'new_value': self.new_value
|
||||
}
|
||||
return str
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@
|
||||
{{ followup.comment|force_escape|num_to_link|linebreaksbr }}
|
||||
{% if followup.ticketchange_set.all %}<div class='changes'><ul>
|
||||
{% for change in followup.ticketchange_set.all %}
|
||||
<li>{% blocktrans %}Changed {{ change.field }} from {{ change.old_value }} to {{ change.new_value }}.{% endblocktrans %}</li>
|
||||
<li>{% blocktrans with change.field as field and change.old_value as old_value and change.new_value as new_value %}Changed {{ field }} from {{ old_value }} to {{ new_value }}.{% endblocktrans %}</li>
|
||||
{% endfor %}
|
||||
{% for attachment in followup.attachment_set.all %}{% if forloop.first %}<div class='attachments'><ul>{% endif %}
|
||||
<li><a href='{{ attachment.file.url }}'>{{ attachment.filename }}</a> ({{ attachment.mime_type }}, {{ attachment.size|filesizeformat }})</li>
|
||||
|
Loading…
Reference in New Issue
Block a user