diff --git a/apps/accounts/models.py b/apps/accounts/models.py index 0a34937..5761f47 100644 --- a/apps/accounts/models.py +++ b/apps/accounts/models.py @@ -17,10 +17,16 @@ class Account(models.Model): def __str__(self): return self.user.username - def get_xp_daily_report(self): + def get_xp_10daily_report(self): return [ diary.get_earned_xp() - for diary in self.diaries.order_by("-created_date")[:30] + for diary in self.diaries.order_by("-created_date")[:10] + ][::-1] + + def get_xp_31daily_report(self): + return [ + diary.get_earned_xp() + for diary in self.diaries.order_by("-created_date")[:31] ][::-1] def get_full_name(self): diff --git a/templates/clans/overview.html b/templates/clans/overview.html index 03a5b2e..39d84f7 100644 --- a/templates/clans/overview.html +++ b/templates/clans/overview.html @@ -289,7 +289,7 @@

Overview

-

Reports for the last 30 days by Diary's XP

+

Reports for the last 31 days by Diary's XP

@@ -327,7 +327,7 @@

Overview

- +
@@ -388,7 +388,7 @@

Overview

app.querySelector('#accounts-10day-report-chart', function (el) { const {% for account in top_accounts %} - datasetData{{ forloop.counter }} = {{ account.get_xp_daily_report }}, + datasetData{{ forloop.counter }} = {{ account.get_xp_10daily_report }}, {% endfor %} canvas = el[0], @@ -494,10 +494,10 @@

Overview

}); -app.querySelector('#accounts-30day-report-chart', function (el) { +app.querySelector('#accounts-31day-report-chart', function (el) { const {% for account in top_accounts %} - datasetData{{ forloop.counter }} = {{ account.get_xp_daily_report }}, + datasetData{{ forloop.counter }} = {{ account.get_xp_31daily_report }}, {% endfor %} canvas = el[0],