+
{{template "menu" .}}
-
+
This page does not exist!
- If you came here by a link from this very same website you can tell
- me about it on
twitter .
-
- Either way, there's nothing to see here, so you'll have to
-
head over to the home page .
-
-
- Bye!
+
+ If you came here by a link from this very same website you can
+ tell me about it on
+ twitter .
+
+
+ Either way, there's nothing to see here, so you'll have to
+ head over to the home page .
+
+
+ Bye!
+
{{template "footer"}}
{{template "analytics"}}
diff --git a/res/template/500.html b/res/template/500.html
index 65192fd..9374acb 100644
--- a/res/template/500.html
+++ b/res/template/500.html
@@ -1,7 +1,7 @@
{{define "500"}}
- {{template "meta_tags" "Internal Server Error"}}
+ {{template "meta_tags" "500, Internal Server Error"}}
{{template "user_style" .}}
@@ -10,15 +10,15 @@
{{template "menu" .}}
You broke pixeldrain
- Great job.
-
- 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
home page and
- start over.
-
-
- Bye!
+
+ Great job.
+
+
+ Just kidding, something went wrong on the pixeldrain server and
+ it's my fault. I'll soon be notified of the problem and will
+ take a look at it. You can try again in a few minutes (or
+ hours), or go back to the home page and start over.
+
{{template "footer"}}
{{template "analytics"}}
diff --git a/res/template/file_not_found.html b/res/template/file_not_found.html
index 7153cc2..7c5e3fb 100644
--- a/res/template/file_not_found.html
+++ b/res/template/file_not_found.html
@@ -1,19 +1,61 @@
{{define "file_not_found"}}
- {{template "meta_tags" "File Not Found"}}
+ {{template "meta_tags" "404, File Not Found"}}
{{template "user_style" .}}
+
-
- {{template "menu"}}
-
File not Found
- I'm sorry, but this file does not exist!
- It may have expired, or taken down by the owner.
- You can
Visit the homepage to upload your own files .
-
- It was fun having you, bye for now!
+
+ {{template "menu" .}}
+
404, File Not Found!
+
+ This file does not exist, or it has been removed. Possible
+ reasons for this are:
+
+
+ The file has not been viewed for 100 days and has expired
+ Something went wrong on the pixeldrain servers causing the file to be temporarily unavailable
+ The file voilated copyright laws and has received a takedown request
+ The content was deemed illegal in some country and censorship was requested by a government organisation
+
+
+ I'm sorry for the inconvenience.
+
+
+ {{template "footer"}}
+
+ {{template "analytics"}}
+
+
+{{end}}
+{{define "list_not_found"}}
+
+
+ {{template "meta_tags" "404, List Not Found"}}
+ {{template "user_style" .}}
+
+
+
+
+ {{template "menu" .}}
+
+
404, List Not Found!
+
+ This list does not exist, or it has been removed. Possible
+ reasons for this are:
+
+
+ All files in this list have not been viewed for 100 days and have expired
+ Something went wrong on the pixeldrain servers causing the list to be temporarily unavailable
+ The files in the list voilated copyright laws and have received a takedown request
+ The files in the list were deemed illegal in some country and censorship was requested by a government organisation
+
+
+ I'm sorry for the inconvenience.
+
+
{{template "footer"}}
{{template "analytics"}}
diff --git a/res/template/file_viewer.html b/res/template/file_viewer.html
index 174aab8..85aa1a7 100644
--- a/res/template/file_viewer.html
+++ b/res/template/file_viewer.html
@@ -52,7 +52,7 @@
- Copy
+ C opy Link
@@ -60,7 +60,7 @@
- Details
+ Detai ls
{{template "advertisement" .}}
diff --git a/res/template/home.html b/res/template/home.html
index 0f03255..bc49e48 100644
--- a/res/template/home.html
+++ b/res/template/home.html
@@ -92,6 +92,7 @@
your address bar. If you don't have Brave browser yet you
can download it here:
Install Brave .
+
Install Brave .
Installing and using Brave with this referral link also
counts as a 5$ donation.
diff --git a/webcontroller/file_viewer.go b/webcontroller/file_viewer.go
index 0de4518..af87767 100644
--- a/webcontroller/file_viewer.go
+++ b/webcontroller/file_viewer.go
@@ -42,12 +42,14 @@ func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request,
finfo = append(finfo, inf)
}
+ templateData := wc.newTemplateData(w, r)
+
if len(finfo) == 0 {
- wc.serveNotFound(w, r)
+ w.WriteHeader(http.StatusNotFound)
+ wc.templates.Get().ExecuteTemplate(w, "file_not_found", templateData)
return
}
- templateData := wc.newTemplateData(w, r)
templateData.OGData = metadataFromFile(*finfo[0])
var err error
if list {
@@ -58,7 +60,7 @@ func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request,
APIResponse: map[string]interface{}{
"data": finfo,
"date_created": "now",
- "title": "Concatenation of files",
+ "title": "Multiple files",
"date_lastview": "now",
"views": 0,
},
diff --git a/webcontroller/list_viewer.go b/webcontroller/list_viewer.go
index 9cd8d10..4e9697a 100644
--- a/webcontroller/list_viewer.go
+++ b/webcontroller/list_viewer.go
@@ -14,15 +14,17 @@ import (
func (wc *WebController) serveListViewer(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
var api = pixelapi.New(wc.conf.APIURLInternal, "")
var list, err = api.GetList(p.ByName("id"))
+ var templateData = wc.newTemplateData(w, r)
if err != nil {
if err, ok := err.(pixelapi.Error); ok && err.ReqError {
log.Error("API request error occurred: %s", err.Value)
+
}
- wc.serveNotFound(w, r)
+ w.WriteHeader(http.StatusNotFound)
+ wc.templates.Get().ExecuteTemplate(w, "list_not_found", templateData)
return
}
- var templateData = wc.newTemplateData(w, r)
templateData.Title = fmt.Sprintf("%s ~ Pixeldrain list", list.Title)
templateData.OGData = metadataFromList(*list)
templateData.Other = viewerData{