| 1 | <!DOCTYPE html |
|---|
| 2 | PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
|---|
| 3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|---|
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" |
|---|
| 5 | xmlns:py="http://genshi.edgewall.org/" |
|---|
| 6 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
|---|
| 7 | <xi:include href="layout.html"/> |
|---|
| 8 | |
|---|
| 9 | <head> |
|---|
| 10 | <title>Create Code Review</title> |
|---|
| 11 | </head> |
|---|
| 12 | |
|---|
| 13 | <body> |
|---|
| 14 | <div id="content" py:with="modify = req.args.get('modify', 0)"> |
|---|
| 15 | <h1 py:if="not followup and not modify">Create a New Code Review</h1> |
|---|
| 16 | <h1 py:if="followup">Create a New Followup Code Review</h1> |
|---|
| 17 | <h1 py:if="modify">Modify an existing Code Review</h1> |
|---|
| 18 | |
|---|
| 19 | <!--! CodeReview name is empty if new, with previous name is resubmitted --> |
|---|
| 20 | <form class="workflow-actions" method="post" action="${href.peerReviewNew()}" onsubmit="return validateInput(this);" id="new-review"> |
|---|
| 21 | <fieldset id="properties"> |
|---|
| 22 | <legend>General information.</legend> |
|---|
| 23 | <table> |
|---|
| 24 | <tr> |
|---|
| 25 | <th>Name:</th> |
|---|
| 26 | <td><input type="text" name="Name" value="${name}" id="review-name"/></td> |
|---|
| 27 | </tr> |
|---|
| 28 | <tr> |
|---|
| 29 | <th>Project:</th> |
|---|
| 30 | <td> |
|---|
| 31 | <select id="project" name="project"> |
|---|
| 32 | <option value=""> --- </option> |
|---|
| 33 | <option py:for="item in projects" value="${item}" |
|---|
| 34 | selected="${curproj == item or None}" >${item}</option> |
|---|
| 35 | </select> |
|---|
| 36 | </td> |
|---|
| 37 | </tr> |
|---|
| 38 | <tr> |
|---|
| 39 | <th>Additional notes:</th> |
|---|
| 40 | <td> |
|---|
| 41 | <p class="help">You may use wiki formating here.</p> |
|---|
| 42 | <!-- Display an empty notes area if it's a new CodeReview, display previous notes |
|---|
| 43 | if resubmitted --> |
|---|
| 44 | <textarea class="trac-fullwidth" name="Notes" cols="60" rows="8" py:content="notes" id="review-notes"></textarea> |
|---|
| 45 | <div id="noteschange" class="ticketdraft" style="display: none"> |
|---|
| 46 | <p>Preview:</p> |
|---|
| 47 | <div class="notes-preview comment searchable"> |
|---|
| 48 | |
|---|
| 49 | </div> |
|---|
| 50 | </div> |
|---|
| 51 | </td> |
|---|
| 52 | </tr> |
|---|
| 53 | </table> |
|---|
| 54 | </fieldset> |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | <fieldset> |
|---|
| 58 | <legend py:if="not followup and not modify">Select the sections to be reviewed.</legend> |
|---|
| 59 | <legend py:if="followup">The current file revisions are automatically set for all files.</legend> |
|---|
| 60 | <legend py:if="modify">Modify the list of files.</legend> |
|---|
| 61 | |
|---|
| 62 | <!--! Displays the file browser --> |
|---|
| 63 | <div id="repo_browser" data-is-modify="$modify"> |
|---|
| 64 | </div> |
|---|
| 65 | |
|---|
| 66 | <div py:if="followup" id="follow-up-hint"> |
|---|
| 67 | <p class="help">You can't add files to the current review.</p> |
|---|
| 68 | </div> |
|---|
| 69 | |
|---|
| 70 | <div py:if="modify"> |
|---|
| 71 | <p>You can't add files when modifying a review. Only files without comments may be removed</p> |
|---|
| 72 | </div> |
|---|
| 73 | |
|---|
| 74 | <table py:if="not modify_" class="listing dirlist" id="myfilelist"> |
|---|
| 75 | <thead> |
|---|
| 76 | <tr> |
|---|
| 77 | <th>Filename (Click to remove)</th> |
|---|
| 78 | <th>Repository</th> |
|---|
| 79 | <th>Start Line</th> |
|---|
| 80 | <th>End Line</th> |
|---|
| 81 | <th py:if="followup">Current File Revision</th> |
|---|
| 82 | <th>Current Repo Revision</th> |
|---|
| 83 | <th py:if="followup">Previous File Revision</th> |
|---|
| 84 | <th py:if="followup">Previous Repo Revision</th> |
|---|
| 85 | <th py:if="modify">Comments</th> |
|---|
| 86 | </tr> |
|---|
| 87 | </thead> |
|---|
| 88 | <!--! Display an empty file list if it's a new CodeReview, display previous list if resubmitted --> |
|---|
| 89 | <tbody py:if="new == 'yes'" id="myfilebody"> |
|---|
| 90 | <tr id="no-files" class="even"> |
|---|
| 91 | <td>No files have been added to the code review.</td> |
|---|
| 92 | <td></td> |
|---|
| 93 | <td></td> |
|---|
| 94 | <td></td> |
|---|
| 95 | <td></td> |
|---|
| 96 | <td py:if="modify"></td> |
|---|
| 97 | </tr> |
|---|
| 98 | </tbody> |
|---|
| 99 | |
|---|
| 100 | <tbody py:if="new != 'yes'" py:with="cls=cycle(('odd', 'even'))" id="myfilebody"> |
|---|
| 101 | <tr py:for="item in prevFiles" id="${item.element_id}" class="${cls.next()}"> |
|---|
| 102 | <td> |
|---|
| 103 | <input type="hidden" name="file" |
|---|
| 104 | value="${item.id_string}"/> |
|---|
| 105 | <a py:if="not item.num_comments" |
|---|
| 106 | href="javascript:removefile('${item.id_string}')">${item['path']} |
|---|
| 107 | </a> |
|---|
| 108 | <py:if test="item.num_comments">${item['path']}</py:if> |
|---|
| 109 | </td> |
|---|
| 110 | <td>${item['repo'] if item['repo'] else '(default)'}</td> |
|---|
| 111 | <td>${item['line_start']}</td> |
|---|
| 112 | <td>${item['line_end']}</td> |
|---|
| 113 | |
|---|
| 114 | <td py:if="followup">${item.curchangerevision}</td> |
|---|
| 115 | <td py:if="followup">${item.curreporev}</td> |
|---|
| 116 | <td py:if="followup">${item['changerevision']}</td> |
|---|
| 117 | <td>${item['revision']}</td> |
|---|
| 118 | |
|---|
| 119 | <td py:if="modify">${item.num_comments}</td> |
|---|
| 120 | </tr> |
|---|
| 121 | </tbody> |
|---|
| 122 | </table> |
|---|
| 123 | <p py:if="not modify" class="help">If <strong>Start Line</strong> and <strong>End Line</strong> are set to zero the |
|---|
| 124 | whole file is selected for review.</p> |
|---|
| 125 | </fieldset> |
|---|
| 126 | |
|---|
| 127 | <fieldset> |
|---|
| 128 | <legend>Select reviewers for your review.</legend> |
|---|
| 129 | <xi:include href="user_list.html"/> |
|---|
| 130 | </fieldset> |
|---|
| 131 | |
|---|
| 132 | <div> |
|---|
| 133 | <div class="buttons"> |
|---|
| 134 | <input py:if="oldid" type="hidden" name="oldid" value="$oldid"/> |
|---|
| 135 | <input py:if="not followup and not modify" type="submit" name="create" |
|---|
| 136 | value="${new == 'yes' and 'Add Code Review' or 'Resubmit Code Review'}"/> |
|---|
| 137 | <input py:if="followup" type="hidden" name="followup" value="1"/> |
|---|
| 138 | <input py:if="followup" type="submit" name="createfollowup" |
|---|
| 139 | value="${new == 'yes' and 'Add Code Review' or 'Add Followup Review'}"/> |
|---|
| 140 | <input py:if="modify" type="submit" name="cancel" value="Cancel"/> |
|---|
| 141 | <input py:if="modify" type="submit" name="save" value="Save Changes"/> |
|---|
| 142 | </div> |
|---|
| 143 | </div> |
|---|
| 144 | |
|---|
| 145 | </form> |
|---|
| 146 | <div id="dialog-confirm" title="Remove file?"> |
|---|
| 147 | <p> |
|---|
| 148 | <span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span> |
|---|
| 149 | Really remove the file <strong id="confirm-name"></strong>?</p> |
|---|
| 150 | </div> |
|---|
| 151 | <div id="user-rem-confirm" title="Remove user?"> |
|---|
| 152 | <p> |
|---|
| 153 | <span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span> |
|---|
| 154 | Really remove the user <strong id="user-rem-name"></strong>?</p> |
|---|
| 155 | </div> |
|---|
| 156 | <script type="text/javascript" src="${href.chrome('hw/js/peerReviewNew.js')}"/> |
|---|
| 157 | </div> |
|---|
| 158 | </body> |
|---|
| 159 | </html> |
|---|