From c7445e73ff2a54c63baeeeb707defa3266c9e4b9 Mon Sep 17 00:00:00 2001 From: Samuel Veiga Rangel Date: Tue, 22 Oct 2024 14:30:34 -0300 Subject: [PATCH 1/2] =?UTF-8?q?Adiciona=20condi=C3=A7=C3=A3o=20if=20em=20a?= =?UTF-8?q?bout=5Fjournal=20para=20rendenrizar=20conteudo=20da=20pagina=20?= =?UTF-8?q?informativa=20antigo=20ou=20do=20core.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- opac/webapp/main/views.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/opac/webapp/main/views.py b/opac/webapp/main/views.py index ee3ca831..d7dc0ea9 100644 --- a/opac/webapp/main/views.py +++ b/opac/webapp/main/views.py @@ -638,11 +638,16 @@ def about_journal(url_seg): ) else: latest_issue_legend = None - - section_journal_content = utils.fetch_and_extract_section( - collection_acronym, journal.acronym, language - ) - + + if journal.old_information_page: + page = controllers.get_page_by_journal_acron_lang(journal.acronym, language) + content = page.content + else: + section_journal_content = utils.fetch_and_extract_section( + collection_acronym, journal.acronym, language + ) + content = section_journal_content + context = { "journal": journal, "latest_issue_legend": latest_issue_legend, @@ -652,9 +657,7 @@ def about_journal(url_seg): ], } - if section_journal_content: - context["content"] = section_journal_content - + context['content'] = content context.update(controllers.get_issue_nav_bar_data(journal)) return render_template("journal/about.html", **context) From 98806a32947491e2177f7d48bf78e6aebd3722ac Mon Sep 17 00:00:00 2001 From: Samuel Veiga Rangel Date: Tue, 22 Oct 2024 14:36:20 -0300 Subject: [PATCH 2/2] Adiciona o campo old_information_page ao formulario do periodico --- opac/webapp/admin/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opac/webapp/admin/views.py b/opac/webapp/admin/views.py index df611e2e..ffea8232 100644 --- a/opac/webapp/admin/views.py +++ b/opac/webapp/admin/views.py @@ -589,6 +589,7 @@ class JournalAdminView(OpacBaseAdminView): "eletronic_issn", "unpublish_reason", "url_segment", + "old_information_page", ] column_formatters = dict( @@ -634,6 +635,7 @@ class JournalAdminView(OpacBaseAdminView): is_public=__("Publicado?"), unpublish_reason=__("Motivo de despublicação"), url_segment=__("Segmento de URL"), + old_information_page=__("Manter página informativa legado"), ) @action("publish", _("Publicar"), ACTION_PUBLISH_CONFIRMATION_MSG)