diff --git a/app/assets/stylesheets/home.css.scss b/app/assets/stylesheets/home.css.scss new file mode 100644 index 0000000..c8aece5 --- /dev/null +++ b/app/assets/stylesheets/home.css.scss @@ -0,0 +1,9 @@ +// 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/ + +.hero-unit { + .asciicast { + margin-top: 40px; + } +} diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 5317885..0de180e 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,5 +1,6 @@ class HomeController < ApplicationController def show @asciicasts = Asciicast.order("created_at DESC").limit(10) + @asciicast = @asciicasts.first end end diff --git a/app/views/asciicasts/_asciicast.html.erb b/app/views/asciicasts/_asciicast.html.erb index 554ba50..5e50352 100644 --- a/app/views/asciicasts/_asciicast.html.erb +++ b/app/views/asciicasts/_asciicast.html.erb @@ -4,9 +4,11 @@
-
- <%= random_description %> -
+ <% unless (defined? skip_description) && skip_description %> +
+ <%= random_description %> +
+ <% end %> <%= player_script(asciicast) %> diff --git a/app/views/home/show.html.erb b/app/views/home/show.html.erb index 01eb821..1b68ed0 100644 --- a/app/views/home/show.html.erb +++ b/app/views/home/show.html.erb @@ -1,9 +1,16 @@

ascii.io

No bullshit asciicasting for developers

+ + <%= render :partial => 'asciicasts/asciicast', + :object => @asciicast, + :locals => { :skip_description => true } %> +

- <%= link_to 'Try it', installation_path, :class => "btn btn-primary btn-large" %> + <%= link_to 'Use it!', installation_path, :class => "btn btn-primary btn-large" %> + <%= link_to 'Browse', browse_path, :class => "btn btn-large" %>

+

Recent asciicasts

diff --git a/app/views/layouts/_navigation.html.erb b/app/views/layouts/_navigation.html.erb index f955380..8966bf7 100644 --- a/app/views/layouts/_navigation.html.erb +++ b/app/views/layouts/_navigation.html.erb @@ -1,5 +1,5 @@