You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.1 KiB

4 years ago
4 years ago
4 years ago
  1. import os
  2. from flask import Blueprint, render_template, url_for, redirect
  3. from flask_basicauth import BasicAuth
  4. basic_auth = BasicAuth()
  5. default_views = Blueprint('default_views', __name__, url_prefix='/')
  6. @default_views.route('/')
  7. def index():
  8. return render_template('index.html')
  9. @default_views.route('/handbook')
  10. def handbook():
  11. return render_template('handbook.html')
  12. @default_views.route('/wiki')
  13. @basic_auth.required
  14. def wiki():
  15. return render_template('wiki.html')
  16. @default_views.route('/worldmap')
  17. def worldmap():
  18. return render_template('worldmap.html')
  19. @default_views.route('/lairs')
  20. def lair_gallery():
  21. base_path = "/srv/www/atr0phy.net/acks/img/dynamic_lairs/"
  22. base_url = "https://www.atr0phy.net/acks/img/dynamic_lairs/"
  23. animal_lairs = []
  24. for filename in os.listdir(base_path + "animal/"):
  25. animal_lairs.append(base_url + "animal/" + filename)
  26. humanoid_lairs = []
  27. for filename in os.listdir(base_path + "humanoid/"):
  28. humanoid_lairs.append(base_url + "humanoid/" + filename)
  29. return render_template('lair_gallery.html', animal=animal_lairs, humanoid=humanoid_lairs)