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
20 changes: 13 additions & 7 deletions src/core/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ def get_settings_to_edit(display_group, journal, user):
"replyto_address",
"use_credit",
"a11y_public_info",
"feeds",
]

group_of_settings = process_setting_list(journal_settings, "general", journal)
Expand Down Expand Up @@ -1035,22 +1036,27 @@ def password_policy_check(request):
password = request.POST.get("password_1")

rules = [
lambda s: len(password) >= request.press.password_length
or _("Your password must be {} characters long").format(
request.press.password_length
lambda s: (
len(password) >= request.press.password_length
or _("Your password must be {} characters long").format(
request.press.password_length
)
)
]

if request.press.password_upper:
rules.append(
lambda password: any(x.isupper() for x in password)
or _("An uppercase character is required")
lambda password: (
any(x.isupper() for x in password)
or _("An uppercase character is required")
)
)

if request.press.password_number:
rules.append(
lambda password: any(x.isdigit() for x in password)
or _("A number is required")
lambda password: (
any(x.isdigit() for x in password) or _("A number is required")
)
)

problems = [p for p in [r(password) for r in rules] if p != True]
Expand Down
4 changes: 2 additions & 2 deletions src/review/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def __init__(self, *args, **kwargs):
self.fields["decision"].widget.attrs["onchange"] = "decision_change()"
self.fields["decision"].widget.attrs["onfocus"] = "store_previous_decision()"
self.fields["editor"].queryset = editors
self.fields["editor"].label_from_instance = (
lambda obj: f"{obj.full_name()} ({obj.email})"
self.fields["editor"].label_from_instance = lambda obj: (
f"{obj.full_name()} ({obj.email})"
)
if not newly_created:
self.fields["message_to_editor"].widget = forms.HiddenInput()
Expand Down
4 changes: 2 additions & 2 deletions src/submission/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ class EditorArticleInfoSubmit(ArticleInfo):
def __init__(self, *args, **kwargs):
super(EditorArticleInfoSubmit, self).__init__(*args, **kwargs)
if self.fields.get("section"):
self.fields["section"].label_from_instance = (
lambda obj: obj.display_name_public_submission
self.fields["section"].label_from_instance = lambda obj: (
obj.display_name_public_submission
)
self.fields["section"].help_text = (
"As an editor you will see all "
Expand Down
3 changes: 3 additions & 0 deletions src/templates/admin/elements/forms/group_journal.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ <h2>Other</h2>
<p>If you want to toggle CRediT support, you can do so here.</p>
{% include "admin/elements/forms/field.html" with field=edit_form.display_use_credit %}
{% include "admin/elements/forms/field.html" with field=edit_form.use_credit %}

<p>When enabled, RSS and Atom feed links are included in the journal's page headers.</p>
{% include "admin/elements/forms/field.html" with field=edit_form.feeds %}
</div>

{% if request.press.allow_journal_a11y_info %}
Expand Down
6 changes: 4 additions & 2 deletions src/themes/OLH/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
{% hook 'base_head_css' %}

{% if request.journal %}
<link href="{% journal_url 'rss_articles' %}" type="application/atom+xml" rel="alternate" title="Article Feed for Journal">
<link href="{% journal_url 'rss_news' %}" type="application/atom+xml" rel="alternate" title="News Feed for Journal">
{% if journal_settings.general.feeds %}
<link href="{% journal_url 'rss_articles' %}" type="application/atom+xml" rel="alternate" title="Article Feed for Journal">
<link href="{% journal_url 'rss_news' %}" type="application/atom+xml" rel="alternate" title="News Feed for Journal">
{% endif %}
{% else %}
<link rel="alternate" type="application/rss+xml" title="Articles RSS Feed" href="{% url 'rss_articles' %}"/>
<link type="application/atom+xml" rel="alternate" title="News Feed for Journal" href="{% url 'rss_news' %}">
Expand Down
2 changes: 2 additions & 0 deletions src/themes/clean/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
{% block head %}{% endblock head %}
<link rel="sitemap" type="application/xml" title="Sitemap" href="{% url 'website_sitemap' %}">

{% if not request.journal or journal_settings.general.feeds %}
<link href="{% journal_url 'rss_articles' %}" type="application/atom+xml" rel="alternate"
title="Article Feed for Journal">
<link href="{% journal_url 'rss_news' %}" type="application/atom+xml" rel="alternate" title="News Feed for Journal">
{% endif %}
{% include "common/elements/favicons.html" %}

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet"
Expand Down
2 changes: 1 addition & 1 deletion src/themes/material/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<link rel="sitemap" type="application/xml" title="Sitemap" href="{% url 'website_sitemap' %}">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
{% if request.journal %}
{% if request.journal and journal_settings.general.feeds %}
<link href="{% journal_url 'rss_articles' %}" type="application/atom+xml" rel="alternate"
title="Article Feed for Journal">
<link href="{% journal_url 'rss_news' %}" type="application/atom+xml" rel="alternate"
Expand Down
19 changes: 19 additions & 0 deletions src/utils/install/journal_defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -5615,5 +5615,24 @@
"editor",
"journal-manager"
]
},
{
"group": {
"name": "general"
},
"setting": {
"description": "RSS and Atom feed links in the journal's page headers.",
"is_translatable": false,
"name": "feeds",
"pretty_name": "RSS/Atom Feeds",
"type": "boolean"
},
"value": {
"default": "on"
},
"editable_by": [
"editor",
"journal-manager"
]
}
]
Loading