1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00
This commit is contained in:
Steffo 2019-06-20 17:01:13 +02:00
parent 87578155a8
commit fb0f3d9395
2 changed files with 26 additions and 22 deletions

View file

@ -12,7 +12,7 @@ rp = Royalprint("wikiedit", __name__, url_prefix="/wikiedit", template_folder=tm
@rp.route("/<uuid:page_id>", defaults={"title": ""}, methods=["GET", "POST"]) @rp.route("/<uuid:page_id>", defaults={"title": ""}, methods=["GET", "POST"])
@rp.route("/<uuid:page_id>/<title>") @rp.route("/<uuid:page_id>/<title>", methods=["GET", "POST"])
def wikiedit_by_id(page_id: uuid.UUID, title: str): def wikiedit_by_id(page_id: uuid.UUID, title: str):
alchemy, alchemy_session = f.current_app.config["ALCHEMY"], f.current_app.config["ALCHEMY_SESSION"] 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() page = alchemy_session.query(alchemy.WikiPage).filter(alchemy.WikiPage.page_id == page_id).one_or_none()
@ -23,4 +23,4 @@ def wikiedit_by_id(page_id: uuid.UUID, title: str):
return f.render_template("wikiedit_page.html", page=page) return f.render_template("wikiedit_page.html", page=page)
elif f.request.method == "POST": elif f.request.method == "POST":
return "Haha doesn't work yet" return ""

View file

@ -18,26 +18,30 @@
</div> </div>
<div class="bot"> <div class="bot">
<form method="POST" class="wikiedit-form"> <form method="POST" class="wikiedit-form">
<label for="wikiedit-title"> <label for="wikiedit-title">
<span class="label-text">Titolo</span> <span class="label-text">Titolo</span>
<input id="wikiedit-title" type="text" name="title" placeholder="Titolo" value="{{ page.title }}"> <input id="wikiedit-title" type="text" name="title" value="{{ page.title }}">
</label> </label>
<label for="wikiedit-format"> <label for="wikiedit-format">
<span class="label-text">Formato</span> <span class="label-text">Formato</span>
<input id="wikiedit-format" type="text" name="format" placeholder="Format" disabled value="{{ page.format }}"> <input id="wikiedit-format" type="text" name="format" disabled value="{{ page.format }}">
</label> </label>
<!--suppress HtmlFormInputWithoutLabel --> <!--suppress HtmlFormInputWithoutLabel -->
<textarea id="wikiedit-content" name="content">{{ page.content }}</textarea> <textarea id="wikiedit-content" name="content">{{ page.content }}</textarea>
<label for="wikiedit-css"> <label for="wikiedit-css">
<span class="label-text">Tema</span> <span class="label-text">Tema</span>
<select id="wikiedit-css" name="css"> <select id="wikiedit-css" name="css">
<option value="None" {% if page.css == None %}selected{% endif %}>Royal Games</option> <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> <option value="tf2.css" {% if page.css == "tf2.css" %}selected{% endif %}>Team Fortress 2</option>
</select> </select>
</label> </label>
<label for="wikiedit-submit"> <label for="wikiedit-reason">
<input id="wikiedit-submit" type="submit" value="Salva"> <span class="label-text">Motivo</span>
</label> <input id="wikiedit-reason" type="text" name="reason">
</label>
<label for="wikiedit-submit">
<input id="wikiedit-submit" type="submit" value="Salva">
</label>
</form> </form>
</div> </div>
</div> </div>