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 'prawn'
gem 'prawn_rails'
gem 'gravtastic'
# To use Jbuilder templates for JSON
# gem 'jbuilder'

View file

@ -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

View file

@ -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

View file

@ -39,15 +39,28 @@
<% if !event.empty? %>
<!-- There is an event, calculate the span and show it -->
<% span[room.id] = event[0].event_type.length / 15 %>
<td rowspan ="<%= span[room.id] %>">
<%= event[0].title %><br>
<td rowspan ="<%= span[room.id] %>" >
<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>
<% span[room.id] = span[room.id] + 1 %>
<% end %>
<% if span[room.id] == 1 %>
<!-- span equals 1 show an empty td -->
<td class="empty <%= "room" + "#{room.id}" %>">
Empty
</td>
<% end %>
<% if span[room.id] > 1 %>