Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions journal/migrations/0059_journalproxyadminonly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 5.2.7 on 2026-02-08 01:08

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("journal", "0058_rename_journal_inline_panel_related_names"),
]

operations = [
migrations.CreateModel(
name="JournalProxyAdminOnly",
fields=[],
options={
"verbose_name": "Journal (Admin Only)",
"verbose_name_plural": "Journals (Admin Only)",
"proxy": True,
"indexes": [],
"constraints": [],
},
bases=("journal.journal",),
),
]
185 changes: 138 additions & 47 deletions journal/proxys.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,169 +7,260 @@

class JournalProxyEditor(Journal):
panels_titles = [
# SOBRE O PERIÓDICO - 08 - Ficha Bibliográfica - F - Ano de criação do periódico / ISSN
AutocompletePanel("official", read_only=True),
# SOBRE O PERIÓDICO - 08 - Ficha Bibliográfica - A - Título do periódico
FieldPanel("title", read_only=True),
# SOBRE O PERIÓDICO - 08 - Ficha Bibliográfica - B - Título abreviado do periódico
FieldPanel("short_title"),
InlinePanel("other_titles", label=_("Other titles")),
# InlinePanel("other_titles", label=_("Other titles")),
]

panels_scope_and_about = [
InlinePanel("mission", label=_("Mission")),
# InlinePanel("mission", label=_("Mission")),

# SOBRE O PERIÓDICO - 01 - brief history
InlinePanel("history", label=_("Brief History")),

# SOBRE O PERIÓDICO - 05 - focus and scope
InlinePanel("focus", label=_("Focus and Scope")),
AutocompletePanel("subject"),
InlinePanel("thematic_area", label=_("Thematic Areas")),
AutocompletePanel("subject_descriptor"),
AutocompletePanel("wos_area"),
AutocompletePanel("wos_db"),
# AutocompletePanel("subject"),
# InlinePanel("thematic_area", label=_("Thematic Areas")),
# AutocompletePanel("subject_descriptor"),
# AutocompletePanel("wos_area"),
# AutocompletePanel("wos_db"),
Comment on lines 19 to +31
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Large blocks of panels are being kept as commented-out code. This file is now the only place in the journal app that uses commented-out InlinePanel/AutocompletePanel definitions, which makes the panel configuration harder to read/maintain over time. Prefer removing these panels entirely (git history already preserves them) or gating them behind an explicit configuration/feature flag if they are expected to return.

Copilot uses AI. Check for mistakes.

# SOBRE O PERIÓDICO - 07a - Fontes de Indexação padronizadas
AutocompletePanel("indexed_at"),
# SOBRE O PERIÓDICO - 07b - Fontes de Indexação adicionais / não padronizadas
AutocompletePanel("additional_indexed_at"),
AutocompletePanel("vocabulary"),
InlinePanel("title_in_database", label=_("Title in Database")),

# AutocompletePanel("vocabulary"),
# InlinePanel("title_in_database", label=_("Title in Database")),
]

panels_institutions = [
# SOBRE O PERIÓDICO - 08 - Ficha Bibliográfica - C1 - Publicação de
InlinePanel("owner_history", label=_("Owner")),
# SOBRE O PERIÓDICO - 08 - Ficha Bibliográfica - C2 - Publicação de
InlinePanel("publisher_history", label=_("Publisher")),

# POLÍTICA EDITORIAL - 14 - Patrocinadores e Agências de Fomento
InlinePanel("sponsor_history", label=_("Sponsor")),
Comment on lines +47 to 49
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is trailing whitespace on the blank line and on the comment line here. This will be rejected by the repo’s pre-commit trailing-whitespace hook; please remove the extra spaces.

Copilot uses AI. Check for mistakes.
InlinePanel(
"copyright_holder_history",
label=_("Copyright Holder"),
),
# InlinePanel(
# "copyright_holder_history",
# label=_("Copyright Holder"),
# ),
]

panels_website = [
# SOBRE O PERIÓDICO - 10a - Contato
FieldPanel("contact_name"),
# SOBRE O PERIÓDICO - 10b - Contato
FieldPanel("contact_address"),
# SOBRE O PERIÓDICO - 10c - Contato
AutocompletePanel("contact_location"),
# SOBRE O PERIÓDICO - 10d - Contato
InlinePanel("journal_email", label=_("Contact e-mail")),

# SOBRE O PERIÓDICO - 09d - Websites
FieldPanel("logo", heading=_("Logo")),
# FieldPanel("journal_url"),
InlinePanel("related_journal_urls", label=_("Journal Urls")),
# SOBRE O PERIÓDICO - 09c - Websites
FieldPanel("journal_url"),

# InlinePanel("related_journal_urls", label=_("Journal Urls")),
Comment on lines +69 to +71
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

journal_url is being exposed in the editor UI while related_journal_urls is commented out. The codebase previously introduced JournalURL (migration 0025_journalurl) and migrated values from journal_url into the inline panel, and there’s no model logic keeping journal_url and related_journal_urls in sync. This means edits to journal_url here will likely be ignored by the rest of the system (which prefetches/uses related_journal_urls) and can lead to inconsistent data. Consider keeping related_journal_urls as the editable field (and leaving journal_url hidden/read-only), or add explicit synchronization/validation so both representations stay consistent.

Suggested change
FieldPanel("journal_url"),
# InlinePanel("related_journal_urls", label=_("Journal Urls")),
# FieldPanel("journal_url"),
InlinePanel("related_journal_urls", label=_("Journal Urls")),

Copilot uses AI. Check for mistakes.

# SOBRE O PERIÓDICO - 09b - Websites
FieldPanel("submission_online_url"),
FieldPanel("main_collection"),
# FieldPanel("main_collection"),

# SOBRE O PERIÓDICO - 09 - Websites e Mídias Sociais
InlinePanel("social_networks", label=_("Social Network")),

# SOBRE O PERIÓDICO - 08 - Ficha Bibliográfica - D - Periodicidade
FieldPanel("frequency"),

# SOBRE O PERIÓDICO - 08 - Ficha Bibliográfica - E - Modalidade de publicação
FieldPanel("publishing_model"),
FieldPanel("standard"),
# FieldPanel("standard"),
]

panels_open_science = [
FieldPanel("open_access"),
FieldPanel("url_oa"),
InlinePanel("open_science_form_files", label=_("Open Science accordance form")),
FieldPanel("journal_use_license"),
# FieldPanel("open_access"),

# SOBRE O PERIÓDICO - 02 - journal declares it is open access
InlinePanel("open_access_text", label=_("Open Access")),
# FieldPanel("url_oa"),

# SOBRE O PERIÓDICO - 03a - Conformidade com a Ciência Aberta - formulário de auto declaração
InlinePanel("open_science_form_files", label=_("Open Science accordance form")),

# SOBRE O PERIÓDICO - 04 - Ética na Publicação
InlinePanel(
"ethics",
label=_("Ethics"),
),

# POLÍTICA EDITORIAL - 11b - Direitos Autorais / AUTORES CEDEM PARA PUBLICAR EM CC-BY
# FieldPanel("journal_use_license"),

# POLÍTICA EDITORIAL - 03 - Dados Abertos
InlinePanel("open_data", label=_("Open data")),

# POLÍTICA EDITORIAL - 01 - Preprints
InlinePanel("preprint", label=_("Preprint")),

# POLÍTICA EDITORIAL - 02 - Peer review
InlinePanel("peer_review", label=_("Peer review")),

# about_the_journal - 03b - Conformidade com a Ciência Aberta - declaração de conformidade
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section-mapping comments are inconsistent here (about_the_journal vs the rest of the file using SOBRE O PERIÓDICO/POLÍTICA EDITORIAL). Since the main goal of this PR is clear field-to-section mapping, please standardize the terminology/casing so the mapping is unambiguous and searchable.

Suggested change
# about_the_journal - 03b - Conformidade com a Ciência Aberta - declaração de conformidade
# SOBRE O PERIÓDICO - 03b - Conformidade com a Ciência Aberta - declaração de conformidade

Copilot uses AI. Check for mistakes.
InlinePanel(
"open_science_compliance",
label=_("Open Science Compliance"),
),
]

panels_policy = [
InlinePanel(
"ethics",
label=_("Ethics"),
),

# POLÍTICA EDITORIAL - 10 - Comitê de Ética
InlinePanel(
"ethics_committee",
label=_("Ethics Committee"),
),
# POLÍTICA EDITORIAL - 11a - detentor dos direitos autorais
InlinePanel(
"copyright",
label=_("Copyright"),
),

# POLÍTICA EDITORIAL - 12 - Propriedade Intelectual e Termos de uso - Responsabilidade do site
InlinePanel(
"website_responsibility",
label=_("Intellectual Property / Terms of use / Website responsibility"),
),

# POLÍTICA EDITORIAL - 13 - Propriedade Intelectual e Termos de uso - Responsabilidade do autor
InlinePanel(
"author_responsibility",
label=_("Intellectual Property / Terms of use / Author responsibility"),
),

# POLÍTICA EDITORIAL - 05 - Política de Ética e Más condutas, Errata e Retratação
InlinePanel(
"policies",
label=_("Retraction Policy | Ethics and Misconduct Policy"),
),
AutocompletePanel("digital_pa"),

# AutocompletePanel("digital_pa"),
# about_the_journal - 06 - Preservação Digital - texto + link - poderia estar fixo no template html?
InlinePanel(
"digital_preservation",
label=_("Digital Preservation"),
),

# POLÍTICA EDITORIAL - 06 - Política sobre Conflito de Interesses
InlinePanel(
"conflict_policy",
label=_("Conflict of interest policy"),
),

# POLÍTICA EDITORIAL - 07 - Adoção de softwares de verificação de similaridade
InlinePanel(
"software_adoption",
label=_("Similarity Verification Software Adoption"),
),

# POLÍTICA EDITORIAL - 09 - Questões de Sexo e Gênero
InlinePanel(
"gender_issues",
label=_("Gender Issues"),
),
# POLÍTICA EDITORIAL - 04 - Cobrança de Taxas
InlinePanel(
"fee_charging",
label=_("Fee Charging"),
),
InlinePanel(
"editorial_policy",
label=_("Editorial Policy"),
),
# InlinePanel(
# "editorial_policy",
# label=_("Editorial Policy"),
# ),

# POLÍTICA EDITORIAL - 08 - Adoção de softwares uso de recursos de Inteligência Artificial
# Uso por autores
# Responsabilidade e transparência
# Uso por pareceristas e editores
# Processos de avaliação e decisões editoriais
# Atualizações - TEXTO FIXO NO TEMPLATE HTML?
InlinePanel(
"artificial_intelligence",
label=_("Artificial Intelligence"),
),
]
panels_notes = [InlinePanel("notes", label=_("Notes"))]
# panels_notes = [InlinePanel("notes", label=_("Notes"))]

panels_instructions_for_authors = [
# INSTRUÇÕES AOS AUTORES - 01 - Tipos de documentos aceitos
InlinePanel(
"accepted_document_types",
label=_("Accepted Document Types"),
),
# INSTRUÇÕES AOS AUTORES - 02 - Contribuição dos Autores
InlinePanel(
"authors_contributions",
label=_("Authors Contributions"),
),
InlinePanel(
"preparing_manuscript",
label=_("Preparing Manuscript"),
),

# INSTRUÇÕES AOS AUTORES - 0? -
# InlinePanel(
# "preparing_manuscript",
# label=_("Preparing Manuscript"),
# ),
Comment on lines +212 to +217
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These section-mapping comments still contain placeholders like 0?. This undermines the refactor’s purpose (explicit mapping to the form sections) and makes it hard to trust the documentation. Please replace with the correct section number/name (or remove the mapping comment if it can’t be confirmed yet).

Copilot uses AI. Check for mistakes.

# INSTRUÇÕES AOS AUTORES - 04 - Ativos Digitais
InlinePanel(
"digital_assets",
label=_("Digital Assets"),
),

# INSTRUÇÕES AOS AUTORES - 05 - Citações e Referências
InlinePanel(
"citations_and_references",
label=_("Citations and References"),
),
InlinePanel(
"supp_docs_submission",
label=_("Supplementary Documents Required for Submission"),
),

# INSTRUÇÕES AOS AUTORES - 0? -
# InlinePanel(
# "supp_docs_submission",
# label=_("Supplementary Documents Required for Submission"),
# ),

# INSTRUÇÕES AOS AUTORES - 06 - Declaração de Financiamento
InlinePanel(
"financing_statement",
label=_("Financing Statement"),
),
InlinePanel(
"acknowledgements",
label=_("Acknowledgements"),
),

# INSTRUÇÕES AOS AUTORES - 0? -
# InlinePanel(
# "acknowledgements",
# label=_("Acknowledgements"),
# ),
# INSTRUÇÕES AOS AUTORES - 07 - Informações Adicionais
InlinePanel(
"additional_information",
label=_("Additional Information"),
),
FieldPanel("author_name"),
FieldPanel("manuscript_length"),
# FieldPanel("author_name"),
# FieldPanel("manuscript_length"),

# INSTRUÇÕES AOS AUTORES - 03 - Formato de Envio dos Artigos
FieldPanel("format_check_list"),
AutocompletePanel("text_language"),
AutocompletePanel("abstract_language"),

# AutocompletePanel("text_language"),
# AutocompletePanel("abstract_language"),
]

# CORPO EDITORIAL
panels_editorial_board = [
InlinePanel("editorial_board_member_journal", label=_("Editorial Board")),
]
Expand Down
Loading