diff --git a/app/assets/stylesheets/asciicasts.css.scss b/app/assets/stylesheets/asciicasts.css.scss index de86a4e..eaff551 100644 --- a/app/assets/stylesheets/asciicasts.css.scss +++ b/app/assets/stylesheets/asciicasts.css.scss @@ -659,6 +659,15 @@ $color5: #EDC951; .bg254 { background-color: #e4e4e4 } .bg255 { background-color: #eeeeee } + .meta { + .avatar { + width: 24px; + padding: 1px; + background-color: white; + border: 1px solid #ccc; + } + } + .description { color: #3e3e3e; font-family: arial, helvetica; diff --git a/app/helpers/asciicasts_helper.rb b/app/helpers/asciicasts_helper.rb index 0f69e5f..e39daf8 100644 --- a/app/helpers/asciicasts_helper.rb +++ b/app/helpers/asciicasts_helper.rb @@ -10,6 +10,16 @@ module AsciicastsHelper end end + def asciicast_author(asciicast) + if asciicast.user + link_to avatar_img(asciicast.user) + " #{asciicast.user.nickname}", '#' + end + end + + def asciicast_time(asciicast) + time_ago_in_words(asciicast.created_at) + " ago" + end + def player_script(asciicast) return < diff --git a/app/views/asciicasts/show.html.erb b/app/views/asciicasts/show.html.erb index eb3935d..956e877 100644 --- a/app/views/asciicasts/show.html.erb +++ b/app/views/asciicasts/show.html.erb @@ -1,6 +1,10 @@ -

<%= asciicast_title(@asciicast) %>

-
+

<%= asciicast_title(@asciicast) %>

+

+ <%= asciicast_author(@asciicast) %> + <%= asciicast_time(@asciicast) %> +

+