76 lines
2.2 KiB
PHTML
76 lines
2.2 KiB
PHTML
{% extends "lean-console/base/layout" %}
|
|
|
|
{% language.set "lean.update" %}
|
|
|
|
{% title _("title") %}
|
|
|
|
|
|
{% function setStatusModifierClass($line) : string %}
|
|
{% return match(substr($line, 0, 2)) {
|
|
'??' => "action-add",
|
|
default => false,
|
|
} ?: match(substr($line, 0, 1)) {
|
|
'M' => "action-delete",
|
|
default => "",
|
|
}%}
|
|
{% endfunction %}
|
|
|
|
{% function setDiffModifierClass($line) : string %}
|
|
{% return match(substr($line, 0, 2)) {
|
|
'--' => "action-delete",
|
|
'++' => "action-add",
|
|
'@@' => "action-group",
|
|
default => false,
|
|
} ?: match(substr($line, 0, 1)) {
|
|
'-' => "action-delete",
|
|
'+' => "action-add",
|
|
default => "",
|
|
}%}
|
|
{% endfunction %}
|
|
|
|
{% section "content" %}
|
|
<section>
|
|
<header>
|
|
<h1>{% _ 'git.header' %}</h1>
|
|
</header>
|
|
|
|
<article class="updates">
|
|
<div class="git-status">
|
|
<strong style="display:block;margin-bottom:7px">'git status' output</strong>
|
|
|
|
<code style="white-space:normal;font-size:120%">
|
|
{% foreach $status as $line %}
|
|
<div class="{{ setStatusModifierClass($line) }}">
|
|
{% if $line %}
|
|
{{ $line }}
|
|
{% endif %}
|
|
</div>
|
|
{% endforeach %}
|
|
</code>
|
|
</div>
|
|
|
|
<div class="git-diff" style="margin-top:2rem">
|
|
<strong style="display:block;margin-bottom:7px">'git diff' output</strong>
|
|
|
|
<code style="white-space:normal;font-size:120%">
|
|
{% foreach $diff as $line %}
|
|
<div class="{{ setDiffModifierClass($line) }}">
|
|
{% if $line %}
|
|
{{ $line }}
|
|
{% endif %}
|
|
</div>
|
|
{% endforeach %}
|
|
</code>
|
|
</div>
|
|
</article>
|
|
<footer>
|
|
{{ $lastUpdate }}
|
|
</footer>
|
|
</section>
|
|
{% endsection %}
|
|
|
|
<style>
|
|
.action-delete {color:#f88}
|
|
.action-add {color: #88ff8a}
|
|
.action-group {color:#88bcff}
|
|
</style> |