kopia lustrzana https://github.com/wagtail/wagtail
Revert "Use the proper content type for confirmation messages"
This reverts commit 6c44d6113c
.
pull/12182/head
rodzic
efc419a3a1
commit
f21d8181ed
|
@ -106,11 +106,11 @@
|
|||
{% if sessions.0.revision_id %}
|
||||
<template data-controller="w-teleport" data-w-teleport-target-value="#title-text-w-overwrite-changes-dialog" data-w-teleport-reset-value="true">
|
||||
{% if current_session.user == sessions.0.user %}
|
||||
{% blocktranslate trimmed with model_name=content_type.name asvar someone_has_saved_message %}
|
||||
{% blocktranslate trimmed with model_name=_("page") asvar someone_has_saved_message %}
|
||||
You have saved a newer version of this {{ model_name }} in another session
|
||||
{% endblocktranslate %}
|
||||
{% else %}
|
||||
{% blocktranslate trimmed with user_name=sessions.0.user|user_display_name|default:_("System") model_name=content_type.name asvar someone_has_saved_message %}
|
||||
{% blocktranslate trimmed with user_name=sessions.0.user|user_display_name|default:_("System") model_name=_("page") asvar someone_has_saved_message %}
|
||||
{{ user_name }} has saved a newer version of this {{ model_name }}
|
||||
{% endblocktranslate %}
|
||||
{% endif %}
|
||||
|
|
|
@ -12,16 +12,12 @@ class EditingSessionsModule(Component):
|
|||
ping_url,
|
||||
release_url,
|
||||
other_sessions,
|
||||
content_type,
|
||||
revision_id=None,
|
||||
):
|
||||
self.current_session = current_session
|
||||
self.ping_url = ping_url
|
||||
self.release_url = release_url
|
||||
self.sessions_list = EditingSessionsList(
|
||||
current_session, other_sessions, content_type
|
||||
)
|
||||
self.content_type = content_type
|
||||
self.sessions_list = EditingSessionsList(current_session, other_sessions)
|
||||
self.revision_id = revision_id
|
||||
|
||||
def get_context_data(self, parent_context):
|
||||
|
@ -36,7 +32,6 @@ class EditingSessionsModule(Component):
|
|||
"release_url": self.release_url,
|
||||
"ping_interval": str(ping_interval), # avoid the need to | unlocalize
|
||||
"sessions_list": self.sessions_list,
|
||||
"content_type": self.content_type,
|
||||
"revision_id": self.revision_id,
|
||||
}
|
||||
|
||||
|
@ -44,14 +39,9 @@ class EditingSessionsModule(Component):
|
|||
class EditingSessionsList(Component):
|
||||
template_name = "wagtailadmin/shared/editing_sessions/list.html"
|
||||
|
||||
def __init__(self, current_session, other_sessions, content_type):
|
||||
def __init__(self, current_session, other_sessions):
|
||||
self.current_session = current_session
|
||||
self.sessions = other_sessions
|
||||
self.content_type = content_type
|
||||
|
||||
def get_context_data(self, parent_context):
|
||||
return {
|
||||
"current_session": self.current_session,
|
||||
"sessions": self.sessions,
|
||||
"content_type": self.content_type,
|
||||
}
|
||||
return {"current_session": self.current_session, "sessions": self.sessions}
|
||||
|
|
|
@ -180,9 +180,7 @@ def ping(request, app_label, model_name, object_id, session_id):
|
|||
}
|
||||
for other_session in other_sessions
|
||||
],
|
||||
"html": EditingSessionsList(
|
||||
session, other_sessions, content_type
|
||||
).render_html(),
|
||||
"html": EditingSessionsList(session, other_sessions).render_html(),
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -713,7 +713,6 @@ class CreateEditViewOptionalFeaturesMixin:
|
|||
args=(session.id,),
|
||||
),
|
||||
[],
|
||||
content_type,
|
||||
revision_id,
|
||||
)
|
||||
|
||||
|
|
|
@ -901,7 +901,6 @@ class EditView(WagtailAdminTemplateMixin, HookResponseMixin, View):
|
|||
args=(session.id,),
|
||||
),
|
||||
[],
|
||||
content_type,
|
||||
self.page.latest_revision_id,
|
||||
)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue