lables on page view
This commit is contained in:
parent
26fccf932b
commit
22d2749e7f
4 changed files with 14 additions and 7 deletions
|
@ -85,6 +85,7 @@ class Page {
|
|||
'login' => $issue['user']['login']
|
||||
),
|
||||
'created_at' => $issue['created_at'],
|
||||
'labels' => $issue['labels']
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -3,4 +3,13 @@
|
|||
<img class="avatar" src="{{ user.avatar_url }}&s=44" role="presentation" aria-hidden="true" width="44"
|
||||
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 %}
|
|
@ -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>
|
||||
|
|
Reference in a new issue