Skip to content

Commit 9d4db67

Browse files
committed
newforms-admin: Fixed #5695. AdminFileWidget now properly marks strings for translation and a minor XHTML fix.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent ac4f5ef commit 9d4db67

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

django/contrib/admin/tests/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
2929
>>> w = AdminFileWidget()
3030
>>> print conditional_escape(w.render('test', 'test'))
31-
Currently: <a target="_blank" href="%(MEDIA_URL)stest">test</a> <br>Change: <input type="file" name="test" />
31+
Currently: <a target="_blank" href="%(MEDIA_URL)stest">test</a> <br />Change: <input type="file" name="test" />
3232
3333
To test ForeignKeyRawIdWidget a user object must be created. Its pk is
3434
explicitly set to 100 to avoid having to potentially overmatch in the test.

django/contrib/admin/widgets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def render(self, name, value, attrs=None):
7272
from django.conf import settings
7373
output = []
7474
if value:
75-
output.append('Currently: <a target="_blank" href="%s%s">%s</a> <br>Change: ' % (settings.MEDIA_URL, value, value))
75+
output.append('%s <a target="_blank" href="%s%s">%s</a> <br />%s ' % \
76+
(_('Currently:'), settings.MEDIA_URL, value, value, _('Change:')))
7677
output.append(super(AdminFileWidget, self).render(name, value, attrs))
7778
return mark_safe(u''.join(output))
7879

0 commit comments

Comments
 (0)