Make branch name take place of tag name when not in HEAD.

This commit is contained in:
flash 2019-04-11 20:26:32 +02:00
parent dc854bb7d5
commit d7713b27c1
2 changed files with 12 additions and 8 deletions

View file

@ -7,11 +7,14 @@
<div class="footer__copyright">
{{ 'https://flash.moe'|html_link('Flashwave', 'footer__link') }} 2013-{{
''|date('Y') }} /
{{ ('https://github.com/flashwave/misuzu/tree/' ~ git_tag)|html_link(git_tag, 'footer__link') }}
# {{ ('https://github.com/flashwave/misuzu/commit/' ~ git_commit_hash(true))|html_link(git_commit_hash(), 'footer__link') }}
{% set git_branch = git_branch() %}
{% if git_branch != 'HEAD' %}
({{ ('https://github.com/flashwave/misuzu/tree/' ~ git_branch)|html_link(git_branch, 'footer__link') }})
{{ ('https://github.com/flashwave/misuzu/tree/' ~ git_branch)|html_link(git_branch, 'footer__link') }}
{% else %}
{% set git_tag = git_tag() %}
{{ ('https://github.com/flashwave/misuzu/tree/' ~ git_tag)|html_link(git_tag, 'footer__link') }}
{% endif %}
# {{ ('https://github.com/flashwave/misuzu/commit/' ~ git_commit_hash(true))|html_link(git_commit_hash(), 'footer__link') }}
{% if constant('MSZ_DEBUG') or current_user.user_id|default(0) == 1 %}
/ SQL Queries: {{ sql_query_count()|number_format }}
/ Took: {{ startup_time()|number_format(5) }} seconds

View file

@ -37,16 +37,17 @@
<div class="footer__background"></div>
<div class="footer__wrapper">
{% autoescape false %}
{% set git_tag = git_tag() %}
{% set git_branch = git_branch() %}
<div class="footer__copyright">
{{ 'https://flash.moe'|html_link('Flashwave', 'footer__link') }} 2013-{{
''|date('Y') }} /
{{ ('https://github.com/flashwave/misuzu/tree/' ~ git_tag)|html_link(git_tag, 'footer__link') }}
# {{ ('https://github.com/flashwave/misuzu/commit/' ~ git_commit_hash(true))|html_link(git_commit_hash(), 'footer__link') }}
{% set git_branch = git_branch() %}
{% if git_branch != 'HEAD' %}
({{ ('https://github.com/flashwave/misuzu/tree/' ~ git_branch)|html_link(git_branch, 'footer__link') }})
{{ ('https://github.com/flashwave/misuzu/tree/' ~ git_branch)|html_link(git_branch, 'footer__link') }}
{% else %}
{% set git_tag = git_tag() %}
{{ ('https://github.com/flashwave/misuzu/tree/' ~ git_tag)|html_link(git_tag, 'footer__link') }}
{% endif %}
# {{ ('https://github.com/flashwave/misuzu/commit/' ~ git_commit_hash(true))|html_link(git_commit_hash(), 'footer__link') }}
</div>
{% endautoescape %}
</div>