diff --git a/ExampleApp/Extra/__init__.py b/ExampleApp/Extra/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e189702f6e3443d37c53a8bf10157c1bb8fa5f4f --- /dev/null +++ b/ExampleApp/Extra/__init__.py @@ -0,0 +1,4 @@ +from flask import render_template + +def home(): + return render_template('home.html') \ No newline at end of file diff --git a/ExampleApp/Extra/lang/en.yaml b/ExampleApp/Extra/lang/en.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5fc2b43a24e44eb27845fd8b0a3b15c967b0fe05 --- /dev/null +++ b/ExampleApp/Extra/lang/en.yaml @@ -0,0 +1,2 @@ +hello_message: 'Hello extra page!' +men_index: 'Extra page' diff --git a/ExampleApp/Extra/manifest.yaml b/ExampleApp/Extra/manifest.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1d2a4bac20d8b6c4269612fa6ec5f4f8da49145f --- /dev/null +++ b/ExampleApp/Extra/manifest.yaml @@ -0,0 +1,7 @@ +default_language: 'en' +views: + - url: &index_url '' + function: 'home' +menu: + - url: *index_url + name_string: men_index \ No newline at end of file diff --git a/ExampleApp/Main/__init__.py b/ExampleApp/Main/__init__.py index bc2add6b8c5dca47f9c9a1be9b8b99eb4501ed1b..e189702f6e3443d37c53a8bf10157c1bb8fa5f4f 100644 --- a/ExampleApp/Main/__init__.py +++ b/ExampleApp/Main/__init__.py @@ -1,2 +1,4 @@ -def hello_string(): - return 'Hello' \ No newline at end of file +from flask import render_template + +def home(): + return render_template('home.html') \ No newline at end of file diff --git a/ExampleApp/Main/lang/de.yaml b/ExampleApp/Main/lang/de.yaml index 9e26dfeeb6e641a33dae4961196235bdb965b21b..543634e3c393d7fa865616e92c3000fca5c6b0e2 100644 --- a/ExampleApp/Main/lang/de.yaml +++ b/ExampleApp/Main/lang/de.yaml @@ -1 +1,3 @@ -{} \ No newline at end of file +hello_message: 'Hello extra page!' +men_index: 'Extra page' +men_index_repo_link: 'Gitlab Repo' \ No newline at end of file diff --git a/ExampleApp/Main/manifest.yaml b/ExampleApp/Main/manifest.yaml index e96e126972e6b01d928d076be6ddf36cbb007aac..ddbe9dc155ae3e98e6ac0f7838b4b371d317f4b4 100644 --- a/ExampleApp/Main/manifest.yaml +++ b/ExampleApp/Main/manifest.yaml @@ -1,4 +1,11 @@ default_language: 'de' views: - - url: 'hello_string' - function: 'hello_string' \ No newline at end of file + - url: &index_url '' + function: 'home' +menu: + - url: *index_url + name_string: men_index + menu: + - url: 'https://git.imp.fu-berlin.de/slobinger/sams-classes' + external: true + name_string: men_index_repo_link \ No newline at end of file diff --git a/ExampleApp/config/config.yaml b/ExampleApp/config/config.yaml index c1d153d390ae898968ee2901f1120c8f2f68dd95..5ee69e58f4c67311d4760744d45be091bbdd9533 100644 --- a/ExampleApp/config/config.yaml +++ b/ExampleApp/config/config.yaml @@ -5,4 +5,5 @@ exampleApp: default_language: de main_app: 'ExampleApp.Main' apps: - - 'ExampleApp.Main' \ No newline at end of file + - 'ExampleApp.Main' + - 'ExampleApp.Extra' \ No newline at end of file diff --git a/ExampleApp/templates/base-struct.html b/ExampleApp/templates/base-struct.html index f35722e641dc9e84c2c14d69c51abd5e984dac29..0b5c838f4595f4b2281c79f14fc40b018e1cd00a 100644 --- a/ExampleApp/templates/base-struct.html +++ b/ExampleApp/templates/base-struct.html @@ -10,10 +10,10 @@ <div id="header">{% block header %}{% endblock %}</div> <div id="global_app_menu"> <ul> - {% for entry in menu_list recursive%} + {% for entry in menu recursive%} <li><a href='{{ entry.url }}'>{{ entry.name }}</a></li> - {% if entry.subentries %} - <ul class="submenu">{{ loop(entry.subentries) }}</ul> + {% if entry.menu %} + <ul class="submenu">{{ loop(entry.menu) }}</ul> {% endif %} {% endfor %} </ul> diff --git a/ExampleApp/templates/home.html b/ExampleApp/templates/home.html index 6107666674f652ca6178a73e871cbb10c1781d27..88b80f8826bf517e5f640bc26900466f86c547e0 100644 --- a/ExampleApp/templates/home.html +++ b/ExampleApp/templates/home.html @@ -3,6 +3,6 @@ {% block head %} {{ super() }} {% endblock %} {% block content %} <h1>Home</h1> - <p>samsHub Startseite: {{ hub_lang['home_wellcome_message']|safe }}</p> + <p>samsHub Startseite: {{ app_lang['hello_message'] }}</p> {% endblock %} {% block header %}samsHUB -{% endblock %} \ No newline at end of file