2
2
from django .contrib .admin .widgets import AdminTextInputWidget , AdminTextareaWidget
3
3
from django .core .exceptions import ValidationError , ImproperlyConfigured
4
4
from django .core .urlresolvers import NoReverseMatch
5
+ from django .utils .html import conditional_escape
6
+ from django .utils .safestring import mark_safe
5
7
from django .utils .translation import ugettext , ugettext_lazy as _
6
8
from fluent_faq import appsettings
7
9
from fluent_contents .admin import PlaceholderFieldAdmin
@@ -125,7 +127,7 @@ def _reverse_faqpage_index(self, request, obj=None):
125
127
126
128
@classmethod
127
129
def get_actions_column (cls , faqquestion ):
128
- return u' ' .join (cls ._actions_column_icons (faqquestion ))
130
+ return mark_safe ( u' ' .join (conditional_escape ( a ) for a in cls ._actions_column_icons (faqquestion ) ))
129
131
130
132
@classmethod
131
133
def _actions_column_icons (cls , object ):
@@ -140,10 +142,10 @@ def _actions_column_icons(cls, object):
140
142
# In the second case, the edit page should still be reachable, and the "view on site" link will give an alert.
141
143
pass
142
144
else :
143
- actions .append (
145
+ actions .append (mark_safe (
144
146
u'<a href="{url}" title="{title}" target="_blank"><img src="{static}fluent_faq/img/admin/world.gif" width="16" height="16" alt="{title}" /></a>' .format (
145
147
url = url , title = _ ('View on site' ), static = settings .STATIC_URL )
146
- )
148
+ ))
147
149
return actions
148
150
149
151
@classmethod
0 commit comments