Speaker is displayed instead of submitter un public pages
This commit is contained in:
parent
3a2bf49f97
commit
cb76a9b7cc
4 changed files with 12 additions and 9 deletions
|
|
@ -138,6 +138,7 @@ class ProposalController < ApplicationController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@event = Event.find(params[:id])
|
@event = Event.find(params[:id])
|
||||||
|
@speaker = @event.speakers.first || @event.submitter
|
||||||
end
|
end
|
||||||
|
|
||||||
def confirm
|
def confirm
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ class Event < ActiveRecord::Base
|
||||||
has_many :event_people, :dependent => :destroy
|
has_many :event_people, :dependent => :destroy
|
||||||
has_many :event_attachments, :dependent => :destroy
|
has_many :event_attachments, :dependent => :destroy
|
||||||
has_many :people, :through => :event_people
|
has_many :people, :through => :event_people
|
||||||
|
has_many :speakers, :through => :event_people, :source => :person, :conditions => {"event_people.event_role" => "speaker"}
|
||||||
belongs_to :event_type
|
belongs_to :event_type
|
||||||
|
|
||||||
belongs_to :track
|
belongs_to :track
|
||||||
|
|
|
||||||
|
|
@ -38,15 +38,15 @@
|
||||||
.span8
|
.span8
|
||||||
%h3
|
%h3
|
||||||
by
|
by
|
||||||
= @event.submitter.public_name
|
= @speaker.public_name
|
||||||
- if @event.submitter.company
|
- if @speaker.company
|
||||||
%br
|
%br
|
||||||
%span.muted
|
%span.muted
|
||||||
from
|
from
|
||||||
= @event.submitter.company
|
= @speaker.company
|
||||||
-if @event.submitter.biography
|
-if @speaker.biography
|
||||||
= simple_format(@event.submitter.biography)
|
= simple_format(@speaker.biography)
|
||||||
.span4
|
.span4
|
||||||
= image_tag @event.submitter.gravatar_url(:size => 200), :class => "img-rounded pull-right", :style => "margin: 8px;"
|
= image_tag @speaker.gravatar_url(:size => 200), :class => "img-rounded pull-right", :style => "margin: 8px;"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,15 @@
|
||||||
class="event" role="button"
|
class="event" role="button"
|
||||||
data-href="<%= url_for(conference_proposal_path(@conference.short_title, event[0].id)) %>">
|
data-href="<%= url_for(conference_proposal_path(@conference.short_title, event[0].id)) %>">
|
||||||
<h5>
|
<h5>
|
||||||
<%= image_tag event[0].submitter.gravatar_url, :class => "img-circle pull-right", :alt => event[0].submitter.public_name, :title => event[0].submitter.public_name, :style => "padding:8px;" %>
|
<%- speaker = event[0].speakers.first || event[0].submitter %>
|
||||||
|
<%= image_tag speaker.gravatar_url, :class => "img-circle pull-right", :alt => speaker.public_name, :title => speaker.public_name, :style => "padding:8px;" %>
|
||||||
<i class="icon-comment"></i>
|
<i class="icon-comment"></i>
|
||||||
<%= event[0].title %><br>
|
<%= event[0].title %><br>
|
||||||
<% unless event[0].subtitle.empty? %>
|
<% unless event[0].subtitle.empty? %>
|
||||||
<span class="text-error"><%= event[0].subtitle %></span><br>
|
<span class="text-error"><%= event[0].subtitle %></span><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
<i class="icon-user"></i>
|
<i class="icon-user"></i>
|
||||||
<%= event[0].submitter.public_name %>
|
<%= speaker.public_name %>
|
||||||
<% if event[0].track%>
|
<% if event[0].track%>
|
||||||
<br><i class="icon-road"></i>
|
<br><i class="icon-road"></i>
|
||||||
<span class="label" style="background-color:<%= event[0].track.color if event[0].track %>"><%= event[0].track.name %></span>
|
<span class="label" style="background-color:<%= event[0].track.color if event[0].track %>"><%= event[0].track.name %></span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue