some beauty fixes
authorJess <jessicatz.fairymeadow@gmail.com>
Sat, 20 Sep 2014 22:49:02 +0000 (00:49 +0200)
committerJess <jessicatz.fairymeadow@gmail.com>
Sat, 20 Sep 2014 22:49:02 +0000 (00:49 +0200)
data/db.sqlite3
meta/static/js/main.js
meta/templates/base.html
meta/templates/index.html
meta/views.py
mlpccg-web/urls.py

index 511121d..2381d89 100644 (file)
Binary files a/data/db.sqlite3 and b/data/db.sqlite3 differ
index 8177d41..fbc9721 100644 (file)
@@ -7,7 +7,7 @@ function rateDeck() {
 var tournaments = new Bloodhound({
     datumTokenizer: Bloodhound.tokenizers.obj.nonword('name'),
     queryTokenizer: Bloodhound.tokenizers.nonword,
-    prefetch: '/tournaments'
+    prefetch: '/tournaments_json'
 });
 
 tournaments.clearPrefetchCache()
index 5ed434b..988e783 100644 (file)
     <div class="navbar navbar-default navbar-fixed-top" role="navigation">
       <div class="container">
         <div class="navbar-header">
-          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
-            <span class="sr-only">Toggle navigation</span>
-            <span class="icon-bar"></span>
-            <span class="icon-bar"></span>
-            <span class="icon-bar"></span>
-          </button>
-          <a class="navbar-brand" href="{% url 'meta.views.index' %}">meta is magic</a>
-        </div>
-        <div class="navbar-right">
-          <a class="navbar-brand" href="{% url 'meta.views.index' %}">BETA</a>
+          <a class="navbar-brand" href="{% url 'meta.views.index' %}">meta is magic BETA</a>
         </div>
         <!-- <div class="navbar-collapse collapse"> -->
         <!--   <form class="navbar-form navbar-right" role="form"> -->
index 0d97cf3..af2c720 100644 (file)
@@ -13,7 +13,7 @@
         {% csrf_token %}
         <div class="form-group">
           <label class="sr-only" for="ponyheadURL">ponyhead decklist url</label>
-          <input type="url" name="url" class="form-control input-lg" id="ponyheadURL" placeholder="Deck URL"/>
+          <input type="url" name="url" class="form-control input-lg" id="ponyheadURL" placeholder="PonyHead URL"/>
           <button type="submit" class="btn btn-lg btn-default btn-primary">Tell me!</button>
         </div>
       </form>
@@ -87,7 +87,9 @@
         {% csrf_token %}
         <div class="form-group">
           <label class="sr-only" for="ponyheadURL">ponyhead decklist url</label>
-          <input type="url" name="url" class="form-control input-lg" id="ponyheadURL" placeholder="Deck URL"/>
+          <input type="url" name="url" class="form-control input-lg" id="ponyheadURL" placeholder="PonyHead URL"/>
+          <label class="sr-only" for="decklistName">decklist name</label>
+          <input type="text" name="text" class="form-control input-lg" id="decklistName" placeholder="Deck name (optional)"/>
           <button type="submit" class="btn btn-lg btn-default btn-primary">Add me!</button>
         </div>
       </form>
index 011eccf..d6d6eda 100644 (file)
@@ -26,7 +26,7 @@ def index(request):
         'tournaments': tournament_data
     }, context_instance=RequestContext(request))
 
-def tournaments(request):
+def tournaments_json(request):
     return HttpResponse(json.dumps([{'name': t.name, 'id': t.id} for t in TournamentModel.objects.all()]),
                         content_type='application/json')
 
@@ -42,8 +42,22 @@ def tournaments_detail(request, tournament_id):
         'records': records,
         'tournament': tournament})
 
+def decklists(request):
+    decklists = DeckListModel.objects.all()
+
+    return render(request, 'decklists.html', {
+        'decklists': decklists})
+
+def decklists_detail(request, decklist_id):
+    decklist = get_object_or_404(DeckListModel, pk=decklist_id)
+
+    return render(request, 'decklists_detail.html', {
+        'decklist': decklist})
+
 def rate(request):
-    decklist = DeckList(url=request.POST['url'])
+    url = request.POST.get('url', 'v1code=%s' % request.GET.get('v1code'))
+
+    decklist = DeckList(url=url)
 
     if request.POST.get('d_name') and request.POST.get('t_date') and request.POST.get('t_name') and request.POST.get('t_placement'):
         try:
index a0f9650..b6109fe 100644 (file)
@@ -8,6 +8,7 @@ urlpatterns = patterns(
     url(r'^admin/', include(admin.site.urls)),
     url(r'^$', 'meta.views.index'),
     url(r'^rate$', 'meta.views.rate'),
-    url(r'^tournaments$', 'meta.views.tournaments'),
-    url(r'^tournaments/(?P<tournament_id>\d+)$', 'meta.views.tournaments_detail')
+    url(r'^tournaments_json$', 'meta.views.tournaments_json'),
+    url(r'^tournaments/(?P<tournament_id>\d+)$', 'meta.views.tournaments_detail'),
+    url(r'^decklists$', 'meta.views.decklists')
 )