Merge pull request #24 from g-goessel/add_index_counter
Adds a counter of indexed torrents on the homepage
This commit is contained in:
commit
98fac967d2
@ -67,7 +67,13 @@ def requires_auth(f):
|
|||||||
@app.route("/")
|
@app.route("/")
|
||||||
@requires_auth
|
@requires_auth
|
||||||
def home_page():
|
def home_page():
|
||||||
return flask.render_template("homepage.html")
|
magneticod_db = get_magneticod_db()
|
||||||
|
|
||||||
|
with magneticod_db:
|
||||||
|
cur = magneticod_db.execute("SELECT count() FROM torrents ;")
|
||||||
|
n_torrents = cur.fetchone()[0]
|
||||||
|
|
||||||
|
return flask.render_template("homepage.html", n_torrents=n_torrents)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/torrents/")
|
@app.route("/torrents/")
|
||||||
|
@ -20,4 +20,11 @@ main form input {
|
|||||||
|
|
||||||
main > div {
|
main > div {
|
||||||
margin-right: 0.5em;
|
margin-right: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
margin-top: 0.833em;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
@ -15,5 +15,9 @@
|
|||||||
<input type="search" name="search" placeholder="Search the BitTorrent DHT" autofocus>
|
<input type="search" name="search" placeholder="Search the BitTorrent DHT" autofocus>
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
Now with {{n_torrents}} torrents available !
|
||||||
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user