mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Update workflow/workflow task add/edit header to be consistent with other admin pages
This commit is contained in:
parent
9256a9dfbd
commit
ada0c8d502
@ -22,7 +22,6 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include "wagtailadmin/shared/header.html" with title=view.page_title icon=view.header_icon merged=1 %}
|
||||
|
||||
<form action="{{ view.get_add_url }}" enctype="multipart/form-data" method="POST" novalidate>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% extends "wagtailadmin/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load i18n wagtailadmin_tags %}
|
||||
|
||||
{% block titletag %}{{ view.page_title }}{% endblock %}
|
||||
|
||||
|
@ -24,18 +24,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<header role="banner" class="merged">
|
||||
<div class="row nice-padding">
|
||||
<div class="left">
|
||||
<div class="col header-title">
|
||||
<h1 class="icon icon-{{ view.header_icon }}">
|
||||
{{ view.page_title }}{% if view.subtitle %} <span>{{ view.subtitle }}</span>{% endif %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% include "wagtailadmin/shared/header.html" with title=view.page_title subtitle=object.name icon=view.header_icon merged=1 %}
|
||||
|
||||
<form action="{% block form_action %}{{ view.edit_url }}{% endblock %}"{% if is_multipart %} enctype="multipart/form-data"{% endif %} method="POST" novalidate>
|
||||
{% csrf_token %}
|
||||
|
@ -21,8 +21,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% include "wagtailadmin/shared/header.html" with title=view.page_title icon=view.header_icon merged=1 %}
|
||||
{% include "wagtailadmin/shared/header.html" with title=view.page_title subtitle=object.name icon=view.header_icon merged=1 %}
|
||||
|
||||
<form action="{{ view.edit_url }}" enctype="multipart/form-data" method="POST" novalidate>
|
||||
{% csrf_token %}
|
||||
|
@ -58,7 +58,7 @@ class Index(IndexView):
|
||||
class Create(CreateView):
|
||||
permission_policy = workflow_permission_policy
|
||||
model = Workflow
|
||||
page_title = _("Create a new workflow")
|
||||
page_title = _("New workflow")
|
||||
template_name = 'wagtailadmin/workflows/create.html'
|
||||
success_message = _("Workflow '{0}' created.")
|
||||
add_url_name = 'wagtailadmin_workflows:add'
|
||||
@ -118,7 +118,7 @@ class Create(CreateView):
|
||||
class Edit(EditView):
|
||||
permission_policy = workflow_permission_policy
|
||||
model = Workflow
|
||||
page_title = _("Edit workflow")
|
||||
page_title = _("Editing workflow")
|
||||
template_name = 'wagtailadmin/workflows/edit.html'
|
||||
success_message = _("Workflow '{0}' updated.")
|
||||
add_url_name = 'wagtailadmin_workflows:add'
|
||||
@ -308,7 +308,7 @@ class TaskIndex(IndexView):
|
||||
add_url_name = 'wagtailadmin_workflows:select_task_type'
|
||||
edit_url_name = 'wagtailadmin_workflows:edit_task'
|
||||
page_title = _("Workflow tasks")
|
||||
add_item_label = _("Create a workflow task")
|
||||
add_item_label = _("New workflow task")
|
||||
header_icon = 'thumbtack'
|
||||
|
||||
def show_disabled(self):
|
||||
@ -353,7 +353,7 @@ def select_task_type(request):
|
||||
class CreateTask(CreateView):
|
||||
permission_policy = task_permission_policy
|
||||
model = None
|
||||
page_title = _("Create a workflow task")
|
||||
page_title = _("New workflow task")
|
||||
template_name = 'wagtailadmin/workflows/create_task.html'
|
||||
success_message = _("Task '{0}' created.")
|
||||
add_url_name = 'wagtailadmin_workflows:add_task'
|
||||
@ -387,7 +387,7 @@ class CreateTask(CreateView):
|
||||
class EditTask(EditView):
|
||||
permission_policy = task_permission_policy
|
||||
model = None
|
||||
page_title = _("Edit workflow task")
|
||||
page_title = _("Editing workflow task")
|
||||
template_name = 'wagtailadmin/workflows/edit_task.html'
|
||||
success_message = _("Task '{0}' updated.")
|
||||
add_url_name = 'wagtailadmin_workflows:select_task_type'
|
||||
@ -403,6 +403,10 @@ class EditTask(EditView):
|
||||
def model(self):
|
||||
return type(self.get_object())
|
||||
|
||||
@cached_property
|
||||
def page_title(self):
|
||||
return _("Editing {task_type}".format(task_type=self.get_object().content_type.name))
|
||||
|
||||
def get_queryset(self):
|
||||
if self.queryset is None:
|
||||
return Task.objects.all()
|
||||
|
Loading…
Reference in New Issue
Block a user