Permalink
Browse files

Merge pull request #128 from rossbruniges/admin-winners

Closes #120, #121, #122 - allowing winners to be chosen and then displayed
  • Loading branch information...
2 parents d3380b1 + 13d538c commit 2079dc529dd7746baf9fc70f73fc105f36b05735 @rossbruniges rossbruniges committed Feb 25, 2013
@@ -48,6 +48,14 @@ div[role=main] .big-picture .busta {
-moz-animation: float 3s infinite;
animation: float 3s infinite;
}
+.closed div[role=main] .big-picture .busta {
+ padding: 2em 30px 2em 360px;
+ background: url('/static/base/img/home/winning-cup.png') 40px 2em no-repeat;
+ position: relative;
+ -webkit-animation: none;
+ -moz-animation: none;
+ animation: none;
+}
.big-picture .busta > i {
content: "";
width: 305px;
@@ -113,6 +121,61 @@ div[role=main] .big-picture .busta {
.build li.market:before {
background-image: url('/static/base/img/home/panel-market.png');
}
+.winners li {
+ padding: 30px;
+ margin: 0;
+ background: #e6e6e6;
+ border: 1px solid #c4c4c4;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ width: 31%;
+ margin-right: 2%;
+ min-height: 300px;
+}
+.entries li:nth-child(3n+1) {
+ clear: none;
+}
+.winners li:before {
+ content: none;
+}
+.winners li h2 {
+ margin-top: 0.2em;
+}
+.winners .champ {
+ width: 97%;
+ position: relative;
+ margin: 0 0 1em 0;
+ min-height: 20px;
+}
+.winners li b {
+ color: #000;
+}
+.winners li a {
+ position: relative;
+}
+.winners .champ a {
+ position: static;
+}
+.winners .frame {
+ max-height: 120px;
+}
+.champ .frame {
+ width: 300px;
+ max-height: 200px;
+ margin-right: 20px;
+}
+.winners .badge {
+ left: -10px;
+ top: 10px;
+ background: transparent;
+ padding: 0;
+ width: auto;
+}
+.winners .champ .badge {
+ top: 20px;
+ left: 25px;
+}
.gameon_partners .col {
float: left;
width: 50%;
@@ -277,7 +340,8 @@ div[role=main] .big-picture .busta {
}
@media all and (max-width: 800px) {
- div[role=main] .big-picture .busta {
+ div[role=main] .big-picture .busta,
+ .closed div[role=main] .big-picture .busta {
background-image: none;
-webkit-animation: none;
-moz-animation: none;
@@ -327,6 +391,29 @@ div[role=main] .big-picture .busta {
margin-left: 0;
left: 0;
}
+ .winners li {
+ padding: 10px;
+ margin-right: 0;
+ min-height: 30px;
+ }
+ .winners .frame {
+ max-height: 200px;
+ }
+ .winners .champ {
+ width: 100%;
+ }
+ .winners .champ .frame {
+ width: 100%;
+ max-height: 300px;
+ }
+ .winners .badge {
+ left: -5px;
+ top: 10px;
+ }
+ .winners .champ .badge {
+ top: 0;
+ left: 5px;
+ }
.partners li {
padding-left: 0;
height: auto;
@@ -332,6 +332,7 @@ nav li a {
box-sizing: border-box;
padding: 0 10px;
margin-bottom: 1em;
+ position: relative;
}
.entries li:nth-child(3n+1) {
clear: left;
@@ -340,6 +341,15 @@ nav li a {
width: 100%;
height: auto;
display: block;
+ position: relative;
+ z-index: 10;
+}
+.entries .badge {
+ width: auto;
+ position: absolute;
+ top: -1em;
+ left: 0;
+ z-index: 20;
}
.entries .cta {
margin-top: 0.5em;
@@ -507,6 +517,9 @@ nav li a {
width: auto;
margin-right: 0;
}
+ .entries .badge {
+ width: 40%;
+ }
.mini-col {
float: none;
width: auto;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,88 @@
+{% extends 'base.html' %}
+
+{% block page_css %}
+<link rel="stylesheet" href="{{ static('base/css/home.css') }}">
+{% endblock %}
+
+{% block page_title %}Homepage{% endblock %}
+{% block page_id %}home{% endblock %}
+{% block section_class %}landing closed{% endblock %}
+
+{% block header_logo %}
+ <h1 class="logo"><a href="{{ url('static_site.home') }}"><img src="{{ static('base/img/logo.png') }}" alt="Game on" width="262" height="72" /></a></h1>
+{% endblock %}
+
+{% block content %}
+<section class="big-picture cf">
+ <div class="busta">
+ <span></span>
+ <p class="announce">Winners Announced!</p>
+ <p class="shout">Discover the winning entries and play the games!</p>
+ </div>
+</section>
+<section class="build cf">
+ <div class="busta">
+ <h2 class="exclaim">Winning entries</h2>
+ <ol class="winners entries cf">
+ <li class="champ">
+ <a href="{{ url('submissions.entry_single', slug=winners.champ.slug) }}">
+ <span class="frame"><img src="{{ winners.champ.get_image_src() }}" alt="" /></span>
+ <b class="whimper">Grand Prize Winner</b>
+ <h2 class="announce">{{ winners.champ.title }}</h2>
+ {{ winners.champ.get_award_badge()|safe }}
+ </a>
+ <p class="whimper">{{ winners.champ.description }}</p>
+ </li>
+ <li>
+ <a class="cf" href="{{ url('submissions.entry_single', slug=winners.best_hack.slug) }}">
+ <span class="frame"><img src="{{ winners.best_hack.get_image_src() }}" alt="" /></span>
+ <b class="whimper">Best Hackable Game</b>
+ <h2 class="announce">{{ winners.best_hack.title }}</h2>
+ {{ winners.best_hack.get_award_badge()|safe }}
+
+ </a>
+ <p class="whimper">{{ winners.best_hack.description|truncate(300) }}</p>
+ </li>
+ <li>
+ <a class="cf" href="{{ url('submissions.entry_single', slug=winners.best_device.slug) }}">
+ <span class="frame"><img src="{{ winners.best_device.get_image_src() }}" alt="" /></span>
+ <b class="whimper">Best Multi-Device Game</b>
+ <h2 class="announce">{{ winners.best_device.title }}</h2>
+ {{ winners.best_device.get_award_badge()|safe }}
+ </a>
+ <p class="whimper">{{ winners.best_device.description|truncate(300) }}</p>
+ </li>
+ <li>
+ <a class="cf" href="{{ url('submissions.entry_single', slug=winners.best_web.slug) }}">
+ <span class="frame"><img src="{{ winners.best_web.get_image_src() }}" alt="" /></span>
+ <b class="whimper">Best Web-Only Game</b>
+ <h2 class="announce">{{ winners.best_web.title }}</h2>
+ {{ winners.best_web.get_award_badge()|safe }}
+ </a>
+ <p class="whimper">{{ winners.best_web.description|truncate(300) }}</p>
+ </li>
+ </ol>
+ <p><a href="{{ url('submissions.entry_list') }}" class="cta">See all entries</a></p>
+ <section class="gameon_partners cf">
+ <div class="col">
+ <h2 class="announce">Game On is generously supported by:</h2>
+ <ul class="partners">
+ <li><a href="http://www.nesta.org.uk/"><img src="{{ static('base/img/partners/nesta.png') }}" alt="Nesta" /></a></li>
+ <li><a href="http://www.nominettrust.org.uk/"><img src="{{ static('base/img/partners/nominettrust.png') }}" alt="Nominet Trust" /></a></li>
+ </ul>
+ </div>
+ <div class="col with">
+ <h2 class="announce">In partnership with:</h2>
+ <ul class="partners with">
+ <li class="lg"><a href="http://globalgamejam.org/"><img src="{{ static('base/img/partners/ggj.png') }}" alt="Global Game Jam" /></a></li>
+ <li class="lg"><a href="http://www.igda.org/"><img src="{{ static('base/img/partners/igda.png') }}" alt="IDGA" /></a></li>
+ <li class="cl"><a href="http://www.chillingo.com/"><img src="{{ static('base/img/partners/Chillingo.png') }}" alt="Chillingo" /></a></li>
+ <li><a href="http://ukie.info/"><img src="{{ static('base/img/partners/ukie.png') }}" alt="UKIE" /></a></li>
+ <li><a href="https://github.com/"><img src="{{ static('base/img/partners/GitHub.png') }}" alt="github" /></a></li>
+ <li><a href="http://www.nvidia.co.uk"><img src="{{ static('base/img/partners/nvidia.png') }}" alt="Nvidia" /></a></li>
+ </ul>
+ </div>
+ </section>
+ </div>
+</section>
+{% endblock %}
@@ -2,66 +2,70 @@
import commonware
-from gameon.submissions.models import Category
+from gameon.submissions.models import Category, Entry, Challenge
from gameon.events.models import Event
log = commonware.log.getLogger('playdoh')
def home(request, template='static_site/landing.html'):
- """Main example view."""
-
upcoming_events = Event.objects.get_upcoming()
+ current_challenge = Challenge.objects.get_current_challenge()
+
+ if not current_challenge.announce_winners:
+ data = {
+ 'events': upcoming_events.order_by('start_date')[:5],
+ 'num_events': upcoming_events.count(),
+ }
+ else:
+ data = {
+ 'winners': {
+ 'champ': Entry.objects.get(award="champ"),
+ 'best_hack': Entry.objects.get(award="best-hack"),
+ 'best_device': Entry.objects.get(award="best-device"),
+ 'best_web': Entry.objects.get(award="best-web"),
+ }
+ }
+ template = 'static_site/closed.html'
- data = {
- 'events': upcoming_events.order_by('start_date')[:5],
- 'num_events': upcoming_events.count()
- }
return render(request, template, data)
def rules(request, template='static_site/rules.html'):
- """Main example view."""
data = {
'categories': Category.objects.all().order_by('name'),
}
return render(request, template, data)
def judges(request, template='static_site/judges.html'):
- """Main example view."""
data = {}
return render(request, template, data)
def judging(request, template='static_site/judging.html'):
- """Main example view."""
data = {}
return render(request, template, data)
def prizes(request, template='static_site/prizes.html'):
- """Main example view."""
data = {
'categories': Category.objects.all().order_by('name'),
}
return render(request, template, data)
def resources(request, template='static_site/resources.html'):
- """Main example view."""
data = {}
return render(request, template, data)
def legal(request, template='static_site/legal.html'):
- """Main example view."""
data = {}
return render(request, template, data)
def faqs(request, template='static_site/faqs.html'):
- """Main example view."""
data = {}
return render(request, template, data)
@@ -15,8 +15,9 @@ class CategoryAdmin(admin.ModelAdmin):
class EntryAdmin(admin.ModelAdmin):
model = models.Entry
prepopulated_fields = {"slug": ("title",)}
- list_display = ('title', 'category', 'created_by')
- list_filter = ('category',)
+ list_display = ('title', 'category', 'created_by', 'award')
+ list_filter = ('category', 'award')
+ list_editable = ('award', )
admin.site.register(models.Challenge, ChallengeAdmin)
Oops, something went wrong.

0 comments on commit 2079dc5

Please sign in to comment.