Use gravatars, some schedule layout hacking

This commit is contained in:
Henne Vogelsang 2013-06-19 16:06:34 +02:00 committed by Henne Vogelsang
parent c2e007e2b8
commit a11d562dbd
4 changed files with 22 additions and 3 deletions

View file

@ -36,6 +36,7 @@ gem 'transitions', :require => ["transitions", "active_record/transitions"]
gem 'acts_as_commentable_with_threading' gem 'acts_as_commentable_with_threading'
gem 'prawn' gem 'prawn'
gem 'prawn_rails' gem 'prawn_rails'
gem 'gravtastic'
# To use Jbuilder templates for JSON # To use Jbuilder templates for JSON
# gem 'jbuilder' # gem 'jbuilder'

View file

@ -57,6 +57,7 @@ GEM
actionpack (>= 3.0) actionpack (>= 3.0)
formtastic-bootstrap (2.1.1) formtastic-bootstrap (2.1.1)
formtastic (~> 2.2) formtastic (~> 2.2)
gravtastic (3.2.6)
haml (4.0.2) haml (4.0.2)
tilt tilt
hashery (2.1.0) hashery (2.1.0)
@ -162,6 +163,7 @@ DEPENDENCIES
cocoon cocoon
devise devise
formtastic-bootstrap formtastic-bootstrap
gravtastic
haml haml
jquery-fileupload-rails jquery-fileupload-rails
jquery-rails jquery-rails

View file

@ -1,4 +1,7 @@
class Person < ActiveRecord::Base class Person < ActiveRecord::Base
include Gravtastic
gravtastic :size => 32
attr_accessible :email, :first_name, :last_name, :public_name, :biography, :company, :avatar, :irc_nickname attr_accessible :email, :first_name, :last_name, :public_name, :biography, :company, :avatar, :irc_nickname
has_many :event_people, :dependent => :destroy has_many :event_people, :dependent => :destroy

View file

@ -39,15 +39,28 @@
<% if !event.empty? %> <% if !event.empty? %>
<!-- There is an event, calculate the span and show it --> <!-- There is an event, calculate the span and show it -->
<% span[room.id] = event[0].event_type.length / 15 %> <% span[room.id] = event[0].event_type.length / 15 %>
<td rowspan ="<%= span[room.id] %>"> <td rowspan ="<%= span[room.id] %>" >
<%= event[0].title %><br> <p class="pull-right text-info text-center">
<%= image_tag event[0].submitter.gravatar_url, :class => "img-circle" %><br>
<small><%= event[0].submitter.public_name %></small>
</p>
<h5>
<%= event[0].event_type.title %>:
<%= event[0].title %><br>
<span class="muted"><%= event[0].subtitle %></span><br>
<% if event[0].track%>
Track: <span style="background-color:<%= event[0].track.color if event[0].track %>"><%= event[0].track.name %></span>
<% end -%>
</h5>
<% if span[room.id] > 2 %>
<%= truncate(event[0].abstract, :length => 80) %>
<% end %>
</td> </td>
<% span[room.id] = span[room.id] + 1 %> <% span[room.id] = span[room.id] + 1 %>
<% end %> <% end %>
<% if span[room.id] == 1 %> <% if span[room.id] == 1 %>
<!-- span equals 1 show an empty td --> <!-- span equals 1 show an empty td -->
<td class="empty <%= "room" + "#{room.id}" %>"> <td class="empty <%= "room" + "#{room.id}" %>">
Empty
</td> </td>
<% end %> <% end %>
<% if span[room.id] > 1 %> <% if span[room.id] > 1 %>