profile link in header bar
This commit is contained in:
parent
8211feb33b
commit
20f47f02a8
|
@ -86,7 +86,7 @@ def message(socket, data):
|
|||
m = Message(
|
||||
quest=quest,
|
||||
message=message)
|
||||
if user.username:
|
||||
if user.is_authenticated:
|
||||
m.user = user
|
||||
m.save()
|
||||
|
||||
|
@ -551,7 +551,7 @@ def vote(socket, data):
|
|||
option=option,
|
||||
ip_address=ip_address
|
||||
)
|
||||
if user.username:
|
||||
if user.is_authenticated:
|
||||
pv.user = user
|
||||
pv.save()
|
||||
|
||||
|
|
|
@ -18,32 +18,7 @@
|
|||
<script>window.onload = load;</script>
|
||||
{% endblock %}
|
||||
{% block header %}
|
||||
{% if request.user == quest.owner %}
|
||||
<span><a href="{{ url('quest:edit_quest', args=[quest_id, page_num]) }}">Edit Quest</a></span>
|
||||
{% endif %}
|
||||
<span id="pageSelection">
|
||||
<select onChange="window.location.href=this.value">
|
||||
<optgroup label="Pages">
|
||||
{% for page in pages %}
|
||||
<option value="{{ url('quest:quest', args=[quest_id, page.page_num]) }}"{% if page.page_num == page_num %} selected="yes" {% if vars.update({'next_page': loop.nextitem}) %}{% endif %}{% endif %}>{{ page.title }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% if appendices %}
|
||||
<optgroup label="Appendices">
|
||||
{% for appendix in appendices %}
|
||||
<option value="{{ url('quest:quest', args=[quest_id, appendix.page_num]) }}"{% if appendix.page_num == page_num %} selected="yes"{% endif %}>{{ appendix.title }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endif %}
|
||||
</select>
|
||||
</span>
|
||||
<span id="live" style="display:{% if quest.live %}initial{% else %}none{% endif %};">
|
||||
LIVE
|
||||
</span>
|
||||
<span id="liveIn" style="display:{% if quest.live_time and not quest.live %}initial{% else %}none{% endif %};">
|
||||
Live in: <span id="liveCountdown"></span> (<span id="liveTime">{% if quest.live_time %}{{ localtime(quest.live_time).strftime('%Y-%m-%d %H:%M') }}{% endif %}</span>)
|
||||
</span>
|
||||
<span id="toggleChat"><a onclick="toggle_chat()" href="javascript:void(0);">{% if request.session.get("hide_chat") == True %}←{% else %}→{% endif %}</a></span>
|
||||
{% include "quest/quest_header.html" %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div id="questPane" style="width:{% if request.session.get("hide_chat") == True %}100%{% else %}70%{% endif %};">
|
||||
|
|
31
quest/jinja2/quest/quest_header.html
Normal file
31
quest/jinja2/quest/quest_header.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
{% if request.user == quest.owner %}
|
||||
<span><a href="{{ url('quest:edit_quest', args=[quest_id, page_num]) }}">Edit Quest</a></span>
|
||||
{% endif %}
|
||||
<span id="pageSelection">
|
||||
<select onChange="window.location.href=this.value">
|
||||
<optgroup label="Pages">
|
||||
{% for page in pages %}
|
||||
<option value="{{ url('quest:quest', args=[quest_id, page.page_num]) }}"{% if page.page_num == page_num %} selected="yes" {% if vars.update({'next_page': loop.nextitem}) %}{% endif %}{% endif %}>{{ page.title }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% if appendices %}
|
||||
<optgroup label="Appendices">
|
||||
{% for appendix in appendices %}
|
||||
<option value="{{ url('quest:quest', args=[quest_id, appendix.page_num]) }}"{% if appendix.page_num == page_num %} selected="yes"{% endif %}>{{ appendix.title }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endif %}
|
||||
</select>
|
||||
</span>
|
||||
<span id="live" style="display:{% if quest.live %}initial{% else %}none{% endif %};">
|
||||
LIVE
|
||||
</span>
|
||||
<span id="liveIn" style="display:{% if quest.live_time and not quest.live %}initial{% else %}none{% endif %};">
|
||||
Live in: <span id="liveCountdown"></span> (<span id="liveTime">{% if quest.live_time %}{{ localtime(quest.live_time).strftime('%Y-%m-%d %H:%M') }}{% endif %}</span>)
|
||||
</span>
|
||||
<span id="space"></span>
|
||||
{% if request.user.is_authenticated %}
|
||||
<span id="profileLink"><a href="{{ url('user:profile', args=[request.user.id]) }}">Profile</a></span>
|
||||
{% endif %}
|
||||
<span id="toggleChat"><a onclick="toggle_chat()" href="javascript:void(0);">{% if request.session.get("hide_chat") == True %}←{% else %}→{% endif %}</a></span>
|
||||
|
|
@ -20,37 +20,7 @@
|
|||
<script>window.onload = load;</script>
|
||||
{% endblock %}
|
||||
{% block header %}
|
||||
{% if request.user == quest.owner %}
|
||||
<span><a href="{{ url('quest:edit_quest', args=[quest_id, page_num]) }}">Edit Quest</a></span>
|
||||
{% endif %}
|
||||
<span>
|
||||
<select onChange="window.location.href=this.value">
|
||||
<optgroup label="Pages">
|
||||
{% for page in pages %}
|
||||
<option value="{{ url('quest:quest', args=[quest_id, page.page_num]) }}"{% if page.page_num == page_num %} selected="yes" {% if vars.update({'next_page': loop.nextitem }) %}{% endif %}{% endif %}>{{ page.title }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% if appendices %}
|
||||
<optgroup label="Appendices">
|
||||
{% for appendix in appendices %}
|
||||
<option value="{{ url('quest:quest', args=[quest_id, appendix.page_num]) }}"{% if appendix.page_num == page_num %} selected="yes"{% endif %}>{{ appendix.title }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endif %}
|
||||
</select>
|
||||
</span>
|
||||
{% if quest.live %}
|
||||
<span id="live">
|
||||
LIVE
|
||||
</span>
|
||||
{% else %}
|
||||
{% if quest.live_time %}
|
||||
<span id="liveIn">
|
||||
Live in: <span id="liveCountdown"></span> (<span id="liveTime">{{ localtime(quest.live_time).strftime('%Y-%m-%d %H:%M') }}</span>)
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<span id="toggleChat"><a onclick="toggle_chat()" href="javascript:void(0);">{% if request.session.get("hide_chat") == True %}←{% else %}→{% endif %}</a></span>
|
||||
{% include "quest/quest_header.html" %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div id="questPane" style="width:{% if request.session.get("hide_chat") == True %}100%{% else %}70%{% endif %};">
|
||||
|
|
|
@ -14,8 +14,8 @@ h3 {
|
|||
padding: 0.25em;
|
||||
}
|
||||
|
||||
#toggleChat {
|
||||
margin-left: auto;
|
||||
#space {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#questPane {
|
||||
|
|
Loading…
Reference in New Issue
Block a user