Commits

Albert O'Connor  committed 0432775

A functional site, which has some design issues to work out.

  • Participants
  • Parent commits ad48f31

Comments (0)

Files changed (17)

File go_opendata/static/css/good.css

     margin: 0px;
     font-weight: lighter;
     font-size: 12pt;
+    background: #F1F1F1;
+    color: #191919;
 }
 
 header {
-    background: #333;
+    background: #333534;
     color: #ddd;
     font-size: 12pt;
-    padding: 10px;
-    background-image: url(../img/header_grad.svg);
+    /*background-image: url(../img/header_grad.svg);*/
+    box-shadow: 0px 0px 5px #111;
+}
+
+header > div {
+    padding-top: 20px;
+    height: 90px;
 }
 
 .tagline {
     color: #AAA;
-    font-size: 10pt;
+    font-size: 16pt;
+    font-style: italic;
+    padding-top: 23px;
 }
 
-clearfix {
+.right {
+    text-align: right;
+}
+
+.clearfix {
   *zoom: 1;
 }
 .clearfix:before,
 
 div.exclude_footer {
     min-height: 100%;
-    margin: 0 auto -60px; /* the bottom margin is the negative value of the footer's height */
-    box-shadow: 0px 0px 15px #060606;
+    height: auto;
 }
 
 div#main {
+    width: 100%;
+    overflow: hidden;
+    padding-bottom: 120px;
+}
+
+.hero_image {
+    background-image: url(../img/placeholder.jpg);
+    height: 300px;
+    width: 110%;
+    margin-left: -5px;
+    overflow: hidden;
+    background-size: 100%;
+    background-position-y: -300px;
+    box-shadow: 0px 0px 5px #111 inset;
+}
+
+.hero_wrap {
+    background: #a7734c;
+    color: #F1F1F1;
+    font-size: 14pt;
+    text-shadow: 0px -2px 1px #666;
+    box-shadow: 0px 0px 5px #111;
     
 }
 
+.hero_wrap > div {
+    padding: 20px 0px;
+    margin-bottom: 10px;
+}
+
+.hero_wrap form {
+    padding-top: 6px;
+}
+
+.hero_wrap input[type=text] {
+    height: 22px;
+    font-size: 12pt;
+    vertical-align: middle;
+    display: inline-block;
+}
+
+#main > div.container_16 {
+    margin-bottom: 1em;
+}
+
 article h1 {
+    margin: 0.4em 0em;
+}
+
+article h1, article h2, article h3 {
     font-weight: lighter;
 }
 
 aside {
+    background: #CCCACB;
     margin-top: 27px;
     padding: 24px;
     text-align: center;
 
 footer {
     position: relative;
-    height: 60px;
+    margin-top: -120px;
+    height: 120px;
+    clear:both;
+    color: #AAA;
+    background: #333534;
+}
+
+footer > div {
+    padding: 50px 0px;
+}
+
+footer a {
+    color: #AAA;
+    text-decoration: none;
+}
+
+ul.sponsor {
+    margin: 0px;
+    padding: 0px;
     text-align: center;
 }
 
+ul.sponsor li {
+    list-style: none;
+    margin: 10px;
+    float: left;
+}
+
+ul.sponsor li img {
+    border: none;
+}
+
+div.fieldset label {
+    float: left;
+    width: 90px;
+    text-align: right;
+    padding-top: 7px;
+}
+
+div.fieldset div.controls label {
+    float: none;
+}
+
+div.fieldset div.controls ul {
+    padding: 7px 0px;
+    margin: 0px;
+}
+
+div.fieldset div.controls ul li {
+    list-style: none;
+    font-size: 10pt;
+}
+
+div.fieldset div.controls  {
+    margin-left: 100px;
+}
+
+div.fieldset div.controls input[type=text] {
+    width: 200px;
+    padding: 5px;
+    font-size: 10pt;
+}
+
+div.fieldset div.controls textarea {
+    padding: 5px;
+    font-size: 10pt;
+    width: 500px;
+    height: 100px;
+}
+
+div.fieldset + div.fieldset {
+    margin-top: 20px;
+}
+
 .btn {
   display: inline-block;
   *display: inline;

File go_opendata/static/img/goodlogo.png

Added
New image

File go_opendata/static/img/opendatawr.png

Added
New image

File go_opendata/static/img/placeholder.jpg

Added
New image

File go_opendata/static/img/region.png

Added
New image

File go_opendata/static/img/uwaterloo.png

Added
New image

File go_opendata/templates/_field.html

+<div class="fieldset">
+{{ field.label_tag }}
+<div class="controls">
+{{ field }}
+{% if field.help_text %}
+<br>
+<small>{{ field.help_text }}</small>
+{% endif %}
+{% if field.errors %}
+{% for error in field.errors %}
+<br>
+{{ error }}
+{% endfor %}
+{% endif %}
+</div>
+</div>

File go_opendata/templates/base.html

 {% endcomment %}
 {% endblock head_js %}
 
-{% block header %}
-<div class="alpha grid_8">
-    <div class="logo">GO Open Data <span class="tagline">May 2013</span></div>
-</div>
-{% endblock header %}
+{% block body %}
+  {% block containerdiv %}
+  <div id="container">
+  {% endblock containerdiv %}
+    <div class="exclude_footer">
+    <header>
+    <div class="container_16">
+    {% block header %}
+    <div class="alpha grid_8">
+        <a href="{% url 'home' %}"><img src="{{ STATIC_URL }}img/goodlogo.png" alt="GO Open Data Conference"/></a>
+    </div>
+    <div class="omega grid_8 right tagline">
+        Coming May 2013 to the Region of Waterloo
+    </div>
+    {% endblock %}
+    </div>
+    </header>
+    <div id="main" role="main">
+    {% block pre_contents %}{% endblock %}
+    <div class="container_16">
+    {% block contents %}
+    {% endblock %}
+    </div>
+    </div>
+    </div>
+    <footer>
+    <div class="container_16">
+    {% block footer %}
+    <div class="grid_16 alpha omega">
+        <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/80x15.png"></a>
+        Created in 2012 by Albert O'Connor Web Developer. Contact us at <a href="mailto:info@go-opendata.ca">info@go-opendata.ca</a>
+    </div>
+    {% endblock %}
+    </div>
+    </footer>
+  </div>
+{% endblock body %}
 
-{% block footer %}
-<div class="grid_4 alpha">
-</div>
-{% endblock footer %}

File go_opendata/templates/home.html

 {% extends "base.html" %}
 
+{% block pre_contents %}
+<div class="hero_image breakout">
+</div>
+<div class="hero_wrap">
+    <div class="container_16">
+        <div class="alpha grid_9">
+            Bring together developers, citizens and administrators from across Ontario for an open dialog about Open Data.
+        </div>
+        <div class="omega grid_7 right">
+            <form method="post">
+                {% csrf_token %}
+                {% for field in form %}
+                {% include "_field_no_label.html"%}
+                {% endfor %}
+                <input class="btn" type="submit" value="Get Involved">
+            </form>
+        </div>
+    </div>
+</div>
+{% endblock %}
+
 {% block contents %}
 <article>
-<div class="grid_10 alpha">
+<div class="grid_8 alpha">
+
 <h1>About</h1>
 
 <p>Passionate people are working to make data more open and to make use of open data all over Ontario. From local municipalities, to universities, to citizen and developer groups, individuals are discussing Open Data. We want to bring everyone together to share experiences, learn about each other, and build a larger community. A community to help promote Open Data across Ontario.</p>
 
 <p>To make this happen we are hosting a one day conference in spring 2013 to bring together administrators, developers and citizens. Meanwhile building a public directory of groups, advocates and other resources.</p>
 </div>
-<div class="grid_6 omega">
-<aside>
-    <div class="header">Want More?</div>
-    <form method="post">
-    {% csrf_token %}
-    {% for field in form %}
-    {% include "_field_no_label.html"%}
-    {% endfor %}
-    <input class="btn btn-large" type="submit" value="Send Me Updates">
-    </form>
-</aside>
+<div class="grid_8 omega">
+    <h1>Brought to you by</h1>
+    <ul class="sponsor">
+        <li><img src="{{ STATIC_URL }}img/region.png"></li>
+        <li><img src="{{ STATIC_URL }}img/opendatawr.png"></li>
+        <li><img src="{{ STATIC_URL }}img/uwaterloo.png"></li>
+    </ul>
 <div>
 </article>
 {% endblock contents %}

File go_opendata/templates/interests/interest.html

+{% extends "base.html" %}
+
+{% block contents %}
+<article>
+<div class="grid_16 alpha omega">
+    <h1>Thanks!</h1>
+    <p>We will email you when there are updates.</p>
+    
+    <h2>Bonus Round</h2>
+    <p>If you have moment, can you provide some more information about your interest in the conference.</p>
+    <form method="post">
+    {% csrf_token %}
+    {% for field in form.visible_fields %}
+    {% include "_field.html"%}
+    {% endfor %}
+    {% for field in form.hidden_fields %}
+    {{ field }}
+    {% endfor %}
+    <div class="fieldset">
+        <div class="controls">
+            <input type="submit" value="Send" class="btn"/>
+        </div>
+    </div>
+    </form>
+</div>
+</article>
+{% endblock contents %}

File go_opendata/templates/interests/thanks.html

+{% extends "base.html" %}
+
+{% block contents %}
+<article>
+<div class="grid_16 alpha omega">
+    <h1>Thanks Again!</h1>
+    <p>Thanks for your interest in GO Open Data. You will be hearing form us soon as the planning comes together.</p>
+</div>
+</article>
+{% endblock contents %}

File go_opendata/urls.py

 
 urlpatterns = patterns('',
     # Examples:
-    url(r'^testing/$', "go_opendata.views.home", name='home'),
+    url(r'^$', 'go_opendata.views.home', name='home'),
+    url(r'^interest/(\d+)/$', 'interests.views.interest', name='interest'),
+    url(r'^interest/thanks/again/$', TemplateView.as_view(template_name="interests/thanks.html"), name='thanks_again'),
     
     (r'^robots\.txt$', include('robots.urls')),
 

File go_opendata/views.py

         form = EmailForm(request.POST)
         if form.is_valid():
             interest = form.save()
-            
+            return redirect("interest", interest.pk)
     else:
         form = EmailForm()
         

File interests/forms.py

 from django import forms
 
-from interests.models import Interest    
+from interests.models import Interest, Role
 
 class EmailForm(forms.ModelForm):
     email = forms.CharField(required=True, widget=forms.TextInput(attrs=dict(placeholder="email@domain.com",
                                                                              size=25)))
     class Meta:
         model = Interest
-        fields = ("email",)
+        fields = ("email",)
+        
+class InterestForm(forms.ModelForm):
+    email = forms.CharField(required=True, widget=forms.HiddenInput)
+    roles = forms.ModelMultipleChoiceField(queryset=Role.objects.all(),
+                                           required=False,
+                                           widget=forms.CheckboxSelectMultiple())
+    class Meta:
+        model = Interest
+        exclude = ("completed", "created", "updated")

File interests/migrations/0002_auto__add_field_interest_completed__add_field_interest_created__add_fi.py

+# encoding: 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 'Interest.completed'
+        db.add_column('interests_interest', 'completed', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False)
+
+        # Adding field 'Interest.created'
+        db.add_column('interests_interest', 'created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime(2012, 10, 19, 13, 52, 54, 990090), blank=True), keep_default=False)
+
+        # Adding field 'Interest.updated'
+        db.add_column('interests_interest', 'updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime(2012, 10, 19, 13, 53, 12, 630783), blank=True), keep_default=False)
+
+
+    def backwards(self, orm):
+        
+        # Deleting field 'Interest.completed'
+        db.delete_column('interests_interest', 'completed')
+
+        # Deleting field 'Interest.created'
+        db.delete_column('interests_interest', 'created')
+
+        # Deleting field 'Interest.updated'
+        db.delete_column('interests_interest', 'updated')
+
+
+    models = {
+        'interests.interest': {
+            'Meta': {'object_name': 'Interest'},
+            'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+            'completed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'location': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
+            'roles': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['interests.Role']", 'null': 'True', 'blank': 'True'}),
+            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
+        },
+        'interests.role': {
+            'Meta': {'object_name': 'Role'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '64'})
+        }
+    }
+
+    complete_apps = ['interests']

File interests/models.py

     
     comments = models.TextField(blank=True, null=True)
     
+    completed = models.BooleanField(default=False)
+    created = models.DateTimeField(auto_now_add=True)
+    updated = models.DateTimeField(auto_now=True)
+    
     def __unicode__(self):
         return u"Interest for " + self.email
     

File interests/views.py

 from django.shortcuts import render, redirect, get_object_or_404
 
+from interests.models import Interest
+from interests.forms import InterestForm
+
+def interest(request, pk, template="interests/interest.html"):
+    interest = get_object_or_404(Interest, pk=pk)
+    if interest.completed:
+        return redirect("home")
+    
+    if request.method == "POST":
+        form = InterestForm(request.POST, instance=interest)
+        if form.is_valid():
+            interest = form.save(commit=False)
+            interest.completed = True
+            interest.save()
+            form.save_m2m()
+            return redirect("thanks_again")
+    else:
+        form = InterestForm(instance=interest)
+        
+    return render(request,
+                  template,
+                  dict(form=form))