This repository has been archived on 2023-05-12. You can view files and clone it, but cannot push or open issues or pull requests.
media-host/views/pages/upload.ejs
2023-05-12 00:32:13 -04:00

102 lines
4.3 KiB
Text

<!DOCTYPE html>
<html>
<head>
<title>upload - <%- config["meta"]["name"] %></title>
<link href="/css/upload.css" rel="stylesheet">
<% if (config["captcha"]) { %>
<% if (config["captcha"]["enabled"] == true && config["captcha"]["show-at-anon-upload"] == true && typeof account == "object" && account !== null) { %>
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
<% } %>
<% } %>
<meta property="og:site_name" content="<%= config.meta.name %>">
<meta name="title" content="Upload">
<meta property="og:title" content="Upload">
<meta property="twitter:title" content="Upload">
<meta property="og:type" content="website">
<%- include("../partial/html-head")%>
</head>
<body>
<%- include("../partial/header") %>
<div class="modal">
<% if (config.alert) { %>
<div class="err"><p><%-config.alert%></p></div>
<% } %>
<h2 class="nm">Upload</h2>
<p class="nm">The maximum file size is <%= maxsize %>.</p>
<% if (
config["sharex-support"] &&
(config["captcha"]["enabled"] !== true || config["captcha"]["show-at-anon-upload"] !== true) && account == null ||
typeof account == "object"
) { %>
<p class="nm">You can now upload to <%= config.meta.name %> with <a href="https://getsharex.com/">ShareX</a> using this <a href="/sharex">custom upload file</a>.</p>
<% } %>
<% if (typeof err == "string") { %>
<div class="err">
<p><%= err %></p>
</div>
<% } %><br>
<noscript>
<% if (config["captcha"]) { %>
<% if (config["captcha"]["enabled"] == true && config["captcha"]["show-at-anon-upload"] == true && account == null) { %>
<p><i>This instance requires Javascript in order to validate your request, due to a CAPTCHA requirement.</i></p>
<% } else { %>
<form action="/upload" enctype="multipart/form-data" method="post">
<input name="file" type="file" value="Upload file" class="upload"><br><br>
<div class="field">
<label for="privacy">Upload Privacy:</label>
<select name="privacy">
<option value="0">Unlisted</option>
<option value="1">Public (shown on profile)</option>
</select>
</div>
<input type="submit" value="Upload" class="sub">
</form>
<% } %>
<% } else { %>
<form action="/upload" enctype="multipart/form-data" method="post">
<input name="file" type="file" value="Upload file" class="upload">
<div class="field">
<label for="privacy">Upload Privacy:</label>
<select name="privacy">
<option value="0">Unlisted</option>
<option value="1">Public (shown on profile)</option>
</select>
</div>
<input type="submit" value="Upload" class="sub">
</form>
<% } %>
</noscript>
<div class="require-script">
<div>
<input name="file" type="file" id="jsFileUpload" disabled><br><br>
<label for="privacy">Upload Privacy:</label>
<select name="privacy" id="privacy">
<option value="0">Unlisted</option>
<option value="1">Public (shown on profile)</option>
</select><br><br>
<% if (config["captcha"]) { %>
<% if (config["captcha"]["enabled"] == true && config["captcha"]["show-at-anon-upload"] == true && account == null) { %>
<script src="https://js.hcaptcha.com/1/api.js?recaptchacompat=off" async defer></script>
<div class="hc-container" id="cpt" data-sitekey="<%= config['captcha']['sitekey'] %>" data-callback="sendCaptcha"></div>
<% } %>
<% } %>
<button id="up" onclick="upload();">Upload</button><br>
<p><i>By clicking "Upload", you agree to the <a href="/terms">Terms of Service</a>.</i></p>
<div id="progress" style="display:none;">
<div class="prgbar" id="prgBar">
<div class="inner" id="prgUpload"></div>
</div><br>
<p id="prgTxt" class="nm"></p>
</div>
</div>
</div>
</div>
<%- include("../partial/footer") %>
<script src="/js/upload.js"></script>
</body>
</html>