Skip to content

Commit

Permalink
feat(core): colour code related ticket background to ticket type
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-nfc committed Aug 30, 2024
1 parent 1665e51 commit 6ec16cb
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 10 deletions.
14 changes: 11 additions & 3 deletions app/core/templates/core/ticket.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

{% if ticket.related_tickets %}
{% for related_ticket in ticket.related_tickets %}
<div id="linked-tickets">
<div id="linked-tickets" class="{{ related_ticket.type }}-ticket">
<div class="icon icon-{{ related_ticket.how_related }}">{% include related_ticket.icon_filename %}</div>
<div class="ticket">
{% if related_ticket.how_related == 'blocked_by' %}
Expand All @@ -43,8 +43,16 @@
{% elif related_ticket.how_related == 'related' %}
Related to
{% endif %}
&nbsp;
{{ related_ticket.title }}
<a href="{% if related_ticket.type == 'request' %}
{% url 'Assistance:_ticket_request_view' ticket_type=related_ticket.type pk=related_ticket.id %}
{% elif related_ticket.type == 'change' %}
{% url 'ITIM:_ticket_change_view' ticket_type=related_ticket.type pk=related_ticket.id %}
{% elif related_ticket.type == 'incident' %}
{% url 'ITIM:_ticket_incident_view' ticket_type=related_ticket.type pk=related_ticket.id %}
{% elif related_ticket.type == 'problem' %}
{% url 'ITIM:_ticket_problem_view' ticket_type=related_ticket.type pk=related_ticket.id %}
{% endif %}
">{{ related_ticket.title }}</a>
</div>
</div>
{% endfor %}
Expand Down
8 changes: 8 additions & 0 deletions app/core/templates/core/ticket/type_icon.html.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<span id="ticket-icon">

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" class="{{ ticket_type }}-ticket">

<path d="M319.33-246.67h321.34v-66.66H319.33v66.66Zm0-166.66h321.34V-480H319.33v66.67ZM226.67-80q-27 0-46.84-19.83Q160-119.67 160-146.67v-666.66q0-27 19.83-46.84Q199.67-880 226.67-880H574l226 226v507.33q0 27-19.83 46.84Q760.33-80 733.33-80H226.67Zm314-542.67v-190.66h-314v666.66h506.66v-476H540.67Zm-314-190.66v190.66-190.66 666.66-666.66Z"/>
</svg>

</span>
1 change: 1 addition & 0 deletions app/core/templates/icons/ticket/ticket.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 41 additions & 7 deletions app/project-static/ticketing.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

}


#linked-tickets .icon.icon-related svg{
background-color: #afdbff;
border-radius: 10px;
Expand All @@ -61,6 +60,41 @@
}


#linked-tickets .ticket #ticket-icon {
display: inline-block;
width: 20px;
line-height: 30px;
vertical-align: middle;
padding: 0px;
margin: 0px 5px 0px 0px;
height: 20px;
}
/*
#ticket-icon div {
background-color: #e79b37;
display: inline;
width: 20px;
line-height: 30px;
vertical-align: middle;
padding: 0px;
margin: 0px;
}*/

#linked-tickets .ticket #ticket-icon svg {
/*background-color: #e79b37;*/
/*background-color: tomato;*/
display: inline;
/*width: 20px;*/
height: 22px;
padding: 1px;
border: none;
border-radius: 10px;
/*line-height: 20px;*/

}


#ticket-additional-data {
padding-right: 10px;
font-size: 12pt;
Expand Down Expand Up @@ -329,32 +363,32 @@
}


h3.incident-ticket {
.incident-ticket {
background-color: #f7baba;
}


h3.request-ticket {
.request-ticket {
background-color: #f7e9ba;
}


h3.change-ticket {
.change-ticket {
background-color: #badff7;
}


h3.problem-ticket {
.problem-ticket {
background-color: #f7d0ba;
}


h3.issue-ticket {
.issue-ticket {
background-color: #baf7db;
}


h3.project_task-ticket {
.project_task-ticket {
background-color: #c5baf7;
}

Expand Down

0 comments on commit 6ec16cb

Please sign in to comment.