From 94a20a8818ffff48a6ee06c451d3e6ce78f7d002 Mon Sep 17 00:00:00 2001 From: Krateng Date: Thu, 19 Dec 2019 20:05:50 +0100 Subject: [PATCH] Added pyhp partials --- maloja/web/partial/charts_artists.pyhp | 76 ++++++++++++++++++++++++++ maloja/web/partial/pagination.pyhp | 59 ++++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 maloja/web/partial/charts_artists.pyhp create mode 100644 maloja/web/partial/pagination.pyhp diff --git a/maloja/web/partial/charts_artists.pyhp b/maloja/web/partial/charts_artists.pyhp new file mode 100644 index 0000000..7bb9582 --- /dev/null +++ b/maloja/web/partial/charts_artists.pyhp @@ -0,0 +1,76 @@ + + + if amountkeys.get("max_") is not None: amountkeys["perpage"],amountkeys["page"] = amountkeys["max_"],0 + firstindex = amountkeys["page"] * amountkeys["perpage"] + lastindex = firstindex + amountkeys["perpage"] + + + + + + + + + + try: + artistslast = db.get_charts_artists(**filterkeys,timerange=limitkeys["timerange"].next(step=-1)) + # create rank association + lastrank = {} + for al in artistslast: + lastrank[al["artist"]] = al["rank"] + for a in artists: + try: + a["delta"] = lastrank[a["artist"]] - a["rank"] + except: + a["delta"] = math.inf + except: + pass + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#🆕↗↘➡
+ + + + + diff --git a/maloja/web/partial/pagination.pyhp b/maloja/web/partial/pagination.pyhp new file mode 100644 index 0000000..2449a98 --- /dev/null +++ b/maloja/web/partial/pagination.pyhp @@ -0,0 +1,59 @@ + + + + + + + + +
+ + + + + 1 + + + | + + + + ... | + + + + + + + + + « + + + + + + + + » + + + + + + + + + | ... + + + + | + + + + + + + +