diff --git a/neo_dolfin/app.py b/neo_dolfin/app.py index 4fd99ac8..5cb74bcd 100644 --- a/neo_dolfin/app.py +++ b/neo_dolfin/app.py @@ -22,6 +22,8 @@ import plotly.graph_objects as go from services.basiq_service import BasiqService from io import StringIO +import json + load_dotenv() # Load environment variables from .env from classes import * @@ -421,11 +423,16 @@ def open_terms_of_use(): def open_terms_of_use_AI(): return render_template("TermsofUse-AI.html") -# APPLICATION Article Template PAGE -@app.route('/articleTemplate/') -def open_article_template(): - return render_template("articleTemplate.html") - +# APPLICATION ARTICLE TEMPLATE ROUTING +@app.route('/articleTemplate/') +def open_article_template(article_id): + current_dir = os.path.dirname(os.path.abspath(__file__)) + json_path = os.path.join(current_dir, 'static', 'json', 'article.json') + with open(json_path) as json_file: + articles_data = json.load(json_file) + article = next((article for article in articles_data if article['id'] == article_id), None) + return render_template('articleTemplate.html', articles=[article]) + # APPLICATION USER SPECIFIC PROFILE PAGE @app.route('/profile') def profile(): diff --git a/neo_dolfin/static/json/article.json b/neo_dolfin/static/json/article.json new file mode 100644 index 00000000..704d8eca --- /dev/null +++ b/neo_dolfin/static/json/article.json @@ -0,0 +1,35 @@ +[ + { + "id": 1, + "title": "Unravelling Common Bad Saving Habits", + "date": "25/09/2023", + "content1": " When it comes to financial stability, the road is often obstructed by common bad saving habits that many individuals unknowingly develop. One pervasive issue is the absence of a well-structured budget. Without a clear understanding of income, expenses, and financial goals, people risk spending impulsively and struggling to allocate funds for savings. As financial guru Dave Ramsey wisely notes, 'A budget is telling your money where to go instead of wondering where it went.' Establishing and adhering to a budget is foundational to fostering successful saving habits, helping individuals take control of their financial destinies.", + "content2": " Procrastination emerges as another significant hurdle on the path to financial security. Delaying the initiation of a savings plan deprives individuals of the compounding power that accelerates wealth accumulation. Embracing the proverbial wisdom that 'The best time to plant a tree was 20 years ago. The second-best time is now,' is crucial. Overcoming the bad habit of procrastination requires a proactive approach, urging individuals to start saving immediately to maximise the benefits of compound interest over time.", + "content3": " A detrimental habit that can lead to financial turmoil is reliance on credit to sustain a lifestyle beyond one's means. Excessive use of credit cards and the accumulation of high-interest debt create a cycle that is challenging to break. Financial expert Suze Orman offers valuable advice, stating, 'A big part of financial freedom is having your heart and mind free from worry about the what-ifs of life.' Escaping the clutches of credit dependency involves developing a realistic budget, cutting unnecessary expenses, and diligently working to pay down outstanding debts.", + "content4": " Finally, failing to establish an emergency fund is a common pitfall that leaves individuals vulnerable to unforeseen financial challenges. Without a financial safety net, unexpected expenses can lead to debt and disrupt long-term savings goals. As Warren Buffett wisely notes, 'The most important investment you can make is in yourself.' Creating an emergency fund provides a cushion, allowing individuals to navigate financial uncertainties without compromising their overall stability. In unravelling these common bad saving habits, individuals can pave the way for a more secure and prosperous financial future.", + "quote1": "The most important investment ", + "quote2": "you can make is in yourself." + }, + { + "id": 2, + "title": "Article 2", + "date": "02/15/2023", + "content1": "Another article...", + "content2": "More content...", + "content3": "Even more content...", + "content4": "Final content...", + "quote1": "Quote-first half", + "quote2": "Quote-second half.." + }, + { + "id": 3, + "title": "Article 3", + "date": "09/15/2024", + "content1": "Another article...", + "content2": "More content...", + "content3": "Even more content...", + "content4": "Final content...", + "quote1": "Quote-first half", + "quote2": "Quote-second half.." + } +] diff --git a/neo_dolfin/templates/articleTemplate.html b/neo_dolfin/templates/articleTemplate.html index eb71126b..e7424425 100644 --- a/neo_dolfin/templates/articleTemplate.html +++ b/neo_dolfin/templates/articleTemplate.html @@ -2,75 +2,61 @@ - - - DolFin - Article - - - + + + DolFin - Article + + + - {% include 'components/navbar.html' %} + {% include 'components/navbar.html' %} + {% for article in articles %} +
+
+
+

{{ article.title }}

+
+
+

{{ article.date }}

+
+
+ + + +
+
+
+
+ +

{{ article.content1 }}

+
+
+

{{ article.content2 }}

+
+
+
+
+
+ +

"{{ article.quote1 }},

+

{{ article.quote2 }}..."

+
+
+

{{ article.content3 }}

+
+
+

{{ article.content4 }}

+
+
+ {% endfor %} -
-
-
-
-

Article Title

-
-
-

01/09/2023

-
-
- - - -
-
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur purus velit, mattis - faucibus risus at, porta aliquet elit. Suspendisse mollis nulla dolor, nec eleifend urna - malesuada sit amet. Sed vel elit dui. Curabitur fermentum, mi id porta rutrum, justo leo gravida - ipsum, at maximus elit ante nec tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Curabitur purus velit.

-
-
Placeholder Image -
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur purus velit, mattis - faucibus risus at, porta aliquet elit. Suspendisse mollis nulla dolor, nec eleifend urna malesuada - sit amet. Sed vel elit dui. Curabitur fermentum, mi id porta rutrum, justo leo gravida ipsum, at - maximus elit ante nec tortor.

-
-
-
-

"Lorem ipsim dolor sit amet,

-

consectetur adipiscing elit..."

-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur purus velit, - mattis faucibus risus at, porta aliquet elit. Suspendisse mollis nulla dolor, nec - eleifend urna malesuada sit amet. Sed vel elit dui. Curabitur fermentum, mi id porta - rutrum, justo leo gravida ipsum, at maximus elit ante nec tortor. Lorem ipsum dolor sit - amet, consectetur adipiscing elit. Curabitur purus velit , mattis faucibus risus at, - porta aliquet elit.

-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur purus velit, mattis - faucibus risus at, porta aliquet elit. Suspendisse mollis nulla dolor, nec eleifend urna - malesuada sit amet. Sed vel elit dui. Curabitur fermentum, mi id porta rutrum, justo leo gravida - ipsum, at maximus elit ante nec tortor.

-
-
-
{% include 'components/footer.html' %} - + {% include 'components/footer.html' %} + -
- \ No newline at end of file + diff --git a/neo_dolfin/templates/news.html b/neo_dolfin/templates/news.html index 787ba6a5..bca3c68a 100644 --- a/neo_dolfin/templates/news.html +++ b/neo_dolfin/templates/news.html @@ -55,7 +55,7 @@

Latest News

- +
https://images.unsplash.com/photo-1553729459-efe14ef6055d @@ -71,7 +71,7 @@
Top 5 common bad saving habits

10/10/23

@@ -82,7 +82,7 @@
Top 5 common bad saving habits
- +
https://images.unsplash.com/photo-1481223014211-199b3e8f0002 @@ -103,7 +103,7 @@
What is

25/06/23

@@ -116,7 +116,7 @@
What is
- +
https://plus.unsplash.com/premium_photo-1676637656277-498f73258bec @@ -136,7 +136,7 @@
Learn w

08/10/23

diff --git a/neo_dolfin/transactions_ut.db b/neo_dolfin/transactions_ut.db deleted file mode 100644 index 76a61248..00000000 Binary files a/neo_dolfin/transactions_ut.db and /dev/null differ