Browse files

Closes #121 - a homepage showing winning entries, and a way to turn t…

…his view off/on as required
  • Loading branch information...
1 parent db7e08d commit 13d538cf3f8a6140b55a06b4de7661485b49a305 @rossbruniges rossbruniges committed Feb 25, 2013
View
89 gameon/base/static/base/css/home.css
@@ -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;
View
2 gameon/base/static/base/css/master.css
@@ -347,7 +347,7 @@ nav li a {
.entries .badge {
width: auto;
position: absolute;
- top: -0.2em;
+ top: -1em;
left: 0;
z-index: 20;
}
View
BIN gameon/base/static/base/img/badges/best-device.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN gameon/base/static/base/img/badges/best-hack.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN gameon/base/static/base/img/badges/best-web.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN gameon/base/static/base/img/badges/champ.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN gameon/base/static/base/img/badges/notable.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN gameon/base/static/base/img/home/winning-cup.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
88 gameon/static_site/templates/static_site/closed.html
@@ -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 %}
View
32 gameon/static_site/views.py
@@ -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)
View
102 gameon/submissions/migrations/0012_auto__add_field_challenge_announce_winners.py
@@ -0,0 +1,102 @@
+# -*- coding: utf-8 -*-
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+ # Adding field 'Challenge.announce_winners'
+ db.add_column('submissions_challenge', 'announce_winners',
+ self.gf('django.db.models.fields.BooleanField')(default=False),
+ keep_default=False)
+
+
+ def backwards(self, orm):
+ # Deleting field 'Challenge.announce_winners'
+ db.delete_column('submissions_challenge', 'announce_winners')
+
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'submissions.category': {
+ 'Meta': {'object_name': 'Category'},
+ 'awarded_for': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'})
+ },
+ 'submissions.challenge': {
+ 'Meta': {'object_name': 'Challenge'},
+ 'announce_winners': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '200'}),
+ 'start_date': ('django.db.models.fields.DateTimeField', [], {})
+ },
+ 'submissions.entry': {
+ 'Meta': {'object_name': 'Entry'},
+ 'award': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['submissions.Category']", 'null': 'True', 'blank': 'True'}),
+ 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['users.Profile']", 'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'default': "''"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'}),
+ 'team_description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'team_members': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'team_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+ 'to_market': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'}),
+ 'video_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '255'})
+ },
+ 'users.profile': {
+ 'Meta': {'object_name': 'Profile'},
+ 'bio': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
+ 'website': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '255', 'blank': 'True'})
+ }
+ }
+
+ complete_apps = ['submissions']
View
2 gameon/submissions/models.py
@@ -66,6 +66,8 @@ class Challenge(models.Model):
verbose_name=_(u'Slug'))
start_date = models.DateTimeField(verbose_name=_(u'Start date'))
end_date = models.DateTimeField(verbose_name=_(u'End date'))
+ announce_winners = models.BooleanField(default=False,
+ help_text="Tick when you've selected the winners and want to tell people!")
def __unicode__(self):
return self.name

0 comments on commit 13d538c

Please sign in to comment.