1
0
Fork 0

lables on page view

This commit is contained in:
Lukas Winkler 2017-09-20 20:50:37 +02:00
parent 26fccf932b
commit 22d2749e7f
4 changed files with 14 additions and 7 deletions

View file

@ -85,6 +85,7 @@ class Page {
'login' => $issue['user']['login']
),
'created_at' => $issue['created_at'],
'labels' => $issue['labels']
);
}

View file

@ -9,16 +9,11 @@
<div class="container">
<div class="page-header">
<h1>{{ title }}
<a href="https://github.com/{{ githubOrganization }}/{{ githubRepository }}/issues/{{ number }}">
<a href="{{ html_url }}">
<small>#{{ number }}</small>
</a>
</h1>
{% if labels and labels|length %}
{% for label in labels %}
<span class="badge text-{{ label.color | textcolor }}"
style="background: {{ '#' ~ label.color }}">{{ label.name }}</span>
{% endfor %}
{% endif %}
{{ macro.labels(labels) }}
{% if milestone %}
<span class="badge badge-secondary" title="{{ milestone.description }}">{{ milestone.title }}</span>

View file

@ -4,3 +4,12 @@
height="44">@{{ user.login }}
</a>
{% endmacro %}
{% macro labels(labels) %}
{% if labels and labels|length %}
{% for label in labels %}
<span class="badge text-{{ label.color | textcolor }}"
style="background: {{ '#' ~ label.color }}">{{ label.name }}</span>
{% endfor %}
{% endif %}
{% endmacro %}

View file

@ -1,4 +1,5 @@
{% extends "layout.twig" %}
{% import "macros.twig" as macro %}
{% block head %}
{% if currentPage > 1 %}
@ -45,6 +46,7 @@
{% if issue.state == 'closed' %}
<span class="badge badge-secondary">closed</span>
{% endif %}
{{ macro.labels(issue.labels) }}
</small>
</div>
</a>