Skip to content

Commit

Permalink
Merge pull request #2239 from shinyichen/print-layout
Browse files Browse the repository at this point in the history
Print layout
  • Loading branch information
thostetler committed Feb 19, 2022
2 parents 028691f + 27ba141 commit 3c87226
Show file tree
Hide file tree
Showing 21 changed files with 462 additions and 247 deletions.
2 changes: 1 addition & 1 deletion src/js/mixins/discovery_bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define([
'orcid-instructions',
'public-libraries',
];
var regx = new RegExp('^#(/?(' + routes.join('|') + ').*/?)?$', 'i');
var regx = new RegExp('^#?(/?(' + routes.join('|') + ').*/?)?$', 'i');

var isPushState = function() {
return (
Expand Down
196 changes: 134 additions & 62 deletions src/js/widgets/abstract/templates/abstract_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ <h2 class="s-abstract-title">
{{/if}}
</h2>

<button class="btn btn-xs btn-default-flat s-toggle-aff" id="toggle-aff">
<button
class="btn btn-xs btn-default-flat s-toggle-aff print-hidden"
id="toggle-aff"
>
Show affiliations
</button>
<span id="pending-aff" style="display: none;"
Expand All @@ -29,7 +32,7 @@ <h2 class="s-abstract-title">
>
{{#if authorAff.length}} {{#if hasMoreAuthors}}
<button
class="btn btn-xs btn-default-flat s-toggle-authors"
class="btn btn-xs btn-default-flat s-toggle-authors print-hidden"
id="toggle-more-authors"
>
Show all authors
Expand All @@ -40,75 +43,131 @@ <h2 class="s-abstract-title">
<ul class="list-inline">
{{#each authorAff}}
<li class="author">
<a href="#search/q=author:{{this.[5]}}&sort=date%20desc,%20bibcode%20desc">
<a href="search/q=author:{{this.[5]}}&sort=date%20desc,%20bibcode%20desc">
{{this.[0]}}
</a>
<span>
{{#compare this.[2] '-' operator="!=="}}
<a class="orcid-author" href="#search/q=orcid:{{this.[2]}}&sort=date%20desc,%20bibcode%20desc">
<img class="inactive" src="../../styles/img/orcid-inactive.svg" alt="search by orcid">
<img class="active hidden" src="../../styles/img/orcid-active.svg" alt="search by orcid">
</a>
{{else}}
{{#compare this.[3] '-' operator="!=="}}
<a class="orcid-author" href="#search/q=orcid:{{this.[3]}}&sort=date%20desc,%20bibcode%20desc">
<img class="inactive" src="../../styles/img/orcid-inactive.svg" alt="search by orcid">
<img class="active hidden" src="../../styles/img/orcid-active.svg" alt="search by orcid">
</a>
{{else}}
{{#compare this.[4] '-' operator="!=="}}
<a class="orcid-author" href="#search/q=orcid:{{this.[4]}}&sort=date%20desc,%20bibcode%20desc">
<img class="inactive" src="../../styles/img/orcid-inactive.svg" alt="search by orcid">
<img class="active hidden" src="../../styles/img/orcid-active.svg" alt="search by orcid">
</a>
{{/compare}}
{{/compare}}
{{/compare}}
<a
class="orcid-author"
href="search/q=orcid:{{this.[2]}}&sort=date%20desc,%20bibcode%20desc"
>
<img
class="inactive"
src="../../styles/img/orcid-inactive.svg"
alt="search by orcid"
/>
<img
class="active hidden"
src="../../styles/img/orcid-active.svg"
alt="search by orcid"
/>
</a>
{{else}} {{#compare this.[3] '-' operator="!=="}}
<a
class="orcid-author"
href="search/q=orcid:{{this.[3]}}&sort=date%20desc,%20bibcode%20desc"
>
<img
class="inactive"
src="../../styles/img/orcid-inactive.svg"
alt="search by orcid"
/>
<img
class="active hidden"
src="../../styles/img/orcid-active.svg"
alt="search by orcid"
/>
</a>
{{else}} {{#compare this.[4] '-' operator="!=="}}
<a
class="orcid-author"
href="search/q=orcid:{{this.[4]}}&sort=date%20desc,%20bibcode%20desc"
>
<img
class="inactive"
src="../../styles/img/orcid-inactive.svg"
alt="search by orcid"
/>
<img
class="active hidden"
src="../../styles/img/orcid-active.svg"
alt="search by orcid"
/>
</a>
{{/compare}} {{/compare}} {{/compare}}
</span>
<span class="affiliation hide"> (<i>{{this.[1]}}</i>)</span>{{#if @last}}{{else}};{{/if}}
<span class="affiliation hide"> (<i>{{this.[1]}}</i>)</span>{{#if
@last}}{{else}};{{/if}}
</li>
{{/each}}

{{#if hasMoreAuthors}}
{{/each}} {{#if hasMoreAuthors}}
<li class="author">
;
<span class="extra-dots">
<a data-target="more-authors" title="Show all authors">...</a>
</span>
</li>
{{/if}}
{{/if}} {{#each authorAffExtra}}

{{#each authorAffExtra}}
<li class="author extra hide">
<a href="#search/q=author:{{this.[5]}}&sort=date%20desc,%20bibcode%20desc">
<a href="search/q=author:{{this.[5]}}&sort=date%20desc,%20bibcode%20desc">
{{this.[0]}}
</a>
<span>
{{#compare this.[2] '-' operator="!=="}}
<a class="orcid-author" href="#search/q=orcid:{{this.[2]}}&sort=date%20desc,%20bibcode%20desc">
<img class="inactive" src="../../styles/img/orcid-inactive.svg" alt="search by orcid">
<img class="active hidden" src="../../styles/img/orcid-active.svg" alt="search by orcid">
</a>
{{else}}
{{#compare this.[3] '-' operator="!=="}}
<a class="orcid-author" href="#search/q=orcid:{{this.[3]}}&sort=date%20desc,%20bibcode%20desc">
<img class="inactive" src="../../styles/img/orcid-inactive.svg" alt="search by orcid">
<img class="active hidden" src="../../styles/img/orcid-active.svg" alt="search by orcid">
</a>
{{else}}
{{#compare this.[4] '-' operator="!=="}}
<a class="orcid-author" href="#search/q=orcid:{{this.[4]}}&sort=date%20desc,%20bibcode%20desc">
<img class="inactive" src="../../styles/img/orcid-inactive.svg" alt="search by orcid">
<img class="active hidden" src="../../styles/img/orcid-active.svg" alt="search by orcid">
</a>
{{/compare}}
{{/compare}}
{{/compare}}
<a
class="orcid-author"
href="search/q=orcid:{{this.[2]}}&sort=date%20desc,%20bibcode%20desc"
>
<img
class="inactive"
src="../../styles/img/orcid-inactive.svg"
alt="search by orcid"
/>
<img
class="active hidden"
src="../../styles/img/orcid-active.svg"
alt="search by orcid"
/>
</a>
{{else}} {{#compare this.[3] '-' operator="!=="}}
<a
class="orcid-author"
href="search/q=orcid:{{this.[3]}}&sort=date%20desc,%20bibcode%20desc"
>
<img
class="inactive"
src="../../styles/img/orcid-inactive.svg"
alt="search by orcid"
/>
<img
class="active hidden"
src="../../styles/img/orcid-active.svg"
alt="search by orcid"
/>
</a>
{{else}} {{#compare this.[4] '-' operator="!=="}}
<a
class="orcid-author"
href="search/q=orcid:{{this.[4]}}&sort=date%20desc,%20bibcode%20desc"
>
<img
class="inactive"
src="../../styles/img/orcid-inactive.svg"
alt="search by orcid"
/>
<img
class="active hidden"
src="../../styles/img/orcid-active.svg"
alt="search by orcid"
/>
</a>
{{/compare}} {{/compare}} {{/compare}}
</span>
<span class="affiliation hide"> (<i>{{this.[1]}}</i>)</span>{{#if @last}}{{else}};{{/if}}
<span class="affiliation hide"> (<i>{{this.[1]}}</i>)</span>{{#if
@last}}{{else}};{{/if}}
</li>
{{/each}}

</ul>
</div>
{{/if}}
Expand All @@ -129,31 +188,41 @@ <h4 class="sr-only">Abstract</h4>
<dd>
<div id="article-publication">{{{pub_raw}}}</div>
</dd>
{{/if}}
{{#if book_author}}
{{/if}} {{#if book_author}}
<dt>
Book Author{{#compare book_author.length 1 operator='>'}}(s){{/compare}}:
</dt>
<dd>
{{#each book_author}}<a href="{{href}}">{{name}}</a>{{delim}}{{/each}}
</dd>
{{/if}}
{{#if formattedDate}}
{{/if}} {{#if formattedDate}}
<dt>Pub Date:</dt>
<dd>{{formattedDate}}</dd>
{{/if}} {{#if doi}}
<dt>DOI:</dt>
<dd>
<span>
<a data-target="DOI" href="{{doi.href}}" target="_blank" rel="noreferrer noopener">{{doi.doi}}</a>
<a
data-target="DOI"
href="{{doi.href}}"
target="_blank"
rel="noreferrer noopener"
>{{doi.doi}}</a
>
<i class="fa fa-external-link" aria-hidden="true"></i>
</span>
</dd>
{{/if}} {{#if arxiv}}
<dt>arXiv:</dt>
<dd>
<span>
<a data-target="arXiv" href="{{arxiv.href}}" target="_blank" rel="noreferrer noopener">{{arxiv.id}}</a>
<a
data-target="arXiv"
href="{{arxiv.href}}"
target="_blank"
rel="noreferrer noopener"
>{{arxiv.id}}</a
>
<i class="fa fa-external-link" aria-hidden="true"></i>
</span>
</dd>
Expand All @@ -162,11 +231,12 @@ <h4 class="sr-only">Abstract</h4>
<dt>Bibcode:</dt>
<dd>
<button
class="btn btn-link copy-btn"
style="padding: 0px"
id="abs-bibcode-copy"
data-clipboard-text="{{bibcode}}"
aria-label="copy bibcode">
class="btn btn-link copy-btn"
style="padding: 0px"
id="abs-bibcode-copy"
data-clipboard-text="{{bibcode}}"
aria-label="copy bibcode"
>
{{ bibcode }}
<i
class="icon-help"
Expand All @@ -176,7 +246,9 @@ <h4 class="sr-only">Abstract</h4>
data-content="The bibcode is assigned by the ADS as a unique identifier for the paper."
></i>
</button>
<span id="abs-bibcode-copy-msg" class="text-info" style="display: none;">Copied!</span>
<span id="abs-bibcode-copy-msg" class="text-info" style="display: none;"
>Copied!</span
>
</dd>

{{#if keyword}}
Expand Down
19 changes: 11 additions & 8 deletions src/js/widgets/bubble_chart/templates/container.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<div>
<div class="col-xs-12 s-explore-close-container">
<div class="col-xs-12 s-explore-close-container">
<div class="s-large-close close-widget close">x</div>
</div>
<header class="s-network-title">
</div>
<header class="s-network-title">
<h3>Results Graph</h3>
<button class="btn btn-link download s-download hidden">
<i class="fa fa-download fa-2x" aria-hidden="true" title="download data in csv"></i>
<i
class="fa fa-download fa-2x"
aria-hidden="true"
title="download data in csv"
></i>
<span class="sr-only">download data in csv</span>
</button>
</header>
</header>
</div>
<div class="s-bubble-label-container">
<div class="graph-select reads-vs-time active">
Expand All @@ -34,7 +38,7 @@ <h3>Results Graph</h3>
{{/if}}
</div>

<div class="controls s-controls">
<div class="controls s-controls print-hidden">
<div>
<h6>What is the Paper Graph?</h6>
This graph allows you to view metrics for both the long-term influence
Expand All @@ -59,6 +63,5 @@ <h6>Filter Your Search</h6>
</button>
</div>

<a id="download-link" class="hidden"></a>

<a id="download-link" class="hidden"></a>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h4>Suggested Articles</h4>
<br>

{{#compare permission "owner" operator="=="}}
<div class="row"><div class="col-xs-6"><button class="btn btn-sm btn-success submit-add-to-library" {{#ifSetEmpty selectedBibs}}disabled{{/ifSetEmpty}}>Add selected papers to this library</button></div></div>
<div class="row print-hidden"><div class="col-xs-6"><button class="btn btn-sm btn-success submit-add-to-library" {{#ifSetEmpty selectedBibs}}disabled{{/ifSetEmpty}}>Add selected papers to this library</button></div></div>
{{/compare}}
</div>
<br>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="header s-header"></div>
<div class="header s-header s-lib-header"></div>

<div class="main s-main"></div>
<div class="main s-main"></div>
Loading

0 comments on commit 3c87226

Please sign in to comment.