~sircmpwn/todo.sr.ht

ref: 752f8fe0262868a002ecb8899bfb46846873b3e5 todo.sr.ht/todosrht/templates/events.html -rw-r--r-- 2.8 KiB
752f8fe0наб Don't link to create a label if the user wouldn't be able to 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<div class="event-list">
{% for event in events %}
{% if event.ticket %}
  <div class="event">
    <h4>
      <a
        href="{{ event.ticket|ticket_url }}"
      >#{{event.ticket.scoped_id}}</a> {{ event.ticket.title }}
      <small class="pull-right">{{ event.created | date }}</small>
    </h4>
    <p>
    {% if EventType.created in event.event_type %}
      Ticket created by <a href="{{ event.ticket.submitter|participant_url }}">
        {{ event.ticket.submitter }}
      </a>
    {% elif EventType.comment in event.event_type %}
      Comment by <a href="{{ event.comment.submitter|participant_url }}">
        {{ event.comment.submitter }}
      </a>
    {% elif EventType.label_added in event.event_type %}
      {{ event.label|label_badge(cls="small") }} added by
      <a href="{{ event.participant|participant_url }}">{{ event.participant }}</a>
    {% elif EventType.label_removed in event.event_type %}
      {{ event.label|label_badge(cls="small") }} removed by
      <a href="{{ event.participant|participant_url }}">{{ event.participant }}</a>
    {% elif EventType.assigned_user in event.event_type %}
      <a href="{{event.by_participant|participant_url}}">
        {{event.by_participant}}
      </a>
      assigned
      <a href="{{event.participant|participant_url}}">
        {{event.participant}}
      </a>
      to #{{event.ticket.scoped_id}}
    {% elif EventType.unassigned_user in event.event_type %}
      <a href="{{event.by_participant|participant_url}}">
        {{event.by_participant}}
      </a>
      unassigned
      <a href="{{event.participant|participant_url}}">
        {{event.participant}}
      </a>
      from #{{event.ticket.scoped_id}}
    {% endif %}
    {% with tracker=event.ticket.tracker %}
      on <a href="{{ tracker.owner|user_url }}"
        >{{ tracker.owner }}</a>/<a href="{{ tracker|tracker_url }}"
        >{{ tracker.name }}</a>
    {% endwith %}
    </p>
    <blockquote>
      {% if event.comment %}
      {{ event.comment.text | md }}
      {% elif EventType.created in event.event_type
        and event.ticket.description %}
      {{ event.ticket.description | md }}
      {% endif %}
    </blockquote>
    {% if EventType.status_change in event.event_type %}
    <p>
      <strong class="text-success">
        {{ event.old_status.name.upper() }}
        {% if event.old_status == TicketStatus.resolved %}
        {{ event.old_resolution.name.upper() }}
        {% endif %}
      </strong>
      {{icon("arrow-right", cls="sm")}}
      <strong class="text-success">
        {{ event.new_status.name.upper() }}
        {% if event.new_status == TicketStatus.resolved %}
        {{ event.new_resolution.name.upper() }}
        {% endif %}
      </strong>
    </p>
    {% endif %}
  </div>
{% endif %}
{% else %}
  <p>Nothing here yet!</p>
{% endfor %}
</div>