Browse Source

adding last updated code

main
Simon Bowie 1 month ago
parent
commit
7a0022af97
4 changed files with 13 additions and 4 deletions
  1. +3
    -1
      web/app/main.py
  2. +6
    -1
      web/app/resources.py
  3. +2
    -0
      web/app/templates/about.html
  4. +2
    -2
      web/content/colophon.md

+ 3
- 1
web/app/main.py View File

@@ -50,13 +50,15 @@ def test():
# route for about page
@main.route('/about')
def about():
# get last updated date
last_updated = get_last_date()
with open('content/about.md', 'r') as f:
main_text = f.read()
main_text = markdown.markdown(main_text)
with open('content/colophon.md', 'r') as f:
sidebar_text = f.read()
sidebar_text = markdown.markdown(sidebar_text)
return render_template('about.html', main_text=main_text, sidebar_text=sidebar_text)
return render_template('about.html', main_text=main_text, sidebar_text=sidebar_text, last_updated=last_updated)

# route for events page
@main.route('/practice_seminars')

+ 6
- 1
web/app/resources.py View File

@@ -89,4 +89,9 @@ def get_book_cover(book):
else:
book_cover = {'thumbnail': openl_url}
book.update(book_cover)
return book
return book

# function to retrieve last updated date from the database
def get_last_date():
resource = Resource.query.order_by(Resource.created.asc()).filter_by(published=True).first()
return resource.created.isoformat()

+ 2
- 0
web/app/templates/about.html View File

@@ -9,6 +9,8 @@

<div id="colophon" class="cell-margin text lg:my-16">
{{ sidebar_text | safe }}

<hr>Database last updated: {{ last_updated[0:10] }}
</div>
</div>


+ 2
- 2
web/content/colophon.md View File

@@ -6,10 +6,10 @@ Back-end coding by [Simon Bowie](https://simonxix.com), front-end coding by [Joe

Special thanks to Gary Hall, Rebekka Kiesewetter, Marcell Mars, Toby Steiner, and Samuel Moore, and everyone who has provided feedback on our research or shared suggestions of examples to feature, including the participants of COPIM’s experimental publishing workshop, and Nicolás Arata, Dominique Babini, Maria Fernanda Pampin, Sebastian Nordhoff, Abel Packer, and Armanda Ramalho, and Agatha Morka.

Our appreciation also goes out to the [Next Generation Library Publishing Project](https://educopia.org/next-generation-library-publishing/) for sharing an early catalogue-in-progress version of [SComCat](https://www.scomcat.net/) with us which formed one of the inspirations behind the Compendium.
Our appreciation also goes out to the [Next Generation Library Publishing Project](https://educopia.org/next-generation-library-publishing/) for sharing an early catalogue-in-progress version of SComCat with us which formed one of the inspirations behind the Compendium.
___

Copyright © 2023 [COPIM](https://copim.ac.uk/).
Copyright © 2023–2024 [COPIM](https://copim.ac.uk/).

Design © 2023 [Joel Galvez](https://joelgalvez.com/selected).


Loading…
Cancel
Save