Skip to content

Commit

Permalink
tower project site
Browse files Browse the repository at this point in the history
  • Loading branch information
lancejpollard committed Jan 24, 2012
0 parents commit edaac72
Show file tree
Hide file tree
Showing 3,503 changed files with 395,020 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global

# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
Empty file added .npmignore
Empty file.
9 changes: 9 additions & 0 deletions .slugignore
@@ -0,0 +1,9 @@
*.psd
*.pdf
test
spec
./docs
README.markdown
Watchfile
.gitignore
wiki
33 changes: 33 additions & 0 deletions Cakefile
@@ -0,0 +1,33 @@
require 'tower'
knox = require 'knox'

task 'environment', ->
Tower.env = 'production'
Tower.Application.instance().initialize()

task 'routes', ->
invoke 'environment'

result = []
routes = Tower.Route.all()

result

task 'assets:upload', ->
invoke 'assets:upload:s3'

task 'assets:upload:s3', ->
invoke 'environment'

client = knox.createClient Tower.secrets.s3

Tower.Application.Assets.upload (from, to, headers, callback) ->
client.putFile from, to, headers, callback

task 'assets:bundle', ->
invoke 'environment'
Tower.Application.Assets.bundle()

task 'assets:stats', 'Table displaying uncompressed, minified, and gzipped asset sizes', ->
invoke 'environment'
Tower.Application.Assets.stats()
1 change: 1 addition & 0 deletions Procfile
@@ -0,0 +1 @@
web: node server.js -e production
2 changes: 2 additions & 0 deletions README.md
@@ -0,0 +1,2 @@
# App

73 changes: 73 additions & 0 deletions Watchfile
@@ -0,0 +1,73 @@
require('design.io').extension('watchfile')

async = require('async')
File = require('pathfinder').File
Shift = require('shift')

require("design.io-stylesheets") /(app\/client|lib\/stylesheets)/
compress: false
debug: false
ignore: /(public|node_modules)/
outputPath: (path) ->
"public/stylesheets/#{path}".replace(/\.(sass|scss|stylus|styl|less|css)/, ".css")

require("design.io-javascripts")
compress: false
debug: false
ignore: /(public|node_modules|server|test.*|spec.*[sS]pec|app\/views)/
outputPath: (path) ->
"public/javascripts/#{path}".replace(/\.(js|coffee)/, ".js")

watch /app\/views.*\.coffee$/
update: (path, callback) ->
try
nodes = path.replace("app/views/", "").split("/")
name = {}

data = File.read(path)
id = nodes.join("/")
selector = id
name = ""

@broadcast body: data, id: id, selector: selector, path: "/#{name}"

files = File.files("app/views")
result = []

for file in files
continue unless file.match(/\.coffee$/)
result.push [file.replace(/\.coffee$/, ""), File.read(file)]

template = "Tower.View.cache =\n"

engine = new Shift.CoffeeScript

iterator = (item, next) =>
template += " '#{item[0]}': ->\n"
lines = item[1].split(/\n/)
for line, i in lines
lines[i] = " #{line}"
template += lines.join("\n")
template += "\n"
next()

async.forEachSeries result, iterator, (error) =>
engine.render template, bare: true, (error, string) =>
if error
console.log error
return callback(error)
else
File.write "public/javascripts/app/views/templates.js", string
callback()

catch error
callback(error)

client:
update: (data) ->
Tower.View.cache[data.id] = data

if data.reload
window.location = data.path
else
Tower.get data.path
7 changes: 7 additions & 0 deletions app/client/config/application.coffee
@@ -0,0 +1,7 @@
class App extends Tower.Application
@configure ->
@use Tower.Middleware.Agent
@use Tower.Middleware.Location
@use Tower.Middleware.Router

window.App = new App
3 changes: 3 additions & 0 deletions app/client/controllers/applicationController.coffee
@@ -0,0 +1,3 @@
class App.ApplicationController extends Tower.Controller
ready: ->

2 changes: 2 additions & 0 deletions app/client/controllers/postsController.coffee
@@ -0,0 +1,2 @@
class App.PostsController extends Tower.Controller

119 changes: 119 additions & 0 deletions app/client/stylesheets/application.styl
@@ -0,0 +1,119 @@
// @import '/lib/stylesheets/variables'
// @import '/lib/stylesheets/mixins'
// @import '/lib/stylesheets/typography'
// @import '/lib/stylesheets/code'
// @import "/app/client/stylesheets/application/_base"
// @import "/app/client/stylesheets/application/_header"
// @import "/app/client/stylesheets/application/_forms"
// @import "/app/client/stylesheets/application/_tables"
// @import "/app/client/stylesheets/application/_body"
// @import "/app/client/stylesheets/application/_sidebar"
// @import "/app/client/stylesheets/application/_footer"

$green = #8BA341
$blue = #79C5CE //#92CBD3
$white = #eaecea

a
color: #EC3D2F

body
font: 18px "Lucida Grande", Helvetica, Arial, sans-serif
font-family: 'Esteban', serif;
font-family: 'Forum', cursive;
background: $white
background: $blue url(/images/noise.png);
position: relative;
h1, h2, h3, h4
font-family: 'Antic', sans-serif;
font-family: 'Gruppo', cursive; // better
font-family: 'Josefin Sans', sans-serif; // ok
//font-family: 'Maven Pro', sans-serif;
//font-family: 'Expletus Sans', cursive;
//font-family: 'Quattrocento Sans', sans-serif;
h2
font-size: 24px
//background: white
//opacity: 0.9
//margin-left: -50px;
//padding-left: 10px
//width: 20px
h3
font-size: 18px
#navigation
display: block
position: relative;
margin: 0 auto
width: auto
max-width: 650px
li
margin: 0 0 0 21px !important
a
color: white
#header
display: block
position: relative;
margin: 0 auto
width: auto
max-width: 610px
padding: 60px 20px 20px 20px
h1
text-align: left
h1, h2, h3, h4
color: white
.forkme
position: absolute;
top: 0;
right: 0;
border: 0
opacity: 0.9
img
width: 149px;
height: 149px
#footer
min-height: 100px
background: $green url(/images/noise.png);
position: relative;
bottom: 0px;
#body
position: relative;
#background
position: absolute
left: 0px
right: 0px
top: 0px
bottom: 0px
background: white
opacity: 0.9
//background: #222;
//background: $white url(/images/noise.png);
color: #111
margin: 0 auto;
width: auto
max-width: 610px
padding: 20px
#content
position: relative

@media screen and (max-width: 610px)
.forkme
display: none

@media screen and (max-width: 480px)
#navigation
text-align: center
position: relative;
ul
float: none
margin: 0 auto
display: inline-block;
position: relative;
#header
padding: 0px 10px 10px 10px
h1
text-align: center
#body
width: auto
max-width: 440px
pre
font-size: 10px;
33 changes: 33 additions & 0 deletions app/client/stylesheets/application/_base.styl
@@ -0,0 +1,33 @@
$frame-width = 960px;
$mini-frame-width = 610px;

html, body {
background: $tan-1;
margin: 0px !important;
padding: 0px !important;
width: 100%;
min-height: 100%;
}

.frame {
//width: 610px;
width: $frame-width;
height: auto;
margin: 0 auto;
@include clearfix;
}

#content img {
@include shadow(1px, 1px, 2px, #D9D9D9);
//border: 8px solid white;
padding: 7px;
background: white;
border: 1px solid $tan-1;
margin: 0 0;
display: inline-block;
}
#content {
a img {
//margin-left: -5px !important; // hack
}
}

0 comments on commit edaac72

Please sign in to comment.