Skip to content

Commit

Permalink
Merge pull request #59 from questionlp/show-urls
Browse files Browse the repository at this point in the history
Add support for show URL field from database and Patreon links
  • Loading branch information
questionlp authored Jan 17, 2024
2 parents 364e172 + 00f64f8 commit 263dcc1
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 15 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changes

## 5.10.0

### Application Changes

- Add support for new show URL field from the Wait Wait Stats Database, which is used in place of
the `/s/` redirect link if there is a value stored for a particular show
- Add support for Patreon link in the side pop-out nav, dropdown nav menu and in the footer by way
of the `settings.patreon_url` config key

### Component Changes

- Upgrade wwdtm from 2.7.0 to 2.8.0

## 5.9.0

### Application Changes
Expand Down
1 change: 1 addition & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def create_app() -> Flask:
app.jinja_env.globals["mastodon_user"] = _config["settings"].get(
"mastodon_user", ""
)
app.jinja_env.globals["patreon_url"] = _config["settings"].get("patreon_url", "")
app.jinja_env.globals["use_decimal_scores"] = _config["settings"][
"use_decimal_scores"
]
Expand Down
8 changes: 7 additions & 1 deletion app/shows/templates/shows/all_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ <h2><a href="{{ url_for('shows.year_month_day',
month=repeat_show.month,
day=repeat_show.day) }}">{{ show.original_show_date }}</a></span>
{% endif %}
<span class="show-nprlink"><a href="{{ url_for('main_redirects.npr_show_redirect', show_date=show.date) }}">NPR</a></span>
<span class="show-nprlink">
{% if show.show_url %}
<a href="{{ show.show_url }}">NPR</a>
{% else %}
<a href="{{ url_for('main_redirects.npr_show_redirect', show_date=show.date) }}">NPR</a>
{% endif %}
</span>
<span class="database-id">DB ID: {{ show.id }}</span>
</div>
</div>
Expand Down
8 changes: 7 additions & 1 deletion app/shows/templates/shows/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ <h2><a href="{{ url_for('shows.year_month_day',
month=repeat_show.month,
day=repeat_show.day) }}">{{ show.original_show_date }}</a></span>
{% endif %}
<span class="show-nprlink"><a href="{{ url_for('main_redirects.npr_show_redirect', show_date=show.date) }}">NPR</a></span>
<span class="show-nprlink">
{% if show.show_url %}
<a href="{{ show.show_url }}">NPR</a>
{% else %}
<a href="{{ url_for('main_redirects.npr_show_redirect', show_date=show.date) }}">NPR</a>
{% endif %}
</span>
<span class="database-id">DB ID: {{ show.id }}</span>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions app/templates/core/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<li><a href="{{ blog_url }}">Blog</a></li>
<li><a href="{{ graphs_url }}">Graphs</a></li>
<li><a href="{{ reports_url }}">Reports</a></li>
{% if patreon_url %}
<li><a href="{{ patreon_url }}">Patreon</a></li>
{% endif %}
</ul>
</div>
</div>
Expand Down
8 changes: 6 additions & 2 deletions app/templates/core/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
<li><a href="{{ blog_url }}">Blog</a></li>
<li><a href="{{ graphs_url }}">Graphs</a></li>
<li><a href="{{ reports_url }}">Reports</a></li>
{% if patreon_url %}
<li class="divider" tabindex="-1"></li>
<li><a href="{{ blog_url }}/contact-me/">Contact Me</a></li>
<li><a href="{{ patreon_url }}">Patreon</a></li>
{% endif %}
</ul>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="{{ url_for('guests.index') }}">Guests</a></li>
Expand Down Expand Up @@ -53,8 +55,10 @@
<li><a href="{{ blog_url }}">Blog</a></li>
<li><a href="{{ graphs_url }}">Graphs</a></li>
<li><a href="{{ reports_url }}">Reports</a></li>
{% if patreon_url %}
<li><div class="divider"></div></li>
<li><a href="{{ blog_url }}/contact-me/">Contact Me</a></li>
<li><a href="{{ patreon_url }}">Patreon</a></li>
{% endif %}
</ul>
</div>
<!-- End Navigation -->
31 changes: 23 additions & 8 deletions app/templates/pages/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h2>Overview</h2>
<p>
The Wait Wait... Don't Tell Me! Stats Page is collection of details
and statistics for the weekly NPR news quiz show,
&quot;<a href="//waitwait.npr.org">Wait Wait... Don't Tell Me!</a>&quot;
&quot;<a href="https://waitwait.npr.org">Wait Wait... Don't Tell Me!</a>&quot;
This site contains data for each of the hosts, panelist, scorekeeper and
Not My Job guest that has appeared on the show.
</p>
Expand Down Expand Up @@ -47,13 +47,28 @@ <h2>Source Code</h2>

<h2>Acknowledgments</h2>
<p>
One of the inspirations that I had when building this site was
<a href="http://www.mrkland.com/mrkland.com/passive/WWDTM/index.htm">mrk.'s
Wait Wait Don't Tell Me Statistics Pages</a>
(<a href="https://web.archive.org/web/20190404122827/http://www.mrkland.com/zone/WWDTM/index.htm">Internet
Archive</a>). I used some of the scoring data from that site
to fill in some of the informational blanks for some of the shows prior
to Peter Sagal becoming the show's host.
One of the inspirations that I had when building this site was
<a href="http://www.mrkland.com/mrkland.com/passive/WWDTM/index.htm">mrk.'s
Wait Wait Don't Tell Me Statistics Pages</a>
(<a href="https://web.archive.org/web/20190404122827/http://www.mrkland.com/zone/WWDTM/index.htm">Internet
Archive</a>). I used some of the scoring data from that site
to fill in some of the informational blanks for some of the shows prior
to Peter Sagal becoming the show's host.
</p>

<p>
I would also like to thank David Moss for providing a list of the direct
links for each show page on NPR.org for the shows from 2006 through 2023.
</p>

{% if patreon_url %}
<h2>Supporting the Wait Wait Stats Project</h2>
<p>
If you would like to help support the Wait Wait Stats Project, including
improvements, new features, or help cover the host of hosting and maintaining
the Wait Wait Stats applications, consider supporting me on
<a href="{{ patreon_url }}">Patreon</a>.
</p>
{% endif %}

{% endblock %}
2 changes: 1 addition & 1 deletion app/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
#
# vim: set noai syntax=python ts=4 sw=4:
"""Application Version for Wait Wait Stats Page."""
APP_VERSION = "5.9.0"
APP_VERSION = "5.10.0"
1 change: 1 addition & 0 deletions config.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"time_zone": "UTC",
"mastodon_url": "",
"mastodon_user": "",
"patreon_url": "",
"sort_by_venue": false,
"use_decimal_scores": false
}
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Flask==3.0.0
gunicorn==21.2.0
Markdown==3.5.2

wwdtm==2.7.0
wwdtm==2.8.0
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Flask==3.0.0
gunicorn==21.2.0
Markdown==3.5.2

wwdtm==2.7.0
wwdtm==2.8.0

0 comments on commit 263dcc1

Please sign in to comment.