Skip to content

Commit

Permalink
Stop having comma for two person lists (#1266)
Browse files Browse the repository at this point in the history
  • Loading branch information
tunetheweb authored Sep 3, 2020
1 parent 618f239 commit 48f4057
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/templates/base/2019/base_chapter.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@
{% macro render_byline() %}
<div class="byline">{{ self.written_by_before() }}
{% for author in metadata.get('authors') %}
<a class="author" href="{{ url_for('contributors', year=year, lang=lang, _anchor=author) }}">{{ config.contributors[author].name if author in config.contributors else author }}</a>{{ self.comma() if not loop.last }}
<a class="author" href="{{ url_for('contributors', year=year, lang=lang, _anchor=author) }}">{{ config.contributors[author].name if author in config.contributors else author }}</a>{{ self.comma() if not loop.last and loop.length > 2 }}
{% if loop.index == loop.length - 1 %}{{ self.and() }}{% endif %}
{% endfor %}{{ self.written_by_after() }}
</div>

<div class="byline reviewers">{{ self.reviewed_by_before() }}
{% for reviewer in metadata.get('reviewers') %}
<a class="reviewer" href="{{ url_for('contributors', year=year, lang=lang, _anchor=reviewer) }}">{{ config.contributors[reviewer].name if reviewer in config.contributors else reviewer }}</a>{{ self.comma() if not loop.last }}
<a class="reviewer" href="{{ url_for('contributors', year=year, lang=lang, _anchor=reviewer) }}">{{ config.contributors[reviewer].name if reviewer in config.contributors else reviewer }}</a>{{ self.comma() if not loop.last and loop.length > 2 }}
{% if loop.index == loop.length - 1 %}{{ self.and() }}{% endif %}
{% endfor %}{{ self.reviewed_by_after() }}
</div>

{% if metadata.get('translators') | length >= 1 %}
<div class="byline translators">{{ self.translated_by_before() }}
{% for translator in metadata.get('translators') %}
<a class="translator" href="{{ url_for('contributors', year=year, lang=lang, _anchor=translator) }}">{{ config.contributors[translator].name if translator in config.contributors else translator }}</a>{{ self.comma() if not loop.last }}
<a class="translator" href="{{ url_for('contributors', year=year, lang=lang, _anchor=translator) }}">{{ config.contributors[translator].name if translator in config.contributors else translator }}</a>{{ self.comma() if not loop.last and loop.length > 2 }}
{% if loop.index == loop.length - 1 %}{{ self.and() }}{% endif %}
{% endfor %}{{ self.translated_by_after() }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/base/2019/base_ebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ <h1 class="title title-lg">
{% endif %}
<div class="contributor-teams">
{% for id in contributor.teams | sort() %}
<span class="contributor-team team-{{ id }}">{{ localizedTeamNames[id] if localizedTeamNames[id]|length else team.name }}</span>{{ self.comma() if not loop.last }}
<span class="contributor-team team-{{ id }}">{{ localizedTeamNames[id] if localizedTeamNames[id]|length else team.name }}</span>{{ self.comma() if not loop.last and loop.length > 2 }}
{% endfor %}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/templates/base/2019/ebook.ejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ <h1 class="title title-lg">

<div class="byline">{{ self.written_by_before() }}
{% for author in metadata.get('authors') %}
<a class="author" href="#contributors-{{ author }}">{{ config.contributors[author].name if author in config.contributors else author }}</a>{{ self.comma() if not loop.last }}
<a class="author" href="#contributors-{{ author }}">{{ config.contributors[author].name if author in config.contributors else author }}</a>{{ self.comma() if not loop.last and loop.length > 2 }}
{% if loop.index == loop.length - 1 %}{{ self.and() }}{% endif %}
{% endfor %}{{ self.written_by_after() }}
</div>

<div class="byline reviewers">{{ self.reviewed_by_before() }}
{% for reviewer in metadata.get('reviewers') %}
<a class="reviewer" href="#contributors-{{ reviewer }}">{{ config.contributors[reviewer].name if reviewer in config.contributors else reviewer }}</a>{{ self.comma() if not loop.last }}
<a class="reviewer" href="#contributors-{{ reviewer }}">{{ config.contributors[reviewer].name if reviewer in config.contributors else reviewer }}</a>{{ self.comma() if not loop.last and loop.length > 2 }}
{% if loop.index == loop.length - 1 %}{{ self.and() }}{% endif %}
{% endfor %}{{ self.reviewed_by_after() }}
</div>

{% if metadata.get('translators') | length >= 1 %}
<div class="byline translators">{{ self.translated_by_before() }}
{% for translator in metadata.get('translators') %}
<a class="translator" href="#contributors-{{ translator }}">{{ config.contributors[translator].name if translator in config.contributors else translator }}</a>{{ self.comma() if not loop.last }}
<a class="translator" href="#contributors-{{ translator }}">{{ config.contributors[translator].name if translator in config.contributors else translator }}</a>{{ self.comma() if not loop.last and loop.length > 2 }}
{% if loop.index == loop.length - 1 %}{{ self.and() }}{% endif %}
{% endfor %}{{ self.translated_by_after() }}
</div>
Expand Down

0 comments on commit 48f4057

Please sign in to comment.