From a7a9f47756dc0cd517986487a5510ca77bac417b Mon Sep 17 00:00:00 2001 From: vadik likholetov Date: Fri, 17 Nov 2023 08:50:24 +0200 Subject: [PATCH] Added the rest of the data display to sar_details.html --- app.py | 5 +--- templates/base.html | 34 ++++++++++++++------------ templates/sar_details.html | 49 +++++++++++++++++++++++++++++--------- 3 files changed, 58 insertions(+), 30 deletions(-) diff --git a/app.py b/app.py index 7f4bd7e..80963d1 100644 --- a/app.py +++ b/app.py @@ -19,14 +19,12 @@ metadata = MetaData(naming_convention=convention) def get_locale(): - return session.get('language', request.accept_languages.best_match(['en', 'ru', 'et', 'lv', 'fi'])) + return session.get('language', request.accept_languages.best_match(['en', 'ru', 'ee', 'lv', 'fi','se','lt'])) app = Flask(__name__) app.config['SECRET_KEY'] = 'secret_key' -#app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3' -#app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+mysqlconnector://sarbaseuser:password@localhost/sarbaseapp' app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URL', 'mysql+mysqlconnector://sarbaseuser:password@localhost/sarbaseapp') app.config['BABEL_DEFAULT_LOCALE'] = 'en' babel= Babel(app) @@ -56,6 +54,5 @@ def set_language(lang_code): - if __name__ == '__main__': app.run() diff --git a/templates/base.html b/templates/base.html index 4b59f57..821564d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -2,14 +2,8 @@ - - - - + + {% block title %}Default Title{% endblock %} @@ -38,13 +32,13 @@ @@ -59,7 +53,7 @@ {% else %} {% endif %} @@ -88,10 +82,20 @@ - - - - + + + + + + + + + + diff --git a/templates/sar_details.html b/templates/sar_details.html index 22fd94b..8606f32 100644 --- a/templates/sar_details.html +++ b/templates/sar_details.html @@ -28,17 +28,42 @@
-

SAR Job Details

+

#{{ sar.id }} : {{ sar.title }}

-

ID: {{ sar.id }}

-
-

Created at: {{ sar.created }}

-

Last updated: {{ sar.updated }}

-
-

Start Date: {{ sar.start_date }}

-

Manager: {{ sar.manager }}

- + + + + + + +
+
+
+
+

Created at: {{ sar.created }}

+

Last updated: {{ sar.updated }}

+
+

Status: {{ sar.status }}

+

Category: {{ sar.category }}

+

Start Date: {{ sar.start_date }}

+

Finish Date: {{ sar.finish_date }}

+

Result: {{ sar.result }}

+

Manager: {{ sar.manager_id }}

+
+
+
+
+
+

IPP longitude: {{ sar.longitude }}

+

IPP latitude: {{ sar.latitude }}

+

Longitude found: {{ sar.longitude_found }}

+

Latitude found: {{ sar.latitude_found }}

+

Description: {{ sar.description }}

+

Description private: {{ sar.description_hidden }}

+
+
+
@@ -55,10 +80,12 @@
- {{ comment.user.full_name }}: at {{ comment.created }} , updated {{ comment.updated }} + {{ comment.user.full_name }}: at {{ comment.created }} , + updated {{ comment.updated }}
-

{{ comment.text }}

+

{{ comment.text }}

+
{% for gpx_track in comments_with_gpx %}