Skip to content

Commit

Permalink
Order issues by status and order and views by order in project_detail
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Nov 18, 2023
1 parent 7bdd0be commit ed83257
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rdmo/projects/models/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
4 changes: 2 additions & 2 deletions rdmo/projects/templates/projects/project_detail_views.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2>{% trans 'Views' %}</h2>

{% include 'projects/project_detail_views_help.html' %}

{% if project.views.exists %}
{% if views %}

<table class="table">
<thead>
Expand All @@ -27,7 +27,7 @@ <h2>{% trans 'Views' %}</h2>
</th>
</thead>
<tbody>
{% for view in project.views.all %}
{% for view in views %}
<tr>
<td>
<a href="{% url 'project_view' project.pk view.pk %}">{{ view.title }}</a>
Expand Down
5 changes: 4 additions & 1 deletion rdmo/projects/views/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ed83257

Please sign in to comment.