-
Notifications
You must be signed in to change notification settings - Fork 85
[ Issue #509 + #510] Series views #589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andrepapoti
wants to merge
8
commits into
getpatchwork:main
Choose a base branch
from
profusion:i509
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fe7c868
views: add series-list view
andrepapoti 4770c98
tests: Add tests for series list view
andrepapoti 8659bef
views: add series-detail view
andrepapoti ca73edf
views: add shortcut to series-list view on navigation bar
andrepapoti c7fb7df
views: add series navigation buttons for patch-detail view
andrepapoti 330d2b0
docs: add release notes for series-list and series-detail
andrepapoti 6eb5ae4
fixup! views: add series-list view
victor-accarini 9cc8934
fixup! views: add series-detail view
victor-accarini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{% extends "base.html" %} | ||
|
||
{% load humanize %} | ||
{% load syntax %} | ||
{% load person %} | ||
{% load patch %} | ||
{% load static %} | ||
{% load utils %} | ||
|
||
{% block title %}{{series.name}}{% endblock %} | ||
|
||
{% block body %} | ||
|
||
<div> | ||
{% include "patchwork/partials/download-buttons.html" %} | ||
<h1>{{ series.name }}</h1> | ||
</div> | ||
|
||
<table class="patch-meta"> | ||
<tr> | ||
<th>Series ID</th> | ||
<td> | ||
{{ series.id }} | ||
<span class="btn-link btn-copy glyphicon glyphicon-copy" data-clipboard-text="{{ request.build_absolute_uri }}{{ series.get_absolute_url }}" title="Copy to Clipboard"></span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Date</th> | ||
<td>{{ series.date }}</td> | ||
</tr> | ||
<tr> | ||
<th>Submitter</th> | ||
<td>{{ series.submitter }}</td> | ||
</tr> | ||
<tr> | ||
<th>Total</th> | ||
<td>{{ series.patches }}</td> | ||
</tr> | ||
</table> | ||
<br> | ||
<h2>Patches</h2> | ||
<br> | ||
{% include "patchwork/partials/patch-list.html" %} | ||
|
||
<div id="cover-letter"> | ||
<h2>Cover Letter</h2> | ||
{% if series.cover_letter.content %} | ||
<pre class="content">{{ series.cover_letter.content }}</pre> | ||
{% else %} | ||
No cover letter available | ||
{% endif %} | ||
</div> | ||
|
||
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
{% extends "base.html" %} | ||
|
||
{% load person %} | ||
{% load static %} | ||
|
||
{% block title %}{{project.name}}{% endblock %} | ||
{% block series_active %}active{% endblock %} | ||
|
||
{% block body %} | ||
|
||
{% load person %} | ||
{% load listurl %} | ||
{% load patch %} | ||
{% load series %} | ||
{% load project %} | ||
{% load static %} | ||
|
||
{% include "patchwork/partials/pagination.html" %} | ||
|
||
<input type="hidden" name="form" value="serieslistform"/> | ||
<input type="hidden" name="project" value="{{project.id}}"/> | ||
|
||
<table id="serieslist" class="table table-hover table-extra-condensed table-striped pw-list" data-toggle="checkboxes" data-range="true"> | ||
<thead> | ||
<tr> | ||
{% if user.is_authenticated and user.profile.show_ids %} | ||
<th> | ||
ID | ||
</th> | ||
{% endif %} | ||
|
||
<th> | ||
<span class="series-list-header">Series</span> | ||
</th> | ||
|
||
<th> | ||
Version | ||
</th> | ||
|
||
<th> | ||
{% project_tags %} | ||
</th> | ||
|
||
<th> | ||
<span class="series-list-header" title="Success / Warning / Fail">S/W/F</span> | ||
</th> | ||
|
||
<th> | ||
<span class="series-list-header" title="Declared review interest">Review Interest</span> | ||
</th> | ||
|
||
<th> | ||
<span class="series-list-header">Patches</span> | ||
</th> | ||
|
||
<th> | ||
{% if 'date.asc' == order %} | ||
<a href="{% listurl order='date.desc' %}" class="colactive"> | ||
<span class="glyphicon glyphicon-chevron-up"></span> | ||
{% elif 'date.desc' == order %} | ||
<a href="{% listurl order='date.asc' %}" class="colactive"> | ||
<span class="glyphicon glyphicon-chevron-down"></span> | ||
{% endif %} | ||
<span class="series-list-header">Date</span> | ||
{% if 'date.asc' == order or 'date.desc' == order%} | ||
</a> | ||
{% endif %} | ||
</th> | ||
|
||
<th> | ||
<span class="series-list-header">Submitter</span> | ||
</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
{% for series in page %} | ||
<tr id="series_row:{{series.id}}"> | ||
{% if user.is_authenticated and user.profile.show_ids %} | ||
<td> | ||
<button type="button" class="btn btn-xs btn-copy" data-clipboard-text="{{ series.id }}" title="Copy to Clipboard"> | ||
{{ series.id }} | ||
</button> | ||
</td> | ||
{% endif %} | ||
<td> | ||
<a href="{% url 'series-detail' project_id=project.linkname series_id=series.id %}?state=*"> | ||
{{ series.name|default:"[no subject]"|truncatechars:100 }} | ||
</a> | ||
</td> | ||
<td> | ||
{{ series.version|default:"-"}} | ||
</td> | ||
|
||
<td id="series-tags:{{series.id}}" class="text-nowrap">{{ series|series_tags }}</td> | ||
<td id="series-checks:{{series.id}}" class="text-nowrap">{{ series|series_checks }}</td> | ||
<td id="series-interest:{{series.id}}" class="text-nowrap">{{ series|series_interest }}</td> | ||
<td>{{ series.received_total}}</td> | ||
<td class="text-nowrap">{{ series.date|date:"Y-m-d" }}</td> | ||
<td>{{ series.submitter|personify:project }}</td> | ||
</tr> | ||
{% empty %} | ||
<tr> | ||
<td colspan="8">No series to display</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
|
||
{% if page.paginator.count %} | ||
{% include "patchwork/partials/pagination.html" %} | ||
{% endif %} | ||
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Patchwork - automated patch tracking system | ||
# Copyright (C) 2008 Jeremy Kerr <[email protected]> | ||
# Copyright (C) 2015 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
from django import template | ||
from django.utils.safestring import mark_safe | ||
|
||
from patchwork.models import Check | ||
|
||
|
||
register = template.Library() | ||
|
||
|
||
@register.filter(name='series_tags') | ||
def series_tags(series): | ||
counts = [] | ||
titles = [] | ||
|
||
for tag in [t for t in series.project.tags if t.show_column]: | ||
count = 0 | ||
for patch in series.patches.with_tag_counts(series.project).all(): | ||
count += getattr(patch, tag.attr_name) | ||
|
||
titles.append('%d %s' % (count, tag.name)) | ||
if count == 0: | ||
counts.append('-') | ||
else: | ||
counts.append(str(count)) | ||
|
||
return mark_safe( | ||
'<span title="%s">%s</span>' % (' / '.join(titles), ' '.join(counts)) | ||
) | ||
|
||
|
||
@register.filter(name='series_checks') | ||
def series_checks(series): | ||
required = [Check.STATE_SUCCESS, Check.STATE_WARNING, Check.STATE_FAIL] | ||
titles = ['Success', 'Warning', 'Fail'] | ||
counts = series.check_count | ||
|
||
check_elements = [] | ||
for state in required[::-1]: | ||
if counts[state]: | ||
color = dict(Check.STATE_CHOICES).get(state) | ||
count = str(counts[state]) | ||
else: | ||
color = '' | ||
count = '-' | ||
|
||
check_elements.append( | ||
f'<span class="patchlistchecks {color}">{count}</span>' | ||
) | ||
|
||
check_elements.reverse() | ||
|
||
return mark_safe( | ||
'<span title="%s">%s</span>' | ||
% (' / '.join(titles), ''.join(check_elements)) | ||
) | ||
|
||
|
||
@register.filter(name='series_interest') | ||
def series_interest(series): | ||
reviews = series.interest_count | ||
review_title = ( | ||
f'has {reviews} interested reviewers' | ||
if reviews > 0 | ||
else 'no interested reviewers' | ||
) | ||
review_class = 'exists' if reviews > 0 else '' | ||
return mark_safe( | ||
'<span class="patchinterest %s" title="%s">%s</span>' | ||
% (review_class, review_title, reviews if reviews > 0 else '-') | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need tests for this also.