add link to ticket in ticket edition popup (#77950) #6

Merged
lguerin merged 1 commits from wip/77950-ticket-link into main 2023-06-01 17:40:39 +02:00
3 changed files with 9 additions and 3 deletions

View File

@ -6,7 +6,7 @@
{% if issue.info.doc_focus %}<span class="icon doc"></span>{% endif %}
</td>
<td class="type">
{{ issue.info.issue_type }}
{{ issue.info.issue_type|default:"" }}
</td>
<td class="issue"><a href="{{ issue.url }}">#{{ issue.id }}</a></td>
<td class="subject">

View File

@ -1,13 +1,15 @@
{% extends "scrutiny/base.html" %}
{% load gadjo %}
{% block appbar %}
<h2>Infos du ticket #{{ form.instance.issue_id }}</h2>
<h2>Infos du ticket #{{ issue.id }}</h2>
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
<p><a href="{{ issue.url }}">{{ issue.url }}</a></p>
{% csrf_token %}
{{ form.as_p }}
{{ form|with_template }}
<div class="buttons">
<button class="submit-button">Enregistrer</button>
<a class="cancel" href="/">Annuler</a>

View File

@ -361,6 +361,10 @@ class IssueInfoUpdate(FormView):
self.issue = Issue(kwargs['issue_id'])
return super().dispatch(request, *args, **kwargs)
def get_context_data(self, **kwargs):
kwargs['issue'] = self.issue
return super().get_context_data(**kwargs)
def get_form_kwargs(self):
info, created = IssueInfo.objects.get_or_create(issue_id=self.issue.id)
kwargs = super().get_form_kwargs()