1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-12-17 23:24: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

@ -20,11 +20,11 @@
<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>
@ -35,6 +35,10 @@
<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-reason">
<span class="label-text">Motivo</span>
<input id="wikiedit-reason" type="text" name="reason">
</label>
<label for="wikiedit-submit"> <label for="wikiedit-submit">
<input id="wikiedit-submit" type="submit" value="Salva"> <input id="wikiedit-submit" type="submit" value="Salva">
</label> </label>