Skip to content

Commit

Permalink
update card designs and search function
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalPasts committed Jul 30, 2023
1 parent ec65675 commit f80bef7
Show file tree
Hide file tree
Showing 58 changed files with 1,725 additions and 813 deletions.
208 changes: 113 additions & 95 deletions _includes/author_card.html
Original file line number Diff line number Diff line change
@@ -1,110 +1,128 @@
<div class="author-card">
<div class="authors-container">
<!-- assign and number author affiliations -->
{% assign affiliations = '' | split: '' %}

{% for author in include.authors %}
{% assign affiliation = author[1].affiliation | split: ", " %}
{% assign affiliations = affiliations | concat: affiliation %}
{% endfor %}
<div class="author-box1">

{% assign unique_affiliations = affiliations | uniq %}

{% for author in include.authors %}
{%- if forloop.length > 0 -%}
<!-- <div class="author-container"> -->
{{ author[1].name }}

{% assign affiliation_count = 0 %}
{% for affiliation in unique_affiliations %}
{% assign affiliation_count = affiliation_count | plus: 1 %}
{% assign author_affiliations = author[1].affiliation | split: ", " %}
{% for author_affiliation in author_affiliations %}
{% if author_affiliation == affiliation %}
<sup>{{ affiliation_count }}</sup>
{% endif %}
<div class="authors-container">
<!-- assign and number author affiliations -->
{% assign affiliations = '' | split: '' %}

{% for author in include.authors %}
{% assign affiliation = author[1].affiliation | split: ", " %}
{% assign affiliations = affiliations | concat: affiliation %}
{% endfor %}

{% assign unique_affiliations = affiliations | uniq %}

{% for author in include.authors %}
{%- if forloop.length > 0 -%}
<!-- <div class="author-container"> -->
{{ author[1].name }}

{% assign affiliation_count = 0 %}
{% for affiliation in unique_affiliations %}
{% assign affiliation_count = affiliation_count | plus: 1 %}
{% assign author_affiliations = author[1].affiliation | split: ", " %}
{% for author_affiliation in author_affiliations %}
{% if author_affiliation == affiliation %}
<sup>{{ affiliation_count }}</sup>
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}

{% if author[1].orcid != null %}
<a href="https://orcid.org/{{author[1].orcid}}" target="_blank"><i class="fa-brands fa-orcid fa-sm"></i></a>
{% endif %}
{% if author[1].academia != null %}
<a href="{{author[1].academia}}" target="_blank"><i class="fa-solid fa-graduation-cap fa-sm"></i></a>
{% endif %}
{% if author[1].github != null %}
<a href="{{author[1].github}}" target="_blank"><i class="fa-brands fa-github fa-sm"></i></a>
{% endif %}

{% if author[1].orcid != null %}
<a href="https://orcid.org/{{author[1].orcid}}" target="_blank"><i class="fa-brands fa-orcid fa-sm"></i></a>
{% endif %}
{% if author[1].academia != null %}
<a href="{{author[1].academia}}" target="_blank"><i class="fa-solid fa-graduation-cap fa-sm"></i></a>
{% endif %}
{% if author[1].github != null %}
<a href="{{author[1].github}}" target="_blank"><i class="fa-brands fa-github fa-sm"></i></a>
{% endif %}

{% unless forloop.last %}, {% endunless -%}
<!-- </div> -->
{%- endif -%}
{% endfor %}
</div>

<div class="affiliations">
{% assign affiliation_count = 0 %}
{% for affiliation in unique_affiliations %}
{% assign affiliation_count = affiliation_count | plus: 1 %}
<p><sup>{{ affiliation_count }}</sup> {{affiliation}}</p>
{% endfor %}
</div>

<div class="dates">
<p>Submitted on: {{ include.date | date: "%B %d, %Y" }}</p>
<p>Published on: {{ include.publish-date | date: "%B %d, %Y" }}</p>
{% if include.peer-review-date != null %}
<p>Peer reviewed: {{ include.peer-review-date | date: "%B %d, %Y" }}</p>
{% endif %}
{% if include.update-date != null %}
<p>Last update: {{ include.update-date | date: "%B %d, %Y" }}</p>
{% endif %}
</div>

<div class="peer-review">
{% if include.reviewers != null %}
Reviewed by:
{% for reviewer in include.reviewers %}
{%- if forloop.length > 0 -%}
{{ reviewer[1].name }}
{% if reviewer[1].orcid != null %}
<a href="https://orcid.org/{{reviewer[1].orcid}}" target="_blank"><i class="fa-brands fa-orcid fa-sm"></i></a>
{% endif %}
{% if reviewer[1].academia != null %}
<a href="{{reviewer[1].academia}}" target="_blank"><i class="fa-solid fa-graduation-cap fa-sm"></i></a>
{% endif %}
{% if reviewer[1].github != null %}
<a href="{{reviewer[1].github}}" target="_blank"><i class="fa-brands fa-github fa-sm"></i></a>
{% endif %}
<!-- {% unless forloop.last %}, {% endunless -%} -->
{%- endif -%}
{% endfor %}
<a href="https://doi.org/{{include.doi}}" target="_blank">
<span class="doi" style="background-image: url(https://zenodo.org/badge/DOI/{{include.doi}}.svg);">doi</span>
</a>

{% else %}
<i>Under peer review</i>
{% endif %}

</div>

{% unless forloop.last %}, {% endunless -%}
<!-- </div> -->
{%- endif -%}
{% endfor %}
</div>

<div class="affiliations">
{% assign affiliation_count = 0 %}
{% for affiliation in unique_affiliations %}
{% assign affiliation_count = affiliation_count | plus: 1 %}
<p><sup>{{ affiliation_count }}</sup> {{affiliation}}</p>
{% endfor %}
</div>
<div class="author-box2">

<div class="dates">
<p>Submitted on: {{ include.date | date: "%B %d, %Y" }}</p>
<p>Published on: {{ include.publish-date | date: "%B %d, %Y" }}</p>
{% if include.peer-review-date != null %}
<p>Peer reviewed: {{ include.peer-review-date | date: "%B %d, %Y" }}</p>
{% endif %}
{% if include.update-date != null %}
<p>Last update: {{ include.update-date | date: "%B %d, %Y" }}</p>
{% if include.deprecated != null %}
<div class="deprecated">
<i>This tutorial is deprecated!</i>
</div>
{% endif %}
</div>

<div class="peer-review">
{% if include.reviewers != null %}
Reviewed by:
{% for reviewer in include.reviewers %}
{%- if forloop.length > 0 -%}
{{ reviewer[1].name }}
{% if reviewer[1].orcid != null %}
<a href="https://orcid.org/{{reviewer[1].orcid}}" target="_blank"><i class="fa-brands fa-orcid fa-sm"></i></a>
{% endif %}
{% if reviewer[1].academia != null %}
<a href="{{reviewer[1].academia}}" target="_blank"><i class="fa-solid fa-graduation-cap fa-sm"></i></a>
{% endif %}
{% if reviewer[1].github != null %}
<a href="{{reviewer[1].github}}" target="_blank"><i class="fa-brands fa-github fa-sm"></i></a>
{% endif %}
{% unless forloop.last %}, {% endunless -%}
{%- endif -%}
{% endfor %}
<a href="https://doi.org/{{include.doi}}" target="_blank">
<span class="doi" style="background-image: url(https://zenodo.org/badge/DOI/{{include.doi}}.svg);">doi</span>
</a>

{% else %}
<i>Under peer review</i>
{% endif %}

</div>

<div class="card-summary">
<p>
{{ include.summary }}
</p>
<p>
{% for tag in include.tags %}
#{{ tag }}
{% endfor %}
</p>
</div>
<div class="card-summary">
<p>
<b>Summary:</b> {{ include.summary }}
</p>
</div>

{% if include.difficulty != null %}
<div class="difficulty">
<div class="card-tags">
<p>
Difficulty level: {{include.difficulty}}
{% for tag in include.tags %}
#{{ tag }}
{% endfor %}
</p>
</div>
{% endif %}

{% if include.difficulty != null %}
<div class="difficulty">
<p>
Difficulty level: {{include.difficulty}}
</p>
</div>
{% endif %}

</div>
</div>
59 changes: 37 additions & 22 deletions _includes/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,48 @@
<a href="{{ site.baseurl }}{{ include.url }}">
<div class="card-body">

<h3 class="card-title">
{{ include.title }}
</h3>
<div class="card-image">
<img src="{{ site.baseurl }}/images/{{ include.item_type }}/{{ include.title }}/banner-image.png" alt="Image not available">
</div>

<div class="card-content">

<div class="card-meta">
<i class="fas fa-robot fa-sm"></i>
{% for author in include.authors %}
{%- if forloop.length > 0 -%}
{{ author[1].name }}{% unless forloop.last %}, {% endunless -%}
{%- endif -%}
{% endfor %}
<i class="fas fa-calendar-alt fa-sm"></i>
{{ include.date | date: "%B %d, %Y" }}
<i class="fas fa-hashtag fa-sm"></i>
<span class="page-tags">
{% for tag in include.tags %}
<h3 class="card-title">
{{ include.title }}
</h3>

<div class="card-meta">
<i class="fas fa-robot fa-sm"></i>
{% for author in include.authors %}
{%- if forloop.length > 0 -%}
{{ tag }}{% unless forloop.last %}, {% endunless -%}
{{ author[1].name }}{% unless forloop.last %}, {% endunless -%}
{%- endif -%}
{% endfor %}
</span>
</div>
<i class="fas fa-calendar-alt fa-sm"></i>
{{ include.date | date: "%B %d, %Y" }}
<i class="fas fa-hashtag fa-sm"></i>

<span class="page-tags">
{% for tag in include.tags %}
{%- if forloop.length > 0 -%}
{{ tag }}{% unless forloop.last %}, {% endunless -%}
{%- endif -%}
{% endfor %}
</span>

<div class="card-summary">
<p>
{{ include.summary }}
</p>
{% if include.doi != null %}
<span class="doi" style="background-image: url(https://zenodo.org/badge/DOI/{{include.doi}}.svg);">doi</span>
{% else %}
<p><span><i>Under peer review</i></span></p>
{% endif %}
</div>

<div class="card-summary">
<p>
{{ include.summary }}
</p>
</div>

</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div id="credits">
<h3>Contact us</h3>
<p>For any questions about OpenDANES, send us an email at the
<p>For any questions about OpenDANES, or to join the DANES discord channel or mailing list, send us an email at the
<a href="https://digitalpasts.github.io/" target="_blank">Digital Pasts Lab</a>
(<a href="mailto:{{ site.email }}">{{ site.email }}</a>)</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion _includes/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<li><a href="{{site.baseurl}}/nav/posters.html">Posters</a></li>
<li><a href="{{site.baseurl}}/nav/DANES-resources.html">DANES Resources</a></li>
<li><a href="{{site.baseurl}}/nav/submission-guidelines.html">Submission Guidelines</a></li>
<li><input type="text" id="search-input" placeholder="&#xf002"></li>
<li><a href="{{site.baseurl}}/nav/search.html"><i class="fa-solid fa-magnifying-glass"></i></a></li>
</ul>
</div>

Expand Down
62 changes: 59 additions & 3 deletions _includes/search.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,73 @@
<!-- HTML elements for search -->
<ul id="results-container"></ul>

<div class="search-area">
<input type="text" id="search-input" placeholder="Dig through the findings...">
<ul id="results-container"></ul>

{% capture result_elem %}
<a href="{url}">

<div class="card visible">
<a href="{url}">
<div class="card-body">

<div class="card-image">
<img src="{{ site.baseurl }}/images/{type}s/{title}/banner-image.png" alt="Image not available">
</div>

<div class="card-content">

<h3 class="card-title">
{title}
</h3>

<div class="card-meta">
<i class="fas fa-robot fa-sm"></i>
{authors}
<i class="fas fa-calendar-alt fa-sm"></i>
{publish-date}
<i class="fas fa-hashtag fa-sm"></i>

<span class="page-tags">
{tags}
</span>

<!-- {% if doi != null %}
<span class="doi" style="background-image: url(https://zenodo.org/badge/DOI/{doi}.svg);">{doi}</span>
{% else %}
<p><span class="card-peer-review" style="
font-style: italic;
font-size: 1.3vw;
">Under peer review</span></p>
{% endif %} -->
</div>

<div class="card-summary">
<p>
{summary}
</p>
</div>

</div>

</div>
</a>
</div>



<!-- <a href="{url}">
<li class="result">
<h4 class="result-title">
{title}
</h4>
<p>{authors} | {tags}</p>
<p>{summary}</p>
</li>
</a>
</a> -->
{% endcapture %}
</div>





Expand Down
1 change: 0 additions & 1 deletion _layouts/default+toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ <h2><i class="far fa-folder-open"></i> On this page</h2>
{% include toc.html html=content %}
</div>
<div class="content">
{% include search.html %}
<h1>{{ page.title }}</h1>
{{ content }}
</div>
Expand Down
Loading

0 comments on commit f80bef7

Please sign in to comment.