mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Create test home page?
This commit is contained in:
parent
bf0d6da143
commit
e9c9673e6e
7 changed files with 63 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
from .web import create_app
|
from .web import create_app
|
||||||
from .web.blueprints import helloworld, testing
|
from .web.blueprints import home
|
||||||
|
|
||||||
|
|
||||||
class TestConfig:
|
class TestConfig:
|
||||||
|
@ -8,7 +8,7 @@ class TestConfig:
|
||||||
REQUIRED_TABLES = set()
|
REQUIRED_TABLES = set()
|
||||||
|
|
||||||
|
|
||||||
app = create_app(TestConfig, [helloworld, testing])
|
app = create_app(TestConfig, [home])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from .helloworld import bp as helloworld
|
from .helloworld import bp as helloworld
|
||||||
from .testing import bp as testing
|
from .testing import bp as testing
|
||||||
|
from .home import bp as home
|
||||||
|
|
||||||
__all__ = ["helloworld", "testing"]
|
__all__ = ["helloworld", "testing", "home"]
|
||||||
|
|
|
@ -6,5 +6,5 @@ bp = Royalprint("helloworld", __name__, url_prefix="/helloworld")
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/")
|
@bp.route("/")
|
||||||
def helloworld():
|
def helloworld_index():
|
||||||
return "Hello world!"
|
return "Hello world!"
|
||||||
|
|
10
royalnet/web/blueprints/home/__init__.py
Normal file
10
royalnet/web/blueprints/home/__init__.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import flask as f
|
||||||
|
from ... import Royalprint
|
||||||
|
|
||||||
|
|
||||||
|
bp = Royalprint("home", __name__, template_folder="templates")
|
||||||
|
|
||||||
|
|
||||||
|
@bp.route("/")
|
||||||
|
def home_index():
|
||||||
|
return f.render_template("home.html")
|
16
royalnet/web/blueprints/home/templates/home.html
Normal file
16
royalnet/web/blueprints/home/templates/home.html
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
Home
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="doublebox">
|
||||||
|
<div class="top">
|
||||||
|
<span class="left">Ciao!</span>
|
||||||
|
</div>
|
||||||
|
<div class="bot">
|
||||||
|
Ciao!
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
|
@ -7,7 +7,7 @@ bp = Royalprint("testing", __name__, url_prefix="/testing", required_tables={Roy
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/listroyals")
|
@bp.route("/listroyals")
|
||||||
def listroyals():
|
def testing_listroyals():
|
||||||
from ..alchemyhandler import alchemy, alchemy_session
|
from ...alchemyhandler import alchemy, alchemy_session
|
||||||
royals = alchemy_session.query(alchemy.Royal).all()
|
royals = alchemy_session.query(alchemy.Royal).all()
|
||||||
return f'<body><script type="text/plain" style="display: block;">{repr(royals)}</script></body>'
|
return f'<body><script type="text/plain" style="display: block;">{repr(royals)}</script></body>'
|
||||||
|
|
30
royalnet/web/templates/base.html
Normal file
30
royalnet/web/templates/base.html
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="it">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="author" content="Stefano Pigozzi">
|
||||||
|
<meta name="keywords" content="Royal Games,RYG,Gaming,Videogames,Community">
|
||||||
|
<meta name="description" content="Royal Games Community">
|
||||||
|
<meta property="og:site_name" content="Royal Games">
|
||||||
|
<title>{% block title %}{% endblock %}</title>
|
||||||
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">
|
||||||
|
<link rel="stylesheet" href="https://steffo.eu/static/styling.css">
|
||||||
|
<link rel="icon" href="{{ url_for("static", filename="favicon.png") }}" type="image/png">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!--TODO: togliere questa roba-->
|
||||||
|
<div id="top-bar">
|
||||||
|
<span id="steffo">
|
||||||
|
Royal Games
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="h-container">
|
||||||
|
{% block content %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
<div id="foot-scripts">
|
||||||
|
{% block footscripts %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue