Add new clipboard-list icon and use for workflows. Fix if statement in views/pages to add buttons outside main conditional clauses

pull/6257/head
jacobtoppm 2020-02-17 16:58:15 +00:00 zatwierdzone przez Matt Westcott
rodzic b01ba985c4
commit b10ba56b26
7 zmienionych plików z 26 dodań i 14 usunięć

Wyświetl plik

@ -66,6 +66,12 @@
.errorlist {
margin: 0.5em 0 0 1em;
}
.workflow {
&:before {
content: map-get($icons, 'clipboard-list');
}
}
}
.messages.new > ul {

Wyświetl plik

@ -9,6 +9,7 @@ $icons: (
'bin': '\e038',
'bold': '\e026',
'chain-broken': '\e047',
'clipboard-list': '\e900',
'code': '\e001',
'cog': '\e020',
'cogs': '\e00c',

Wyświetl plik

@ -0,0 +1,3 @@
<symbol id="clipboard-list" viewBox="0 0 384 512">
<path d="M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM96 424c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm0-96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm0-96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm96-192c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm128 368c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-96c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-96c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16z"></path>
</svg>

Wyświetl plik

@ -453,7 +453,7 @@ def edit(request, page_id):
_('Compare with live version')
))
# Check for revisions still undergoing moderation and warn
elif total_tasks == 1:
if total_tasks == 1:
# If only one task in workflow, show simple message
workflow_info = _("This page is currently awaiting moderation")
elif current_task_number:
@ -461,9 +461,9 @@ def edit(request, page_id):
else:
workflow_info = format_html(_("<b>Page '{}'</b> is on <b>Task '{}'</b> in <b>Workflow '{}'</b>. "), page.get_admin_display_title(), current_task_number, total_tasks, task_name, workflow_name)
if approved_task and getattr(settings, 'WAGTAIL_WORKFLOW_REQUIRE_REAPPROVAL_ON_EDIT', True):
messages.warning(request, mark_safe(workflow_info + _("Editing this Page will cause completed Tasks to need re-approval.")), buttons=buttons)
messages.warning(request, mark_safe(workflow_info + _("Editing this Page will cause completed Tasks to need re-approval.")), buttons=buttons, extra_tags="workflow")
else:
messages.success(request, workflow_info, buttons=buttons)
messages.success(request, workflow_info, buttons=buttons, extra_tags="workflow")
errors_debug = None

Wyświetl plik

@ -28,7 +28,7 @@ class Index(IndexView):
edit_url_name = 'wagtailadmin_workflows:edit'
page_title = _("Workflows")
add_item_label = _("Add a workflow")
header_icon = 'placeholder'
header_icon = 'clipboard-list'
def get_queryset(self):
queryset = super().get_queryset()
@ -51,7 +51,7 @@ class Create(CreateView):
add_url_name = 'wagtailadmin_workflows:add'
edit_url_name = 'wagtailadmin_workflows:edit'
index_url_name = 'wagtailadmin_workflows:index'
header_icon = 'placeholder'
header_icon = 'clipboard-list'
edit_handler = None
def get_edit_handler(self):
@ -87,7 +87,7 @@ class Edit(EditView):
index_url_name = 'wagtailadmin_workflows:index'
enable_item_label = _('Enable')
enable_url_name = 'wagtailadmin_workflows:enable'
header_icon = 'placeholder'
header_icon = 'clipboard-list'
edit_handler = None
MAX_PAGES = 5
@ -137,7 +137,7 @@ class Disable(DeleteView):
edit_url_name = 'wagtailadmin_workflows:edit'
delete_url_name = 'wagtailadmin_workflows:disable'
index_url_name = 'wagtailadmin_workflows:index'
header_icon = 'placeholder'
header_icon = 'clipboard-list'
@property
def get_edit_url(self):
@ -254,7 +254,7 @@ def add_to_page(request, workflow_pk):
return render(request, 'wagtailadmin/workflows/add_to_page.html', {
'workflow': workflow,
'form': form,
'icon': 'placeholder',
'icon': 'clipboard-list',
'title': _("Workflows"),
'next': next_url,
'confirm': confirm
@ -270,7 +270,7 @@ class TaskIndex(IndexView):
edit_url_name = 'wagtailadmin_workflows:edit_task'
page_title = _("Tasks")
add_item_label = _("Add a task")
header_icon = 'placeholder'
header_icon = 'clipboard-list'
def get_queryset(self):
queryset = super().get_queryset()
@ -303,7 +303,7 @@ def select_task_type(request):
return render(request, 'wagtailadmin/workflows/select_task_type.html', {
'task_types': task_types,
'icon': 'placeholder',
'icon': 'clipboard-list',
'title': _("Workflows"),
})
@ -317,7 +317,7 @@ class CreateTask(CreateView):
add_url_name = 'wagtailadmin_workflows:add_task'
edit_url_name = 'wagtailadmin_workflows:edit_task'
index_url_name = 'wagtailadmin_workflows:task_index'
header_icon = 'placeholder'
header_icon = 'clipboard-list'
edit_handler = None
@cached_property
@ -372,7 +372,7 @@ class EditTask(EditView):
delete_item_label = _('Disable')
enable_item_label = _('Enable')
enable_url_name = 'wagtailadmin_workflows:enable_task'
header_icon = 'placeholder'
header_icon = 'clipboard-list'
edit_handler = None
@cached_property
@ -424,7 +424,7 @@ class DisableTask(DeleteView):
edit_url_name = 'wagtailadmin_workflows:edit_task'
delete_url_name = 'wagtailadmin_workflows:disable_task'
index_url_name = 'wagtailadmin_workflows:task_index'
header_icon = 'placeholder'
header_icon = 'clipboard-list'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)

Wyświetl plik

@ -103,7 +103,7 @@ def register_collections_menu_item():
@hooks.register('register_settings_menu_item')
def register_workflows_menu_item():
return MenuItem(_('Workflows'), reverse('wagtailadmin_workflows:index'), classnames='icon icon-placeholder', order=100)
return MenuItem(_('Workflows'), reverse('wagtailadmin_workflows:index'), classnames='icon icon-clipboard-list', order=100)
@hooks.register('register_page_listing_buttons')

Wyświetl plik

@ -790,6 +790,7 @@
</style>
<ul class="unlist">
<<<<<<< HEAD
<li>{% icon 'wagtail-icon' %} wagtail</li>
<li>{% icon 'wagtail-inverse' %} wagtail-inverse</li>
<li>{% icon 'cogs' %} cogs</li>
@ -814,6 +815,7 @@
<li>{% icon 'plus' %} plus</li>
<li>{% icon 'tag' %} tag</li>
<li>{% icon 'folder-open-inverse' %} folder-open-inverse</li>
<li>{% icon 'clipboard-list' %} clipboard-list</li>
<li>{% icon 'cog' %} cog</li>
<li>{% icon 'tick' %} tick</li>
<li>{% icon 'user' %} user</li>