Update templates to use new databags translations
This commit is contained in:
parent
4284d510c9
commit
22eebc8f2f
10 changed files with 68 additions and 36 deletions
|
|
@ -1,5 +1,26 @@
|
|||
{% extends "page.html" %}
|
||||
{% from "macros/breadcrumbs.html" import breadcrumbs %}
|
||||
{% from "macros/translation.html" import transbag %}
|
||||
|
||||
{% set t_running_sprint = transbag('translate', this.alt, 'running_sprint') %}
|
||||
{% set t_what_is_a_sprint = transbag('translate', this.alt, 'what_is_a_sprint') %}
|
||||
{% set t_challenge_coin = transbag('translate', this.alt, 'challenge_coin') %}
|
||||
{% set t_sprint_description = transbag('translate', this.alt, 'sprint_description') %}
|
||||
{% set t_sprint_video = transbag('translate', this.alt, 'sprint_pycon_video') %}
|
||||
{% set t_date = transbag('translate', this.alt, 'date') %}
|
||||
{% set t_speakers = transbag('translate', this.alt, 'speakers') %}
|
||||
{% set t_sprinters = transbag('translate', this.alt, 'sprinters') %}
|
||||
{% set t_and = " " + transbag('translate', this.alt, 'and')|trim + " " %}
|
||||
{% set t_event_more_info = transbag('translate', this.alt, 'event_more_info') %}
|
||||
{% set t_website = transbag('translate', this.alt, 'website') %}
|
||||
{% set t_speaking_before_title = transbag('translate', this.alt, 'speaking_before_title') %}
|
||||
{% set t_speaking_after_title = transbag('translate', this.alt, 'speaking_after_title')|trim %}
|
||||
{% set t_keynoting_before_title = transbag('translate', this.alt, 'keynoting_before_title') %}
|
||||
{% set t_keynoting_after_title = transbag('translate', this.alt, 'keynoting_after_title')|trim %}
|
||||
{% set t_tutorial_before_title = transbag('translate', this.alt, 'tutorial_before_title') %}
|
||||
{% set t_tutorial_after_title = transbag('translate', this.alt, 'tutorial_after_title')|trim %}
|
||||
{% set t_sprint_helping = transbag('translate', this.alt, 'sprint_helping') %}
|
||||
{% set t_sprint_helping_plural = transbag('translate', this.alt, 'sprint_helping_plural') %}
|
||||
|
||||
{% block title %}{{ this.title }}{% endblock %}
|
||||
{% block preamble %}
|
||||
|
|
@ -7,36 +28,36 @@
|
|||
<div class="container">
|
||||
<p>{{ breadcrumbs(this) }}</p>
|
||||
<h1>{{ this.title }}</h1>
|
||||
<p>{{ this.date.strftime("%A, %-d %B %Y") }}</p>
|
||||
<p>{{ this.date|datetimeformat("EEEE, MMMM d, YYYY", locale=this.alt)|capitalize }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block main %}
|
||||
{% if this.event_type == "talk" %}
|
||||
<p>{{ this.speaker|join(" and ")}} will be speaking at {{ this.title }}, giving a presentation entitled "<a href="{{ this.url }}">{{ this.talk_title }}</a>".
|
||||
<p>{{ this.speaker|join(t_and)}} {{ t_speaking_before_title }} {{ this.title }}{{ t_speaking_after_title }} "<a href="{{ this.url }}">{{ this.talk_title }}</a>".
|
||||
{% elif this.event_type == "keynote" %}
|
||||
<p>{{ this.speaker|join(" and ")}} will be keynoting {{ this.title }}, giving a presentation entitled "<a href="{{ this.url }}">{{ this.talk_title }}</a>".
|
||||
<p>{{ this.speaker|join(t_and)}} {{ t_keynoting_before_title }} {{ this.title }}{{ t_keynoting_after_title }} "<a href="{{ this.url }}">{{ this.talk_title }}</a>".
|
||||
{% elif this.event_type == "tutorial" %}
|
||||
<p>{{ this.speaker|join(" and ")}} will be presenting a tutorial at {{ this.title }}, entitled "<a href="{{ this.url }}">{{ this.talk_title }}</a>".
|
||||
<p>{{ this.speaker|join(t_and)}} {{ t_tutorial_before_title }} {{ this.title }}{{ t_tutorial_after_title }} "<a href="{{ this.url }}">{{ this.talk_title }}</a>".
|
||||
{% elif this.event_type == "sprint" %}
|
||||
<p>BeeWare will be running a sprint at {{ this.title }}.</p>
|
||||
<p>{{ this.speaker|join(" and ") }} will be at the sprints, and will be more than willing to help First Time Contributors earn their own shiny <a href="{{ '/contributing/challenge-coins/'|url(alt=this.alt) }}">Challenge Coin</a>.
|
||||
<p>For more information, check the <a href="{{ this.url }}">{{ this.title }} website</a></p>
|
||||
<h3>What is a Sprint?</h3>
|
||||
<p>Code sprints are events held normally after a conference where attendees can use the conference venue to work in small groups on various projects. Learn more about how sprints work with the <a href="https://www.youtube.com/watch?v=hOtKgFaFcz0">PyCon US 'What is a sprint?' video</a> </p>
|
||||
<p>{{ t_running_sprint }} {{ this.title }}.</p>
|
||||
<p>{{ this.speaker|join(t_and) }} {% if this.speaker|length > 1 %}{{ t_sprint_helping_plural }}{% else %}{{ t_sprint_helping }}{% endif %} <a href="{{ '/contributing/challenge-coins/'|url(alt=this.alt) }}">{{ t_challenge_coin }}</a>.
|
||||
<p>{{ t_event_more_info }}<a href="{{ this.url }}">{{ this.title }} {{ t_website }}</a></p>
|
||||
<h3>{{ t_what_is_a_sprint }}</h3>
|
||||
<p>{{ t_sprint_description }} <a href="https://www.youtube.com/watch?v=hOtKgFaFcz0">{{ t_sprint_video }}</a> </p>
|
||||
{% endif %}
|
||||
<p><em>{{ this.description }}</em></p>
|
||||
{% endblock %}
|
||||
{% block gutter %}
|
||||
<div class="col-sm-12 col-md-4 gutter">
|
||||
<dl>
|
||||
<dt>Date:</dt>
|
||||
<dd>{{ this.date.strftime("%-d %B %Y") }}</dd>
|
||||
<dt>{{ t_date|trim }}:</dt>
|
||||
<dd>{{ this.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|capitalize }}</dd>
|
||||
|
||||
{% if this.event_type == "sprint" %}
|
||||
<dt>Sprinters:</dt>
|
||||
<dt>{{ t_sprinters|trim }}:</dt>
|
||||
{% elif this.event_type == "talk" %}
|
||||
<dt>Speakers:</dt>
|
||||
<dt>{{ t_speakers|trim }}:</dt>
|
||||
{% endif %}
|
||||
<dd>
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@
|
|||
{% block main %}
|
||||
<h2>{{ t_upcoming_events }}</h2>
|
||||
{% for child in this.children.filter(F.upcoming == True) %}
|
||||
<p 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></p>
|
||||
<p class="upcoming event" data-date="{{ child.date }}">{{ child.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|capitalize }} <a href="{{ child|url(alt=this.alt) }}">{{ child.title }} {{ child.event_type}}</a></p>
|
||||
{% endfor %}
|
||||
<h2>{{ t_past_events }}</h2>
|
||||
{% for child in this.children.filter(F.upcoming == False).order_by('-date') %}
|
||||
<p class="past event" data-date="{{ child.date }}">{{ child.date.strftime("%-d %B %Y") }} <a href="{{ child|url(alt=this.alt) }}">{{ child.title }} {{child.event_type}}</a></p>
|
||||
<p class="past event" data-date="{{ child.date }}">{{ child.date|datetimeformat("MMMM d, YYYY", locale=this.alt)|capitalize }} <a href="{{ child|url(alt=this.alt) }}">{{ child.title }} {{child.event_type}}</a></p>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
{% block gutter %}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
{% set t_tutorial = transbag('translate', this.alt, 'tutorial') %}
|
||||
{% set t_come_see_us = transbag('translate', this.alt, 'come_see_us') %}
|
||||
{% set t_sprinting = transbag('translate', this.alt, 'sprinting') %}
|
||||
{% set t_ad_hoc_sponsor = transbag('translate', this.alt, 'ad_hoc_sponsor') %}
|
||||
|
||||
{% block title %}{{ this.title }}{% endblock %}
|
||||
{% block preamble %}
|
||||
|
|
@ -64,7 +65,7 @@
|
|||
<div class="carousel-inner" role="listbox">
|
||||
<div class="carousel-item active">
|
||||
<p><a href="{{ '/community/members/revsys/'|url(alt=this.alt) }}"><img class="img-fluid" src="/community/members/revsys/revsys-large.png"></a></p>
|
||||
<p>Ad hoc sponsor</p>
|
||||
<p>{{ t_ad_hoc_sponsor }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
{% macro menu_item(identifier) %}
|
||||
{% set identifier_url = '/' + identifier %}
|
||||
{% set trans_url = identifier_url|url(alt=this.alt) %}
|
||||
{% set this_is_child = this.is_child_of(trans_url) %}
|
||||
{% set this_is_child = this.is_child_of(identifier_url) %}
|
||||
<li class="nav-item{% if this_is_child %} active{% endif %}">
|
||||
<a class="nav-link" href="{{ trans_url }}">{{ transbag('menu', this.alt, identifier) }}{% if this_is_child %}<span class="sr-only">(current)</span>{% endif %}</a>
|
||||
</li>
|
||||
|
|
@ -72,10 +72,12 @@ ga('send', 'pageview');
|
|||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">{{ t_languages }} <span class="caret"></span></a>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdown01">
|
||||
<a class="dropdown-item" href="{{ '.'|url(alt='en') }}">English</a>
|
||||
{% set eng_active = this.alt == 'en' %}
|
||||
<a class="dropdown-item {% if eng_active %}active{% endif %}" href="{{ '.'|url(alt='en') }}">English</a>
|
||||
{% for alt, alternative in config.ALTERNATIVES.items()|sort %}
|
||||
{% set alt_active = alt == this.alt %}
|
||||
{% if alt != 'en' %}
|
||||
<a class="dropdown-item" href="{{ '.'|url(alt=alt) }}">{{ alternative.name.en }}</a>
|
||||
<a class="dropdown-item {% if alt_active %}active{% endif %}" href="{{ '.'|url(alt=alt) }}">{{ alternative.name.en }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
{% macro badge(type, name) %}
|
||||
{% from "macros/translation.html" import transbag %}
|
||||
|
||||
{% macro badge(type, name, alt) %}
|
||||
|
||||
{% if name is string %}
|
||||
<dt>{{ type }}:</dt><dd>{{ bag('labels', name) }}</dd>
|
||||
<dt>{{ type }}:</dt><dd>{{ transbag('labels', alt, name) }}</dd>
|
||||
{% else %}
|
||||
<dt>{{ type }}:</dt><dd>{% for n in name %}{% if loop.index != 1 %}, {% endif %} {{ bag('labels', n)}}{% endfor %}</dd>
|
||||
<dt>{{ type }}:</dt><dd>{% for n in name %}{% if loop.index != 1 %}, {% endif %} {{ transbag('labels', alt, n)|trim }}{% endfor %}</dd>
|
||||
{% endif %}
|
||||
|
||||
<!-- <img src="badges/{{type}}/{{name}}"> -->
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{% from "macros/translation.html" import transbag %}
|
||||
|
||||
{% macro member_badge(member) %}
|
||||
{% set t_superpower = transbag('translate', member.alt, 'superpower') %}
|
||||
{% set t_superpower = transbag('translate', member.alt, 'superpower')|trim %}
|
||||
|
||||
<img src="/community/team/{{member._id}}/{{ member._id}}.png" width="100%">
|
||||
<a href="https://github.com/{{ member.github_handle }}"><i class="fa fa-github fa-lg icon" aria-hidden="true"></i> {{ member.github_handle }}</a>
|
||||
|
|
@ -12,9 +12,9 @@
|
|||
{% if member.superpower %}
|
||||
<br>
|
||||
{% if member.superpower is string %}
|
||||
{{ t_superpower }}: {{bag('labels', member.superpower) }}
|
||||
{{ t_superpower }}: {{ transbag('labels', meber.alt, member.superpower) }}
|
||||
{% else %}
|
||||
{{ t_superpower }}: {% for s in member.superpower %}{% if loop.index != 1 %}, {% endif %} {{ bag('labels', s) }}{% endfor %}
|
||||
{{ t_superpower }}: {% for s in member.superpower %}{% if loop.index != 1 %}, {% endif %} {{ transbag('labels', member.alt, s)|trim }}{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{% from "macros/translation.html" import transbag %}
|
||||
|
||||
{% macro sponsorship_level(sponsor) %}
|
||||
{% set t_sponsor = transbag('translate', sponsor.alt, 'sponsor') %}
|
||||
{{ bag('labels', sponsor.level) }} {{ t_sponsor }}
|
||||
{% set t_sponsor = transbag('translate', sponsor.alt, 'sponsor')|trim %}
|
||||
{{ t_sponsor|capitalize }} {{ transbag('labels', sponsor.alt, sponsor.level) }}
|
||||
{% endmacro %}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,12 @@
|
|||
{% set t_attic_after = transbag('translate', this.alt, 'attic_after').strip() %}
|
||||
{% set t_cookie_before = transbag('translate', this.alt, 'cookie_before').strip() %}
|
||||
{% set t_cookie_after = transbag('translate', this.alt, 'cookie_after').strip() %}
|
||||
{% set t_project_type = transbag('translate', this.alt, 'project_type').strip() %}
|
||||
{% set t_maturity = transbag('translate', this.alt, 'maturity').strip() %}
|
||||
{% set t_language = transbag('translate', this.alt, 'language').strip() %}
|
||||
{% set t_platform = transbag('translate', this.alt, 'platform').strip() %}
|
||||
{% set t_source_code = transbag('translate', this.alt, 'source_code').strip() %}
|
||||
{% set t_documentation = transbag('translate', this.alt, 'documentation').strip() %}
|
||||
|
||||
{% block title %}{{ this.name }}{% endblock %}
|
||||
{% block preamble %}
|
||||
|
|
@ -62,14 +68,14 @@
|
|||
<div class="col-sm-4">
|
||||
<div class="sidebar-module sidebar-module-inset gutter">
|
||||
<img class="img-fluid center-block" {% if this.customlogo %}src="./{{ this._id }}.png" {% else %} src="/static/images/defaultlogo.png"{% endif %}></div>
|
||||
<p><a href="https://github.com/pybee/{{ this._id }}"><i class="fa fa-github fa-lg" aria-hidden="true"></i> Source Code</a></p>
|
||||
{% if this.rtfd_name %}<p><a href="https://{{ this.rtfd_name }}.readthedocs.io/"><i class="fa fa-book fa-lg" aria-hidden="true"></i> Documentation</a></p>{% endif %}
|
||||
<p><a href="https://github.com/pybee/{{ this._id }}"><i class="fa fa-github fa-lg" aria-hidden="true"></i> {{ t_source_code }}</a></p>
|
||||
{% if this.rtfd_name %}<p><a href="https://{{ this.rtfd_name }}.readthedocs.io/"><i class="fa fa-book fa-lg" aria-hidden="true"></i> {{ t_documentation }}</a></p>{% endif %}
|
||||
<hr>
|
||||
<dl>
|
||||
{{ badge("Project Type", this.project_type) }}
|
||||
{{ badge("Maturity", this.maturity) }}
|
||||
{{ badge("Language", this.languages) }}
|
||||
{{ badge("Platform", this.platforms) }}
|
||||
{{ badge(t_project_type, this.project_type, this.alt) }}
|
||||
{{ badge(t_maturity, this.maturity, this.alt) }}
|
||||
{{ badge(t_language, this.languages, this.alt) }}
|
||||
{{ badge(t_platform, this.platforms, this.alt) }}
|
||||
</dl>
|
||||
<hr>
|
||||
<a href="https://labhr.github.io/hatrack/#repo=pybee/{{ this._id }}">{{ t_contributors }}</a>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<div class="container">
|
||||
<p>{{ breadcrumbs(this) }}</p>
|
||||
<h2>{{ this.title }}</h2>
|
||||
<p>{{ t_by|capitalize }} {{ this.author }}; {{ t_published }} {{ this.pub_date.strftime('%-d %B %Y') }}</p>
|
||||
<p>{{ t_by|capitalize }} {{ this.author }}; {{ t_published }} {{ this.pub_date|datetimeformat("MMMM d, YYYY" ,locale=this.alt)|capitalize }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
{% block body %}
|
||||
<ul class="sitemap">
|
||||
{% for page in site.query('/', alt=this.alt) recursive %}
|
||||
<li><a href="{{ page|url(alt=this.alt) }}">{{ page.record_label }}</a>
|
||||
<li><a href="{{ page|url(alt=this.alt) }}">{{ page['title'] or page['name'] or page.record_label }}</a>
|
||||
{% if page.children %}
|
||||
<ul>{{ loop(page.children) }}</ul>
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue