Commit a0ae045
Add tags to patches (#69)
A Tag is an arbitrary label for a patch in the Commitfest UI. Other than
helping users identify patches of interest, it has no other semantic
meaning to the CF application. This addresses #11 and #67.
Tags are created using the administrator interface. They consist of a
unique name and a background color. The color should be sent from
compliant browsers in `#rrggbb` format, which is stored without backend
validation; to avoid later CSS injection, any non-conforming values are
replaced with black during rendering.
It also includes some javascript to help admins pick colors that aren't
completely eye-gouging, by putting up an (ignorable) warning if we don't
meet baseline [WCAG
recommendations](https://www.w3.org/WAI/WCAG22/Techniques/general/G18.html)
on text contrast.
## Notes
- To avoid putting a separate name+color copy of every tag into each row
of the `patchlist` query, I instead grab the tag IDs and look them up in
a map at render time. I think this requires `@transaction.atomic` to tie
the map and patches together, which I've added across the entire view
for simplicity.
- Backend validation for the color didn't make a whole lot of sense to
me, since only admins can create tags and we escape at time-of-use
anyway.
## Screenshots
Admin interface:

User interface:

---------
Co-authored-by: Jelte Fennema-Nio <[email protected]>1 parent 58cdf34 commit a0ae045
File tree
16 files changed
+746
-21
lines changed- media/commitfest/js
- pgcommitfest/commitfest
- fixtures
- migrations
- templates
- templatetags
16 files changed
+746
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
41 | 61 | | |
42 | 62 | | |
| 63 | + | |
43 | 64 | | |
44 | 65 | | |
45 | 66 | | |
| |||
0 commit comments