-
Notifications
You must be signed in to change notification settings - Fork 7
Adiciona filtros na area admin dos procs #756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
robertatakenaka
merged 6 commits into
scieloorg:main
from
robertatakenaka:adiciona_filtros_na_area_admin_dos_procs
Oct 8, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4506738
refactor: migra ArticleModelAdmin para ArticleSnippetViewSet
robertatakenaka 3300985
refactor: migra IssueAdmin e TOCAdmin para SnippetViewSet
robertatakenaka 1634345
refactor: migra JournalAdmin para sistema SnippetViewSet
robertatakenaka 546b026
refactor: moderniza interface de migração para SnippetViewSet
robertatakenaka 025232b
refactor: migra módulo de processamento para SnippetViewSet
robertatakenaka d268987
Corrige rota das páginas administrativas (snippets) de journals e art…
robertatakenaka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
core/templates/wagtailadmin/summary_items/article_summary_item.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| {% load i18n wagtailadmin_tags %} | ||
|
|
||
| <li> | ||
| {% icon name="doc-full" %} | ||
| <a href="{% url 'article_article_modeladmin_index' %}"> | ||
| {% icon name="folder-inverse" %} | ||
| <a href="{% url 'wagtailsnippets_article_article:list' %}"> | ||
| {% blocktrans trimmed count counter=total_article with total_article|intcomma as total %} | ||
| <span>{{ total_article }}</span> Article | ||
| {% plural %} | ||
| <span>{{ total_article }}</span> Articles | ||
| {% endblocktrans %} | ||
| </a> | ||
| </li> | ||
| </li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,87 +1,115 @@ | ||
| from django.utils.translation import gettext_lazy as _ | ||
| from wagtail_modeladmin.options import ( | ||
| ModelAdmin, | ||
| ModelAdminGroup, | ||
| modeladmin_register, | ||
| ) | ||
| from wagtail.admin.panels import FieldPanel, InlinePanel, MultiFieldPanel | ||
| from wagtail.admin.ui.tables import UpdatedAtColumn | ||
| from wagtail.snippets.models import register_snippet | ||
| from wagtail.snippets.views.snippets import SnippetViewSet, SnippetViewSetGroup | ||
| from wagtail import hooks | ||
|
|
||
| from config.menu import get_menu_order | ||
| from issue.views import IssueCreateView, TOCEditView | ||
|
|
||
| from .models import TOC, Issue | ||
|
|
||
|
|
||
| class IssueAdmin(ModelAdmin): | ||
| class IssueSnippetViewSet(SnippetViewSet): | ||
| model = Issue | ||
| inspect_view_enabled = True | ||
| icon = "folder" | ||
| menu_label = _("Issues") | ||
| create_view_class = IssueCreateView | ||
| menu_icon = "folder" | ||
| menu_order = get_menu_order("issue") | ||
| add_to_settings_menu = False | ||
| exclude_from_explorer = False | ||
|
|
||
| list_display = ( | ||
| add_to_admin_menu = False | ||
|
|
||
| # Views customizadas | ||
| create_view_class = IssueCreateView | ||
|
|
||
| # Configuração de listagem | ||
| list_display = [ | ||
| "journal", | ||
| "publication_year", | ||
| "order", | ||
| "volume", | ||
| "number", | ||
| "supplement", | ||
| ) | ||
| list_filter = ("publication_year",) | ||
| search_fields = ( | ||
| UpdatedAtColumn(), | ||
| ] | ||
|
|
||
| list_filter = ["publication_year", "journal"] | ||
|
|
||
| search_fields = [ | ||
| "journal__journal_acron", | ||
| "journal__official_journal__title", | ||
| "journal__official_journal__issn_electronic", | ||
| "journal__official_journal__issn_print", | ||
| "publication_year", | ||
| "volume", | ||
| "number", | ||
| "supplement", | ||
| ) | ||
|
|
||
| # def get_ordering(self, request): | ||
| # qs = super().get_queryset(request) | ||
| # # Only show people managed by the current user | ||
| # return qs.order_by("-updated") | ||
| ] | ||
|
|
||
| # Paginação - máximo 50 por página | ||
| list_per_page = 50 | ||
|
|
||
| # Ordenação padrão | ||
| ordering = ["-publication_year", "-updated"] | ||
|
|
||
| # Habilitar inspeção | ||
| inspect_view_enabled = True | ||
|
|
||
| # Configurações de exportação | ||
| list_export = ["csv", "xlsx"] | ||
| export_filename = "issues" | ||
|
|
||
|
|
||
| class TOCAdmin(ModelAdmin): | ||
| class TOCSnippetViewSet(SnippetViewSet): | ||
| model = TOC | ||
| inspect_view_enabled = True | ||
| icon = "folder" | ||
| menu_label = _("Table of contents sections") | ||
| edit_view_class = TOCEditView | ||
| menu_icon = "folder" | ||
| menu_order = get_menu_order("issue") | ||
| menu_order = get_menu_order("issue") + 1 | ||
| add_to_settings_menu = False | ||
| exclude_from_explorer = False | ||
|
|
||
| list_display = ( | ||
| add_to_admin_menu = False | ||
|
|
||
| # Configuração de listagem | ||
| list_display = [ | ||
| "issue", | ||
| "creator", | ||
| "created", | ||
| "updated_by", | ||
| "updated", | ||
| ) | ||
| list_filter = ("ordered",) | ||
| search_fields = ( | ||
| ] | ||
|
|
||
| list_filter = ["ordered", "created", "updated"] | ||
|
|
||
| search_fields = [ | ||
| "issue__journal__title", | ||
| "issue__journal__official_journal__title", | ||
| "issue__volume", | ||
| "issue__number", | ||
| "issue__supplement", | ||
| "issue__publication_year", | ||
| ) | ||
| ] | ||
|
|
||
| # Paginação - máximo 50 por página | ||
| list_per_page = 50 | ||
|
|
||
| # Ordenação padrão | ||
| ordering = ["-updated"] | ||
|
|
||
| # Habilitar inspeção | ||
| inspect_view_enabled = True | ||
|
|
||
| # Configurações de exportação | ||
| list_export = ["csv", "xlsx"] | ||
| export_filename = "table_of_contents" | ||
|
|
||
|
|
||
| class IssueModelAdminGroup(ModelAdminGroup): | ||
| # Grupo de Snippets para Issues | ||
| class IssueSnippetViewSetGroup(SnippetViewSetGroup): | ||
| menu_icon = "folder" | ||
| menu_label = _("Issues") | ||
| menu_order = get_menu_order("issue") | ||
| items = ( | ||
| IssueAdmin, | ||
| TOCAdmin, | ||
| ) | ||
|
|
||
| # Itens do grupo | ||
| items = (IssueSnippetViewSet, TOCSnippetViewSet) | ||
|
|
||
|
|
||
| modeladmin_register(IssueModelAdminGroup) | ||
| # Registrar o grupo | ||
| register_snippet(IssueSnippetViewSetGroup) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The menu label has changed from 'Tasks' to 'Articles'. Ensure this change is intentional and consistent with the application's navigation structure.