mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
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
This commit is contained in:
parent
ac4f5efc4f
commit
9d4db678f4
@ -28,7 +28,7 @@ HTML escaped.
|
||||
|
||||
>>> w = AdminFileWidget()
|
||||
>>> print conditional_escape(w.render('test', 'test'))
|
||||
Currently: <a target="_blank" href="%(MEDIA_URL)stest">test</a> <br>Change: <input type="file" name="test" />
|
||||
Currently: <a target="_blank" href="%(MEDIA_URL)stest">test</a> <br />Change: <input type="file" name="test" />
|
||||
|
||||
To test ForeignKeyRawIdWidget a user object must be created. Its pk is
|
||||
explicitly set to 100 to avoid having to potentially overmatch in the test.
|
||||
|
@ -72,7 +72,8 @@ class AdminFileWidget(forms.FileInput):
|
||||
from django.conf import settings
|
||||
output = []
|
||||
if value:
|
||||
output.append('Currently: <a target="_blank" href="%s%s">%s</a> <br>Change: ' % (settings.MEDIA_URL, value, value))
|
||||
output.append('%s <a target="_blank" href="%s%s">%s</a> <br />%s ' % \
|
||||
(_('Currently:'), settings.MEDIA_URL, value, value, _('Change:')))
|
||||
output.append(super(AdminFileWidget, self).render(name, value, attrs))
|
||||
return mark_safe(u''.join(output))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user