From 6d8f2afbb6e599c8a0f9038d2b099a9d38297cb5 Mon Sep 17 00:00:00 2001 From: Cailean Finn Date: Sun, 1 Dec 2024 15:02:52 +0000 Subject: [PATCH] activity list added --- app.py | 16 ++++++++++++ static/assets/styles.css | 34 ++++++++++++++++++++++++- templates/_activities.html | 5 ++++ templates/_article.html | 14 +++++++++++ templates/_list.html | 25 +++++++++++++++++++ templates/_main.html | 5 ++++ templates/_nav.html | 32 ++++++++++++++++++++++++ templates/activities.html | 9 +++++++ templates/index.html | 51 +------------------------------------- 9 files changed, 140 insertions(+), 51 deletions(-) create mode 100644 templates/_activities.html create mode 100644 templates/_article.html create mode 100644 templates/_list.html create mode 100644 templates/_main.html create mode 100644 templates/_nav.html create mode 100644 templates/activities.html diff --git a/app.py b/app.py index 03210cf..395aee0 100644 --- a/app.py +++ b/app.py @@ -16,6 +16,7 @@ class WikiApp(Flask): # Define routes # self.route('/', methods=['GET'])(self.homepage) self.route('/', methods=['GET'])(self.home) + self.route('/activities', methods=['GET'])(self.activities) self.route('/data', methods=['GET'])(self.data_int) self.route('/newsletter/', methods=['GET'])(self.generate_newsletter) self.route('/publications', methods=['GET'])(self.fetch_publications) @@ -38,6 +39,21 @@ class WikiApp(Flask): homepage_content += page_content print(table) return render_template('index.html', title=pages[0], cont=homepage_content, table=table) + + def activities(self): + # fetch publications as test + activity_list = self.get_activities() + return render_template('activities.html', title="Activities", activities=activity_list) + + def get_activities(self): + concepts = ['Newsletters', 'Projects'] + publication_page_list = self.fetch_all_pages(concepts) + updated_cat_list = self.fetch_pages_cat(publication_page_list) + projects = updated_cat_list.get('Projects', []) + sorted_prj = dict(sorted(projects.items(), key=lambda item: datetime.strptime(item[1]['date'], "%d.%m.%Y" ), reverse=True) ) + newsletters = updated_cat_list.get('Newsletters', []) + sorted_nl = dict(sorted(newsletters.items(), key=lambda item: datetime.strptime(item[1]['date'], "%d.%m.%Y" ), reverse=True) ) + return sorted_nl def data_int(self): return render_template('data.html') diff --git a/static/assets/styles.css b/static/assets/styles.css index b2981c1..ff4c9d7 100644 --- a/static/assets/styles.css +++ b/static/assets/styles.css @@ -136,6 +136,12 @@ a { background-color: black; /* Color of the line */ } +#activity-list { + display: flex; + flex-direction: column; + gap: 40px; +} + /* table */ @@ -149,7 +155,8 @@ table { border-spacing: 20px; border-color: gray; border-radius: 30px; - font-size: 16px; + font-size: 20px; + text-align: left; } th { @@ -208,6 +215,31 @@ p { font-weight: bold; } +.activity { + color: black; + display: flex; + flex-direction: column; + gap:20px; +} + +.activity-title { + text-decoration: underline; + font-weight: bold; +} + +.activity-image { + width: 60%; + height: 400px; + overflow: hidden; +} + +.activity-image img { + width: 100%; + height: 100%; + object-fit: cover; + object-position: center; +} + /* headers */ h4 { font-size: 24px; diff --git a/templates/_activities.html b/templates/_activities.html new file mode 100644 index 0000000..012a243 --- /dev/null +++ b/templates/_activities.html @@ -0,0 +1,5 @@ +
+ {% include "_nav.html" %} +
+ {% include "_list.html" %} +
\ No newline at end of file diff --git a/templates/_article.html b/templates/_article.html new file mode 100644 index 0000000..28ec093 --- /dev/null +++ b/templates/_article.html @@ -0,0 +1,14 @@ +
+
{{ title | safe }}
+
+ {{ cont | safe }} +
+
✲ ✲ ✲
+
+ {%if table != None %} +
+ {{ table | safe }} +
+ {%endif%} +
+
\ No newline at end of file diff --git a/templates/_list.html b/templates/_list.html new file mode 100644 index 0000000..4187f15 --- /dev/null +++ b/templates/_list.html @@ -0,0 +1,25 @@ +
+
{{ title | safe }}
+

This is our activities!

+
✲ ✲ ✲
+
+
+ {% for key, value in activities.items() %} + +
+

{{ key }} ({{ value.date }})

+
+
+
+ {% endfor %} +
+
+
✲ ✲ ✲
+
+ {%if table != None %} +
+ {{ table | safe }} +
+ {%endif%} +
+
\ No newline at end of file diff --git a/templates/_main.html b/templates/_main.html new file mode 100644 index 0000000..9608cbc --- /dev/null +++ b/templates/_main.html @@ -0,0 +1,5 @@ +
+{% include "_nav.html" %} +
+{% include "_article.html" %} +
\ No newline at end of file diff --git a/templates/_nav.html b/templates/_nav.html new file mode 100644 index 0000000..f0828af --- /dev/null +++ b/templates/_nav.html @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/templates/activities.html b/templates/activities.html new file mode 100644 index 0000000..00f4bda --- /dev/null +++ b/templates/activities.html @@ -0,0 +1,9 @@ +{% extends "_base.html" %} + +{% block title %}CONCEPT NULL{% endblock %} + +{% block content %} + +{% include "_activities.html" %} + +{% endblock %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 0c337d3..8ef4d7b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,56 +3,7 @@ {% block title %}CONCEPT NULL{% endblock %} {% block content %} -
-
-
-
- .g8"""bgd .g8""8q. `7MN. `7MF' .g8"""bgd `7MM"""YMM `7MM"""Mq. MMP""MM""YMM -.dP' `M .dP' `YM. MMN. M .dP' `M MM `7 MM `MM.P' MM `7 -dM' ` dM' `MM M YMb M dM' ` MM d MM ,M9 MM -MM MM MM M `MN. M MM MMmmMM MMmmdM9 MM -MM. MM. ,MP M `MM.M MM. MM Y , MM MM -`Mb. ,' `Mb. ,dP' M YMM `Mb. ,' MM ,M MM MM - `"bmmmd' `"bmmd"' .JML. YM `"bmmmd' .JMMmmmmMMM .JMML. .JMML.
-
-`7MN. `7MF'`7MMF' `7MF'`7MMF' `7MMF' - MMN. M MM M MM MM - M YMb M MM M MM MM - M `MN. M MM M MM MM - M `MM.M MM M MM , MM , - M YMM YM. ,M MM ,M MM ,M -.JML. YM `bmmmmd"' .JMMmmmmMMM .JMMmmmmMMM
-
✲ ✲ ✲
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat dignissim justo, posuere imperdiet justo condimentum at. Sed eget odio vitae velit efficitur facilisis lacinia eget libero. Donec ex magna, laoreet id hendrerit at, varius et sem. Phasellus tempor ante in felis vehicula, vitae rhoncus tellus posuere. Ut nec sodales urna. Sed molestie lectus vel dolor maximus, sed cursus urna mattis. Cras eu mauris sit amet mauris lacinia accumsan vitae eu arcu. Duis quis mollis mauris. Maecenas condimentum ac tortor vel sodales. Fusce eget erat ut odio interdum porta. Donec placerat nisl id dui dapibus, finibus volutpat massa placerat. Donec commodo pellentesque ipsum eget ullamcorper. Praesent fermentum sit amet turpis sit amet sagittis. Aliquam tempus, sapien eget tincidunt luctus, urna felis molestie dolor, ac blandit arcu erat vitae eros. Morbi a lacus laoreet, varius eros ut, rutrum nibh.

- -
- -
-
+{% include "_main.html" %} -
-
{{ title | safe }}
-
- {{ cont | safe }} -
-
✲ ✲ ✲
-
- {%if table != None %} -
- {{ table | safe }} -
- {%endif%} -
- -
-
{% endblock %} \ No newline at end of file