Just a whole bunch of fixing

This commit is contained in:
2018-07-09 21:41:17 +02:00
parent 5633460b97
commit 9c7b79403e
25 changed files with 208 additions and 320 deletions

25
res/template/404.html Normal file
View File

@@ -0,0 +1,25 @@
{{define "404"}}<!DOCTYPE html>
<html>
<head>
{{template "meta_tags" "Not Found"}}
</head>
<body>
<div id='body' class="body">
{{template "menu" .}}
<br/>
<h1>This page does not exist!</h1>
If you came here by a link from this very same website you can tell
me about it on <a href="https://twitter.com/Fornax96">twitter</a>.
<br/><br/>
Either way, there's nothing to see here, so you'll have to
<a href='/'>head over to the home page</a>.
<br/>
<br/>
Bye!
{{template "footer"}}
</div>
{{template "analytics"}}
</body>
</html>
{{end}}

26
res/template/500.html Normal file
View File

@@ -0,0 +1,26 @@
{{define "500"}}<!DOCTYPE html>
<html>
<head>
{{template "meta_tags" "Internal Server Error"}}
</head>
<body>
<div id='body' class="body">
{{template "menu" .}}
<br/>
<h1>You broke pixeldrain</h1>
Great job.
<br/><br/>
But not to worry, the engineering team has been pulled out of bed to
have a look at the issue. You can try again in a few minutes (maybe
hours, who knows?), or go back to the <a href='/'>home page</a> and
start over.
<br/>
<br/>
Bye!
{{template "footer"}}
</div>
{{template "analytics"}}
</body>
</html>
{{end}}

View File

@@ -0,0 +1,24 @@
{{define "file_manager"}}<!DOCTYPE html>
<html>
<head>
{{template "meta_tags" "File Manager"}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>
<body>
{{template "menu" .}}
<br/>
{{range .Other.Files}}
<a class="file_button" href="/u/{{.ID}}" target="_blank">
<img src="{{$.APIEndpoint}}/file/{{.ID}}/thumbnail" alt="{{.FileName}}" />
<span style="color: var(--highlight_color);">{{.FileName}}</span>
<br/>
{{.DateUpload}}
</a>
{{end}}
{{template "analytics"}}
</body>
</html>
{{end}}

View File

@@ -12,16 +12,16 @@
<h1>Log in to your PixelDrain account</h1>
<div id="submit_result"></div>
<form onSubmit="return submitForm();" class="highlight_dark border_top border_bottom">
<table style="margin-left: auto; margin-right: auto;">
<tr>
<table class="form">
<tr class="form">
<td>Username</td>
<td><input id="username" name="username" type="text" autocomplete="username" value=""/></td>
</tr>
<tr>
<tr class="form">
<td>Password</td>
<td><input id="password" name="password" type="password" autocomplete="current-password"/></td>
</tr>
<tr>
<tr class="form">
<td colspan=2 style="text-align: right;"><input type="submit" value="Login" class="button_highlight"/></td>
</tr>
</table>

View File

@@ -14,36 +14,36 @@
<div id="submit_result"></div>
<form onSubmit="return submitForm();" class="highlight_dark border_top border_bottom">
<table style="margin-left: auto; margin-right: auto; text-align: left; max-width: 30em;">
<tr>
<tr class="form">
<td>Username</td>
<td><input id="register_username" type="text" autocomplete="username" class="form_input"/></td>
</tr>
<tr><td colspan="2">used for logging into your account<br/><hr/></td></tr>
<tr>
<tr class="form"><td colspan="2">used for logging into your account<br/><hr/></td></tr>
<tr class="form">
<td>E-mail address</td>
<td><input id="register_email" type="text" autocomplete="email" class="form_input"/></td>
</tr>
<tr><td colspan="2">
<tr class="form"><td colspan="2">
not required. your e-mail address will only be used for
password resets and important account notifications<br/>
<hr/>
</td></tr>
<tr>
<tr class="form">
<td>Password</td>
<td><input id="register_password1" type="password" autocomplete="new-password" class="form_input"/></td>
</tr>
<tr>
<tr class="form">
<td>Password verification</td>
<td><input id="register_password2" type="password" autocomplete="new-password" class="form_input"/></td>
</tr>
<tr>
<tr class="form">
<td colspan="2">
you need to enter your password twice so we can
verify that you have not made any typing errors<br/>
<hr/>
</td>
</tr>
<tr>
<tr class="form">
<td>
Turing test<br/>
(Click the white box)
@@ -52,14 +52,18 @@
<div class="g-recaptcha" data-theme="dark" data-sitekey="6LdEeQ0TAAAAALBmDF_k_2LgbpuJM66PGspByViS"></div>
</td>
</tr>
<tr>
<tr class="form">
<td colspan="2">
the reCaptcha turing test verifies that you are not
an evil robot that is trying to flood the website
with fake accounts<br/><hr/>
</td>
</tr>
<tr><td colspan="2" style="text-align: right;"><input type="submit" value="Register" class="button_highlight"/></td></tr>
<tr class="form">
<td colspan="2" style="text-align: right;">
<input type="submit" value="Register" class="button_highlight"/>
</td>
</tr>
</table>
</form>
<br/>

View File

@@ -1,7 +1,7 @@
{{define "file_manager"}}<!DOCTYPE html>
{{define "user_files"}}<!DOCTYPE html>
<html>
<head>
{{template "meta_tags" "File Manager"}}
{{template "meta_tags" "Files"}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>
@@ -14,7 +14,8 @@
</div>
<br/>
{{range .Other.Files}}
{{$files := .PixelAPI.UserFiles 0 1000}}
{{range $files.Files}}
<a class="file_button" href="/u/{{.ID}}" target="_blank">
<img src="{{$.APIEndpoint}}/file/{{.ID}}/thumbnail" alt="{{.FileName}}" />
<span style="color: var(--highlight_color);">{{.FileName}}</span>

View File

@@ -12,7 +12,8 @@
<hr/>
<h2>Your most recently uploaded files:</h2>
<div class="highlight_dark border_top border_bottom">
{{range .Other.Files}}
{{$files := .PixelAPI.UserFiles 0 18}}
{{range $files.Files}}
<a class="file_button" href="/u/{{.ID}}" target="_blank">
<img src="{{$.APIEndpoint}}/file/{{.ID}}/thumbnail" alt="{{.FileName}}" />
<span style="color: var(--highlight_color);">{{.FileName}}</span>
@@ -21,7 +22,7 @@
</a>
{{end}}
<br/>
<a href="/files">...All my files</a>
<a href="/user/files">...All my files</a>
</div>
<hr/>

View File

@@ -2,7 +2,30 @@
<html>
<head>
{{template "meta_tags" "API Documentation"}}
<link rel="stylesheet" href="/res/style/apidoc.css"/>
<style>
.api_doc_details{
border-top: 1px solid;
border-bottom: 1px solid;
margin: 15px -8px 15px -8px;
}
.api_doc_details > summary {
padding: 2px;
font-family: monospace;
}
.api_doc_details > summary > .method {
display: inline-block;
width: 80px;
}
.api_doc_details > div {
padding: 8px;
}
.api_doc_details.request_get{ border-color: #3636ff; background-color: rgba(32, 32, 255, 0.2);} /* GET requests */
.api_doc_details.request_post{ border-color: #00d000; background-color: rgba(0, 255, 0, 0.05);} /* POST requests */
.api_doc_details.request_delete{border-color: #B00000; background-color: rgba(255, 0, 0, 0.05);} /* DELETE requests */
.api_doc_details.request_put{ border-color: #B06000; background-color: rgba(255, 128, 0, 0.05);} /* PUT requests */
.api_doc_details.request_patch{ border-color: #6000B0; background-color: rgba(128, 0, 255, 0.1);} /* PATCH requests */
</style>
</head>
<body>

View File

@@ -1,23 +0,0 @@
{{define "error"}}<!DOCTYPE html>
<html>
<head>
{{template "meta_tags" "Error"}}
</head>
<body>
<div id='body' class="body">
{{template "menu" .}}
<br/>
<h1>Some Error occurred</h1>
Either you made a mistake, or I made a mistake.
<br/><br/>
Either way, there's nothing to see here, so you'll have to <a href='/'>head over to the home page</a>.
<br/>
<br/>
Bye!
{{template "footer"}}
</div>
{{template "analytics"}}
</body>
</html>
{{end}}

View File

@@ -1,7 +1,7 @@
{{define "menu"}}
<div id="navigation" class="highlight_light border_top border_bottom navigation">
<a href="/">Home</a>
<a href="{{if .Authenticated}}/files{{else}}/history{{end}}">My&nbsp;Files</a>
<a href="{{if .Authenticated}}/user/files{{else}}/history{{end}}">My&nbsp;Files</a>
<a href="/api">API</a>
{{if .Authenticated}}<a href="/user">{{.Username}}</a>
<a href="/logout" style="vertical-align: 0.6em; font-size: 0.9em; padding: 1px;">(Log out)</a>{{else}}

View File

@@ -2,28 +2,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Paste ~ PixelDrain</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/global.css"/>
{{template "meta_tags" "Text Upload"}}
<link rel="stylesheet" href="/res/style/viewer.css"/>
<link rel="stylesheet" href="/res/style/layout.css"/>
<link rel="stylesheet" href="/res/style/paste.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="res/img/pixeldrain_big.png"/>
<script src="/res/script/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<meta property="og:type" content="website" />
<meta property="og:title" content="Paste ~ PixelDrain" />
<meta property="og:site_name" content="PixelDrain" />
<meta property="og:description" content="Upload text to PixelDrain" />
<meta property="article:author" content="Fornax96" />
<style>
.textarea{
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
border: none !important;
background: #202020;
}
</style>
</head>
<body>
@@ -45,8 +37,8 @@
</button>
</form>
<iframe id='sponsors' data-aa='73974'
src='//ad.a-ads.com/73974?size=120x600&amp;background_color=000000&amp;text_color=eeeeee&amp;title_color=eeeeee&amp;link_color=9fcf6c&amp;link_hover_color=d2ffa1&amp;title_hover_color=d2ffa1'
scrolling='no' allowtransparency='true' seamless="seamless">
src='//ad.a-ads.com/73974?size=120x600&amp;background_color=000000&amp;text_color=eeeeee&amp;title_color=eeeeee&amp;link_color=9fcf6c&amp;link_hover_color=d2ffa1&amp;title_hover_color=d2ffa1'
scrolling='no' allowtransparency='true' seamless="seamless">
</iframe>
</div>
@@ -57,4 +49,4 @@
{{template "analytics"}}
</body>
</html>
{{end}}
{{end}}