diff --git a/rdmo/projects/models/issue.py b/rdmo/projects/models/issue.py index bfaf95474d..1b2c30164d 100644 --- a/rdmo/projects/models/issue.py +++ b/rdmo/projects/models/issue.py @@ -40,7 +40,7 @@ class Issue(models.Model): ) class Meta: - ordering = ('project__title', ) + ordering = ('project__title', 'task__uri') verbose_name = _('Issue') verbose_name_plural = _('Issues') diff --git a/rdmo/projects/templates/projects/project_detail_views.html b/rdmo/projects/templates/projects/project_detail_views.html index 593aa57c2a..e3cda0f3fa 100644 --- a/rdmo/projects/templates/projects/project_detail_views.html +++ b/rdmo/projects/templates/projects/project_detail_views.html @@ -12,7 +12,7 @@

{% trans 'Views' %}

{% include 'projects/project_detail_views_help.html' %} - {% if project.views.exists %} + {% if views %} @@ -27,7 +27,7 @@

{% trans 'Views' %}

- {% for view in project.views.all %} + {% for view in views %}
{{ view.title }} diff --git a/rdmo/projects/views/project.py b/rdmo/projects/views/project.py index 6bbe56fbd5..934b724cfa 100644 --- a/rdmo/projects/views/project.py +++ b/rdmo/projects/views/project.py @@ -157,7 +157,10 @@ def get_context_data(self, **kwargs): context['memberships'] = memberships.order_by('user__last_name', '-project__level') context['integrations'] = integrations.order_by('provider_key', '-project__level') context['providers'] = get_plugins('PROJECT_ISSUE_PROVIDERS') - context['issues'] = [issue for issue in project.issues.all() if issue.resolve(values)] + context['issues'] = [ + issue for issue in project.issues.order_by('-status', 'task__order', 'task__uri') if issue.resolve(values) + ] + context['views'] = project.views.order_by('order', 'uri') context['snapshots'] = project.snapshots.all() context['invites'] = project.invites.all() context['membership'] = Membership.objects.filter(project=project, user=self.request.user).first()