diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-12 12:12:16 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-12 12:12:16 -0600 |
commit | 7591c0f54fa3272df0f6b7057f6096bb513e9328 (patch) | |
tree | 96ee729a98ca2904da9779f4ccf7659aa3e8a038 /templates/badge.svg.jinja | |
parent | 52737fe6fdec0d168a3f31a632a9cfb3f91a9e4f (diff) | |
download | where-packaged-canon.tar.gz where-packaged-canon.zip |
Diffstat (limited to 'templates/badge.svg.jinja')
-rw-r--r-- | templates/badge.svg.jinja | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/badge.svg.jinja b/templates/badge.svg.jinja index 8143cff..02ba3db 100644 --- a/templates/badge.svg.jinja +++ b/templates/badge.svg.jinja @@ -5,7 +5,7 @@ {%- set ROWS = 1 + versions|length -%} {%- set OUTER_MARGIN = 5 -%} {%- set FONT_WIDENESS = 0.5 -%} -{%- set LONGEST_REPO = versions.keys()|map('length')|max -%} +{%- set LONGEST_REPO = versions.keys()|map(attribute='full_repo_name')|map('length')|max -%} {%- set LONGEST_VERSION = versions.values()|map('string')|map('length')|max -%} {%- set VERSION_X = OUTER_MARGIN + LONGEST_REPO * FONT_WIDENESS * FONT_SIZE -%} {%- set VERSION_WIDTH = OUTER_MARGIN + LONGEST_VERSION * FONT_WIDENESS * FONT_SIZE -%} @@ -21,7 +21,7 @@ <line x1="0" y1="{{ y(ROW_HEIGHT - ROW_MARGIN / 2) }}" x2="{{ WIDTH }}" y2="{{ y(ROW_HEIGHT - ROW_MARGIN / 2) }}" stroke="white" stroke-width="{{ ROW_MARGIN }}"></line>{{ end_row() }} {% for repo, version in versions.items() %} - <text x="{{ OUTER_MARGIN }}" y="{{ texty() }}">{{ repo }}</text> + <text x="{{ OUTER_MARGIN }}" y="{{ texty() }}">{{ repo.full_repo_name }}</text> <rect x="{{ VERSION_X }}" y="{{ y() }}" width="{{ VERSION_WIDTH }}" height="{{ ROW_HEIGHT }}" fill="{% if version < newest_version %}red{% else %}green{% endif %}"></rect> <text x="{{ VERSION_X + OUTER_MARGIN }}" y="{{ texty() }}">{{ version }}</text>{{ end_row() }} |