41 lines
1.5 KiB
Python
41 lines
1.5 KiB
Python
from applets.software import bp
|
|
from flask import Flask, request, session, redirect, \
|
|
url_for, render_template, flash, Blueprint
|
|
from flask import current_app
|
|
|
|
@bp.route('/software')
|
|
def webui_software():
|
|
"""
|
|
Software screen for the webui.
|
|
"""
|
|
menu = current_app.config['CONFIG']['settings']['menu_order'].split(" ")
|
|
next_step_url = menu[menu.index("software")+1]
|
|
if menu[menu.index("software")] == 1:
|
|
previous_step_url = False
|
|
else:
|
|
previous_step_url = menu[menu.index("software")-1]
|
|
|
|
sources_button = ' <button class="button iis-info"> <img src="/static/icons/tab-new-symbolic.svg"> Edit Sources </button>'
|
|
blends_button = ' <button class="button iis-info"> <img src="/static/icons/tab-new-symbolic.svg"> Install a Blend </button>'
|
|
bottom_menu = sources_button + blends_button
|
|
|
|
|
|
return render_template('software.html',
|
|
menu=current_app.config['CONFIG']['settings']['menu'],
|
|
menu_order=current_app.config['CONFIG']['settings']['menu_order'].split(),
|
|
previous_step = previous_step_url,
|
|
next_step = next_step_url,
|
|
bottom_menu = bottom_menu)
|
|
|
|
|
|
def build_menu():
|
|
"""
|
|
Define menu items and paths.
|
|
"""
|
|
# proper one once translations are done:
|
|
#current_app.config['CONFIG']['settings']['menu']['welcome'] = (build_stringlist()['menu_item'], "/welcome", 10)
|
|
current_app.config['CONFIG']['settings']['menu']['software'] = ("Software", "/software", 40)
|
|
|
|
build_menu()
|
|
|