Browse Source

edit_event timezones, admin ts icon, fix ts3_award_points

master
Brandon Cornejo 11 years ago
parent
commit
8dbfaadc02
  1. 5
      app/models.py
  2. BIN
      app/static/img/favicon.ico
  3. BIN
      app/static/img/ts3_viewer/1165367857.png
  4. 13
      app/templates/edit_event.html
  5. 1
      app/templates/layout.html
  6. 13
      app/templates/profile.html
  7. 1
      run.py

5
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):

BIN
app/static/img/favicon.ico

BIN
app/static/img/ts3_viewer/1165367857.png

After

Width: 16  |  Height: 16  |  Size: 501 B

13
app/templates/edit_event.html

@ -65,13 +65,14 @@
<link rel=stylesheet href="//cdnjs.cloudflare.com/ajax/libs/uikit/2.4.0/addons/datepicker/datepicker.gradient.css"></link>
<script>
$(document).ready(function(){
var s = $("#start_time").val().split(" ");
var e = $("#end_time").val().split(" ");
var tz = new Date().getTimezoneOffset();
var s = moment.utc($("#start_time").val(), "DD.MM.YYYY HH:mm").zone(tz);
var e = moment.utc($("#end_time").val(), "DD.MM.YYYY HH:mm").zone(tz);
$("#start_d").val(s[0]);
$("#start_t").val(s[1]);
$("#end_d").val(e[0]);
$("#end_t").val(e[1]);
$("#start_d").val(s.format("DD.MM.YYYY"));
$("#start_t").val(s.format("HH:mm"));
$("#end_d").val(e.format("DD.MM.YYYY"));
$("#end_t").val(e.format("HH:mm"));
});
$(".uk-form").submit(function(event) {

1
app/templates/layout.html

@ -12,6 +12,7 @@
<!-- CSS includes -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/uikit/2.8.0/css/uikit.gradient.min.css" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/app.css') }}" />
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.ico') }}">
<!-- Javascript includes -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

13
app/templates/profile.html

@ -63,15 +63,15 @@
<tbody class="uk-text-small">
<tr>
<td class="uk-width-4-10">TS Points</td>
<td class="uk-width-6-10 uk-text-right">0</td>
<td class="uk-width-6-10 uk-text-right">{{ user.points_from_ts3 }}</td>
</tr>
<tr>
<td>Events Points</td>
<td class="uk-text-right">0</td>
<td class="uk-text-right">{{ user.points_from_events }}</td>
</tr>
<tr>
<td>Forum Points</td>
<td class="uk-text-right">0</td>
<td class="uk-text-right">{{ user.points_from_forum }}</td>
</tr>
<tr>
<td>Last Seen</td>
@ -83,8 +83,13 @@
</tr>
</tbody>
</table>
{% if not user.winrate_data['data'] %}
<h3 class="uk-text-warning">No data compiled, check back tomorrow!</h3>
<button class="uk-button uk-button-success uk-align-center" data-uk-modal="{target: '#winrate_modal'}" disabled>View Winrate</button>
{% else %}
<button class="uk-button uk-button-success uk-align-center" data-uk-modal="{target: '#winrate_modal'}">View Winrate</button>
{% endif %}
{% endif %}
</div>
</div>
@ -99,7 +104,6 @@
{% block pagescripts %}
<script src="http://code.highcharts.com/highcharts.js"></script>
{% cache 60*700 %}
<script>
$('#winrate_modal').on({
'uk.modal.show': function(){
@ -130,5 +134,4 @@
});
});
</script>
{% endcache %}
{% endblock %}

1
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

Loading…
Cancel
Save