issue_detail.html 4.76 KB
Newer Older
1
2
{% extends 'shared/layout.html' %}
{% load static %}
3
4
<!-- Load custom filters from shared app, including ISO 8901 Date-Time Converter -->
{% load custom_filters %}
5
6
7
<!-- Load markdownify -->
{% load markdownify %}
<!-- Start Page Render -->
8
9
10
11
12
<!-- Extra links block for pages that have a user_identifier piped to them.-->
{% block extra_links %}
  {% include 'shared/extend_sidebar.html' %}
{% endblock %}

13
{% block h3 %}
14
15
  {% if results.issue %}
  </h3>
ViolanteCodes's avatar
ViolanteCodes committed
16
  <div class="row justify-content-between">
17
18
19
20
21
22
23
    <p class="col-auto mb-0 small pb-0 pt-0">
      <a href="{{results.go_back_url}}">
        {{results.project.name_with_namespace}}
      </a> 
      ({{results.project.id}}) / issues / #{{results.issue.iid}}
    </p>
    <p class="col-auto text-muted small mb-0 pb-0 pt-0 text-right">
ViolanteCodes's avatar
ViolanteCodes committed
24
      {% if results.issue.created_at %}
25
      Created {{results.issue.created_at|pretty_datetime}} by @{{results.issue.author.username}}
26
27
      {% else %}
      {% endif %}
28
    </p>
29
  </div>
ViolanteCodes's avatar
ViolanteCodes committed
30
31
  <hr class="mb-0 mt-0">
  <div class="row justify-content-between">
32
33
    <div class="col-auto">
      <p class="mb-0 small pb-0 pt-0">
34
35
36
37
38
      {% if results.issue.milestone.title %}
      Milestone: {{results.issue.milestone.title}}.
      {% else %}
      Milestone: <span class="text-muted">(None Assigned.)</span>
      {% endif %}
39
40
      </p>
    </div>
ViolanteCodes's avatar
ViolanteCodes committed
41
  <!-- Generate Links Badges and Labels Pill-Badges -->
ViolanteCodes's avatar
ViolanteCodes committed
42
    <div class="col-auto">
ViolanteCodes's avatar
ViolanteCodes committed
43
      <p class="text-muted small mb-0 pb-0 pt-0 text-right">
ViolanteCodes's avatar
ViolanteCodes committed
44
        {% for label in results.issue.labels %}
45
        <span class="badge-pill badge-primary mr-1 mt-1">{{label}}</mark></span>
ViolanteCodes's avatar
ViolanteCodes committed
46
        {% endfor %}
47
48
        <!-- Back to Project Badge -->
        <a class="btn btn-sm btn-outline-primary ml-4 px-1 py-0" href="{{results.go_back_url}}">Back To Project</a>
ViolanteCodes's avatar
ViolanteCodes committed
49
        <!-- Generate See on Gitlab button   -->
50
51
52
        <a class="btn btn-sm btn-outline-primary ml-2 px-1 py-0" href="{{results.issue.web_url}}" target="__blank">See on Gitlab</a>
        <!-- Create Note Badge -->
        <a class="btn btn-sm btn-primary bg success ml-2 px-1 py-0" href="{{results.new_note_link}}">New Note</a> 
ViolanteCodes's avatar
ViolanteCodes committed
53
      </p>
ViolanteCodes's avatar
ViolanteCodes committed
54
55
56
57
    </div>
  </div>
  <div class="row  mt-5">
    <div class="col-12">
ViolanteCodes's avatar
ViolanteCodes committed
58
59
60
61
62
63
64
      <h4><span class="badge badge-primary mr-2">
        {% if results.issue.state == "closed" %}
        {{results.issue.state|capfirst}}
        {% else %}
        {{results.issue.state|capfirst|slice:"-2"}}
        {% endif %}
      </span>{{results.issue.title|capfirst}}</h4>
ViolanteCodes's avatar
ViolanteCodes committed
65
66
67
    </div>
  <div class="col-12 small mt-0 mb-3 text-right">

68
  </div>
ViolanteCodes's avatar
ViolanteCodes committed
69
</div>
70
71
72
  {% else %}
    Issue Not Found
  {% endif %}
73
74
{% endblock %}
{% block subheader %} 
75
  <p class="small short-height">{{results.issue.description|capfirst|markdownify}}</p>
76
77
78
{% endblock %}

{% block content %}
79

80
<!-- Issue Summary Block -->
81
{% if results.issue.updated_at %}
82
  <div class="row mt-3">
83
84
85
86
87
88
89
    <div class="col-12">
      <h4 class="card-title">Issue Summary</h4>
      <ul>
        <li><span class="text-muted">Currently Assigned To:</span> @{{results.issue.assignee.username}}.
        <span class="text-muted ml-1">Due Date:</span> {{results.issue.due_date|pretty_datetime}}.
        <span class="text-muted ml-1">Last Updated:</span> {{results.issue.updated_at|pretty_datetime}}</li>
      </ul>
90
91
    </div>
  </div>
92
{% else %}
93
{% endif %}
94
95
96
97
<!-- Generate a Back to Landing URL Link -->
{% url 'user-landing' results.user_identifier as go_back_url %}
<div>
  <p>
ViolanteCodes's avatar
ViolanteCodes committed
98
99
100
    You can <a href="{{go_back_url}}">go back to your landing page</a>
    {% if results.issue.updated_at%} 
    or
101
102
    <!-- New_note_link is generated in views.py. -->
    <a href="{{results.new_note_link}}">create a new note</a> for this issue.
ViolanteCodes's avatar
ViolanteCodes committed
103
    {% else %}.{% endif %}
104
105
  </p>
</div>
106

ViolanteCodes's avatar
ViolanteCodes committed
107
<!-- Notes Block -->
108
109
<!-- Note Header Block -->
<div class="row mt-5">
110
  <div class="col-12 p-2">
111
    <h4 class="card-title">Issue Notes</h4>
112
113
  </div>
</div>
114
115
116
117
118
119
120
121
122
123
124
125
126
127

<!-- If notes, iterate through them and display cards. -->
<div class="p2 bg-light">
  {% if results.notes %}
  {% for note in results.notes %}
  <div class="row">
    <div class="col-12 p-2">
      <div class="card mb-2">
        <div class="card-body">
          <p class="card-text text-muted">{{note.noteable_type|title}} 
            note by @{{note.author.username}}, 
            Created: {{note.created_at|pretty_datetime}}, 
            Last Updated: {{note.updated_at|pretty_datetime}}</p>
          <p class="card-text">{{note.body|markdownify}}</p>
128
129
        </div>
      </div>
130
131
    </div>
  </div>
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
  {% endfor %}
  {% else %}
  <!-- If no notes, generate a "No notes block". -->
  <div class="row">
    <div class="col-12 p-2">
      <div class="card mb-2">
        <div class="card-body">
          <p class="card-text text-muted">
            There are no notes for this issue at this time.
          </p>
        </div>
      </div>
    </div>
  </div>
  {% endif %}
</div>
148
{% endblock %}