Merge pull request #761 from OpenGeoLabs/760_attachments

fix for ticket #760 displaying followup attachments again
This commit is contained in:
Garret Wassermann 2019-05-24 11:49:17 -04:00 committed by GitHub
commit 04f6b3efdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -56,7 +56,7 @@
<li>{% blocktrans with change.field as field and change.old_value as old_value and change.new_value as new_value %}Changed {{ field }} from {{ old_value }} to {{ new_value }}.{% endblocktrans %}</li> <li>{% blocktrans with change.field as field and change.old_value as old_value and change.new_value as new_value %}Changed {{ field }} from {{ old_value }} to {{ new_value }}.{% endblocktrans %}</li>
{% if forloop.last %}</ul></div>{% endif %} {% if forloop.last %}</ul></div>{% endif %}
{% endfor %} {% endfor %}
{% for attachment in followup.attachment_set.all %}{% if forloop.first %}<hr><div class='attachments'><ul>{% endif %} {% for attachment in followup.followupattachment_set.all %}{% if forloop.first %}<hr><div class='attachments'><ul>{% endif %}
<li><a href='{{ attachment.file.url }}'>{{ attachment.filename }}</a> ({{ attachment.mime_type }}, {{ attachment.size|filesizeformat }}) <li><a href='{{ attachment.file.url }}'>{{ attachment.filename }}</a> ({{ attachment.mime_type }}, {{ attachment.size|filesizeformat }})
{% if followup.user and request.user == followup.user %} {% if followup.user and request.user == followup.user %}
<a href='{% url 'helpdesk:attachment_del' ticket.id attachment.id %}'><button class="btn btn-danger btn-sm"><i class="fas fa-trash"></i>&nbsp;{% trans 'Delete' %}</button></a> <a href='{% url 'helpdesk:attachment_del' ticket.id attachment.id %}'><button class="btn btn-danger btn-sm"><i class="fas fa-trash"></i>&nbsp;{% trans 'Delete' %}</button></a>

View File

@ -93,6 +93,22 @@
<th>{% trans "Total time spent" %}</th> <th>{% trans "Total time spent" %}</th>
<td>{{ ticket.time_spent }}</td> <td>{{ ticket.time_spent }}</td>
</tr> </tr>
<tr>
<th>{% trans "Attachments" %}</th>
<td>
<ul>
{% for followup in ticket.followup_set.all %}
{% for attachment in followup.followupattachment_set.all %}
<li><a href='{{ attachment.file.url }}'>{{ attachment.filename }}</a> ({{ attachment.mime_type }}, {{ attachment.size|filesizeformat }})
{% if followup.user and request.user == followup.user %}
<a href='{% url 'helpdesk:attachment_del' ticket.id attachment.id %}'><button class="btn btn-danger btn-sm"><i class="fas fa-trash"></i>&nbsp;{% trans 'Delete' %}</button></a>
{% endif %}
</li>
{% endfor %}
{% endfor %}
</ul>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>