learn-request-queue/views/main.eta

118 lines
4.7 KiB
Plaintext
Raw Normal View History

2020-06-24 21:34:53 +00:00
<!DOCTYPE html>
<html>
<head>
<link rel=stylesheet href=/style.css />
<link rel=stylesheet href=/colors.css />
<title><%= it.pageTitle.replace('{username}',it.streamerName) %></title>
2020-11-01 20:07:16 +00:00
<script>
window.loggedIn = <%= it.loggedIn %>;
window.validStates = <%~ it.validStates %>;
window.isStreamer = <%= it.isStreamer %>;
</script>
2020-07-04 06:22:28 +00:00
<script src="main.js" defer></script>
2020-06-24 21:34:53 +00:00
</head>
<body>
2020-09-13 18:12:52 +00:00
<div id="navbar">
<div id="nav-streamerpic"><a href="https://twitch.tv/<%= it.streamerName %>"><img src="<%= it.streamerProfilePicture %>" /></a></div>
<div id="nav-title"><%~ it.pageTitle.replace('{username}',`<a href="https://twitch.tv/${it.streamerName}">${it.streamerName}</a>`) %></div>
2020-07-05 00:51:24 +00:00
<div id="nav-requests"><a href="/">Requests</a></div>
2020-08-08 04:32:06 +00:00
<%- if (it.loggedIn) { -%>
2020-07-05 22:20:22 +00:00
<div id="nav-addrequest"><a href="#" onclick="openAddRequestModal()">Add Request</a></div>
<div id="nav-userpic"><img src="<%= it.userProfilePicture %>" /></div>
<div id="nav-username"><%= it.userName %></div>
<div id="nav-logout"><a href="/logout">Logout</a></div>
<%- } else { // Not logged in -%>
<div id="nav-login"><a href="https://id.twitch.tv/oauth2/authorize?client_id=<%=it.clientId%>&redirect_uri=<%=it.urlPrefix%>/callback&response_type=code">Login</a></div>
<%- } %>
2020-07-05 00:51:24 +00:00
</div>
<div id="main">
<div id="requests"></div><br>
Count:
<select id="count" value="10" onchange="updateTable()">
<option>5</option>
<option selected="selected">10</option>
<option>25</option>
<option>50</option>
<option>100</option>
</select>
<input type="checkbox" id="allRequests" onchange="updateTable()">View requests in any state</input>
</div>
2020-11-01 20:07:16 +00:00
<div id="modalBackground">
<div class="modal" id="messageModal">
<div class="modalClose"><a href="#" onclick="closeMessageModal()">&times;</a></div>
<span id="messageModalText"></span>
</div>
<div class="modal" id="addRequestModal">
<div class="modalClose"><a href="#" onclick="closeAddRequestModal()">&times;</a></div>
2020-07-05 22:20:22 +00:00
<h1>Add Request</h1>
<div class="error" id="addRequestError"></div>
2020-07-06 03:16:41 +00:00
<span id="addRequestInputContainer">
URL: <input id="addRequestUrl" placeholder="https://www.youtube.com/watch?v=dQw4w9WgXcQ"></input>
<button onclick="validateAndSubmitRequest()">Request</button><br>
</span>
2020-07-05 22:20:22 +00:00
Currently, only Youtube links are accepted.
</div>
2020-11-01 20:07:16 +00:00
<div class="modal" id="updateRequestModal">
<div class="modalClose"><a href="#" onclick="closeAddRequestModal()">&times;</a></div>
<h2>Update Request</h2>
<div class="error" id="updateRequestError"></div>
<br>
<a id="updateRequestUrl"></a>
<br>
Current Score: <span id="updateRequestModalCurrentScore"></span>
<hr>
<div>
State:
<select id="updateRequestStateSelect" onchange="updateRequestState(
document.getElementById('updateRequestUrl').innerText,
this.value)">Submit</button>
)"></select>
</div>
<br>
<div>
Modify Score:
<input type="number" id="scoreModifierInput"></input>
<button onclick="updateRequestScoreModifier(
document.getElementById('updateRequestUrl').innerText,
document.getElementById('scoreModifierInput').value)">Submit</button>
<br>
<span id="scoreModifierHelp" class="helptext">
2020-11-01 20:07:16 +00:00
Enter a number to add to (or negative to subtract from) the score of
a request. Use this for things like donations and channel points
redemptions.
</span>
</div>
<br>
<div>
<a id="updateMetadataLink" href="#" onclick="updateRequestMetadata(
document.getElementById('updateRequestUrl').innerText
)">Update Request Metadata</a>
<br>
<span id="updateMetadataHelp" class="helptext">
Use this to update metadata about a request (i.e. title) if it
is missing (shows URL instead of name) or is outdated.
</span>
</div>
<br>
2020-11-01 20:07:16 +00:00
<div>
<a id="deleteRequestLink" href="#" onclick="openDeleteRequestModal(
document.getElementById('updateRequestUrl').innerText
)">Delete Request</a>
</div>
</div>
<div class="modal" id="deleteRequestModal">
<div class="modalClose"><a href="#" onclick="closeDeleteRequestModal()">&times;</a></div>
<h2>Delete Request</h2>
<span style="color: #f00">WARNING:</span>
Deleting a request will remove the request and all votes for it from the
database. This action is irreversible. It will NOT prevent the request
from being made again - use the Rejected state for that. Are you sure
you want to delete this request?
<br><br>
<button onclick="closeDeleteRequestModal()">No</button>
<button onclick="deleteRequest(document.getElementById('updateRequestUrl').innerText)">Yes</button>
</div>
2020-07-05 22:20:22 +00:00
</div>
2020-06-24 21:34:53 +00:00
</body>
</html>