From a11d562dbddd598d6b8449438111f77caf516918 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Wed, 19 Jun 2013 16:06:34 +0200 Subject: [PATCH] Use gravatars, some schedule layout hacking --- Gemfile | 1 + Gemfile.lock | 2 ++ app/models/person.rb | 3 +++ app/views/schedule/index.html.erb | 19 ++++++++++++++++--- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 819c12e8..29415d5f 100644 --- a/Gemfile +++ b/Gemfile @@ -36,6 +36,7 @@ gem 'transitions', :require => ["transitions", "active_record/transitions"] gem 'acts_as_commentable_with_threading' gem 'prawn' gem 'prawn_rails' +gem 'gravtastic' # To use Jbuilder templates for JSON # gem 'jbuilder' diff --git a/Gemfile.lock b/Gemfile.lock index a4a122ca..d09d809a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,6 +57,7 @@ GEM actionpack (>= 3.0) formtastic-bootstrap (2.1.1) formtastic (~> 2.2) + gravtastic (3.2.6) haml (4.0.2) tilt hashery (2.1.0) @@ -162,6 +163,7 @@ DEPENDENCIES cocoon devise formtastic-bootstrap + gravtastic haml jquery-fileupload-rails jquery-rails diff --git a/app/models/person.rb b/app/models/person.rb index dfb9915b..05470c6a 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -1,4 +1,7 @@ class Person < ActiveRecord::Base + include Gravtastic + gravtastic :size => 32 + attr_accessible :email, :first_name, :last_name, :public_name, :biography, :company, :avatar, :irc_nickname has_many :event_people, :dependent => :destroy diff --git a/app/views/schedule/index.html.erb b/app/views/schedule/index.html.erb index d5a56966..49197a7a 100644 --- a/app/views/schedule/index.html.erb +++ b/app/views/schedule/index.html.erb @@ -39,15 +39,28 @@ <% if !event.empty? %> <% span[room.id] = event[0].event_type.length / 15 %> - - <%= event[0].title %>
+ +

+ <%= image_tag event[0].submitter.gravatar_url, :class => "img-circle" %>
+ <%= event[0].submitter.public_name %> +

+
+ <%= event[0].event_type.title %>: + <%= event[0].title %>
+ <%= event[0].subtitle %>
+ <% if event[0].track%> + Track: <%= event[0].track.name %> + <% end -%> +
+ <% if span[room.id] > 2 %> + <%= truncate(event[0].abstract, :length => 80) %> + <% end %> <% span[room.id] = span[room.id] + 1 %> <% end %> <% if span[room.id] == 1 %> "> - Empty <% end %> <% if span[room.id] > 1 %>