OLD | NEW |
(Empty) | |
| 1 [define title]People[end] |
| 2 [define category_css]css/ph_list.css[end] |
| 3 [include "../framework/master-header.ezt" "showtabs"] |
| 4 [include "../framework/js-placeholders.ezt"] |
| 5 |
| 6 <form method="POST" action="list.do" id="membership_form"> |
| 7 <div id="colcontrol"> |
| 8 <div class="list"> |
| 9 [if-any pagination.visible] |
| 10 <div class="pagination"> |
| 11 [if-any pagination.prev_url]<a href="[pagination.prev_url]"><b>‹
</b> Prev</a>[end] |
| 12 Members [pagination.start] - [pagination.last] of [pagination.total_cou
nt] |
| 13 [if-any pagination.next_url]<a href="[pagination.next_url]">Next <b>&rs
aquo;</b></a>[end] |
| 14 </div> |
| 15 [end] |
| 16 <b style="margin-right:1em">Project People</b> |
| 17 |
| 18 [if-any offer_membership_editing] |
| 19 <input type="button" value="Add members" style="font-size:80%" |
| 20 id="add_members_button"> |
| 21 <input type="submit" value="Remove members" style="font-size:80%; margin-le
ft:1em" |
| 22 id="removebtn" name="removebtn" disabled="disabled"> |
| 23 [# TOOD(jrobbins): extra confirmation when removing yourself as owner.] |
| 24 [end] |
| 25 </div> |
| 26 |
| 27 <table cellspacing="0" cellpadding="2" border="0" class="results striped vt" i
d="resultstable" width="100%"> |
| 28 <tbody> |
| 29 [if-any pagination.visible_results] |
| 30 |
| 31 <tr id="headingrow"> |
| 32 [if-any offer_membership_editing] |
| 33 <th style="border-right:0; padding-right:2px"> </th> |
| 34 [end] |
| 35 |
| 36 <th style="white-space:nowrap">Name</th> |
| 37 <th style="white-space:nowrap">Role</th> |
| 38 <th style="white-space:nowrap">Notes</th> |
| 39 </tr> |
| 40 |
| 41 [for pagination.visible_results] |
| 42 [include "people-list-row-part.ezt"] |
| 43 [end] |
| 44 |
| 45 [else] |
| 46 <tr> |
| 47 <td colspan="40" class="id"> |
| 48 <div style="padding: 3em; text-align: center"> |
| 49 This project does not have any members. |
| 50 </div> |
| 51 </td> |
| 52 </tr> |
| 53 [end] |
| 54 |
| 55 |
| 56 </tbody> |
| 57 </table> |
| 58 <div class="list-foot"> |
| 59 <div class="pagination"> |
| 60 [if-any pagination.prev_url]<a href="[pagination.prev_url]"><b>‹</b>
Prev</a>[end] |
| 61 [pagination.start] - [pagination.last] of [pagination.total_count] |
| 62 [if-any pagination.next_url]<a href="[pagination.next_url]">Next <b>›
</b></a>[end] |
| 63 </div> |
| 64 </div> |
| 65 </div> |
| 66 |
| 67 [if-any untrusted_user_groups] |
| 68 <div style="width:45em"> |
| 69 [include "untrusted-user-groups-part.ezt"] |
| 70 </div> |
| 71 [end] |
| 72 |
| 73 [include "people-add-members-form.ezt" "project"] |
| 74 </form> |
| 75 |
| 76 [if-any offer_membership_editing] |
| 77 <script type="text/javascript" nonce="[nonce]"> |
| 78 runOnLoad(function() { |
| 79 $("add_members_button").addEventListener("click", _openAddMembersForm); |
| 80 |
| 81 function _countChecked(opt_className) { |
| 82 var numChecked = 0; |
| 83 var inputs = document.getElementsByTagName('input'); |
| 84 for (var i = 0; i < inputs.length; i++) { |
| 85 var el = inputs[[]i]; |
| 86 if (el.type == 'checkbox' && el.name == 'remove' && el.checked && |
| 87 (!opt_className || opt_className == el.className)) { |
| 88 numChecked++; |
| 89 } |
| 90 } |
| 91 return numChecked; |
| 92 } |
| 93 |
| 94 function _enableRemoveButton() { |
| 95 var removeButton = document.getElementById('removebtn'); |
| 96 if (_countChecked() > 0) { |
| 97 removeButton.disabled = false; |
| 98 } else { |
| 99 removeButton.disabled = true; |
| 100 } |
| 101 } |
| 102 |
| 103 setInterval(_enableRemoveButton, 700); |
| 104 |
| 105 function _preventAbandonment(event) { |
| 106 var meCheckbox = document.getElementById("me_checkbox"); |
| 107 if (meCheckbox && meCheckbox.checked) { |
| 108 numOwnersChecked = _countChecked("owner"); |
| 109 if (numOwnersChecked == [total_num_owners]) { |
| 110 alert("You cannot remove all project owners."); |
| 111 event.preventDefault(); |
| 112 } else { |
| 113 if (!confirm("Remove yourself as project owner?\n" + |
| 114 "You will be locked out of making further changes.")) { |
| 115 event.preventDefault(); |
| 116 } |
| 117 } |
| 118 } |
| 119 return true; |
| 120 } |
| 121 [if-any check_abandonment] |
| 122 $("membership_form").addEventListener("submit", _preventAbandonment); |
| 123 [end] |
| 124 |
| 125 function _handleResultsClick(event) { |
| 126 var target = event.target; |
| 127 if (target.tagName == "A") |
| 128 return; |
| 129 if (target.classList.contains("rowwidgets") || target.parentNode.classList.c
ontains("rowwidgets")) |
| 130 return; |
| 131 if (target.tagName != "TR") target = target.parentNode; |
| 132 _go(target.attributes[[]"data-url"].value, |
| 133 (event.metaKey || event.ctrlKey || event.button == 1)); |
| 134 }; |
| 135 $("resultstable").addEventListener("click", _handleResultsClick); |
| 136 |
| 137 }); |
| 138 </script> |
| 139 [end] |
| 140 |
| 141 |
| 142 [include "../framework/footer-script.ezt"] |
| 143 [include "../framework/master-footer.ezt"] |
OLD | NEW |