Skip to content

Commit

Permalink
First real code commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisyuska committed Aug 27, 2011
1 parent b63cdd4 commit c7848cc
Show file tree
Hide file tree
Showing 72 changed files with 1,266 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
@@ -0,0 +1,6 @@
.bundle
db/*.sqlite3
log/*.log
config/initializers/setup_mail.rb
tmp/
.sass-cache/
33 changes: 33 additions & 0 deletions Gemfile
@@ -0,0 +1,33 @@
source 'http://rubygems.org'

gem 'rails', '3.1.0.rc5'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'
gem 'geocoder'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', "~> 3.1.0.rc"
gem 'coffee-rails', "~> 3.1.0.rc"
gem 'uglifier'
end

gem 'jquery-rails'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
# Pretty printed test output
gem 'turn', :require => false
end
120 changes: 120 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,120 @@
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.0.rc5)
actionpack (= 3.1.0.rc5)
mail (~> 2.3.0)
actionpack (3.1.0.rc5)
activemodel (= 3.1.0.rc5)
activesupport (= 3.1.0.rc5)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.1)
rack-cache (~> 1.0.2)
rack-mount (~> 0.8.1)
rack-test (~> 0.6.0)
sprockets (~> 2.0.0.beta.12)
activemodel (3.1.0.rc5)
activesupport (= 3.1.0.rc5)
bcrypt-ruby (~> 2.1.4)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.0.rc5)
activemodel (= 3.1.0.rc5)
activesupport (= 3.1.0.rc5)
arel (~> 2.1.4)
tzinfo (~> 0.3.29)
activeresource (3.1.0.rc5)
activemodel (= 3.1.0.rc5)
activesupport (= 3.1.0.rc5)
activesupport (3.1.0.rc5)
multi_json (~> 1.0)
ansi (1.3.0)
arel (2.1.4)
bcrypt-ruby (2.1.4)
builder (3.0.0)
coffee-rails (3.1.0.rc.6)
coffee-script (>= 2.2.0)
railties (~> 3.1.0.rc1)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.2)
erubis (2.7.0)
execjs (1.2.4)
multi_json (~> 1.0)
geocoder (1.0.2)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.13)
railties (~> 3.0)
thor (~> 0.14)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
multi_json (1.0.3)
polyglot (0.3.2)
rack (1.3.2)
rack-cache (1.0.2)
rack (>= 0.4)
rack-mount (0.8.2)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.0.rc5)
actionmailer (= 3.1.0.rc5)
actionpack (= 3.1.0.rc5)
activerecord (= 3.1.0.rc5)
activeresource (= 3.1.0.rc5)
activesupport (= 3.1.0.rc5)
bundler (~> 1.0)
railties (= 3.1.0.rc5)
railties (3.1.0.rc5)
actionpack (= 3.1.0.rc5)
activesupport (= 3.1.0.rc5)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
rdoc (3.9.3)
sass (3.1.7)
sass-rails (3.1.0.rc.5)
actionpack (~> 3.1.0.rc1)
railties (~> 3.1.0.rc1)
sass (>= 3.1.4)
sprockets (>= 2.0.0.beta.9)
sprockets (2.0.0.beta.15)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.4)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
turn (0.8.2)
ansi (>= 1.2.2)
tzinfo (0.3.29)
uglifier (1.0.1)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)

PLATFORMS
ruby

DEPENDENCIES
coffee-rails (~> 3.1.0.rc)
geocoder
jquery-rails
rails (= 3.1.0.rc5)
sass-rails (~> 3.1.0.rc)
sqlite3
turn
uglifier
7 changes: 7 additions & 0 deletions Rakefile
@@ -0,0 +1,7 @@
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)

Mapper::Application.load_tasks
Binary file added app/assets/images/rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions app/assets/javascripts/application.js
@@ -0,0 +1,9 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
10 changes: 10 additions & 0 deletions app/assets/javascripts/form.js
@@ -0,0 +1,10 @@
function remove_fields(link) {
$(link).prev("input[type=hidden]").val("1");
$(link).closest(".fields").hide();
}

function add_fields(link, association, content) {
var new_id = new Date().getTime();
var regexp = new RegExp("new_" + association, "g")
$(link).parent().before(content.replace(regexp, new_id));
}
3 changes: 3 additions & 0 deletions app/assets/javascripts/trips.js.coffee
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
7 changes: 7 additions & 0 deletions app/assets/stylesheets/application.css
@@ -0,0 +1,7 @@
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require_tree .
*/
56 changes: 56 additions & 0 deletions app/assets/stylesheets/scaffolds.css.scss
@@ -0,0 +1,56 @@
body {
background-color: #fff;
color: #333;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px; }

p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px; }

pre {
background-color: #eee;
padding: 10px;
font-size: 11px; }

a {
color: #000;
&:visited {
color: #666; }
&:hover {
color: #fff;
background-color: #000; } }

div {
&.field, &.actions {
margin-bottom: 10px; } }

#notice {
color: green; }

.field_with_errors {
padding: 2px;
background-color: red;
display: table; }

#error_explanation {
width: 450px;
border: 2px solid red;
padding: 7px;
padding-bottom: 0;
margin-bottom: 20px;
background-color: #f0f0f0;
h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px;
margin-bottom: 0px;
background-color: #c00;
color: #fff; }
ul li {
font-size: 12px;
list-style: square; } }
86 changes: 86 additions & 0 deletions app/assets/stylesheets/trips.css.scss
@@ -0,0 +1,86 @@
/* Global vars */
$lightBlue: #1144AA;
$darkBlue: #05296E;
$white: #FFF;
$black: #000;
$lighterGray: #808080;
$gray: #272727;
$lightGray: #424242;

body, html {
height: 100%;
margin: 0;
}

div {
margin: 0 auto;
padding: 0;
}

div.wrapper {
min-height: 100%;
width: 100%;
margin: 0;
}

div.header {
margin: 0 auto;
padding: 0;
text-align: center;
background-color: $lightBlue;
border-bottom: 2px solid $black;

h1 {
margin: 0;
padding: 0;
font-size: 4em;
line-height: 120px;
color: $white;
text-shadow: 2px 2px 2px $darkBlue;
}
}

div.main {
width: 800px;
padding: 0;
overflow: auto;
padding-bottom: 36px;
}

div.footer {
position: relative;
margin-top: -36px;
height: 36px;
clear: both;
text-align: center;
width: 100%;
font-size: 18px;
line-height: 36px;
}

div.field {
margin: 5px;
}
div.fields {
margin: 5px;
}

div.block {
margin: 0 10px;
}

#map_canvas {
height: 400px;
width: 780px;
border: 2px solid #000;
margin: 10px;
}

/*Opera Fix */
body:before {
content:"";
height:100%;
float:left;
width:0;
margin-top:-32767px;
}
3 changes: 3 additions & 0 deletions app/controllers/application_controller.rb
@@ -0,0 +1,3 @@
class ApplicationController < ActionController::Base
protect_from_forgery
end
34 changes: 34 additions & 0 deletions app/controllers/trips_controller.rb
@@ -0,0 +1,34 @@
class TripsController < ApplicationController

# GET /trips/1
# GET /trips/1.json
def show
@trip = Trip.find_by_marketable_url(params[:marketable_url])
end

# GET /trips/new
# GET /trips/new.json
def new
@trip = Trip.new
@trip.steps.build
end

# POST /trips
# POST /trips.json
def create
@trip = Trip.new(params[:trip])

if @trip.save
Notifier.confirmation(@trip).deliver
redirect_to trip_details_path(:marketable_url => @trip.marketable_url), notice: "Trip was successfully created."
else
render action: "new"
end
end

# def destroy
# @trip = Trip.find(params[:id])
# @trip.destroy
# redirect_to root_url, :notice => "Successfully deleted trip."
# end
end

0 comments on commit c7848cc

Please sign in to comment.