Skip to content

Commit

Permalink
Add "Coming Soon" banner
Browse files Browse the repository at this point in the history
New greyhounds will by default be put into the "coming soon" category
and must be moved to the "available" category.
  • Loading branch information
zachwhaley committed Jan 21, 2025
1 parent 17f617e commit 18635f1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/update-greyhound.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ on:
status:
type: choice
options:
- 'no update'
- 'available'
- 'pending'
- 'adopted'
- 'medicalhold'
- 'permafoster'
- 'deceased'
default: 'no update'
- 'no update'
default: 'available'
catsafe:
type: choice
options:
Expand Down
4 changes: 4 additions & 0 deletions _layouts/greyhound.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
<div class="text-center alert alert-warning" role="alert">
<span class="banner">⚕️ <b>Medical Hold</b> ⚕️</span>
</div>
{% elsif greyhound.category == 'comingsoon' %}
<div class="text-center alert alert-info" role="alert">
<span class="banner"><b>Coming Soon...</b></span>
</div>
{% elsif greyhound.category == 'available' %}
<div class="text-center alert alert-info" role="alert">
<span class="banner">🐾 <b>Available!</b> 🐾</span>
Expand Down
4 changes: 4 additions & 0 deletions css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ a.thumbnail:hover {
border-radius: 0;
background-color: rgba(223, 240, 216, 0.7);
}
.thumbnail-comingsoon {
@extend .thumbnail-pending;
background-color: rgba(217, 237, 247, 0.7);
}
.thumbnail-permafoster {
@extend .thumbnail-pending;
background-color: rgba(242, 222, 222, 0.7);
Expand Down
28 changes: 27 additions & 1 deletion greyhounds/available-hounds.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,33 @@ <h3>{{ greyhound.title }}</h3>
</div>
{% endfor %}

<!-- Permanent Fosters should be at the bottom of the list -->
<!-- Coming soon follows available list -->
{% assign comingsoon = site.greyhounds | where: "category","comingsoon" %}
{% for greyhound in comingsoon reversed %}
<div class="col-sm-4 col-md-3">
<a class="thumbnail" href="{{ greyhound.url }}">
<div class="thumbnail-container">
{% if greyhound.pic %}
<img class="img-rounded" src="/img/thm/{{ greyhound.pic }}" alt="{{ greyhound.title | remove: '"' }}">
{% else %}
<img class="img-rounded" src="/img/thm/GALT-CENTEX_flag_logo.svg" alt="{{ greyhound.title | remove: '"' }}">
{% endif %}
<div class="thumbnail-comingsoon alert alert-info" role="alert">
<b>Coming Soon!</b>
</div>
</div>
<div class="caption">
{% if greyhound.nick %}
<h3>{{ greyhound.nick }}</h3>
{% else %}
<h3>{{ greyhound.title }}</h3>
{% endif %}
</div>
</a>
</div>
{% endfor %}

<!-- Permanent fosters will be at the bottom of the list -->
{% assign fosters = site.greyhounds | where: "category","permafoster" %}
{% for foster in fosters reversed %}
<div class="col-sm-4 col-md-3">
Expand Down
4 changes: 2 additions & 2 deletions script/add-greyhound.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = async ({github, context, core, inputs}) => {
data: {
layout: 'greyhound',
date: nowDate(),
category: 'available',
category: 'comingsoon',
title: capitalize(inputs.name),
color: inputs.color,
sex: inputs.sex,
Expand All @@ -61,5 +61,5 @@ module.exports = async ({github, context, core, inputs}) => {
await writeFile(filePath, data);
console.log(`Saved ${filePath}`);

return `Adding ${info.data.title} to Available Hounds as ${nameId}! 🌟`;
return `Adding ${info.data.title} to Greyhounds as ${nameId}! 🌟`;
}

0 comments on commit 18635f1

Please sign in to comment.