Skip to content

Commit

Permalink
move index from kadi blueprint to top-level, and moved kadi entrypoin…
Browse files Browse the repository at this point in the history
…t to /kadi
  • Loading branch information
javierggt committed Jul 19, 2022
1 parent 9b3ea08 commit dd7339e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 10 additions & 1 deletion kadi_apps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ def internal_error(e):
return render_template('500.html'), 500


def index():
"""Return main page"""
return render_template(
'index.html',
)


def get_app(name=__name__, settings='devel'):
import kadi_apps
from kadi_apps.blueprints import auth, test, ska_api as api, kadi, find_attitude
Expand Down Expand Up @@ -53,7 +60,9 @@ def get_app(name=__name__, settings='devel'):
app.register_error_handler(404, page_not_found)
app.register_error_handler(500, internal_error)

app.register_blueprint(kadi.blueprint, url_prefix='/')
app.add_url_rule("/", view_func=index)

app.register_blueprint(kadi.blueprint, url_prefix='/kadi')
app.register_blueprint(find_attitude.blueprint, url_prefix='/find_attitude')
app.register_blueprint(mica.blueprint, url_prefix='/mica')
app.register_blueprint(star_hist.blueprint, url_prefix='/star_hist')
Expand Down
8 changes: 0 additions & 8 deletions kadi_apps/blueprints/kadi/kadi.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ def filter_events(
return queryset


@blueprint.route("/")
def index():
"""Return help page for web-kadi API access"""
return render_template(
'index.html',
)


@blueprint.route("/events/")
def events():
"""Return help page for web-kadi API access"""
Expand Down
2 changes: 1 addition & 1 deletion kadi_apps/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{% block titlebar %}
<nav class="navbar navbar-expand-md navbar-dark bg-dark bd-navbar">
<div class="container-xl">
<a class="navbar-brand" href="{{ url_for('kadi.index') }}"> Kadi </a>
<a class="navbar-brand" href="{{ url_for('index') }}"> Kadi </a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down

0 comments on commit dd7339e

Please sign in to comment.