Skip to content

Commit a4ded03

Browse files
committed
[MarkAPI-112] chore: reorganiza o menu na área administrativa.
1 parent 80b3c99 commit a4ded03

5 files changed

Lines changed: 17 additions & 19 deletions

File tree

config/menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
WAGTAIL_MENU_APPS_ORDER = [
2-
"sps_package_validation",
32
"markup_doc",
3+
"reference",
44
"scielo",
55
"tracker",
66
"model_ai",

core/wagtail_hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def group_wagtail_cms_menu_items(request, menu_items):
5151
)
5252
menu_items.append(
5353
SubmenuMenuItem(
54-
_("Wagtail CMS"),
54+
_("Content Manager"),
5555
cms_menu,
5656
icon_name="folder-open-inverse",
5757
name="wagtail_cms",

markup_doc/wagtail_hooks.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
)
2828
from markup_doc.sync_api import sync_collection_from_api
2929
from markup_doc.tasks import get_labels, task_sync_journals_from_api, update_xml
30-
from reference.wagtail_hooks import ReferenceModelViewSet
3130
from xml_manager.wagtail_hooks import (
31+
SPSPackageValidationSnippetViewSet,
3232
XMLDocumentHTMLSnippetViewSet,
3333
XMLDocumentPDFSnippetViewSet,
3434
)
@@ -100,7 +100,7 @@ def form_valid(self, form):
100100
class UploadDocxViewSet(SnippetViewSet):
101101
model = UploadDocx
102102
add_view_class = ArticleDocxCreateView
103-
menu_label = _("Carregar DOCX")
103+
menu_label = _("DOCX")
104104
menu_icon = "upload"
105105
add_to_admin_menu = False
106106
exclude_from_explorer = False
@@ -114,7 +114,7 @@ class MarkupXMLViewSet(SnippetViewSet):
114114
model = MarkupXML
115115
add_view_class = ArticleDocxMarkupCreateView
116116
edit_view_class = ArticleDocxEditView
117-
menu_label = _("XML SPS marcado")
117+
menu_label = _("XML SPS")
118118
menu_icon = "code"
119119
add_to_admin_menu = False
120120
exclude_from_explorer = False
@@ -138,7 +138,7 @@ def form_valid(self, form):
138138
class CollectionModelViewSet(SnippetViewSet):
139139
model = CollectionModel
140140
add_view_class = CollectionModelCreateView
141-
menu_label = _("Coleções SciELO")
141+
menu_label = _("Coleção")
142142
menu_icon = "folder-inverse"
143143
add_to_admin_menu = False
144144
exclude_from_explorer = False
@@ -190,15 +190,15 @@ class XMLSPSSnippetViewSetGroup(SnippetViewSetGroup):
190190
menu_icon = "code"
191191
items = (
192192
MarkupXMLViewSet,
193+
SPSPackageValidationSnippetViewSet,
193194
XMLDocumentPDFSnippetViewSet,
194195
XMLDocumentHTMLSnippetViewSet,
195-
ReferenceModelViewSet,
196196
)
197197

198198

199199
class ScieloSnippetViewSetGroup(SnippetViewSetGroup):
200200
menu_name = "scielo"
201-
menu_label = _("SciELO")
201+
menu_label = _("Journal Manager")
202202
menu_icon = "folder-open-inverse"
203203
menu_order = get_menu_order("scielo")
204204
items = (

reference/wagtail_hooks.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Third-party imports
22
from django.http import HttpResponseRedirect
33
from django.utils.translation import gettext_lazy as _
4+
from wagtail.snippets.models import register_snippet
45
from wagtail.snippets.views.snippets import CreateView, SnippetViewSet
56

67
# Local application imports
@@ -35,9 +36,12 @@ class ReferenceModelViewSet(SnippetViewSet):
3536
model = Reference
3637
add_view_class = ReferenceCreateView
3738
menu_name = "reference"
38-
menu_label = _("Referências bibliográficas")
39+
menu_label = _("Referências")
3940
menu_icon = "openquote"
4041
menu_order = get_menu_order("reference")
4142
exclude_from_explorer = False
4243
list_per_page = 20
43-
add_to_admin_menu = False
44+
add_to_admin_menu = True
45+
46+
47+
register_snippet(ReferenceModelViewSet)

xml_manager/wagtail_hooks.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
from wagtail.snippets.models import register_snippet
1313
from wagtail.snippets.views.snippets import CreateView, EditView, SnippetViewSet
1414

15-
from config.menu import get_menu_order
16-
1715
from . import urls
1816
from .forms import SPSPackageValidationForm
1917
from .models import (
@@ -156,7 +154,7 @@ class XMLDocumentPDFSnippetViewSet(SnippetViewSet):
156154
verbose_name_plural = _("XML Document PDFs")
157155
icon = "doc-full"
158156
menu_name = "xml_manager"
159-
menu_label = _("PDFs derivados")
157+
menu_label = _("PDFs")
160158
menu_icon = "doc-full"
161159
add_to_admin_menu = False
162160

@@ -177,7 +175,7 @@ class XMLDocumentHTMLSnippetViewSet(SnippetViewSet):
177175
verbose_name_plural = _("XML Document HTMLs")
178176
icon = "doc-full"
179177
menu_name = "xml_manager"
180-
menu_label = _("HTMLs derivados")
178+
menu_label = _("HTMLs")
181179
menu_icon = "doc-full-inverse"
182180
add_to_admin_menu = False
183181

@@ -202,8 +200,7 @@ class SPSPackageValidationSnippetViewSet(SnippetViewSet):
202200
menu_name = "sps_package_validation"
203201
menu_label = _("Validar SPS")
204202
menu_icon = "sps-package-validation"
205-
add_to_admin_menu = True
206-
menu_order = get_menu_order("sps_package_validation")
203+
add_to_admin_menu = False
207204

208205
list_display = (
209206
"__str__",
@@ -220,9 +217,6 @@ class SPSPackageValidationSnippetViewSet(SnippetViewSet):
220217
search_fields = ("package_document__title",)
221218

222219

223-
register_snippet(SPSPackageValidationSnippetViewSet)
224-
225-
226220
@hooks.register("register_icons")
227221
def register_xml_manager_icons(icons):
228222
return icons + ["wagtailadmin/icons/sps-package-validation.svg"]

0 commit comments

Comments
 (0)