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

4353 article page sharelinks a11y update #4355

Merged
merged 5 commits into from
Aug 29, 2024
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
8 changes: 8 additions & 0 deletions src/static/common/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,11 @@ article .list-romanupper {
height: auto;
overflow: visible;
}

a.twitter-x{
color: black;
text-decoration: none;
font-size: large;
font-weight: bold;
line-height: 1.25;
}
49 changes: 26 additions & 23 deletions src/themes/OLH/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,44 +101,47 @@ <h3>{{ article.title|safe }}</h3>
{% endif %}

<div data-sticky-container class="row">
<div class="mini-bar sticky" data-sticky data-margin-top="0" data-sticky data-anchor="content">
<div class="mini-bar sticky columns" data-sticky data-margin-top="0" data-sticky data-anchor="content">
<div class="row">
<div class="title-bar" data-responsive-toggle="options-menu" data-hide-for="medium">
<button class="menu-icon" type="button" data-toggle aria-label="{% trans 'Options' %}"></button>
<div class="title-bar-title">{% trans 'Options' %}</div>
</div>
<div id="options-menu">
<div class="large-6 columns">
<div class="small-4 medium-3 large-2 columns">
<ul class="menu vertical medium-horizontal pad-left-15"
data-responsive-menu="drilldown medium-dropdown">
{% with article.get_doi_url as doi_url %}
<li>{% trans "Share" %}:</li>
<li><a href="https://www.facebook.com/share.php?p[url]={% if doi_url %}{{ doi_url }}{% else %}{{ article.url }}{% endif %}" target="_blank" aria-label="{% trans 'Share on Facebook' %}"><i class="fa fa-facebook"></i></a></li>
<li><a href="https://twitter.com/intent/tweet?text={{ article.title }} {% if doi_url %}{{ doi_url }}{% else %}{{ article.url }}{% endif %}" target="_blank" aria-label="{% trans 'Share on X' %}"><i class="fa fa-twitter"></i></a></li>
<li><a class= "twitter-x"
href="https://twitter.com/intent/tweet?text={{ article.title }} {% if doi_url %}{{ doi_url }}{% else %}{{ article.url }}{% endif %}" target="_blank" aria-label="{% trans 'Share on X' %}">&#120143;</a></li>
<li><a href="https://www.linkedin.com/sharing/share-offsite?url={% if doi_url %}{{ doi_url }}{% else %}{{ article.url }}{% endif %}" target="_blank" aria-label="{% trans 'Share on LinkedIn' %}"><i class="fa fa-linkedin"></i></a></li>
{% endwith %}
</ul>
</div>
<div class="large-6 columns">
<ul class="menu vertical medium-horizontal align-right"
data-responsive-menu="dropdown">
{% hook 'article_buttons' %}
<li><a href="{{ article.local_url }}print/" aria-label="{% trans 'print article' %}"><i class="fa fa-print">&nbsp;</i></a></li>
<li><a href="javascript:resizeText(-1)" aria-label="{% trans 'decrease text size' %}">A-</a></li>
<li><a href="javascript:resizeText(1)" aria-label="{% trans 'increase text size' %}">A+</a></li>
{% if author.display_email and not journal_settings.article.hide_author_email_links %}<li><a href="mailto:{{ article.correspondence_author.email }}"><i class="fa fa-envelope"></i></a></li>{% endif %}
<li><a href="#" id="dyslexia-mode" aria-label="{% trans 'Dyslexia mode' %}">{% trans "Dyslexia" %}</a></li>
<li>
<a href="#" aria-label="{% trans 'Cite article' %}"><i class="fa fa-comments">&nbsp;</i></a>
<ul class="menu vertical">
<li><a href="#" data-open="HarvardModal">{% trans "Harvard Citation Style" %}</a></li>
<li><a href="#" data-open="VancouverModal">{% trans "Vancouver Citation Style" %}</a></li>
<li><a href="#" data-open="APAModal">{% trans "APA Citation Style" %}</a></li>
<li><a href="{% url 'serve_article_ris' 'id' article.pk %}"> {% trans 'Download' %} RIS</a></li>
<li><a href="{% url 'serve_article_bib' 'id' article.pk %}">{% trans ' Download' %} BibTeX</a></li>
</ul>
</li>
</ul>
<div class="small-8 medium-9 large-10 columns">
<div class = "float-right">
<ul class="menu vertical medium-horizontal"
data-responsive-menu="dropdown">
{% hook 'article_buttons' %}
<li><a href="{{ article.local_url }}print/" aria-label="{% trans 'print article' %}"><i class="fa fa-print">&nbsp;</i></a></li>
<li><a href="javascript:resizeText(-1)" aria-label="{% trans 'decrease text size' %}">A-</a></li>
<li><a href="javascript:resizeText(1)" aria-label="{% trans 'increase text size' %}">A+</a></li>
{% if author.display_email and not journal_settings.article.hide_author_email_links %}<li><a href="mailto:{{ article.correspondence_author.email }}"><i class="fa fa-envelope"></i></a></li>{% endif %}
<li><a href="#" id="dyslexia-mode" aria-label="{% trans 'Dyslexia mode' %}">{% trans "Dyslexia" %}</a></li>
<li>
<a href="#" aria-label="{% trans 'Cite article' %}"><i class="fa fa-comments">&nbsp;</i></a>
<ul class="menu vertical">
<li><a href="#" data-open="HarvardModal">{% trans "Harvard Citation Style" %}</a></li>
<li><a href="#" data-open="VancouverModal">{% trans "Vancouver Citation Style" %}</a></li>
<li><a href="#" data-open="APAModal">{% trans "APA Citation Style" %}</a></li>
<li><a href="{% url 'serve_article_ris' 'id' article.pk %}"> {% trans 'Download' %} RIS</a></li>
<li><a href="{% url 'serve_article_bib' 'id' article.pk %}">{% trans ' Download' %} BibTeX</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/themes/clean/assets/css/clean.css
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,7 @@ header svg {
.page-item.active .page-link {
background-color: #4F637D;
}

.social-share-btn{
border: 1px black solid;
}
12 changes: 12 additions & 0 deletions src/themes/clean/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,18 @@ <h2>{% trans "Authors" %}</h2>
{% endif %}

{% if article.is_published or proofing %}
<h2>{% trans "Share" %}</h2>
{% with article.get_doi_url as doi_url%}
<a class="waves-effect waves-light btn btn-small social-share-btn facebook-bg"
href="https://www.facebook.com/share.php?p[url]={% if doi_url %}{{ doi_url }}{% else %}{{ article.url }}{% endif %}"
target="_blank" aria-label="{% trans 'Share on Facebook' %}"><i class="fa fa-facebook"></i></a>
<a class="waves-effect waves-light btn btn-small social-share-btn twitter-x"
href="https://twitter.com/intent/tweet?text={{ article.title }} {% if doi_url %}{{ doi_url }}{% else %}{{ article.url }}{% endif %}"
target="_blank" aria-label="{% trans 'Share on X' %}">&#120143;</a>
<a class="waves-effect waves-light btn btn-small social-share-btn linkedin-bg"
href="https://www.linkedin.com/sharing/share-offsite?url={% if doi_url %}{{ doi_url }}{% else %}{{ article.url }}{% endif %}"
target="_blank" aria-label="{% trans 'Share on LinkedIn' %}"><i class="fa fa-linkedin"></i></a></button>
{% endwith %}
<h2>{% trans "Downloads" %}</h2>
{% if galleys %}
<ul>
Expand Down
26 changes: 16 additions & 10 deletions src/themes/material/assets/mat.css
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,11 @@ nav a.sidenav-trigger i {

:root {
--facebook: #3b5998;
--facebook-hover: #3b5998;
--twitter: #00acee;
--twitter-hover: #008abe;
--facebook-hover: white;
--twitter: black;
--twitter-hover: white;
--linkedin: #0e76a8;
--linkedin-hover: #0b5e87;
--linkedin-hover: white;
}

.btn-small {
Expand All @@ -575,27 +575,33 @@ nav a.sidenav-trigger i {
}

.facebook-bg {
background-color: var(--facebook);
background-color: var(--facebook) !important;
color: var(--facebook-hover) !important;
}

.facebook-bg:hover {
background-color: var(--facebook-hover);
background-color: var(--facebook-hover) !important;
color:var(--facebook) !important;
}

.twitter-bg {
background-color: var(--twitter);
background-color: var(--twitter) !important;
color: var(--twitter-hover) !important;
}

.twitter-bg:hover {
background-color: var(--twitter-hover);
background-color: var(--twitter-hover) !important;
color: var(--twitter) !important;
}

.linkedin-bg {
background-color: var(--linkedin);
background-color: var(--linkedin) !important;
color: var(--linkedin-hover) !important;
}

.linkedin-bg:hover {
background-color: var(--linkedin-hover);
background-color: var(--linkedin-hover) !important;
color: var(--linkedin) !important;
}

.flexbox {
Expand Down
4 changes: 2 additions & 2 deletions src/themes/material/templates/journal/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ <h4>
<a class="waves-effect waves-light btn btn-small facebook-bg"
href="https://www.facebook.com/share.php?p[url]={% if doi_url %}{{ doi_url }}{% else %}{{ article.url }}{% endif %}"
target="_blank" aria-label="{% trans 'Share on Facebook' %}"><i class="fa fa-facebook"></i></a>
<a class="waves-effect waves-light btn btn-small twitter-bg"
<a class="waves-effect waves-light btn btn-small twitter-bg twitter-x"
href="https://twitter.com/intent/tweet?text={{ article.title }} {% if doi_url %}{{ doi_url }}{% else %}{{ article.url }}{% endif %}"
target="_blank" aria-label="{% trans 'Share on X' %}"><i class="fa fa-twitter"></i></a>
target="_blank" aria-label="{% trans 'Share on X' %}">&#120143;</a>
<a class="waves-effect waves-light btn btn-small linkedin-bg"
href="https://www.linkedin.com/sharing/share-offsite?url={% if doi_url %}{{ doi_url }}{% else %}{{ article.url }}{% endif %}"
target="_blank" aria-label="{% trans 'Share on LinkedIn' %}"><i class="fa fa-linkedin"></i></a></button>
Expand Down