Compare commits

..

No commits in common. "cb487f231efbf6dfb71f24977a002c5534b71198" and "247fc6729ac10ede4fe7eb161b25f19479a76942" have entirely different histories.

5 changed files with 0 additions and 35 deletions

View File

@ -13,7 +13,6 @@ import random
import bleach import bleach
from django.db import IntegrityError from django.db import IntegrityError
from django.utils.timezone import localtime from django.utils.timezone import localtime
from django.urls import reverse
from quest.models import * from quest.models import *
from quest.tools import handle_img from quest.tools import handle_img
@ -421,12 +420,6 @@ def new_page(socket, data):
) )
p.save() p.save()
data = {}
data['page_num'] = p.page_num
data['title'] = title
data['url'] = reverse('quest:quest', args=[socket.quest_id, p.page_num])
socket.send('new_page', data)
events = {} events = {}
for obj in dir(): for obj in dir():

View File

@ -148,11 +148,6 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
{% if page_num != pages.reverse()[0].page_num %}
<div id="nextPageContainer">
<input type="button" id="nextPage" value="Next Page: {{ pages[page_num].title }}" onclick="window.location.href='{{ url('quest:quest', args=[quest_id, page_num+1]) }}'">
</div>
{% endif %}
</div> </div>
<div id="chatPane" style="display:{% if request.session.get("hide_chat") == True %}none{% else %}flex{% endif %};"> <div id="chatPane" style="display:{% if request.session.get("hide_chat") == True %}none{% else %}flex{% endif %};">
<h1>Chat</h1> <h1>Chat</h1>

View File

@ -96,20 +96,6 @@ h3 {
width: 100%; width: 100%;
} }
#nextPageContainer {
width: 100%;
height: 5em;
padding: 1em;
box-sizing: border-box;
text-align: center;
}
#nextPage {
height: 100%;
width: 100%;
box-sizing: border-box;
}
#chatPane { #chatPane {
height: calc(100% - var(--header-height)); height: calc(100% - var(--header-height));
width: 30%; width: 30%;

View File

@ -154,11 +154,6 @@ socket.events['vote'] = function(data) {
socket.events['set_option_box'] = function(data) { socket.events['set_option_box'] = function(data) {
document.getElementById('pollInput-' + data.option_id).checked = data.polarity; document.getElementById('pollInput-' + data.option_id).checked = data.polarity;
} }
socket.events['new_page'] = function(data) {
if (page_num != data.page_num-1) { return; }
let html_str = '<div id="nextPageContainer"><input type="button" id="nextPage" value="Next Page: ' + data.title + '" onclick="window.location.href=\'' + SCRIPT_NAME + data.url + '\'"></div>';
document.getElementById('questPane').innerHTML = document.getElementById('questPane').innerHTML + html_str;
}
/* Websocket send */ /* Websocket send */
function vote(post_id, option_id) { function vote(post_id, option_id) {

View File

@ -21,12 +21,8 @@ def quest(request, quest_id, page_num=1):
""" """
quest = Quest.objects.get(id=quest_id) quest = Quest.objects.get(id=quest_id)
pages = PageTitle.objects.filter(quest=quest).order_by('page_num') pages = PageTitle.objects.filter(quest=quest).order_by('page_num')
if page_num > pages.reverse()[0].page_num:
page_num = pages.reverse()[0].page_num
return redirect('quest:quest', quest_id=quest.id, page_num=page_num)
messages = quest.message_set.all() messages = quest.message_set.all()
posts = quest.post_set.filter(page_num=page_num) posts = quest.post_set.filter(page_num=page_num)
# TODO: filter by page_num as well
dice_rolls = DiceRoll.objects.filter(dicecall__post__quest=quest) dice_rolls = DiceRoll.objects.filter(dicecall__post__quest=quest)
poll_options = PollOption.objects.filter(poll__post__quest=quest) poll_options = PollOption.objects.filter(poll__post__quest=quest)
poll_votes = PollVote.objects.filter(option__poll__post__quest=quest) poll_votes = PollVote.objects.filter(option__poll__post__quest=quest)