Merge pull request #656 from bgeuken/make_schedules_links
Make talks on schedules table real links
This commit is contained in:
commit
a80e3d814e
3 changed files with 31 additions and 50 deletions
|
|
@ -59,3 +59,9 @@ background-image: -webkit-gradient(
|
|||
.schedule-subtitle {
|
||||
color: rgb(185, 74, 72);
|
||||
}
|
||||
|
||||
a.unstyled-link {
|
||||
text-decoration: none;
|
||||
color: #333333;
|
||||
outline: 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,37 +43,7 @@
|
|||
<% if !event.empty? %>
|
||||
<!-- There is an event, calculate the span and show it -->
|
||||
<% span[room.id] = event[0].event_type.length / 15 %>
|
||||
<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)) %>">
|
||||
<%- if speaker = event[0].speakers.first %>
|
||||
<%= image_tag speaker.gravatar_url, :class => "img-circle pull-right",
|
||||
:alt => speaker.name,
|
||||
:title => speaker.name,
|
||||
:style => "padding:8px;" %>
|
||||
<%- end %>
|
||||
<h5>
|
||||
<span class="fa fa-comment"></span>
|
||||
<%= event[0].title %>
|
||||
<% unless event[0].subtitle.blank? %>
|
||||
<span class="schedule-subtitle">
|
||||
<%= event[0].subtitle %>
|
||||
<span>
|
||||
<% end %>
|
||||
</h5>
|
||||
</span>
|
||||
<span class="schedule-speaker">
|
||||
<span class="fa fa-user"></span>
|
||||
<%= "#{speaker.name}" %>
|
||||
</span>
|
||||
<% if event[0].track%>
|
||||
<span class="schedule-track">
|
||||
<span class="fa fa-road"></span>
|
||||
<span class="label" style="background-color:<%= event[0].track.color if event[0].track %>"><%= event[0].track.name %></span>
|
||||
</span>
|
||||
<% end -%>
|
||||
</td>
|
||||
<%= render partial: 'schedule_item', locals: {event: event, room: room, span: span} %>
|
||||
<% span[room.id] = span[room.id] + 1 %>
|
||||
<% elsif span[room.id] > 1 %>
|
||||
<!-- span is <%= span[room.id] %> and bigger than 1, substract 1 from span -->
|
||||
|
|
@ -94,25 +64,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<%= javascript_tag do %>
|
||||
jQuery( function($) {
|
||||
$('tbody tr td[data-href]').addClass('clickable').mouseup(function(e) {
|
||||
var url = $(this).attr('data-href');
|
||||
if (e.which === 1 && e.ctrlKey){
|
||||
var win = window.open(url, '_blank');
|
||||
win.focus();
|
||||
}
|
||||
else if(e.which === 1)
|
||||
{
|
||||
window.location = url;
|
||||
}
|
||||
else if(e.which === 2)
|
||||
{
|
||||
var win = window.open(url, '_blank');
|
||||
win.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(function() {
|
||||
// add a hash to the URL when the user clicks on a tab
|
||||
$('a[data-toggle="tab"]').on('click', function(e) {
|
||||
|
|
|
|||
24
app/views/conference/_schedule_item.html.haml
Normal file
24
app/views/conference/_schedule_item.html.haml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
%td.event{ style: "width: #{95 / @rooms.length}%; cursor:pointer", |
|
||||
rowspan: span[room.id], |
|
||||
role: "button" } |
|
||||
%a.unstyled-link{href: url_for(conference_proposal_path(@conference.short_title, event[0].id))}
|
||||
- if speaker = event[0].speakers.first
|
||||
= image_tag speaker.gravatar_url, :class => "img-circle pull-right", |
|
||||
:alt => speaker.name, |
|
||||
:title => speaker.name, |
|
||||
:style => "padding:8px;" |
|
||||
%h5
|
||||
%span.fa.fa-comment
|
||||
= event[0].title
|
||||
- unless event[0].subtitle.blank?
|
||||
%span.schedule-subtitle
|
||||
= event[0].subtitle
|
||||
%span.schedule-speaker
|
||||
%span.fa.fa-user
|
||||
= speaker.name
|
||||
- if event[0].track
|
||||
%span.schedule-track
|
||||
%span.fa.fa-road
|
||||
%span.label{ style: "background-color: #{event[0].track.color}" }
|
||||
= event[0].track.name
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue