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

#3088 Editors can now determine whether the date submitted and date accepted display for their articles on all themes #4062

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 src/core/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ def get_settings_to_edit(display_group, journal, user):
'display_altmetric_badge',
'altmetric_badge_type',
'hide_author_email_links',
'display_date_submitted',
'display_date_accepted',
]
group_of_settings = process_setting_list(article_settings, 'article', journal)
setting_group = 'article'
Expand Down
8 changes: 8 additions & 0 deletions src/templates/admin/elements/forms/group_article.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@ <h2>Metrics Display</h2>
{% include "admin/elements/forms/field.html" with field=edit_form.suppress_citations_metric %}
</div>

<div class="title-area">
<h2>Article Dates</h2>
</div>
<div class="content">
<p>{% trans "Enable the display of the dates an article was submitted and accepted." %}.</p>
{% include "admin/elements/forms/field.html" with field=edit_form.display_date_submitted %}
{% include "admin/elements/forms/field.html" with field=edit_form.display_date_accepted %}
</div>

11 changes: 7 additions & 4 deletions src/themes/OLH/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,8 @@ <h4 class="number">
{% if article.is_published or proofing %}
<h5 id="article_date_published">
{% trans "Published on" %} <br>
{{ article.date_published|date:"d M Y" }}
{{ article.date_published|date:"Y-m-d" }}
</h5>
{% else %}
<h5>{% trans "Accepted on" %} <br>
{{ article.date_accepted|date:"d M Y" }}</h5>
{% endif %}
</div>
{% endif %}
Expand Down Expand Up @@ -407,6 +404,12 @@ <h3>{% trans "Publication details" %}</h3>
{% if article.publication_title %}
<li>{% trans "Original ISSN" %}: {{ article.ISSN_override }}</li>
{% endif %}
{% if journal_settings.article.display_date_submitted and article.date_submitted %}
<li>{% trans "Submitted on" %}: {{ article.date_submitted|date:"Y-m-d" }}</li>
{% endif %}
{% if journal_settings.article.display_date_accepted and article.date_accepted %}
<li>{% trans "Accepted on" %}: {{ article.date_accepted|date:"Y-m-d" }}</li>
{% endif %}
</ul>
</div>
{% endif %}
Expand Down
14 changes: 11 additions & 3 deletions src/themes/clean/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,20 @@ <h2>{% trans "Supplementary Files" %}</h2>
{% endif %}
<h2>{% trans "Information" %}</h2>
<ul>
{% if journal_settings.article.display_date_submitted and article.date_submitted %}
<li>
{% trans "Submitted on" %} {{ article.date_submitted|date:"Y-m-d" }}
</li>
{% endif %}
{% if journal_settings.article.display_date_accepted and article.date_accepted %}
<li>
{% trans "Accepted on" %} {{ article.date_accepted|date:"Y-m-d" }}
</li>
{% endif %}
{% if article.is_published or proofing %}
<li id="article_date_published">
{% trans "Published on" %} {{ article.date_published|date:"d M Y" }}
{% trans "Published on" %} {{ article.date_published|date:"Y-m-d" }}
</li>
{% else %}
<li>{% trans "Accepted on" %} {{ article.date_accepted|date:"d M Y" }}</li>
{% endif %}
{% if article.page_range %}
<li>{% trans "Pages" %}: {{ article.page_range }}</li>
Expand Down
46 changes: 20 additions & 26 deletions src/themes/material/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,26 @@ <h4>{% trans "Publication details" %}</h4>
<td>{{ article.ISSN_override}}</td>
</tr>
{% endif %}
{% if journal_settings.article.display_date_submitted and article.date_submitted %}
<tr>
<th>{% trans "Submitted on" %}</th>
<td>{{ article.date_submitted|date:"Y-m-d" }}</td>
</tr>
{% endif %}
{% if journal_settings.article.display_date_accepted and article.date_accepted %}
<tr>
<th>{% trans "Accepted on" %}</th>
<td>{{ article.date_accepted|date:"Y-m-d" }}</td>
</tr>
{% endif %}
{% if article.date_published or proofing %}
<tr>
<th>{% trans "Published on" %}</th>
<td id="article_date_published">
{{ article.date_published|date:"Y-m-d" }}
</td>
</tr>
{% endif %}
</table>
</div>
<div class="spacer">
Expand Down Expand Up @@ -383,32 +403,6 @@ <h4>{% trans "Non Specialist Summary" %}</h4>
<div class="divider"></div>
</div>
{% endif %}

{% if article.date_accepted or article.date_published or proofing %}
<h4>
{% trans "Dates" %}
</h4>
<table class="sidebar-table">
{% if article.date_accepted %}
<tr>
<th>{% trans "Accepted" %}</th>
<td>{{ article.date_accepted|date:"Y-m-d" }}</td>
</tr>
{% endif %}
{% if article.date_published or proofing %}
<tr>
<th>{% trans "Published" %}</th>
<td id="article_date_published">
{{ article.date_published|date:"Y-m-d" }}
</td>
</tr>
{% endif %}
</table>
<div class="spacer">
<div class="divider"></div>
</div>
{% endif %}

<h4>
{% trans "Licence" %}
</h4>
Expand Down
38 changes: 38 additions & 0 deletions src/utils/install/journal_defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -5064,5 +5064,43 @@
"editor",
"journal-manager"
]
},
{
"group": {
"name": "article"
},
"setting": {
"description": "When enabled the date this article was submitted will be displayed along with the date accepted and date published on the article page.",
"is_translatable": false,
"name": "display_date_submitted",
"pretty_name": "Display Date Submitted",
"type": "boolean"
},
"value": {
"default": ""
},
"editable_by": [
"editor",
"journal-manager"
]
},
{
"group": {
"name": "article"
},
"setting": {
"description": "When enabled the date this article was accepted will be displayed along with the date accepted and date published on the article page.",
"is_translatable": false,
Copy link
Member

Choose a reason for hiding this comment

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

is it "this article" or "all articles"

"name": "display_date_accepted",
"pretty_name": "Display Date Accepted",
"type": "boolean"
},
"value": {
"default": "on"
},
"editable_by": [
"editor",
"journal-manager"
]
}
]