kopia lustrzana https://github.com/wagtail/wagtail
Pass last updated info from the view to the status side panel via __init__
rodzic
2b4a206d76
commit
7a045cc7e6
|
|
@ -72,6 +72,7 @@ class BaseStatusSidePanel(BaseSidePanel):
|
|||
translations=None,
|
||||
usage_url=None,
|
||||
history_url=None,
|
||||
live_last_updated_info=None,
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
|
@ -82,6 +83,7 @@ class BaseStatusSidePanel(BaseSidePanel):
|
|||
self.translations = translations
|
||||
self.usage_url = usage_url
|
||||
self.history_url = history_url
|
||||
self.live_last_updated_info = live_last_updated_info
|
||||
self.locking_enabled = isinstance(self.object, LockableMixin)
|
||||
|
||||
def get_status_templates(self, context):
|
||||
|
|
@ -222,6 +224,7 @@ class BaseStatusSidePanel(BaseSidePanel):
|
|||
context["base_model_name"] = context["model_name"]
|
||||
context["history_url"] = self.history_url
|
||||
context["status_templates"] = self.get_status_templates(context)
|
||||
context["live_last_updated_info"] = self.live_last_updated_info
|
||||
context.update(self.get_scheduled_publishing_context(parent_context))
|
||||
context.update(self.get_lock_context(parent_context))
|
||||
if self.object.pk:
|
||||
|
|
|
|||
|
|
@ -671,7 +671,6 @@ class CreateEditViewOptionalFeaturesMixin:
|
|||
context["revision_enabled"] = self.revision_enabled
|
||||
context["draftstate_enabled"] = self.draftstate_enabled
|
||||
context["workflow_enabled"] = self.workflow_enabled
|
||||
context["live_last_updated_info"] = self.get_live_last_updated_info()
|
||||
context["workflow_history_url"] = self.get_workflow_history_url()
|
||||
context[
|
||||
"confirm_workflow_cancellation_url"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ class SnippetStatusSidePanel(BaseStatusSidePanel):
|
|||
"revisions_compare_url_name",
|
||||
"revision_enabled",
|
||||
"draftstate_enabled",
|
||||
"live_last_updated_info",
|
||||
"lock_url",
|
||||
"unlock_url",
|
||||
"user_can_lock",
|
||||
|
|
|
|||
|
|
@ -331,6 +331,7 @@ class EditView(generic.CreateEditViewOptionalFeaturesMixin, generic.EditView):
|
|||
translations=self.translations,
|
||||
usage_url=self.get_usage_url(),
|
||||
history_url=self.get_history_url(),
|
||||
live_last_updated_info=self.get_live_last_updated_info(),
|
||||
)
|
||||
]
|
||||
if self.preview_enabled and self.object.is_previewable():
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue