From a7b85ecc11c2c2404f858e7aeecb6e751f6f0b78 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 20 Jun 2019 02:35:04 +0200 Subject: [PATCH] Create wikiedit royalprint --- royalnet/royalgamesweb.py | 4 +- royalnet/web/royalprints/__init__.py | 3 +- royalnet/web/royalprints/wikiedit/__init__.py | 21 +++ .../wikiedit/templates/wikiedit_page.html | 154 ++++++++++++++++++ .../wikiview/templates/wikiview_page.html | 12 +- royalnet/web/static/ryg.css | 35 ++++ royalnet/web/static/ryg.css.map | 2 +- royalnet/web/static/ryg.less | 42 ++++- royalnet/web/templates/base.html | 1 + 9 files changed, 267 insertions(+), 7 deletions(-) create mode 100644 royalnet/web/royalprints/wikiedit/__init__.py create mode 100644 royalnet/web/royalprints/wikiedit/templates/wikiedit_page.html diff --git a/royalnet/royalgamesweb.py b/royalnet/royalgamesweb.py index ac823de8..7e912ff8 100644 --- a/royalnet/royalgamesweb.py +++ b/royalnet/royalgamesweb.py @@ -1,6 +1,6 @@ import os from .web import create_app -from .web.royalprints import rp_home, rp_wikiview, rp_tglogin, rp_docs +from .web.royalprints import * class TestConfig: @@ -8,7 +8,7 @@ class TestConfig: TG_AK = os.environ["TG_AK"] -app = create_app(TestConfig, [rp_home, rp_wikiview, rp_tglogin, rp_docs]) +app = create_app(TestConfig, [rp_home, rp_wikiview, rp_tglogin, rp_docs, rp_wikiedit]) if __name__ == "__main__": diff --git a/royalnet/web/royalprints/__init__.py b/royalnet/web/royalprints/__init__.py index ba7a5706..5a4c8d0d 100644 --- a/royalnet/web/royalprints/__init__.py +++ b/royalnet/web/royalprints/__init__.py @@ -4,5 +4,6 @@ from .home import rp as rp_home from .wikiview import rp as rp_wikiview from .tglogin import rp as rp_tglogin from .docs import rp as rp_docs +from .wikiedit import rp as rp_wikiedit -__all__ = ["rp_home", "rp_wikiview", "rp_tglogin", "rp_docs"] +__all__ = ["rp_home", "rp_wikiview", "rp_tglogin", "rp_docs", "rp_wikiedit"] diff --git a/royalnet/web/royalprints/wikiedit/__init__.py b/royalnet/web/royalprints/wikiedit/__init__.py new file mode 100644 index 00000000..9bde90c7 --- /dev/null +++ b/royalnet/web/royalprints/wikiedit/__init__.py @@ -0,0 +1,21 @@ +"""A Royal Games Wiki viewer :py:class:`royalnet.web.Royalprint`. Doesn't support any kind of edit.""" +import flask as f +import uuid +import os +from ... import Royalprint +from ....database.tables import Royal, WikiPage, WikiRevision + + +tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates') +rp = Royalprint("wikiedit", __name__, url_prefix="/wikiedit", template_folder=tmpl_dir, + required_tables={Royal, WikiPage, WikiRevision}) + + +@rp.route("/", defaults={"title": ""}) +@rp.route("//") +def wikiedit_by_id(page_id: uuid.UUID, title: str): + alchemy, alchemy_session = f.current_app.config["ALCHEMY"], f.current_app.config["ALCHEMY_SESSION"] + page = alchemy_session.query(alchemy.WikiPage).filter(alchemy.WikiPage.page_id == page_id).one_or_none() + if page is None: + return "No such page", 404 + return f.render_template("wikiedit_page.html", page=page) diff --git a/royalnet/web/royalprints/wikiedit/templates/wikiedit_page.html b/royalnet/web/royalprints/wikiedit/templates/wikiedit_page.html new file mode 100644 index 00000000..f832e6c7 --- /dev/null +++ b/royalnet/web/royalprints/wikiedit/templates/wikiedit_page.html @@ -0,0 +1,154 @@ +{% extends "base.html" %} + +{% block title %} + {{ page.title }} - RYGwikieditor +{% endblock %} + +{% block head %} + <link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css"> + <script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script> +{% endblock %} + +{% block content %} + <div class="doublebox"> + <div class="top"> + <span class="left"> + Wiki Editor + </span> + </div> + <div class="bot"> + <form method="POST" class="wikiedit-form"> + <div class="field"> + <label for="wikiedit-title"> + Titolo + <input id="wikiedit-title" type="text" name="title" placeholder="Titolo" value="{{ page.title }}"> + </label> + </div> + <div class="field"> + <label for="wikiedit-format"> + Formato + <input id="wikiedit-format" type="text" name="format" placeholder="Format" disabled value="{{ page.format }}"> + </label> + </div> + <div class="field"> + <label for="wikiedit-content"> + Contenuto + <textarea id="wikiedit-content" name="content">{{ page.content }}</textarea> + </label> + </div> + <div class="field"> + <label for="wikiedit-css"> + Tema + <select id="wikiedit-css" name="css"> + <option value="None" {% if page.css == None %}selected{% endif %}>Royal Games</option> + <option value="tf2.css" {% if page.css == "tf2.css" %}selected{% endif %}>Team Fortress 2</option> + </select> + </label> + </div> + <div class="field"> + Attenzione! Se due persone stanno modificando la stessa pagina, le modifiche di una di loro rischiano di essere annullate! + </div> + <div class="field"> + <input id="wikiedit-submit" type="submit" value="Applica modifica"> + </div> + </form> + </div> + </div> +{% endblock %} + +{% block footscripts %} + <script> + //TODO: maybe enable autosave? + let simplemde = new SimpleMDE({ + element: document.getElementById("wikiedit-content"), + blockStyles: { + italic: "_" + }, + tabSize: 4, + spellChecker: false, + toolbar: [ + { + name: "bold", + action: SimpleMDE.toggleBold, + className: "fas fa-bold no-icon", + title: "Grassetto", + }, + { + name: "italic", + action: SimpleMDE.toggleItalic, + className: "fas fa-italic no-icon", + title: "Corsivo", + }, + { + name: "strikethrough", + action: SimpleMDE.toggleStrikethrough, + className: "fas fa-strikethrough no-icon", + title: "Barrato", + }, + { + name: "link", + action: SimpleMDE.drawLink, + className: "fas fa-link no-icon", + title: "Link", + }, + "|", + { + name: "heading-smaller", + action: SimpleMDE.toggleHeadingSmaller, + className: "fas fa-header no-icon", + title: "(Rimpicciolisci) Titolo", + }, + { + name: "heading", + action: SimpleMDE.toggleHeadingBigger, + className: "fas fa-header fa-lg no-icon", + title: "(Ingrandisci) Titolo", + }, + "|", + { + name: "code", + action: SimpleMDE.toggleCodeBlock, + className: "fas fa-code no-icon", + title: "Codice", + }, + { + name: "quote", + action: SimpleMDE.toggleBlockquote, + className: "fas fa-quote-left no-icon", + title: "Citazione", + }, + { + name: "unordered-list", + action: SimpleMDE.toggleUnorderedList, + className: "fas fa-list-ul no-icon", + title: "Lista puntata", + }, + { + name: "ordered-list", + action: SimpleMDE.toggleOrderedList, + className: "fas fa-list-ol no-icon", + title: "Lista ordinata", + }, + { + name: "horizontal-rule", + action: SimpleMDE.drawHorizontalRule, + className: "fas fa-minus no-icon", + title: "Separatore", + }, + "|", + { + name: "image", + action: SimpleMDE.drawImage, + className: "fas fa-picture-o no-icon", + title: "Immagine", + }, + { + name: "table", + action: SimpleMDE.drawTable, + className: "fas fa-table no-icon", + title: "Tabella", + } + ], + }); + </script> +{% endblock %} \ No newline at end of file diff --git a/royalnet/web/royalprints/wikiview/templates/wikiview_page.html b/royalnet/web/royalprints/wikiview/templates/wikiview_page.html index e6999bec..adcd9933 100644 --- a/royalnet/web/royalprints/wikiview/templates/wikiview_page.html +++ b/royalnet/web/royalprints/wikiview/templates/wikiview_page.html @@ -8,14 +8,22 @@ <div class="doublebox"> <div class="top"> <span class="left"> - {{ page.title }} + Wiki page </span> <span class="right"> + <a class="permalink no-icon" href="{{ url_for("wikiedit.wikiedit_by_id", page_id=page.page_id|string, title=page.title) }}">e</a> <a class="permalink no-icon" href="{{ url_for("wikiview.wikiview_by_id", page_id=page.page_id|string, title=page.title) }}">#</a> </span> </div> <div class="bot"> - {{ parsed_content }} + <div class="wikiview-page"> + <h1 class="wikiview-title"> + {{ page.title }} + </h1> + <div class="wikiview-content"> + {{ parsed_content }} + </div> + </div> </div> </div> {% endblock %} diff --git a/royalnet/web/static/ryg.css b/royalnet/web/static/ryg.css index 9ff44fbe..d69ee476 100644 --- a/royalnet/web/static/ryg.css +++ b/royalnet/web/static/ryg.css @@ -406,4 +406,39 @@ nav .nav-login-unavailable { .faded { opacity: 0.3; } +.wikiedit-form .field { + margin-top: 4px; + margin-bottom: 4px; +} +.wikiedit-form .editor-toolbar, +.wikiedit-form .editor-statusbar { + background-color: #2a3d62; + color: #a0ccff !important; + border: 0; + opacity: 1 !important; +} +.wikiedit-form .editor-toolbar a, +.wikiedit-form .editor-statusbar a { + color: #a0ccff !important; + border: 0; +} +.wikiedit-form .editor-toolbar a:hover, +.wikiedit-form .editor-statusbar a:hover { + background-color: rgba(160, 204, 255, 0.2); + color: #ffffff !important; +} +.wikiedit-form .editor-toolbar a.active, +.wikiedit-form .editor-statusbar a.active { + background-color: rgba(160, 204, 255, 0.3); + color: white !important; +} +.wikiedit-form .editor-toolbar a.active:hover, +.wikiedit-form .editor-statusbar a.active:hover { + background-color: rgba(160, 204, 255, 0.2); + color: #ffffff !important; +} +.wikiedit-form .CodeMirror { + font-family: "Consolas", monospace !important; + border: 0; +} /*# sourceMappingURL=ryg.css.map */ \ No newline at end of file diff --git a/royalnet/web/static/ryg.css.map b/royalnet/web/static/ryg.css.map index 763fe430..61207c49 100644 --- a/royalnet/web/static/ryg.css.map +++ b/royalnet/web/static/ryg.css.map @@ -1 +1 @@ -{"version":3,"sources":["ryg.less"],"names":[],"mappings":"AAiBA;EACI,aALS,SAAS,4BAKlB;EACA,yBAAA;EACA,cAAA;EACA,sBAAA;;AAGJ;EACI,cAAA;EACA,qBAAA;;AAEA,CAAC;EACG,cAAA;;AAGJ,CAAC;EACG,YAAA;;AAOA,CAFH,IAAI,UAEA;EACG,aAAa,qBAAb;EACA,iBAAA;EACA,SAAS,OAAT;EACA,iBAAA;;AAIJ,CAVH,IAAI,UAUA,sBAAsB;EACnB,aAAa,uBAAb;EACA,iBAAA;EACA,SAAS,OAAT;EACA,iBAAA;;AAIJ,CAlBH,IAAI,UAkBA,iCAAiC;AAAU,CAlB/C,IAAI,UAkB4C,0BAA0B;EACnE,aAAa,uBAAb;EACA,iBAAA;EACA,SAAS,OAAT;EACA,iBAAA;;AAIJ,CA1BH,IAAI,UA0BA,2BAA2B;AAAU,CA1BzC,IAAI,UA0BsC,kCAAkC;EACrE,aAAa,uBAAb;EACA,iBAAA;EACA,SAAS,OAAT;EACA,iBAAA;;AAIJ,CAlCH,IAAI,UAkCA,4BAA4B;AAAU,CAlC1C,IAAI,UAkCuC,iCAAiC;EACrE,aAAa,uBAAb;EACA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AVR,gBAMI,EAIK;AAAD,cAVS,kBAMb,EAIK;EACG,0CAAA;EACA,cAAA;;AAGJ,cAfR,gBAMI,EASK;AAAD,cAfS,kBAMb,EASK;EACG,0CAAA;EACA,uBAAA;;AAEA,cAnBZ,gBAMI,EASK,OAII;AAAD,cAnBK,kBAMb,EASK,OAII;EACG,0CAAA;EACA,cAAA;;AA5BpB,cAkCI;EACI,aAAa,qBAAb;EACA,SAAA","file":"ryg.css"} \ No newline at end of file diff --git a/royalnet/web/static/ryg.less b/royalnet/web/static/ryg.less index c8ea1749..c871b01a 100644 --- a/royalnet/web/static/ryg.less +++ b/royalnet/web/static/ryg.less @@ -496,4 +496,44 @@ nav { .faded { opacity: 0.3; -} \ No newline at end of file +} + +.wikiedit-form { + + .field { + margin-top: 4px; + margin-bottom: 4px; + } + + .editor-toolbar, .editor-statusbar { + background-color: #2a3d62; + color: @fg !important; + border: 0; + opacity: 1 !important; + + a { + color: @fg !important; + border: 0; + + &:hover { + background-color: fade(@fg, 20%); + color: lighten(@fg, 25%) !important; + } + + &.active { + background-color: fade(@fg, 30%); + color: white !important; + + &:hover { + background-color: fade(@fg, 20%); + color: lighten(@fg, 25%) !important; + } + } + } + } + + .CodeMirror { + font-family: "Consolas", monospace !important; + border: 0; + } +} diff --git a/royalnet/web/templates/base.html b/royalnet/web/templates/base.html index c6776f7f..dc5be072 100644 --- a/royalnet/web/templates/base.html +++ b/royalnet/web/templates/base.html @@ -16,6 +16,7 @@ <link rel="stylesheet" href="{{ url_for("static", filename="ryg.css") }}"> {% endif %} <link rel="icon" href="{{ url_for("static", filename="logo.png") }}" type="image/png"> + {% block head %}{% endblock %} </head> <body> <nav>