fileshare/include/templates.h

107 lines
3.2 KiB
C

/*
* vim: sw=2 ts=2 expandtab
*
* "THE PIZZA-WARE LICENSE" (derived from "THE BEER-WARE LICENCE"):
* Thomas Kolb <cfr34k@tkolb.de> wrote this file. As long as you retain this
* notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a pizza in return.
* - Thomas Kolb
*/
#ifndef TEMPLATES_H
#define TEMPLATES_H
// generic definitions
#define HEADER1 \
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"" \
" \"http://www.w3.org/TR/html4/strict.dtd\">" \
"<html>" \
" <head>"
#define HEADER2 \
" <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" >" \
" <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.png\">" \
" </head>" \
" <body>"
#define FOOTER \
" <p><small>Generated by fileshare " VERSION ".</small></p>" \
" </body>" \
"</html>"
// error page definitions
#define ERROR_404 \
HEADER1 \
" <title>Error 404*i - File is imaginary</title>" \
HEADER2 \
" <h1>Error 404*i - File is imaginary</h1>" \
" <p>This page cannot be displayed because it is imaginary.<p>" \
" <p>To view this page in the real world, turn your screen by <sup>&pi;</sup>/<sub>2</sub> .</p>" \
" <pre>" \
" ^ Im\n" \
" |\n" \
" | +j\n" \
" __--+--__\n" \
" _- | -_\n" \
" / X \\\n" \
" | | |\n" \
"----+-------+-------+-----> Re\n" \
" -1 | | +1 |\n" \
" \\ | /\n" \
" --__ | __--\n" \
" --+-- \n" \
" | -j\n" \
" |\n" \
" </pre>" \
FOOTER
#define ERROR_500 \
HEADER1 \
" <title>Error 500 - Internal Server Error</title>" \
HEADER2 \
" <h1>Error 500 - Internal Server Error</h1>" \
" <pre>" \
" _______________________________________ \n" \
"/ Oops. Something went wrong. \\\n" \
"| Please contact the administrator and |\n" \
"\\ tell him how to reproduce this error. /\n" \
" --------------------------------------- \n" \
" \\ \\_______\n" \
" v__v \\ \\ O )\n" \
" (oo) ||----w |\n" \
" (__) || || \\/\\\n" \
" </pre>" \
FOOTER
#define ERROR_403 \
HEADER1 \
" <title>Error 403 - Forbidden</title>" \
HEADER2 \
" <h1>Error 403 - Forbidden</h1>" \
" <p>You are not allowed to access this file or directory.<p>" \
" <p>This error is shown under the following conditions:<p>" \
" <ul>" \
" <li>You are trying to access a file that the server isn't allowed to read</li>" \
" <li>The target filesystem entry is not a regular file or directory</li>" \
" <li>The URL contains \"/..\", which is blocked for security reasons</li>" \
" <li>You are trying to upload a file, and uploads are not enabled for this server</li>" \
" </ul>" \
FOOTER
#define UPLOAD_FORM \
HEADER1 \
" <title>Upload</title>" \
HEADER2 \
" <h1>Upload</h1>" \
" <p>You can upload a file to the current directory here.<p>" \
" <p>" \
" <form method=\"POST\" action=\".\" enctype=\"multipart/form-data\">" \
" <input name=\"data\" type=\"file\" size=\"30\">" \
" <input type=\"submit\" value=\"Go!\">" \
" </form>" \
" </p>" \
FOOTER
#endif // TEMPLATES_H