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

add fair, data science to 'fields', cta for genomics #4762

Merged
merged 15 commits into from
Mar 5, 2024
81 changes: 33 additions & 48 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,28 @@ <h3>Introduction</h3>
</tr>
{% endif %}
{% endif %}
{% if topic.type == "basics" %}
{% if topic.draft != true or jekyll.environment != "production" %}
<tr>
{% assign tutorial_number = site | topic_filter:topic.name | topic_count %}
<td><a href="{{ site.baseurl }}/topics/{{ topic.name }}/">{{ topic.title }}</a>{% if topic.draft %} <div class="label label-default tutorial_tag" style="{{ 'work-in-progress' | colour_tag }}">work-in-progress</div>{% endif %}</td>
<td>{{ tutorial_number }}</td>
</tr>
{% endif %}
{% endif %}
{% endfor %}
</tbody>
</table>

<div id="cta-lp" style="color: var(--brand-color-contrast);background: var(--brand-color);">
<div style="background: repeating-linear-gradient( 135deg, transparent, transparent 10px, #fff1 10px, #fff1 20px );padding: 1rem;">
<h3 style="margin: unset;">Not sure where to start?</h3>
<p style="display: flex;justify-content: space-between;align-items: center;vertical-align: bottom;margin-bottom: 0;">
<span>Try the NGS Basics Learning Path! </span>
<a href="{% link learning-pathways/intro-to-galaxy-and-genomics.md %}?utm_source=gtn&utm_medium=home&utm_campaign=home-cta-lp" class="btn btn-success">Start Learning</a>
</p>
</div>
</div>

<h3>Fields</h3>
<table class="table table-striped">
Expand Down Expand Up @@ -113,54 +131,6 @@ <h3>Technologies</h3>
</tbody>
</table>

<h2>Galaxy Tips & Tricks</h2>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Topic</th>
<th scope="col">Tutorials</th>
</tr>
</thead>
<tbody>
{% for topic_name in sorted_topics %}
{% assign topic = site.data[topic_name] %}
{% if topic.type == "basics" %}
{% if topic.draft != true or jekyll.environment != "production" %}
<tr>
{% assign tutorial_number = site | topic_filter:topic.name | topic_count %}
<td><a href="{{ site.baseurl }}/topics/{{ topic.name }}/">{{ topic.title }}</a>{% if topic.draft %} <div class="label label-default tutorial_tag" style="{{ 'work-in-progress' | colour_tag }}">work-in-progress</div>{% endif %}</td>
<td>{{ tutorial_number }}</td>
</tr>
{% endif %}
{% endif %}
{% endfor %}
</tbody>
</table>

<h2>Data Science Survival Kit</h2>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Topic</th>
<th scope="col">Tutorials</th>
</tr>
</thead>
<tbody>
{% for topic_name in sorted_topics %}
{% assign topic = site.data[topic_name] %}
{% if topic.type == "data-science" %}
{% if topic.draft != true or jekyll.environment != "production" %}
<tr>
{% assign tutorial_number = site | topic_filter:topic.name | topic_count %}
<td><a href="{{ site.baseurl }}/topics/{{ topic.name }}/">{{ topic.title }}</a>{% if topic.draft %} <div class="label label-default tutorial_tag" style="{{ 'work-in-progress' | colour_tag }}">work-in-progress</div>{% endif %}</td>
<td>{{ tutorial_number }}</td>
</tr>
{% endif %}
{% endif %}
{% endfor %}
</tbody>
</table>

<h2>Galaxy for Developers and Admins</h2>
<table class="table table-striped">
<thead>
Expand Down Expand Up @@ -237,13 +207,26 @@ <h2>Contributor Hall of Fame</h2>
</div>

<div class="col-lg-5 col-md-5 col-sm-12">

<h2>Quickstart</h2>

<div class="button-group">
<a href="{% link learning-pathways/index.md %}" class="btn home-cta-button"><div>Learning Pathways</div><img alt="A scientist with a hair bun passes accepts a flask from a small grey creature" src="{% link assets/images/galaxy-for-scientists.svg %}" style="height: 5rem"></a>
<a href="{% link topics/admin/index.md %}" class="btn home-cta-button"><div>Galaxy for SysAdmins</div><img alt="a person sits at a computer with baudot code in the backgorund" src="{% link assets/images/galaxy-for-admins.svg %}" style="height: 5rem"></a>
<a href="{% link topics/dev/index.md %}" class="btn home-cta-button"><div>Galaxy for Developers</div><img alt="a small person leans against a large laptop" src="{% link assets/images/galaxy-for-developers.svg %}" style="height: 5rem"></a>
<a href="{% link topics/teaching/index.md %}" class="btn home-cta-button"><div>Galaxy for Teachers</div><img alt="a person stands in front of a blackboard" src="{% link assets/images/galaxy-for-trainers.svg %}" style="height: 5rem"></a>
</div>


<!-- GTN video -->
<!--
<div class="col-12">
<h2> Welcome to the GTN!</h2>
<p> Find out more about Galaxy Training Network</p>
<iframe width="100%" height="314" src="https://www.youtube-nocookie.com/embed/lDqWxzWNk1k" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen title="YouTube video highlighting GTN features. Video does not need audio."></iframe>
<p>Video created by Geert Bonamie.</p>
</div>
-->
<!-- GTN news -->
<div class="col-12" id="news">
<h2><a href="{% link news.md %}">The latest GTN news</a> <a class="float-right" href="{{ "/feed.xml" | prepend: site.baseurl }}">{% icon rss-feed %}</a></h2>
Expand All @@ -252,12 +235,14 @@ <h2><a href="{% link news.md %}">The latest GTN news</a> <a class="float-right"
<p><a href="{% link news.md %}">See all news</a>
</div>
<!-- Galaxy community video -->
<!--
<div class="col-12">
<h2>Meet & Join the Community!</h2>
<p> Find out how you can become part of the Galaxy community</p>
<iframe width="100%" height="314" src="https://www.youtube-nocookie.com/embed/-1MPdxmRs8U" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen title="YouTube video highlighting the GTN Community. Video has english language audio and subtitles."></iframe>
<p>Video created by Beatriz Serrano-Solano</p>
</div>
-->
<!-- GTN Tweets -->
<div class="col-12">
<h2>GTN Toots</h2>
Expand Down
12 changes: 12 additions & 0 deletions _layouts/topic.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ <h2 id="requirements">Requirements</h2>
</ul>
{% endif %}

{% if topic.learning_path_cta %}
<div id="cta-lp" style="color: var(--brand-color-contrast);background: var(--brand-color);">
<div style="background: repeating-linear-gradient( 135deg, transparent, transparent 10px, #fff1 10px, #fff1 20px );padding: 1rem;">
<h3 style="margin: unset;">Not sure where to start?</h3>
<p style="display: flex;justify-content: space-between;align-items: center;vertical-align: bottom;margin-bottom: 0;">
<span>Try the {{ topic.title }} Learning Pathway!</span>
<a href="/training-material/learning-pathways/{{ topic.learning_path_cta }}.html?utm_source=gtn&utm_medium=topic-admin&utm_campaign=home-cta-lp" class="btn btn-success">Start Learning</a>
</p>
</div>
</div>
{% endif %}

<h2 id="material">Material</h2>
{% if topic.draft %}
<div class="label label-default tutorial_tag" style="{{ 'work-in-progress' | colour_tag }}">work-in-progress</div>{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/tutorial_hands_on.html
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ <h1>{{locale['citing-tutorial'] | default: "Citing this Tutorial"}}</h1>
</blockquote>
{% endif %}

<blockquote class="details" id="feedback-responses">
<blockquote class="details hide-when-printing" id="feedback-responses">
<div id="feedback-response-c" class="box-title">
<button type="button" aria-controls="feedback-response-c" aria-expanded="false">
<i class="fas fa-info-circle" aria-hidden="true"></i>
Expand Down
16 changes: 15 additions & 1 deletion _plugins/gtn/metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def self.histogram(values)
end

def self.histogram_dates(values)
day_bins = [1, 7, 28, 90, 365, 365 * 2, 365 * 3, 365 * 5]
day_bins = [1, 7, 28, 90, 365, 365 * 2, 365 * 3, 365 * 5, Float::INFINITY]
last_bin = 0
day_bins.map do |bin, _idx|
count = values.select { |x| last_bin <= x and x < bin }.length
Expand Down Expand Up @@ -87,6 +87,8 @@ def self.segment_page_by_key(values, key)

def self.collect_metrics(site)
tutorials = site.pages.select { |x| x.data['layout'] == 'tutorial_hands_on' }
# TODO: materials
# materials = site.pages.select { |x| x.data['layout'] == 'tutorial_hands_on' }
first_commit = Date.parse('2015-06-29')
today = Date.today

Expand Down Expand Up @@ -138,6 +140,18 @@ def self.collect_metrics(site)
.map { |seconds| seconds / 3600.0 / 24.0 }
)
},
'tutorial_published_age_days' => {
type: 'histogram',
help: 'How recently was every single Hands-on Tutorial published within the GTN, ' \
'grouped by days since first published.',
value: histogram_dates(
tutorials
.map do |page|
Time.now - Gtn::PublicationTimes.obtain_time(page['path'])
end
.map { |seconds| seconds / 3600.0 / 24.0 }
)
},
'contributor_join_age_days' => {
type: 'histogram',
help: 'When did contributors join? Buckets of their ages by days since joined.',
Expand Down
40 changes: 40 additions & 0 deletions assets/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,21 @@ body {
display: none;
}

// Don't break over a page boundary if possible
h2,h3,h4,h5,h6,h7,h8 {break-after: avoid-page;}
img, svg, table, canvas {break-inside: avoid;}

// Fun fact: paper is not clickable.
// This is mostly applicable for folks printing tutorials which they
// probably shouldn't be doing anyway but just in case.
section#tutorial-content {
a::after {content: " (" attr(href) ")";}

blockquote.agenda {
a::after {content: unset;}
}
}

// Save ink.
pre.highlight {
background: none !important;
Expand Down Expand Up @@ -1517,6 +1532,31 @@ $btn-pink: var(--keypoints-color);
margin: 5px;
}

.home-cta-button {
width: 45%;
flex-direction: column;
padding: 5px;
font-size:1.25rem;
margin: 5px;
color: var(--text-color); // don't need to distinguish for wcag.
border: 1px solid var(--border-light);

div {
font-size: 1.3rem !important;
}

&:hover {
box-shadow: 2px 2px 4px var(--text-color);
}
}

.button-group {
display: flex;
align-items: stretch;
flex-wrap: wrap;
justify-content: space-around;
}

.btn-primary {
background-color: var(--brand-color);
border-color: var(--brand-color);
Expand Down
Loading
Loading