Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions assets/static/beeware.css
Original file line number Diff line number Diff line change
Expand Up @@ -625,3 +625,15 @@ body {
padding: 0 1em 1em 0em;
margin-left: -1em;
}

/*----------------------------------------------------
Upcoming Event on Homepage
--------------------------------------------------- */

.upcoming_event_info {
margin-top: -1rem;
}

p.upcoming_event_date {
font-size: 110%;
}
2 changes: 2 additions & 0 deletions content/news/events/europython-2025-sprints/contents.lr
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ event_type: sprint
speaker: Russell Keith-Magee
---
url: https://ep2025.europython.eu
---
end_date: 2025-07-20
2 changes: 1 addition & 1 deletion content/news/events/europython-2025/contents.lr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In this hands-on tutorial, you'll lean how you can use the BeeWare suite of tool

No experience with mobile or desktop app development is required; a basic familiarity with Python is all you need. By the end of the tutorial, you'll have an app running on your own phone, written entirely by you, using nothing but Python.
---
event_type: talk
event_type: tutorial
---
speaker: Russell Keith-Magee
---
Expand Down
2 changes: 2 additions & 0 deletions content/news/events/pycon-us-2025-sprints/contents.lr
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ event_type: sprint
speaker: Russell Keith-Magee, Malcolm Smith
---
url: https://us.pycon.org/2025/
---
end_date: 2025-05-21
5 changes: 5 additions & 0 deletions models/event.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ label = Event date
type = date
width = 1/4

[fields.end_date]
label = Event end date
type = date
width = 1/4

[fields.talk_title]
label = Talk Title
type = string
Expand Down
4 changes: 2 additions & 2 deletions templates/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="container">
<p>{{ breadcrumbs(this) }}</p>
<h1>{{ this.title }} ({{ this.event_type|title }})</h1>
<p>{{ this.date|datetimeformat("EEEE, MMMM d, YYYY", locale=this.alt)|title }}</p>
<p>{{ this.date|datetimeformat("EEEE, MMMM d, YYYY", locale=this.alt)|title }} {% if this.end_date %} - {{this.end_date|datetimeformat("EEEE, MMMM d, YYYY", locale=this.alt)|title}}{% endif %}</p>
</div>
</div>
{% endblock %}
Expand All @@ -52,7 +52,7 @@ <h3>{{ t_what_is_a_sprint }}</h3>
<div class="col-sm-12 col-md-4 gutter">
<dl>
<dt>{{ t_date|trim }}:</dt>
<dd>{{ this.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title }}</dd>
<dd>{{ this.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title }}{% if this.end_date %} - {{this.end_date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title}}{% endif %}</dd>

{% if this.event_type == "sprint" %}
<dt>{{ t_sprinters|trim }}:</dt>
Expand Down
25 changes: 20 additions & 5 deletions templates/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@
var today = new Date();
$('.upcoming.event').each(function() {
var event_date = new Date($(this).data('date'));
if (event_date >= today) {
var event_end_date = $(this).data('end_date') ? new Date($(this).data('end_date')) : new Date($(this).data('date'));
if (event_date > today || (event_date >= today && event_end_date >= today)) {
$(this).hide();
}
});
$('.current.event').each(function() {
var event_date = new Date($(this).data('date'));
var event_end_date = $(this).data('end_date') ? new Date($(this).data('end_date')) : new Date($(this).data('date'));
if ((event_date = today) || (event_date < today && event_end_date >= today)) {
$(this).hide();
}
});
$('.past.event').each(function() {
var event_date = new Date($(this).data('date'));
if (event_date < today) {
var event_end_date = $(this).data('end_date') ? new Date($(this).data('end_date')) : new Date($(this).data('date'));
if (event_date < today || (event_date < today && event_end_date < today) || (event_date < today && event_end_date >= today)) {
$(this).hide();
}
});
Expand All @@ -41,12 +50,18 @@ <h1>{{ this.title }}</h1>
and use Javascript (which will be evaluated at the time of viewing) to
hide any events that shouldn't appear in each list. #}
<h2>{{ t_upcoming_events }}</h2>
{% for child in this.children.filter(F.date > today) %}
<p class="{% if child.date < today %}past {% endif %}event" data-date="{{ child.date }}">{{ child.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title }} <a href="{{ child|url(alt=this.alt) }}">{{ child.title }} ({{ child.event_type|title }})</a></p>
{% for child in this.children.order_by("date") %}
<p class="{% if (child.date < today and child.end_date is not defined) or (child.date < today and child.end_date < today) %}past {% endif %}event" data-date="{{ child.date }}" data-end-date="{{ child.end_date }}">
{{ child.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title }}{% if child.end_date %} - {{child.end_date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title}}{% endif %}
<a href="{{ child|url(alt=this.alt) }}">{{ child.title }} ({{ child.event_type|title }})</a>
</p>
{% endfor %}
<h2>{{ t_past_events }}</h2>
{% for child in this.children %}
<p class="{% if child.date >= today %}upcoming {% endif %}event" data-date="{{ child.date }}">{{ child.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title }} <a href="{{ child|url(alt=this.alt) }}">{{ child.title }} ({{ child.event_type|title }})</a></p>
<p class="{% if (child.date > today and child.end_date is not defined) or (child.date >= today and child.end_date >= today) %}upcoming
{% elif (child.date == today and child.end_date is not defined) or (child.date < today and child.end_date is defined and child.end_date >= today) %}current {% endif %}event" data-date="{{ child.date }}" data-end-date="{{ child.end_date }}">
{{ child.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title }}{% if child.end_date %} - {{child.end_date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title}}{% endif %}
<a href="{{ child|url(alt=this.alt) }}">{{ child.title }} ({{ child.event_type|title }})</a></p>
{% endfor %}
{% endblock %}
{% block gutter %}
Expand Down
36 changes: 22 additions & 14 deletions templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,21 @@ <h2 class="display-2">{{ this.title }}</h2>
{% endblock %}

{% block body %}

{% block extra_script %}
<script>
(function() {
var today = new Date();
$('.upcoming.event').each(function() {
var event_date = new Date($(this).data('date'));
var event_end_date = $(this).data('end-date') ? new Date($(this).data('end-date')) : new Date($(this).data('date'));
$(this).hide();
if (event_date >= today || (event_date >= today && event_end_date >= today) || (event_date < today && event_end_date >= today)) {
$(this).show();
}
});
})();
</script>
{% endblock %}
<!-- MD and Larger Project List -->
<div class="row">
<div class="col-sm-7 mr-auto">
Expand Down Expand Up @@ -76,20 +90,14 @@ <h3><a href="{{ '/news/buzz/'|url(alt=this.alt) }}">{{ t_latest_news }}</a></h3>

<hr/>

{% set events = site.query('/news/events', alt=this.alt).filter(F.upcoming==True) %}
{% set events = site.query('/news/events', alt=this.alt).filter(F.date).order_by('date') %}
{% if events %}
<h3><a href="{{ '/news/events/'|url(alt=this.alt) }}">{{ t_meet_team }}</a></h3>

<div id="carousel-events" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
{% for event in events %}
<li data-target="#carousel-events" data-slide-to="{{ loop.index0 }} "{% if loop.index0 == 0 %} class="active"{% endif %}></li>
{% endfor %}
</ol>
<div class="carousel-inner" role="listbox">
{% for event in events %}
<div class="carousel-item{% if loop.index0 == 0 %} active{% endif %}">
<h4><a href="{{ event|url(alt=this.alt) }}">{{ event.title }}</a></h4>
<div class="upcoming event" data-date="{{ event.date }}" data-end-date="{{ event.end_date }}">
<h5><a href="{{ event|url(alt=this.alt) }}">{{ event.title }}</a></h5>
<div class="upcoming_event_info">
{% if event.event_type == "keynote" %}
{{ event.speaker[0] }} {{ t_keynoting }}
{% elif event.event_type == "talk" %}
Expand All @@ -102,11 +110,11 @@ <h4><a href="{{ event|url(alt=this.alt) }}">{{ event.title }}</a></h4>
{{ t_sprinting }}
{% else %} <br>
{% endif %}
<p>{{ event.date.strftime("%d %B %Y") }}</p>
<p class="upcoming_event_date">{{ event.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title }}{% if event.end_date %} - {{event.end_date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title}}{% endif %}</p>
</div>
</div>
{% endfor %}
</div>
</div>


<hr/>
{% endif %}
Expand Down
8 changes: 5 additions & 3 deletions templates/news.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
{% set blog = site.query('/news/buzz', alt=this.alt).all() %}
{% set events = site.query('/news/events', alt=this.alt).filter(F.upcoming == True) %}
{% set events = site.query('/news/events', alt=this.alt).filter(F.date).order_by("date") %}
{% block extra_script %}
<script>
(function() {
var today = new Date();
$('.upcoming.event').each(function() {
var event_date = new Date($(this).data('date'));
if (event_date >= today) {
var event_end_date = $(this).data('end-date') ? new Date($(this).data('end-date')) : new Date($(this).data('date'));
$(this).hide();
if (event_date >= today || (event_date >= today && event_end_date >= today) || (event_date < today && event_end_date >= today)) {
$(this).show();
}
});
Expand Down Expand Up @@ -43,7 +45,7 @@ <h3><a href="{{ child|url(alt=this.alt) }}">{{ child.title }}</a></h3>
{{ this.gutter }}
<ul>
{% for child in events %}
<li class="upcoming event" data-date="{{ child.date }}">{{ child.date.strftime("%-d %B %Y") }}: <a href="{{ child|url(alt=this.alt) }}">{{ child.title }} {{ child.event_type}}</a></li>
<li class="upcoming event" data-date="{{ child.date }}" data-end-date="{{ child.end_date }}">{{ child.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title }}{% if child.end_date %} - {{child.end_date|datetimeformat("MMMM d, YYYY", locale=this.alt)|title}}{% endif %}: <a href="{{ child|url(alt=this.alt) }}">{{ child.title }} {{ child.event_type}}</a></li>
{% endfor %}
</ul>
</div>
Expand Down