diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2019-03-15 18:45:47 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2019-03-15 18:45:47 +0100 |
commit | c57494ae405ffbdd8ec45f74ef04ea85895f1bf7 (patch) | |
tree | a0b888069205b7d8260c1862d300032a56b6fd30 /pastepy/templates | |
parent | c5ebdf4428d9d9aab04cf6085a231ed6ea5bf0ab (diff) |
Port application to flask
Diffstat (limited to 'pastepy/templates')
-rw-r--r-- | pastepy/templates/base.html | 20 | ||||
-rw-r--r-- | pastepy/templates/full.html | 18 | ||||
-rw-r--r-- | pastepy/templates/paste.html | 34 | ||||
-rw-r--r-- | pastepy/templates/view.html | 28 |
4 files changed, 100 insertions, 0 deletions
diff --git a/pastepy/templates/base.html b/pastepy/templates/base.html new file mode 100644 index 0000000..e208b6b --- /dev/null +++ b/pastepy/templates/base.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <title>{{ config.PASTEBIN_NAME }}{% if title %} – {{ title }}{% endif %}</title> + <link rel="StyleSheet" href="{{ url_for('static', filename='paste.css') }}" type="text/css"> +{% block head %} +{% endblock %} + </head> + <body> + <div id="page"> + <div id="page-header"> + <h1><a href="/">{{ title }}</a></h1> + </div> + <div id="page-content"> +{% block content %} +{% endblock %} + </div> + </div> + </body> +</html> diff --git a/pastepy/templates/full.html b/pastepy/templates/full.html new file mode 100644 index 0000000..c60126e --- /dev/null +++ b/pastepy/templates/full.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <title>{{ title }}</title> + <link rel="StyleSheet" href="{{ url_for('.highlight_stylesheet') }}" type="text/css"> + <link rel="StyleSheet" href="{{ url_for('static', filename='paste.css') }}" type="text/css"> + <script type="text/javascript" src="{{ url_for('static', filename='view.js') }}"></script> +</head> +<body> +{% if rendered %} +<div class="paste-rendered"> +{% endif %} +{{ text|safe }} +{% if rendered %} +</div> +{% endif %} +</body> +</html> diff --git a/pastepy/templates/paste.html b/pastepy/templates/paste.html new file mode 100644 index 0000000..9a22e76 --- /dev/null +++ b/pastepy/templates/paste.html @@ -0,0 +1,34 @@ +{% extends "base.html" %} +{% block head %} + <script src="{{ url_for('static', filename='edit.js') }}" type="text/javascript"></script> +{% endblock %} +{% block content %} + <form action="/paste" method="post" id="pasteform"> + <ul> + <li id="syntaxli"> + <select name="syntax" id="syntax"> + {% for cat, ls in config.LEXERS %} + <optgroup label="{{ cat }}"> + {% for k, v in ls %} + <option value="{{ v }}"{% if v == (session.syntax or config.DEFAULT_SYNTAX) %} selected="selected"{% endif %}>{{ k }}</option> + {% endfor %} + </optgroup> + {% endfor %} + </select> + <input type="checkbox" name="remember_syntax" id="remember_syntax"{% if session.syntax %} checked{% endif %}> + <label for="remember_syntax">Remember syntax</label> + </li> + <li> + <input type="text" name="nick" id="nick" value="{{ session.nick }}"> + <input type="checkbox" name="remember_me" id="remember_me"{% if session.nick %} checked{% endif %}> + <label for="remember_me">Remember me</label> + </li> + <li><input type="text" name="title" id="title" value="Untitled"></li> + <li><textarea rows="15" cols="80" name="text" id="text"></textarea></li> + <li> + <input type="submit" id="pastesubmit" name="type" value="Paste"> + <input type="submit" id="pastesubmit2" name="type" value="Preview"> + </li> + </ul> + </form> +{% endblock %} diff --git a/pastepy/templates/view.html b/pastepy/templates/view.html new file mode 100644 index 0000000..b0b114c --- /dev/null +++ b/pastepy/templates/view.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} +{% block head %} + <link rel="StyleSheet" href="{{ url_for('.highlight_stylesheet') }}" type="text/css"> + <script type="text/javascript" src="{{ url_for('static', filename='view.js') }}"></script> +{% endblock %} +{% block content %} + <p><a href="/">New paste</a></p> + <div id="paste"> + <h3>{{ pastetitle }}</h3> + <div id="info">Pasted by <span id="nick">{{ nick }}</span> on <span id="date">{{date }}</span> + {% if syntax %} as <span id="syntax-type">{{ syntax }}</span>{% endif %} + </div> + <div id="alt-links"> + {% if hash %} + <a href="/raw/{{ hash }}">Download as plain text</a> + — + <a href="/full/{{ hash }}">View in fullscreen</a> + {% endif %} + </div> + {% if rendered %} + <div class="paste-rendered"> + {% endif %} + {{ text|safe }} + {% if rendered %} + </div> + {% endif %} + </div> +{% endblock %} |