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 511121df19e6a218408b01e27e55da267104cafc..2381d899d87911269e92ef0719c504e5631b5c35 100644 (file)
Binary files a/data/db.sqlite3 and b/data/db.sqlite3 differ
index 8177d414d07a05de9e5e510d090a7743c02e81bd..fbc9721ef55391997a7dca4f1d6410cd3fab1d67 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 5ed434b1e13ec0c79fa57a098b0a387521408f98..988e78390c0a8b4f2e704d143df7c5f8374f98de 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 0d97cf37a359c54b75d82d0912d4e232e5b74224..af2c7202351a4d6c2efe5e3efbe3bb6026f9bcff 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 011eccf563a14e4e6d2a6a86e6ab341a330f9aae..d6d6edad1d538bc6cdec55b0940af0983f378252 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 a0f9650589ac2dbb7552007f75be2d3a6ab523c5..b6109fee1f1795feab9cc6429d7d4dd344a96ed7 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')
 )