gitenberg-dev / giten_site

django repo for running the GITenberg website
http://www.gitenberg.org
40 stars 5 forks source link

Browse Books page #65

Closed bdr99 closed 6 years ago

bdr99 commented 6 years ago

This PR adds the Browse Books page, which shows popular, recently added, and recently updated books. It adds two new database fields, added and updated, which store the date and time that a book was added to the database or updated. A custom save method in the Book model is used to update the updated timestamp only when certain fields are modified.

The popular books are determined by the number of downloads. A download is defined as when a user clicks on the "Downloads" button for a book. This is tracked by having the Downloads button link to a local URL path on the site, which redirects to the Github releases page for the book after incrementing its num_downloads value.

eshellman commented 6 years ago

I've deployed this to https://www.gitenberg.org I'd like to see the Cover model changed to store covers in filefields before running load_repos