Browse Source

Wiki page

master
Brandon Cornejo 4 years ago
parent
commit
087a9fb055
  1. 4
      acks/__init__.py
  2. 4
      acks/quest/views.py
  3. 2
      acks/templates/base.html
  4. 34
      acks/templates/wiki.html
  5. 10
      acks/views.py

4
acks/__init__.py

@ -13,6 +13,10 @@ def create_app():
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db.init_app(app) db.init_app(app)
# Prep basic auth
from acks.views import basic_auth
basic_auth.init_app(app)
# Load our views # Load our views
from acks.views import default_views from acks.views import default_views
app.register_blueprint(default_views) app.register_blueprint(default_views)

4
acks/quest/views.py

@ -7,6 +7,7 @@ from flask import (
Blueprint Blueprint
) )
from acks.views import basic_auth
from .quest_manager import ( from .quest_manager import (
load_quests, load_quests,
get_quest_details, get_quest_details,
@ -22,16 +23,19 @@ quest_views = Blueprint(
) )
@quest_views.route('/list') @quest_views.route('/list')
@basic_auth.required
def quest_list(): def quest_list():
quests = load_quests() quests = load_quests()
return render_template('quest_list.html', quest_map=quests) return render_template('quest_list.html', quest_map=quests)
@quest_views.route('/detail/<int:level>/<string:quest_name>') @quest_views.route('/detail/<int:level>/<string:quest_name>')
@basic_auth.required
def quest_detail(level, quest_name): def quest_detail(level, quest_name):
quest = get_quest_details(level, quest_name) quest = get_quest_details(level, quest_name)
return render_template('quest_detail.html', quest=quest) return render_template('quest_detail.html', quest=quest)
@quest_views.route('/detail/<int:level>/<string:quest_name>/download') @quest_views.route('/detail/<int:level>/<string:quest_name>/download')
@basic_auth.required
def quest_download(level, quest_name): def quest_download(level, quest_name):
archive = get_quest_archive(level, quest_name) archive = get_quest_archive(level, quest_name)
return send_file(archive, attachment_filename="acks_{0}.zip".format(quest_name), as_attachment=True) return send_file(archive, attachment_filename="acks_{0}.zip".format(quest_name), as_attachment=True)

2
acks/templates/base.html

@ -6,7 +6,7 @@
('.header', 'other', 'Other'), ('.header', 'other', 'Other'),
('/npc/spells', 'spells', 'Spells'), ('/npc/spells', 'spells', 'Spells'),
('/quest/list', 'questlist', 'Quests'), ('/quest/list', 'questlist', 'Quests'),
('/api/schema', 'api', 'API'),
('/wiki', 'wiki', 'Wiki'),
] %} ] %}
{% set generation_bar = [ {% set generation_bar = [
('/npc/party', 'npcparty', 'NPC Party'), ('/npc/party', 'npcparty', 'NPC Party'),

34
acks/templates/wiki.html

@ -0,0 +1,34 @@
{% extends "base.html" %}
{% set active_page = "wiki" %}
{% block title %}ACKS Judge Wiki{% endblock %}
{% block content %}
<div class="uk-flex uk-flex-center uk-margin-bottom uk-margin-top">
<h1 class="uk-text-center"><strong>Adventurer Conqueror King</strong>Wiki</h1>
</div>
<div id="frame-container">
<iframe id="wiki-frame" src="https://atr0phy.net/acks/wiki"></iframe>
</div>
{% endblock %}
{% block head %}
<style>
#frame-container {
display: flex;
width: 100%;
height: 85vh;
flex-direction: column:
}
#wiki-frame {
flex-grow: 1;
border: none;
margin: 0;
padding: 0;
}
h1 strong {
display: block;
font-size: 50%;
opacity: 0.65;
}
</style>
{% endblock %}

10
acks/views.py

@ -1,6 +1,9 @@
from flask import current_app, Blueprint, render_template, url_for, redirect
from flask import Blueprint, render_template, url_for, redirect
from flask_basicauth import BasicAuth
basic_auth = BasicAuth()
default_views = Blueprint('default_views', __name__, url_prefix='/') default_views = Blueprint('default_views', __name__, url_prefix='/')
@default_views.route('/') @default_views.route('/')
@ -11,6 +14,11 @@ def index():
def handbook(): def handbook():
return render_template('handbook.html') return render_template('handbook.html')
@default_views.route('/wiki')
@basic_auth.required
def wiki():
return render_template('wiki.html')
@default_views.route('/worldmap') @default_views.route('/worldmap')
def worldmap(): def worldmap():
return render_template('worldmap.html') return render_template('worldmap.html')

Loading…
Cancel
Save