Make it possible to view proposals from the schedule

This commit is contained in:
Henne Vogelsang 2013-06-20 17:24:41 +02:00 committed by Henne Vogelsang
parent 9d668ad1b1
commit c18400f9df
4 changed files with 100 additions and 120 deletions

View file

@ -153,7 +153,9 @@ div.dataTables_scrollFoot table {
border-top: none; border-top: none;
} }
.eventtd {
#schedule td.event {
background-image: linear-gradient(bottom, rgb(247,250,242) 24%, rgb(194,232,190) 97%, rgb(194,232,190) 100%); background-image: linear-gradient(bottom, rgb(247,250,242) 24%, rgb(194,232,190) 97%, rgb(194,232,190) 100%);
background-image: -o-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(194,232,190) 97%, rgb(194,232,190) 100%); background-image: -o-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(194,232,190) 97%, rgb(194,232,190) 100%);
background-image: -moz-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(194,232,190) 97%, rgb(194,232,190) 100%); background-image: -moz-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(194,232,190) 97%, rgb(194,232,190) 100%);
@ -170,28 +172,34 @@ background-image: -webkit-gradient(
); );
} }
/* Borrowed from foundation */ #schedule td.event:hover
.flex-video { {
position: relative; background-image: linear-gradient(bottom, rgb(247,250,242) 24%, rgb(83,171,74) 97%, rgb(83,171,74) 100%);
padding-top: 25px; background-image: -o-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(83,171,74) 97%, rgb(83,171,74) 100%);
padding-bottom: 67.5%; background-image: -moz-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(83,171,74) 97%, rgb(83,171,74) 100%);
height: 0; background-image: -webkit-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(83,171,74) 97%, rgb(83,171,74) 100%);
margin-bottom: 16px; background-image: -ms-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(83,171,74) 97%, rgb(83,171,74) 100%);
overflow: hidden;
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.24, rgb(247,250,242)),
color-stop(0.97, rgb(83,171,74)),
color-stop(1, rgb(83,171,74))
);
} }
.flex-video.widescreen { padding-bottom: 57.25%; } .flexvideo {
.flex-video.vimeo { padding-top: 0; } position: relative;
padding-bottom: 56.25%; /* 16:9 */
.flex-video iframe, padding-top: 25px;
.flex-video object, height: 0;
.flex-video embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
} }
@media only screen and (max-device-width: 800px), only screen and (device-width: 1024px) and (device-height: 600px), only screen and (width: 1280px) and (orientation: landscape), only screen and (device-width: 800px), only screen and (max-width: 767px) { .flexvideo iframe {
.flex-video { padding-top: 0; } position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
} }

View file

@ -1,10 +1,13 @@
class ProposalController < ApplicationController class ProposalController < ApplicationController
before_filter :verify_user before_filter :verify_user, :except => [:show]
before_filter :setup before_filter :setup
before_filter :verify_access, :only => [:edit, :update, :destroy, :confirm] before_filter :verify_access, :only => [:edit, :update, :destroy, :confirm]
def setup def setup
@person = current_user.person @person = current_user.person if current_user
#FIXME: @conference also comes from verify_user, but we need setup also in show
# which can be accessed anonymusly
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
@url = conference_proposal_index_path(@conference.short_title) @url = conference_proposal_index_path(@conference.short_title)
@event_types = @conference.event_types @event_types = @conference.event_types
end end

View file

@ -1,87 +1,44 @@
.row-fluid .row-fluid
.span10 .span3
= image_tag @event.submitter.gravatar_url(:size => 200), :class => "img-rounded"
%h3 %h3
= @event.title = @event.submitter.public_name
%br - if @event.submitter.company
%span.muted %br
= @event.subtitle %span.muted= @event.submitter.company
-if @event.submitter.biography
.span2 %p= @event.submitter.biography
- if @event.transition_possible? :confirm .span9
= link_to "Confirm", conference_proposal_confirm_path(@conference.short_title, @event), :method => :put, :class => "btn btn-mini btn-success" .row-fluid
= link_to "Edit", edit_conference_proposal_path(@conference.short_title, @event.id), :class => "btn btn-mini btn-primary" .span12
= link_to "Withdraw", conference_proposal_path(@conference.short_title, @event.id), :method => :delete, %h3.muted
:confirm => "Are you sure you want to withdraw this proposal?", :class => "btn btn-mini btn-danger" Video coming soon! Meanwhile...
.row-fluid
.row-fluid .span12.flexvideo
.span12 %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>"http://www.youtube.com/embed/Eiv4e5ZxTmg"}
%table.table .row-fluid
%tr .span8
%td %h2
%b Type = @event.title
%td - if @event.subtitle
- if @event.event_type %br
= @event.event_type.title %span.muted
- if !@event.track.nil? = @event.subtitle
%tr %p
%td = simple_format(@event.abstract)
%b Track .span4
%td %dl
= @event.track.name %dt Speaker:
- if !@event.room.nil? %dd= @event.submitter.public_name
%tr %dt Date:
%td %dd= @event.start_time.strftime("%Y %B %e")
%b Room - if @event.language
%td %dt Language:
= @event.room.name %dd= @event.language
- if !@event.start_time.nil? %dt Conference:
%tr %dd= @event.conference.title
%td - if @event.track_id
%b Scheduled time %dt Track:
%td %dd
= @event.start_time %span.label
%tr = @event.track.name
%td
%b Submitted on
%td= @event.created_at
%tr
%td
%b Last updated on
%td= @event.updated_at
%tr
%td
%b Abstract
%td= simple_format(@event.abstract)
%tr
%td
%b Description
%td= simple_format(@event.description)
- if @event.event_attachments.size > 0
%table.table
%thead
%th
%b Filename
%th
%b Title
%th
%b Size
%th
%b Public?
%th
%tbody
- @event.event_attachments.each do |a|
%tr
%td
= link_to a.attachment_file_name, conference_proposal_event_attachment_path(@conference.short_title, @event.id, a.id)
%td
= a.title
%td
= number_to_human_size a.attachment_file_size
%td
- if a.public?
Public
- else
Not Public
%td
= link_to "Delete", conference_proposal_event_attachment_path(@conference.short_title, @event.id, a.id),
:method => :delete, :confirm => "Are you sure you want to delete this attachment? It's permanant!"

View file

@ -11,7 +11,7 @@
<div class="tab-content"> <div class="tab-content">
<% @dates.each do |date| %> <% @dates.each do |date| %>
<div class="tab-pane <%= 'active' if @dates.first == date %>" id ="<%= date %>" > <div class="tab-pane <%= 'active' if @dates.first == date %>" id ="<%= date %>" >
<table class="table table-striped table-bordered" width="100%"> <table class="table table-bordered" id="schedule" width="100%">
<tr> <tr>
<th>Time</th> <th>Time</th>
<% @rooms.each do |room| %> <% @rooms.each do |room| %>
@ -39,7 +39,10 @@
<% 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 style="width: <%= 95 / @rooms.length %>%" rowspan ="<%= span[room.id] %>" class="eventtd" > <td style="width: <%= 95 / @rooms.length %>%; cursor:pointer"
rowspan ="<%= span[room.id] %>"
class="event" role="button"
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;" %> <%= 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;" %>
<i class="icon-comment"></i> <i class="icon-comment"></i>
@ -51,15 +54,9 @@
<%= event[0].submitter.public_name %> <%= event[0].submitter.public_name %>
<% if event[0].track%> <% if event[0].track%>
<br><i class="icon-road"></i> <br><i class="icon-road"></i>
<span 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>
<% end -%> <% end -%>
</h5> </h5>
<% if span[room.id] > 2 %>
<% length = span[room.id] * 40 %>
<p class="hidden-phone">
<%= truncate(event[0].abstract, :length => length) %>
</p>
<% end %>
</td> </td>
<% span[room.id] = span[room.id] + 1 %> <% span[room.id] = span[room.id] + 1 %>
<% elsif span[room.id] > 1 %> <% elsif span[room.id] > 1 %>
@ -78,4 +75,19 @@
</table> </table>
</div> </div>
<% end %> <% end %>
</div> </div>
<%= javascript_tag do %>
jQuery( function($) {
$('tbody tr td[data-href]').addClass('clickable').mouseup(function(e) {
if(e.which===1)
{
window.location = $(this).attr('data-href');
}
else if(e.which===2)
{
window.open($(this).attr('data-href'), '_blank');
}
});
});
<% end %>