mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 03:31:04 +01:00
Refactor out a BoundHelpPanel class
This commit is contained in:
parent
2fd7fe5ae6
commit
1c9015c8ce
@ -611,6 +611,15 @@ class MultiFieldPanel(PanelGroup):
|
||||
return classes
|
||||
|
||||
|
||||
class BoundHelpPanel(BoundPanel):
|
||||
def __init__(self, panel, instance, request, form):
|
||||
super().__init__(panel, instance, request, form)
|
||||
self.content = self.panel.content
|
||||
|
||||
def render(self):
|
||||
return mark_safe(render_to_string(self.panel.template, {"self": self}))
|
||||
|
||||
|
||||
class HelpPanel(Panel):
|
||||
def __init__(
|
||||
self,
|
||||
@ -632,8 +641,8 @@ class HelpPanel(Panel):
|
||||
)
|
||||
return kwargs
|
||||
|
||||
def render(self):
|
||||
return mark_safe(render_to_string(self.template, {"self": self}))
|
||||
def get_bound_panel(self, instance=None, request=None, form=None):
|
||||
return BoundHelpPanel(panel=self, instance=instance, request=request, form=form)
|
||||
|
||||
|
||||
class BoundFieldPanel(BoundPanel):
|
||||
|
Loading…
Reference in New Issue
Block a user