Webhooks: Add comment field (#3095)

This commit is contained in:
ser8phin
2023-02-07 15:17:19 +01:00
committed by GitHub
parent ba2c6e1e58
commit 82dd417a8e
7 changed files with 29 additions and 2 deletions

View File

@@ -564,7 +564,7 @@ class WebHookForm(forms.ModelForm):
class Meta:
model = WebHook
fields = ['target_url', 'enabled', 'all_events', 'limit_events']
fields = ['target_url', 'enabled', 'all_events', 'limit_events', 'comment']
widgets = {
'limit_events': forms.CheckboxSelectMultiple(attrs={
'data-inverse-dependency': '#id_all_events'

View File

@@ -11,6 +11,7 @@
{% csrf_token %}
{% bootstrap_form_errors form %}
{% bootstrap_field form.target_url layout="control" %}
{% bootstrap_field form.comment layout="control" %}
{% bootstrap_field form.enabled layout="control" %}
{% bootstrap_field form.events layout="control" %}
{% bootstrap_field form.all_events layout="control" %}

View File

@@ -35,6 +35,7 @@
<tr>
<th>{% trans "Target URL" %}</th>
<th>{% trans "Events" %}</th>
<th>{% trans "Comment" %}</th>
<th></th>
</tr>
</thead>
@@ -61,6 +62,11 @@
</ul>
{% endif %}
</td>
<td>
{% if w.comment %}
{{ w.comment }}
{% endif %}
</td>
<td class="text-right flip">
<a href="{% url "control:organizer.webhook.edit" organizer=request.organizer.slug webhook=w.id %}"
class="btn btn-default btn-sm" data-toggle="tooltip" title="{% trans "Edit" %}">