added /quest/.../edit_quest and centered header better
This commit is contained in:
parent
9903b79252
commit
96363c55b2
30
templates/edit_quest.html
Normal file
30
templates/edit_quest.html
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% block title %}Edit {{ quest_title }}{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<center><h1>{{ quest_title }}</h1></center>
|
||||||
|
<form method="post" action="{{ url_for('.quest', quest_title=ident_title + '/edit_quest') }}">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Quest Title:</td>
|
||||||
|
<td><input type="text" name="quest_title" value="{{ quest_title }}"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Visible:</td>
|
||||||
|
<td><input type="checkbox" name="visible" value="on"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Anonymous Name:</td>
|
||||||
|
<td><input type="text" name="anon_name" value="Anonymous"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Live:</td>
|
||||||
|
<td><input type="checkbox" name="live" value="off"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Live In:</td>
|
||||||
|
<td>Placeholder</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<input type="submit">
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
|
@ -78,14 +78,15 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block header %}
|
{% block header %}
|
||||||
{% if session.get("user_id") == owner_id %}
|
{% if session.get("user_id") == owner_id %}
|
||||||
<li><a href="{{ url_for('.edit_quest') }}">Edit Quest</a></li>
|
<li><a href="{{ url_for('.quest', quest_title=ident_title + '/edit_quest') }}">Edit Quest</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="questContainer">
|
<div id="questContainer">
|
||||||
<div id="questBody">
|
<div id="questBody">
|
||||||
<center><h1>{{ quest_title }}</h1></center>
|
|
||||||
<table id="questPosts">
|
<table id="questPosts">
|
||||||
|
<td></td>
|
||||||
|
<td><center><h1>{{ quest_title }}</h1></center></td>
|
||||||
{% for quest_post in quest_posts %}
|
{% for quest_post in quest_posts %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="questPostTime">
|
<td class="questPostTime">
|
||||||
|
|
15
views.py
15
views.py
|
@ -65,6 +65,7 @@ def quest(quest_title):
|
||||||
messages = db.get_chat_messages(quest_id)
|
messages = db.get_chat_messages(quest_id)
|
||||||
return render_template('quest.html',
|
return render_template('quest.html',
|
||||||
quest_title=quest_title,
|
quest_title=quest_title,
|
||||||
|
ident_title=ident_title,
|
||||||
quest_posts=quest_posts,
|
quest_posts=quest_posts,
|
||||||
owner_id=owner_id,
|
owner_id=owner_id,
|
||||||
room_id=quest_id,
|
room_id=quest_id,
|
||||||
|
@ -111,12 +112,20 @@ def create_quest():
|
||||||
return redirect(url_for('.quest', quest_title=ident_title))
|
return redirect(url_for('.quest', quest_title=ident_title))
|
||||||
|
|
||||||
|
|
||||||
@views.route("/edit_quest")
|
@views.route("/quest/<path:quest_title>/edit_quest", methods=["GET", "POST"])
|
||||||
def edit_quest():
|
def edit_quest(quest_title):
|
||||||
"""
|
"""
|
||||||
Allows the quest owner to edit the quest.
|
Allows the quest owner to edit the quest.
|
||||||
"""
|
"""
|
||||||
return "lol"
|
ident_title = quest_title
|
||||||
|
data = db.get_quest_meta(ident_title=ident_title)
|
||||||
|
if not data:
|
||||||
|
abort(404)
|
||||||
|
quest_id, quest_title, _, owner_id = data
|
||||||
|
if request.method == "GET":
|
||||||
|
return render_template("edit_quest.html",
|
||||||
|
quest_title=quest_title,
|
||||||
|
ident_title=ident_title)
|
||||||
|
|
||||||
|
|
||||||
@views.route("/set_session")
|
@views.route("/set_session")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user