diff --git a/app/assets/javascripts/home.js.coffee b/app/assets/javascripts/home.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/home.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/ diff --git a/app/assets/javascripts/static_pages.js.coffee b/app/assets/javascripts/static_pages.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/static_pages.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/ diff --git a/app/assets/stylesheets/home.css.scss b/app/assets/stylesheets/home.css.scss new file mode 100644 index 0000000..4a6756f --- /dev/null +++ b/app/assets/stylesheets/home.css.scss @@ -0,0 +1,10 @@ +// Place all the styles related to the home controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ + +div.info { + text-align: center; + font-family: 'Trebuchet MS'; + font-size: 50px; + margin-bottom: 100px; +} diff --git a/app/assets/stylesheets/main.css.scss b/app/assets/stylesheets/main.css.scss index e51bb9b..669be54 100644 --- a/app/assets/stylesheets/main.css.scss +++ b/app/assets/stylesheets/main.css.scss @@ -47,22 +47,39 @@ header { } ul { + li { + display: inline-block; + height: 100%; + font-weight: bold; + + a { + color: white; + } + } + } + + ul#session-info { list-style: none; height: 100%; float: right; background-color: $color1; li { - color: #eee; - display: inline-block; + // color: #eee; margin-right: 20px; - height: 100%; } .avatar { height: 100%; } } + + ul#navigation { + list-style: none; + height: 100%; + float: right; + background-color: $color3; + } } } diff --git a/app/assets/stylesheets/static_pages.css.scss b/app/assets/stylesheets/static_pages.css.scss new file mode 100644 index 0000000..40608b2 --- /dev/null +++ b/app/assets/stylesheets/static_pages.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the static_pages controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000..5317885 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,5 @@ +class HomeController < ApplicationController + def show + @asciicasts = Asciicast.order("created_at DESC").limit(10) + end +end diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb new file mode 100644 index 0000000..7fdbd58 --- /dev/null +++ b/app/controllers/static_pages_controller.rb @@ -0,0 +1,5 @@ +class StaticPagesController < ApplicationController + def show + render params[:page] + end +end diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb new file mode 100644 index 0000000..23de56a --- /dev/null +++ b/app/helpers/home_helper.rb @@ -0,0 +1,2 @@ +module HomeHelper +end diff --git a/app/helpers/static_pages_helper.rb b/app/helpers/static_pages_helper.rb new file mode 100644 index 0000000..2d63e79 --- /dev/null +++ b/app/helpers/static_pages_helper.rb @@ -0,0 +1,2 @@ +module StaticPagesHelper +end diff --git a/app/views/asciicasts/index.html.erb b/app/views/asciicasts/index.html.erb index d92e3cf..39648fa 100644 --- a/app/views/asciicasts/index.html.erb +++ b/app/views/asciicasts/index.html.erb @@ -1,5 +1,3 @@ -

Recent asciicasts

- diff --git a/app/views/home/show.html.erb b/app/views/home/show.html.erb new file mode 100644 index 0000000..e5ec1dc --- /dev/null +++ b/app/views/home/show.html.erb @@ -0,0 +1,9 @@ +
+ Some big awesome tagline and stuff. +
+ +

Recent asciicasts

+ + diff --git a/app/views/layouts/_navigation.html.erb b/app/views/layouts/_navigation.html.erb new file mode 100644 index 0000000..7fc058d --- /dev/null +++ b/app/views/layouts/_navigation.html.erb @@ -0,0 +1,8 @@ + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9f3f2e7..68860d7 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -16,6 +16,7 @@ <%= link_to "ascii.io", "/", :class => "home" %> <%= render :partial => 'layouts/session_info' %> + <%= render :partial => 'layouts/navigation' %> diff --git a/app/views/static_pages/installation.html.erb b/app/views/static_pages/installation.html.erb new file mode 100644 index 0000000..8b70235 --- /dev/null +++ b/app/views/static_pages/installation.html.erb @@ -0,0 +1,5 @@ +How to install + +curl + +gem install diff --git a/config/routes.rb b/config/routes.rb index 6683601..474429c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,6 @@ AsciiIo::Application.routes.draw do - resources :asciicasts - match ':id' => 'asciicasts#show', :constraints => { :id => /\d+/ } + resources :asciicasts, :path => 'a' namespace :api do resources :comments @@ -11,6 +10,8 @@ AsciiIo::Application.routes.draw do end end + match "/installation" => "static_pages#show", :page => 'installation' + match "/auth/:provider/callback" => "sessions#create" match "/auth/failure" => "sessions#failure" @@ -19,5 +20,5 @@ AsciiIo::Application.routes.draw do match "/connect/:user_token" => "user_tokens#create" - root :to => 'asciicasts#index' + root :to => 'home#show' end diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb new file mode 100644 index 0000000..ab1636a --- /dev/null +++ b/spec/controllers/home_controller_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe HomeController do + + describe "GET 'show'" do + it "returns http success" do + get 'show' + response.should be_success + end + end + +end diff --git a/spec/controllers/static_pages_controller_spec.rb b/spec/controllers/static_pages_controller_spec.rb new file mode 100644 index 0000000..67f76af --- /dev/null +++ b/spec/controllers/static_pages_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe StaticPagesController do + +end diff --git a/spec/helpers/home_helper_spec.rb b/spec/helpers/home_helper_spec.rb new file mode 100644 index 0000000..4a37633 --- /dev/null +++ b/spec/helpers/home_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the HomeHelper. For example: +# +# describe HomeHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe HomeHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/static_pages_helper_spec.rb b/spec/helpers/static_pages_helper_spec.rb new file mode 100644 index 0000000..bb67275 --- /dev/null +++ b/spec/helpers/static_pages_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the StaticPagesHelper. For example: +# +# describe StaticPagesHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe StaticPagesHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/views/home/show.html.erb_spec.rb b/spec/views/home/show.html.erb_spec.rb new file mode 100644 index 0000000..18bc0e0 --- /dev/null +++ b/spec/views/home/show.html.erb_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe "home/show.html.erb" do + pending "add some examples to (or delete) #{__FILE__}" +end