Skip to content

Commit

Permalink
Create a link to the project jobs in the project admin view (#950)
Browse files Browse the repository at this point in the history
  • Loading branch information
boardend authored May 27, 2024
1 parent d27d83d commit 46a29ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docker-app/qfieldcloud/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,8 @@ class ProjectAdmin(QFieldCloudModelAdmin):

ordering = ("-updated_at",)

change_form_template = "admin/project_change_form.html"

def get_form(self, *args, **kwargs):
help_texts = {
"file_storage_bytes": _(
Expand Down Expand Up @@ -778,6 +780,7 @@ class JobAdmin(QFieldCloudModelAdmin):
"project__name__iexact",
"project__owner__username__iexact",
"id",
"project__id__iexact",
)
readonly_fields = (
"project",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends 'admin/change_form.html' %}
{% load i18n %}

{% block submit_buttons_bottom %}
{{ block.super }}

<div class="submit-row">
<a href="{% url 'admin:core_job_changelist' %}?q={{original.id}}">{% trans 'Project jobs' %}</a>
</div>
{% endblock %}

0 comments on commit 46a29ef

Please sign in to comment.