|
1 | | -<div style="margin-bottom:5px;"> |
2 | | - <a class="btn btn-secondary" href="edit/">Edit</a> |
3 | | - <button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#reviewModal">Review</button> |
| 1 | +<form method="post" style="margin-bottom:5px;">{%csrf_token%} |
| 2 | + {%if not user.is_authenticated%} |
| 3 | + {%comment%} |
| 4 | + Most of these commands are POSTs, which can't be replayed after logging in, |
| 5 | + so send anonymous users to log in first instead of letting them submit. |
| 6 | + {%endcomment%} |
| 7 | + <a class="btn btn-secondary" href="/account/login/?next=/patch/{{patch.id}}/">Log in to edit</a> |
| 8 | + <button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#reviewModal">Review</button> |
| 9 | + {%else%} |
| 10 | + <a class="btn btn-secondary" href="edit/">Edit</a> |
| 11 | + <button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#reviewModal">Review</button> |
4 | 12 |
|
5 | | - <div class="btn-group"> |
6 | | - <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Change Status</button> |
7 | | - <ul class="dropdown-menu"> |
8 | | - <li><h6 class="dropdown-header">Open statuses</h6></li> |
9 | | - <li><a class="dropdown-item" href="status/review/">Needs review</a></li> |
10 | | - <li><a class="dropdown-item" href="status/author/">Waiting on Author</a></li> |
11 | | - <li><a class="dropdown-item" href="status/committer/">Ready for Committer</a></li> |
12 | | - <li><hr class="dropdown-divider"></li> |
13 | | - <li><h6 class="dropdown-header">Closed statuses</h6></li> |
14 | | - <li><a class="dropdown-item" href="close/reject/" onclick="return verify_reject()">Rejected</a></li> |
15 | | - <li><a class="dropdown-item" href="close/withdrawn/" onclick="return verify_withdrawn()">Withdrawn</a></li> |
16 | | - <li><a class="dropdown-item" href="close/feedback/" onclick="return verify_returned()">Returned with feedback</a></li> |
17 | | - <li><a class="dropdown-item" href="close/committed/" onclick="return flagCommitted({%if patch.committer%}'{{patch.committer}}'{%elif is_committer%}'{{user.username}}'{%else%}null{%endif%})">Committed</a></li> |
18 | | - <li><hr class="dropdown-divider"></li> |
19 | | - <li><h6 class="dropdown-header">Move to</h6></li> |
20 | | - {%if not cf.is_open_regular %} |
21 | | - <li> |
22 | | - <a class="dropdown-item" |
23 | | - href="move/?from_cf_id={{cf.id}}&to_cf_id={{cfs.open.id}}"> |
24 | | - Next CF: {{cfs.open.name}}</a> |
25 | | - </li> |
26 | | - {%endif%} |
27 | | - {%if not cf.is_open_draft %} |
28 | | - <li> |
29 | | - <a class="dropdown-item" |
30 | | - href="move/?from_cf_id={{cf.id}}&to_cf_id={{cfs.draft.id}}"> |
31 | | - {%if cf.draft %} |
32 | | - Next Drafts: |
33 | | - {%else%} |
34 | | - Draft: |
35 | | - {%endif%} |
36 | | - {{cfs.draft.name}}</a> |
37 | | - </li> |
38 | | - {%endif%} |
39 | | - </ul> |
40 | | - </div> |
41 | | - |
42 | | - {%if request.user.is_staff%} |
43 | 13 | <div class="btn-group"> |
44 | | - <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Send private mail</button> |
| 14 | + <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Change Status</button> |
45 | 15 | <ul class="dropdown-menu"> |
46 | | - <li><a class="dropdown-item" href="send_email/?authors={{patch.id}}">Send mail to authors</a></li> |
47 | | - <li><a class="dropdown-item" href="send_email/?reviewers={{patch.id}}">Send mail to reviewers</a></li> |
48 | | - <li><a class="dropdown-item" href="send_email/?authors={{patch.id}}&reviewers={{patch.id}}">Send mail to authors and reviewers</a></li> |
| 16 | + <li><h6 class="dropdown-header">Open statuses</h6></li> |
| 17 | + <li><button class="dropdown-item" formaction="status/review/">Needs review</button></li> |
| 18 | + <li><button class="dropdown-item" formaction="status/author/">Waiting on Author</button></li> |
| 19 | + <li><button class="dropdown-item" formaction="status/committer/">Ready for Committer</button></li> |
| 20 | + <li><hr class="dropdown-divider"></li> |
| 21 | + <li><h6 class="dropdown-header">Closed statuses</h6></li> |
| 22 | + <li><button class="dropdown-item" formaction="close/reject/" onclick="return verify_reject()">Rejected</button></li> |
| 23 | + <li><button class="dropdown-item" formaction="close/withdrawn/" onclick="return verify_withdrawn()">Withdrawn</button></li> |
| 24 | + <li><button class="dropdown-item" formaction="close/feedback/" onclick="return verify_returned()">Returned with feedback</button></li> |
| 25 | + <li><button class="dropdown-item" type="button" onclick="return flagCommitted({%if patch.committer%}'{{patch.committer}}'{%elif is_committer%}'{{user.username}}'{%else%}null{%endif%})">Committed</button></li> |
| 26 | + <li><hr class="dropdown-divider"></li> |
| 27 | + <li><h6 class="dropdown-header">Move to</h6></li> |
| 28 | + {%if not cf.is_open_regular %} |
| 29 | + <li> |
| 30 | + <button class="dropdown-item" |
| 31 | + formaction="move/?from_cf_id={{cf.id}}&to_cf_id={{cfs.open.id}}"> |
| 32 | + Next CF: {{cfs.open.name}}</button> |
| 33 | + </li> |
| 34 | + {%endif%} |
| 35 | + {%if not cf.is_open_draft %} |
| 36 | + <li> |
| 37 | + <button class="dropdown-item" |
| 38 | + formaction="move/?from_cf_id={{cf.id}}&to_cf_id={{cfs.draft.id}}"> |
| 39 | + {%if cf.draft %} |
| 40 | + Next Drafts: |
| 41 | + {%else%} |
| 42 | + Draft: |
| 43 | + {%endif%} |
| 44 | + {{cfs.draft.name}}</button> |
| 45 | + </li> |
| 46 | + {%endif%} |
49 | 47 | </ul> |
50 | 48 | </div> |
| 49 | + |
| 50 | + {%if request.user.is_staff%} |
| 51 | + <div class="btn-group"> |
| 52 | + <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Send private mail</button> |
| 53 | + <ul class="dropdown-menu"> |
| 54 | + <li><a class="dropdown-item" href="send_email/?authors={{patch.id}}">Send mail to authors</a></li> |
| 55 | + <li><a class="dropdown-item" href="send_email/?reviewers={{patch.id}}">Send mail to reviewers</a></li> |
| 56 | + <li><a class="dropdown-item" href="send_email/?authors={{patch.id}}&reviewers={{patch.id}}">Send mail to authors and reviewers</a></li> |
| 57 | + </ul> |
| 58 | + </div> |
| 59 | + {%endif%} |
51 | 60 | {%endif%} |
52 | 61 |
|
53 | | -</div> |
| 62 | +</form> |
0 commit comments