Move view for proposals on schedule board into a partial
This commit is contained in:
parent
1731625153
commit
93135a6085
2 changed files with 53 additions and 49 deletions
|
|
@ -43,36 +43,7 @@
|
||||||
<% 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 %>%; cursor:pointer"
|
<%= render partial: 'schedule_item', locals: {event: event, room: room, span: span} %>
|
||||||
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 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>
|
|
||||||
<% span[room.id] = span[room.id] + 1 %>
|
<% span[room.id] = span[room.id] + 1 %>
|
||||||
<% elsif span[room.id] > 1 %>
|
<% elsif span[room.id] > 1 %>
|
||||||
<!-- span is <%= span[room.id] %> and bigger than 1, substract 1 from span -->
|
<!-- span is <%= span[room.id] %> and bigger than 1, substract 1 from span -->
|
||||||
|
|
@ -93,25 +64,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%= javascript_tag do %>
|
<%= 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() {
|
$(function() {
|
||||||
// add a hash to the URL when the user clicks on a tab
|
// add a hash to the URL when the user clicks on a tab
|
||||||
$('a[data-toggle="tab"]').on('click', function(e) {
|
$('a[data-toggle="tab"]').on('click', function(e) {
|
||||||
|
|
|
||||||
52
app/views/conference/_schedule_item.html.erb
Normal file
52
app/views/conference/_schedule_item.html.erb
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
<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 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>
|
||||||
|
|
||||||
|
<%= 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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
<% end %>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue