-
Notifications
You must be signed in to change notification settings - Fork 91
[ 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
14
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 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
de6b759
models: add attention set to patches
andrepapoti 3d96133
api: add attention_set to patch
andrepapoti 1f51b1f
views: manage users in patch attention list
andrepapoti 38d4d24
admin: add attention set information in patches
victor-accarini 229b9c4
docs: update schema with patch attention set
victor-accarini 60586e3
tests: validate patch attention_set api behavior
victor-accarini 748355a
tests: update patch view tests
victor-accarini 9e708d2
views: add series-list view
andrepapoti 337b606
tests: Add tests for series list view
andrepapoti c96a787
views: add series-detail view
andrepapoti 2ecae72
views: add shortcut to series-list view on navigation bar
andrepapoti ef6a553
views: add series navigation buttons for patch-detail view
andrepapoti 5ad2681
docs: add release notes for series-list and series-detail
andrepapoti ee4f567
feat: use series-detail view instead of patch-list for series
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
views: add series-list view
This view is meant to give a quickoverview on a project since some of them can have hundreds of patches actives. This view also allows the user to apply changes on all of the series patches at once Signed-off-by: andrepapoti <andrepapoti@gmail.com> Signed-off-by: Victor Accarini <victor.accarini@profusion.mobi>
- Loading branch information
commit 9e708d2648d301e08a56ddb399fceb945641b6bb
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| {% 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> | ||
| {{ series.name|default:"[no subject]"|truncatechars:100 }} | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Patchwork - automated patch tracking system | ||
| # Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org> | ||
| # 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 '-') | ||
| ) |
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
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.
If you rename this you need to provide a redirect. There are existing examples of redirects here. Don't forget to preserve query string arguments though since those matter here but didn't matter for fetching e.g. patch mboxes.
This should also be a separate commit, ideally placed before this one in the series.