Commit accce8a6 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add links to approve/reject pending project members (subject to

permission of the user viewing the page).
parent 5a74914d
......@@ -161,8 +161,9 @@ function (_, sup, moment, mainString,
var template = _.template(memberString);
$('#members_content')
.html(template({"members" : json.value,
"pid" : window.TARGET_PROJECT}));
.html(template({"members" : json.value,
"pid" : window.TARGET_PROJECT,
"canapprove" : window.CANAPPROVE}));
// Format dates with moment before display.
$('#members_table .format-date').each(function() {
......
......@@ -50,12 +50,14 @@ if (!ISADMIN() &&
return;
}
$emulablink = "$TBBASE/showproject.php3?project=" . $project->pid();
$canapprove = $project->AccessCheck($this_user, $TB_PROJECT_ADDUSER) ? 1 : 0;
echo "<link rel='stylesheet'
href='css/tablesorter.css'>\n";
echo "<script type='text/javascript'>\n";
echo " window.ISADMIN = $isadmin;\n";
echo " window.CANAPPROVE = $canapprove;\n";
echo " window.EMULAB_LINK = '$emulablink';\n";
echo " window.TARGET_PROJECT = '" . $project->pid() . "';\n";
echo "</script>\n";
......
......@@ -18,6 +18,12 @@
<span class="format-date
<% if (!value.approved) { %>text-danger<% } %>">
<%- value.joined %></span>
<% if (!value.approved && canapprove) { %>
<span>
(<a href='approveuser.php?action=approve&pid=<%= pid %>&uid=<%= uid %>'>Approve</a> or
<a href='approveuser.php?action=approve&pid=<%= pid %>&uid=<%= uid %>'>Reject</a>)
</span>
<% } %>
</td>
</tr>
<% }); %>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment