Parcourir la source

adding last updated code

main
Simon Bowie il y a 1 an
Parent
révision
7a0022af97
4 fichiers modifiés avec 13 ajouts et 4 suppressions
  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 Voir le fichier

# route for about page # route for about page
@main.route('/about') @main.route('/about')
def about(): def about():
# get last updated date
last_updated = get_last_date()
with open('content/about.md', 'r') as f: with open('content/about.md', 'r') as f:
main_text = f.read() main_text = f.read()
main_text = markdown.markdown(main_text) main_text = markdown.markdown(main_text)
with open('content/colophon.md', 'r') as f: with open('content/colophon.md', 'r') as f:
sidebar_text = f.read() sidebar_text = f.read()
sidebar_text = markdown.markdown(sidebar_text) 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 # route for events page
@main.route('/practice_seminars') @main.route('/practice_seminars')

+ 6
- 1
web/app/resources.py Voir le fichier

else: else:
book_cover = {'thumbnail': openl_url} book_cover = {'thumbnail': openl_url}
book.update(book_cover) 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 Voir le fichier



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

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



+ 2
- 2
web/content/colophon.md Voir le fichier



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. 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). Design © 2023 [Joel Galvez](https://joelgalvez.com/selected).



Chargement…
Annuler
Enregistrer