mirror of
https://github.com/FAUSheppy/flask-json-dream-website
synced 2025-12-06 08:11:35 +01:00
implement navbar configuration
This commit is contained in:
@@ -57,3 +57,5 @@ THANKS_STRONG_TEXT = "Strong Text"
|
||||
THANKS_TEXT = "Normal Text"
|
||||
|
||||
DISABLE_MAIN_LINKS = False
|
||||
|
||||
NAVBAR_LINKS = [ ("Navbar-Item1", "/target"), ("Navbar-Item2", "/target2") ]
|
||||
|
||||
@@ -156,12 +156,14 @@ def invalidateEventCache():
|
||||
|
||||
@app.route("/")
|
||||
def root():
|
||||
navbarLinks = [("test", "contact"),("test", "contact"),("test", "contact"),("test", "contact")]
|
||||
return flask.render_template("index.html", conf=app.config,
|
||||
mainLinks=readJsonDir(app.config["MAIN_LINKS_DIR"]),
|
||||
events=getEventsCache(),
|
||||
moreEvents=len(getEventsCache())>3,
|
||||
sections=readJsonDir(app.config["SECTIONS_DIR"]),
|
||||
announcements=parseNewsDirWithTimeout())
|
||||
announcements=parseNewsDirWithTimeout(),
|
||||
navbarLinks=navbarLinks)
|
||||
|
||||
@app.route("/impressum")
|
||||
def impressum():
|
||||
|
||||
@@ -19,6 +19,12 @@
|
||||
<a class="nav-link" href="/">Home</a>
|
||||
</li>
|
||||
|
||||
{% for nl in conf["NAVBAR_LINKS"] %}
|
||||
<li class="nav-item">
|
||||
<a class=nav-link href="{{ nl[1] }}">{{ nl[0] }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
{% if conf["TEAMSPEAK_SERVER"] %}
|
||||
<li class="nav-item right">
|
||||
<a class="nav-link" href="ts3server://{{ conf['TEAMSPEAK_SERVER'] }}">Teamspeak</a>
|
||||
|
||||
Reference in New Issue
Block a user