Brandon Cornejo
11 years ago
18 changed files with 1757 additions and 258 deletions
-
2.gitignore
-
7forms.py
-
83models.py
-
1250static/country_codes.xml
-
38static/css/app.css
-
2static/css/heropedia.css
-
5static/css/ts3_viewer.css
-
9teamspeak.py
-
87templates/hero_random.html
-
155templates/index.html
-
37templates/layout.html
-
41templates/profile.html
-
41templates/settings.html
-
12templates/sidenav.html
-
2templates/teamspeak.html
-
69utils.py
-
91views.py
@ -0,0 +1,7 @@ |
|||
from flask.ext.wtf import Form |
|||
from wtforms import TextField, BooleanField, TextAreaField |
|||
|
|||
class SettingsForm(Form): |
|||
public = BooleanField('public', default=True) |
|||
twitch = TextField('twitch') |
|||
bio_text = TextAreaField('bio_text') |
1250
static/country_codes.xml
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,87 @@ |
|||
{% extends "layout.html" %} |
|||
{% block head %} |
|||
<link rel="stylesheet" href="{{ url_for('static', filename='css/heropedia.css') }}" > |
|||
{% endblock %} |
|||
|
|||
{% block title %} A-Z Challenge: {{ user.nickname }}{% endblock %} |
|||
|
|||
{% block content %} |
|||
{% set taverns = heropedia() %} |
|||
<h2 class="uk-text-center">{{ user.nickname }}'s A-Z Challenge</h2> |
|||
<hr /> |
|||
<div class="uk-grid"> |
|||
<div class="uk-width-large-1-3 uk-width-medium-1-1 uk-panel uk-text-center uk-margin-bottom"> |
|||
<h3 class="uk-panel-title">Current Hero</h3> |
|||
<h4 class="uk-text-bold uk-margin-remove">{{ user.random_hero['localized_name'] }}</h4> |
|||
<img src="{{ url_for('static', filename=hero_image_large(user.random_hero)) }}" class="dn-hero-icon" /> |
|||
|
|||
<p> |
|||
<span id="heroes_completed">Heroes Completed: {{ user.random_heroes.completed | length }}</span><br/> |
|||
<span id="heroes_left">Heroes Left: {{ total_hero_pool() - user.random_heroes.completed|length }}</span> |
|||
</span> |
|||
</p> |
|||
|
|||
{% if g.user and g.user.steamid == user.steamid %} |
|||
<form action="{{ url_for('user_random_hero', userid=g.user.id) }}" method="post" id="random_form" class="uk-margin"> |
|||
<input type="checkbox" name="completed" id="completed_checkbox" style="display:none;"> |
|||
<input type="checkbox" name="skip" id="skip_checkbox" style="display:none;"> |
|||
<a class="uk-button uk-button-success" id="completed_button">Completed!</a> |
|||
<a class="uk-button uk-button-primary" id="skip_button">Skip</a> |
|||
</form> |
|||
{% endif %} |
|||
</div> |
|||
<div class="uk-width-large-2-3 uk-width-medium-1-1 uk-panel uk-text-center uk-margin"> |
|||
<div class="uk-badge uk-panel-badge uk-badge-notification uk-badge-success">x1</div> |
|||
<h3 class="uk-panel-title">Completed</h3> |
|||
{% for hero in user.random_heroes.completed %} |
|||
<img src="{{ url_for('static', filename=hero_image_small(hero)) }}" class="dn-hero-icon" /> |
|||
{% endfor %} |
|||
<br/><br/> |
|||
<br/><br/> |
|||
</div> |
|||
<div class="uk-width-large-2-3 uk-width-medium-1-1 uk-container-center"> |
|||
<ul class="uk-tab" data-uk-tab="{connect:'#taverns'}"> |
|||
<li class="uk-active"><a href="">Strength</a></li> |
|||
<li><a href="">Agility</a></li> |
|||
<li><a href="">Intelligence</a></li> |
|||
</ul> |
|||
<ul id="taverns" class="uk-switcher uk-margin"> |
|||
<li><div class="uk-panel tavern"> |
|||
<label id="tavernStrength">Strength</label> |
|||
{% for hero in taverns[0][1] + taverns[3][1] %} |
|||
<img class="{{hero['name'] in user.random_completed and 'filterUnmatchedHero' or 'filterMatchedHero' }}" id="{{ hero['name'] }}" src="{{ url_for('static', filename=hero_image_small(hero)) }}" /> |
|||
{% endfor %} |
|||
</div></li> |
|||
<li><div class="uk-panel tavern"> |
|||
<label id="tavernAgility">Agility</label> |
|||
{% for hero in taverns[1][1] + taverns[4][1] %} |
|||
<img class="{{hero['name'] in user.random_completed and 'filterUnmatchedHero' or 'filterMatchedHero' }}" id="{{ hero['name'] }}" src="{{ url_for('static', filename=hero_image_small(hero)) }}" /> |
|||
{% endfor %} |
|||
</div> </li> |
|||
<li><div class="uk-panel tavern"> |
|||
<label id="tavernIntelligence">Intelligence</label> |
|||
{% for hero in taverns[2][1] + taverns[5][1] %} |
|||
<img class="{{hero['name'] in user.random_completed and 'filterUnmatchedHero' or 'filterMatchedHero' }}" id="{{ hero['name'] }}" src="{{ url_for('static', filename=hero_image_small(hero)) }}" /> |
|||
{% endfor %} |
|||
</div> </li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
{% endblock %} |
|||
|
|||
{% if g.user and g.user.id == user.id %} |
|||
{% block pagescripts %} |
|||
<script> |
|||
$(document).ready(function() { |
|||
$('#completed_button').click( function() { |
|||
$('#completed_checkbox').attr('checked', true); |
|||
$('#random_form').submit(); |
|||
}); |
|||
$('#skip_button').click( function() { |
|||
$('#skip_checkbox').attr('checked', true); |
|||
$('#random_form').submit(); |
|||
}); |
|||
}); |
|||
</script> |
|||
{% endblock %} |
|||
{% endif %} |
@ -0,0 +1,41 @@ |
|||
{% extends "layout.html" %} |
|||
|
|||
{% block title %}Settings for {{ g.user.nickname }} - DotaNoobs {% endblock %} |
|||
|
|||
{% block content %} |
|||
<div class="uk-grid" data-uk-grid-margin> |
|||
<div class="uk-width-2-3"> |
|||
<h2 class="uk-float-left"><img class="" src="{{ user.avatar }}" /> {{ user.nickname }}</h2> |
|||
</div> |
|||
<div class="uk-width-1-3 uk-text-center"> |
|||
</div> |
|||
<!--Main content area --> |
|||
<div class="uk-width-large-2-3 uk-width-medium-1-1 uk-panel"> |
|||
<form class="uk-form uk-form-width-large" action="" method="post" name="settings"> |
|||
{{ form.hidden_tag() }} |
|||
<fieldset data-uk-margin> |
|||
<legend>Settings</legend> |
|||
<div class="uk-form-row"> |
|||
<ul class="uk-list"> |
|||
<li><label class="uk-form-label"> {{ form.public }} Public Profile</label></li> |
|||
<li><label class="uk-form-label"><input type="checkbox" disabled> Show Big Logo</label></li> |
|||
<li><label class="uk-form-label"><input type="checkbox" disabled> Nonexistant Setting</label></li> |
|||
</ul> |
|||
</div> |
|||
<div class="uk-form-row"> |
|||
<label class="uk-form-label">Twitch.tv Username:</label> <br/> |
|||
{{ form.twitch(placeholder="e.g. shaneomad") }} |
|||
</div> |
|||
<div class="uk-form-row"> |
|||
<label class="uk-form-label">Biography text:</label><br/> |
|||
{{ form.bio_text(rows=14, class='uk-width-1-1', data=g.user.bio_text, placedholder='What you place here is displayed in your profile when other users view it.') }} |
|||
</div> |
|||
<div class="uk-form-controls uk-margin-top"> |
|||
<button class="uk-button uk-button-success" type="submit">Save</button> |
|||
<a class="uk-button" href="{{ url_for('user_profile', userid=g.user.id) }}">Cancel</a> |
|||
</div> |
|||
</fieldset> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
{% endblock %} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue