blob: 01eb634824bd00e5db4624ad62e05c5d921c1f65 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" href="/css/steve_interactive.css">
<link rel="stylesheet" href="/css/jquery-ui.css">
<script src="/js/steve_rest.js" type="text/javascript"></script>
<script src="/js/jquery.js" type="text/javascript"></script>
<script src="/js/jquery-ui.js" type="text/javascript"></script>
<script type="text/javascript">
var ecount = 0;
function seedInvite(type) {
if (type == "closed") {
document.getElementById('msgtemplate').value = "A private election for \"$title\" has been called\n\nTo vote, please visit: $votelink\nThis is a private vote URL. Do not share it with anyone else, or they will be able to vote for you."
} else {
document.getElementById('msgtemplate').value = "A public election for \"$title\" has been called\n\nTo vote, please register for a vote at: $votelink\nAnyone can register to vote."
}
}
function removeEmail(code, response, state) {
if (code == 200) {
ecount--;
document.getElementById('invitestatus').innerHTML = "<img src=\"/images/steve_spinner.gif\"/><br/><big>" + ecount + " emails left to send...</big>"
if (ecount == 0) {
document.getElementById('invitestatus').innerHTML = "<big>All invites have been sent!</big>"
}
} else {
alert(response.message)
}
}
function sendInvites() {
var emails = document.getElementById('emails').value.split(/\r?\n/)
var msgtype = document.getElementById('msgtype').value;
var msgtemplate = document.getElementById('msgtemplate').value;
var election = document.location.search.substr(1);
ecount = emails.length;
document.getElementById('invitestatus').innerHTML = "<img src=\"/images/steve_spinner.gif\"/><br/><big>Preparing.....</big>"
for (i in emails) {
var email = emails[i]
if (email.length > 4 && email.match(/(.+@.+)/)) {
postREST("/steve/admin/invite/" + election, {
email: email,
msgtype: msgtype,
msgtemplate: msgtemplate
},
undefined,
removeEmail,
null)
} else {
removeEmail(200)
}
}
}
</script>
<title>Apache STeVe: Invite people</title>
<meta name="description" content="Apache STeve is a community voting solution, and in use by the ASF.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Apache STeVe">
</head>
<body onload="seedInvite('closed');">
<p style="text-align: center;">
<img src="/images/steve_logo.png"/>
</p>
<div class="formbox">
<a href="javascript:void(location.href='edit_election.html'+document.location.search);" class="btn">Back to election editing</a>
<fieldset>
<legend>Invite one or more users to this election</legend>
<div class="keyvaluepair">
<div class="keyfield">Invitation type:</div>
<select id="msgtype" onchange="seedInvite(this.value)">
<option value="closed">Closed (private) invite</option>
<option value="open">Open (public) invite</option>
</select>
</div>
<div class="keyvaluepair">
<div class="keyfield">Invitation type:</div>
<textarea id="msgtemplate" style="width: 600px; height: 200px;">
</textarea>
</div>
<div class="keyvaluepair">
<div class="keyfield">Email address(es) to invite<br/>(one per line, use <kbd>email proxypersonname</kbd> for proxy votes):</div>
<textarea id="emails" style="width: 300px; height: 300px;"></textarea>
</div>
<input type="button" value="Send invitation(s)" onclick="sendInvites()"/><br/>
<span id="invitestatus"></span>
</fieldset>
</div>
<p style="font-size: 12px; font-style: italic; text-align: center;">
Powered by <a href="https://steve.apache.org/">Apache STeVe</a>.
Copyright 2016, the Apache Software Foundation.
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>
</p>
</body>
</html>