From c18400f9dfe0027d18558ffd9658265041c06b5b Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Thu, 20 Jun 2013 17:24:41 +0200 Subject: [PATCH] Make it possible to view proposals from the schedule --- app/assets/stylesheets/osem.css | 54 ++++++----- app/controllers/proposal_controller.rb | 7 +- app/views/proposal/show.html.haml | 127 ++++++++----------------- app/views/schedule/index.html.erb | 32 +++++-- 4 files changed, 100 insertions(+), 120 deletions(-) diff --git a/app/assets/stylesheets/osem.css b/app/assets/stylesheets/osem.css index 57773a03..26704e77 100644 --- a/app/assets/stylesheets/osem.css +++ b/app/assets/stylesheets/osem.css @@ -153,7 +153,9 @@ div.dataTables_scrollFoot table { 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: -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%); @@ -170,28 +172,34 @@ background-image: -webkit-gradient( ); } -/* Borrowed from foundation */ -.flex-video { - position: relative; - padding-top: 25px; - padding-bottom: 67.5%; - height: 0; - margin-bottom: 16px; - overflow: hidden; +#schedule td.event:hover +{ +background-image: linear-gradient(bottom, rgb(247,250,242) 24%, rgb(83,171,74) 97%, rgb(83,171,74) 100%); +background-image: -o-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(83,171,74) 97%, rgb(83,171,74) 100%); +background-image: -moz-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(83,171,74) 97%, rgb(83,171,74) 100%); +background-image: -webkit-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(83,171,74) 97%, rgb(83,171,74) 100%); +background-image: -ms-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(83,171,74) 97%, rgb(83,171,74) 100%); + +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%; } -.flex-video.vimeo { padding-top: 0; } - -.flex-video iframe, -.flex-video object, -.flex-video embed { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; + +.flexvideo { + position: relative; + padding-bottom: 56.25%; /* 16:9 */ + padding-top: 25px; + height: 0; } -@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) { - .flex-video { padding-top: 0; } +.flexvideo iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } \ No newline at end of file diff --git a/app/controllers/proposal_controller.rb b/app/controllers/proposal_controller.rb index 699eab46..80d046df 100644 --- a/app/controllers/proposal_controller.rb +++ b/app/controllers/proposal_controller.rb @@ -1,10 +1,13 @@ class ProposalController < ApplicationController - before_filter :verify_user + before_filter :verify_user, :except => [:show] before_filter :setup before_filter :verify_access, :only => [:edit, :update, :destroy, :confirm] 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) @event_types = @conference.event_types end diff --git a/app/views/proposal/show.html.haml b/app/views/proposal/show.html.haml index 88b71af8..9462fe6d 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -1,87 +1,44 @@ .row-fluid - .span10 + .span3 + = image_tag @event.submitter.gravatar_url(:size => 200), :class => "img-rounded" %h3 - = @event.title - %br - %span.muted - = @event.subtitle - - .span2 - - if @event.transition_possible? :confirm - = link_to "Confirm", conference_proposal_confirm_path(@conference.short_title, @event), :method => :put, :class => "btn btn-mini btn-success" - = link_to "Edit", edit_conference_proposal_path(@conference.short_title, @event.id), :class => "btn btn-mini btn-primary" - = link_to "Withdraw", conference_proposal_path(@conference.short_title, @event.id), :method => :delete, - :confirm => "Are you sure you want to withdraw this proposal?", :class => "btn btn-mini btn-danger" - -.row-fluid - .span12 - %table.table - %tr - %td - %b Type - %td - - if @event.event_type - = @event.event_type.title - - if !@event.track.nil? - %tr - %td - %b Track - %td - = @event.track.name - - if !@event.room.nil? - %tr - %td - %b Room - %td - = @event.room.name - - if !@event.start_time.nil? - %tr - %td - %b Scheduled time - %td - = @event.start_time - %tr - %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!" + = @event.submitter.public_name + - if @event.submitter.company + %br + %span.muted= @event.submitter.company + -if @event.submitter.biography + %p= @event.submitter.biography + .span9 + .row-fluid + .span12 + %h3.muted + Video coming soon! Meanwhile... + .row-fluid + .span12.flexvideo + %iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=>"http://www.youtube.com/embed/Eiv4e5ZxTmg"} + .row-fluid + .span8 + %h2 + = @event.title + - if @event.subtitle + %br + %span.muted + = @event.subtitle + %p + = simple_format(@event.abstract) + .span4 + %dl + %dt Speaker: + %dd= @event.submitter.public_name + %dt Date: + %dd= @event.start_time.strftime("%Y %B %e") + - if @event.language + %dt Language: + %dd= @event.language + %dt Conference: + %dd= @event.conference.title + - if @event.track_id + %dt Track: + %dd + %span.label + = @event.track.name \ No newline at end of file diff --git a/app/views/schedule/index.html.erb b/app/views/schedule/index.html.erb index e3667b26..9aa47a69 100644 --- a/app/views/schedule/index.html.erb +++ b/app/views/schedule/index.html.erb @@ -11,7 +11,7 @@
<% @dates.each do |date| %>
- +
<% @rooms.each do |room| %> @@ -39,7 +39,10 @@ <% if !event.empty? %> <% span[room.id] = event[0].event_type.length / 15 %> - <% span[room.id] = span[room.id] + 1 %> <% elsif span[room.id] > 1 %> @@ -78,4 +75,19 @@
Time +
<%= 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;" %> @@ -51,15 +54,9 @@ <%= event[0].submitter.public_name %> <% if event[0].track%>
- <%= event[0].track.name %> + <%= event[0].track.name %> <% end -%>
- <% if span[room.id] > 2 %> - <% length = span[room.id] * 40 %> -

- <%= truncate(event[0].abstract, :length => length) %> -

- <% end %>
<% end %> -
\ No newline at end of file + + +<%= 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 %> \ No newline at end of file