From 8dbfaadc02ab5288ea795ee9b844c173f41920e3 Mon Sep 17 00:00:00 2001 From: binaryatrocity Date: Fri, 25 Jul 2014 11:40:33 -0500 Subject: [PATCH] edit_event timezones, admin ts icon, fix ts3_award_points --- app/models.py | 5 +++-- app/static/img/favicon.ico | Bin 0 -> 1150 bytes app/static/img/ts3_viewer/1165367857.png | Bin 0 -> 501 bytes app/templates/edit_event.html | 13 +++++++------ app/templates/layout.html | 1 + app/templates/profile.html | 13 ++++++++----- run.py | 1 - 7 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 app/static/img/favicon.ico create mode 100644 app/static/img/ts3_viewer/1165367857.png diff --git a/app/models.py b/app/models.py index bad7a56..6645d5a 100644 --- a/app/models.py +++ b/app/models.py @@ -100,6 +100,7 @@ class User(db.Model): self.random_heroes = {'current':None, 'completed':[]} self.az_completions = 0 self.ts3_connections = {'list':[]} + self.ts3_rewardtime = datetime.utcnow() self.created = datetime.utcnow() self.last_seen = datetime.utcnow() self.bio_text = None @@ -154,14 +155,14 @@ class User(db.Model): self.ts3_endtime = now # Add general TS3 points here if self.ts3_endtime and self.ts3_rewardtime: - duration = (self.ts3_endtime - self.ts3_rewardtime) / 60.0 + delta = (self.ts3_endtime - self.ts3_rewardtime) + duration = (delta.seconds % 3600) // 60 if duration > reward_threshold: self.ts3_rewardtime = datetime.utcnow() self.points_from_ts3 += 1 else: self.ts3_rewardtime = datetime.utcnow() self.last_seen = datetime.utcnow() - print self.ts3_starttime, self.ts3_endtime, self.ts3_rewardtime db.session.commit(); def finalize_connection(self): diff --git a/app/static/img/favicon.ico b/app/static/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..b2d43e29af7ae8fa25c1ddb3203f77bb01fd2901 GIT binary patch literal 1150 zcmaKsdu&rx9LK-y>Toi`X!o*Z>)Nfiy?v~`z4mr}+_t0b#@61}mI9aXaDyclrhyTI zyt_>U#2HLE~Ma?*rYa&b#m3mc~#9RVZI#oqfzL`;)}HB#S4~q z)5LNvL6#@o-x?aZ?k1t7i5uOVuzj?lc^CN++Oxqq`bHZM6yzMZB+c6K-RgSofyx*?XmJ zE?AY$me`yzJl||@6u#cR&2??dI_CKfwg1lp5Z>wC>YLn69-lr+r13#wPbY|7h+T7d zV@oLriD9&cTXFu_FqWw`&}b^bn62O=X-H%gfw%geYyIUAS@Zh|BL8-hcrW%6S2Q`s zyF1GGa1txy?Z`=K$k{AvYad0pH4dL&1Q*F*8BpRM$X`r+F+|qiI6>ClJx!8#he=@n zlRxu5sm&2fV#$s;65(8N9mXazT6{qS#Rxoc86I&}snEXqxHl(XcRrQfbaA)dMWU58L*pDLEFXuqydEak-aeC?Gy?#uA0+S?=CyrxlT&R)f>mTQ(qE-~{j zcqOpHtxer#!ijpuTexXjr zAFp;i(JDLRQf(7^%5^dOQ=MyRnoPgj&)1aOM5xC$N_efyyT0OCe1LM;&E2A1U*82R pKH}@c|6%_|p~WX7)-3;Zu6|ut+tl80ejQNgd%F6$taD0e0sxc8$kPA- literal 0 HcmV?d00001 diff --git a/app/templates/edit_event.html b/app/templates/edit_event.html index b7a8fd9..5f6205f 100644 --- a/app/templates/edit_event.html +++ b/app/templates/edit_event.html @@ -65,13 +65,14 @@ diff --git a/app/templates/profile.html b/app/templates/profile.html index 2a61d39..878748c 100644 --- a/app/templates/profile.html +++ b/app/templates/profile.html @@ -63,15 +63,15 @@ TS Points - 0 + {{ user.points_from_ts3 }} Events Points - 0 + {{ user.points_from_events }} Forum Points - 0 + {{ user.points_from_forum }} Last Seen @@ -83,8 +83,13 @@ + {% if not user.winrate_data['data'] %} +

No data compiled, check back tomorrow!

+ + {% else %} {% endif %} + {% endif %} @@ -99,7 +104,6 @@ {% block pagescripts %} -{% cache 60*700 %} -{% endcache %} {% endblock %} diff --git a/run.py b/run.py index b603c46..35473d0 100755 --- a/run.py +++ b/run.py @@ -70,7 +70,6 @@ def admin(name): @manager.command def calc_winrates(): from app.analytics import calculate_winrates - tsServer = createTeamspeakInstance() calculate_winrates() @manager.command