Skip to content

Commit

Permalink
#132 Add sponsor domain
Browse files Browse the repository at this point in the history
  • Loading branch information
staticnull committed Sep 2, 2014
1 parent 71fc6e7 commit a2fc000
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 7 deletions.
16 changes: 15 additions & 1 deletion grails-app/conf/BootStrap.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ import gum.*

class BootStrap {
def init = { servletContext ->
sponsors()
speakerTalks()
}

private void sponsors() {
new Sponsor([title: 'Agile Orbit', type: 'Food Sponsor', url: 'http://objectpartners.com', file: "agileorbit-logo.jpg"]).save()
new Sponsor([title: 'FigJam', type: 'Beverage Sponsor', url: 'http://twitter.com/joshareed', file: "figjam-logo-800X225.png"]).save()
new Sponsor([title: 'Object Partners', type: 'Food Sponsor', url: 'http://objectpartners.com', file: "opi-logo-text.png"]).save()
new Sponsor([title: 'ReachLocal', type: 'Beverage Sponsor', url: 'http://reachlocal.com', file: "reachlocal.jpg"]).save()
new Sponsor([title: 'SmartThings', type: 'Space Sponsor', url: 'http://smartthings.com', file: "smart-things-logo-text.png"]).save()
new Sponsor([title: 'Surly Labs', type: 'Beverage Sponsor', url: 'http://surlylabs.com', file: "surly_logo_horizontal.jpg"]).save()
}

private void speakerTalks() {
def groovyMn = new Speaker([name: "GroovyMN", twitterId: "groovymn", githubId: "groovymn", company: "GroovyMN", about: "Groovy Users of Minnesota"]).save()

def applegate = new Speaker([name: "Ryan Applegate", twitterId: "rappleg", githubId: "rappleg", company: "SmartThings"]).save()
Expand Down Expand Up @@ -190,7 +204,7 @@ class BootStrap {

// 20140211-cassandra-jeff-beck.jpg
def _201402 = new Presentation([title: "Cassandra & Grails", slidesUrl: "htp://beckje01.github.io/gum-2014-cassandra-grails-talk", presentationDate: new Date("2014/02/11")]).save()
_201402.addToSpeakers(beck)
_201402.addToSpeakers(beck)
beck.addToPresentations(_201402)
}

Expand Down
9 changes: 9 additions & 0 deletions grails-app/controllers/gum/PagesController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ class PagesController {
log.debug "params: $params"
}

def home2() {
log.debug "params: $params"
def smartThings = Sponsor.findByTitle('SmartThings')
def reachLocal = Sponsor.findByTitle('ReachLocal')
def opi = Sponsor.findByTitle('Object Partners')

render view: "/pages/home2", model: [space: smartThings, beverage: reachLocal, food: opi]
}

def location() {
log.debug "params: $params"
}
Expand Down
23 changes: 23 additions & 0 deletions grails-app/domain/gum/Sponsor.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package gum

class Sponsor {
String type // TODO: Enum
String url
String title // TODO: or unique code?
String file
Date description
Byte photo

static constraints = {
type(blank: false, nullable: false) // TODO: unique: true
url(url:true, blank: true, nullable: true)
title(blank: false, nullable: false, unique: true)
file(blank: false, nullable: false)
description(blank: true, nullable: true, maxSize: 1000)
photo(blank: true, nullable: true)
}

String toString() {
return title
}
}
16 changes: 16 additions & 0 deletions grails-app/views/_home2.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- start: Wrapper-->
<div id="wrapper">
<g:render template="/hero" />

<!-- start: Container -->
<div class="container">
<g:render template="/groovy" />
<g:render template="/projects" />
<calendar:events max="1" />
<hr />
<g:render template="/sponsor/sponsors2" />
</div>
<!-- end: Container -->

</div>
<!-- end: Wrapper -->
11 changes: 11 additions & 0 deletions grails-app/views/pages/home2.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="main" />
<r:require module="slider" />
</head>
<body>
<g:render template="/slider/index" />
<g:render template="/home2" />
</body>
</html>
12 changes: 6 additions & 6 deletions grails-app/views/sponsor/_index.gsp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div class="span3">
<div class="item-description">
<h4>${type}</h4>
<h4>${sponsor?.type ?: type}</h4>
</div>

<div class="picture">
<a href="${url}" title="${title}">
<r:img dir="images/sponsors/" file="${file}" alt="${title} logo" />
<a href="${sponsor?.url ?: url}" title="${sponsor?.title ?: title}">
<r:img dir="images/sponsors/" file="${sponsor?.file ?: file}" alt="${sponsor?.title ?: title} logo" />
<div class="image-overlay-link"></div>
</a>
<g:if test="${description}">
${description}
<g:if test="${sponsor?.description ?: description}">
${sponsor?.description ?: description}
</g:if>
</div>
</div>
</div>
18 changes: 18 additions & 0 deletions grails-app/views/sponsor/_sponsors2.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- start: Row -->
<div class="row">
<div class="span9">
<div class="title"><h3>Sponsors</h3></div>
<div class="row">
<g:render template="/sponsor/index" model="${[sponsor: space]}" />
<g:render template="/sponsor/index" model="${[sponsor: beverage]}" />
<g:render template="/sponsor/index" model="${[sponsor: food]}" />
</div>
<div class="row">
<g:render template="/sponsor/intellij" />
<g:render template="/sponsor/index" model="${[type: "Community Sponsor", url: "http://ug.oreilly.com", title: "O'Reilly", file: "oreilly-logo.gif", description: "Buy ebooks at 50% off use the UG Program discount code: DSUG"]}" />
<g:render template="/sponsor/index" model="${[type: "Hosting Sponsor", url: "http://appfog.com", title: "AppFog", file: "appfog-logo.jpg"]}" />
</div>
</div>
<g:render template="/social/twitter" />
</div>
<!-- end: Row -->

0 comments on commit a2fc000

Please sign in to comment.