Skip to content
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

Para a página informativa do journal, cria possibilidade de manter a página do legado, na ausência de conteúdo do Core #197

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions opac/webapp/admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ class JournalAdminView(OpacBaseAdminView):
"eletronic_issn",
"unpublish_reason",
"url_segment",
"old_information_page",
]

column_formatters = dict(
Expand Down Expand Up @@ -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)
Expand Down
16 changes: 7 additions & 9 deletions opac/webapp/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,15 +639,15 @@ def about_journal(url_seg):
)
else:
latest_issue_legend = None

try:

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
)
except utils.NonRetryableError as e:
return page_not_found(e)
except utils.RetryableError as e:
return internal_server_error(e)
content = section_journal_content

context = {
"journal": journal,
Expand All @@ -658,9 +658,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)

Expand Down