mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
First version of the non-js schedule. Removed the assets from version control.
This commit is contained in:
parent
73013bd3e6
commit
b2f8cfbec3
87 changed files with 127 additions and 200 deletions
|
|
@ -151,5 +151,4 @@ div.dataTables_scrollBody tbody tr:first-child td {
|
|||
|
||||
div.dataTables_scrollFoot table {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3,5 +3,4 @@ class HomeController < ApplicationController
|
|||
@today = Date.current
|
||||
@conferences = Conference.where("start_date >= ?", @today)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
12
app/controllers/schedule_controller.rb
Normal file
12
app/controllers/schedule_controller.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
class ScheduleController < ApplicationController
|
||||
|
||||
layout "application"
|
||||
|
||||
def index
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
@events = @conference.events
|
||||
@dates = @conference.start_date..@conference.end_date
|
||||
@rooms = @conference.rooms
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -2,38 +2,40 @@
|
|||
%h1.center-text{:style => "padding-bottom: 30px"}
|
||||
Upcoming Conferences
|
||||
- @conferences.each do |conference|
|
||||
- if conference.cfp_open? || conference.registration_open?
|
||||
.well
|
||||
.row-fluid
|
||||
.span3
|
||||
= image_tag conference.logo(:original)
|
||||
.span9
|
||||
%h2.center-text
|
||||
= conference.title
|
||||
%h4.center-text
|
||||
= conference.date_range_string
|
||||
.center-text
|
||||
%i
|
||||
%a= link_to conference.venue.name, conference.venue.website, :target => "_new"
|
||||
,
|
||||
%a= link_to conference.venue.address, "http://maps.google.com/maps?q=#{conference.venue.address}", :target => "_new"
|
||||
.row-fluid
|
||||
.span12
|
||||
.center-text
|
||||
= simple_format(conference.venue.description)
|
||||
.row-fluid{:style => "padding-top: 30px;"}
|
||||
.span3
|
||||
- if conference.registration_open?
|
||||
- if conference.user_registered?(current_user)
|
||||
= link_to "Modify Registration", register_conference_path(conference.short_title), :class => "btn btn-success btn-large"
|
||||
|
||||
- else
|
||||
= link_to "Register", register_conference_path(conference.short_title), :class => "btn btn-success btn-large"
|
||||
.well
|
||||
.row-fluid
|
||||
.span3
|
||||
= image_tag conference.logo(:original)
|
||||
.span9
|
||||
%h2.center-text
|
||||
= conference.title
|
||||
%h4.center-text
|
||||
= conference.date_range_string
|
||||
.center-text
|
||||
%i
|
||||
%a= link_to conference.venue.name, conference.venue.website, :target => "_new"
|
||||
,
|
||||
%a= link_to conference.venue.address, "http://maps.google.com/maps?q=#{conference.venue.address}", :target => "_new"
|
||||
.row-fluid
|
||||
.span12
|
||||
.center-text
|
||||
= simple_format(conference.venue.description)
|
||||
.row-fluid{:style => "padding-top: 30px;"}
|
||||
.span4
|
||||
- if conference.registration_open?
|
||||
- if conference.user_registered?(current_user)
|
||||
= link_to "Modify Registration", register_conference_path(conference.short_title), :class => "btn btn-success btn-large"
|
||||
- else
|
||||
%b Registration is closed.
|
||||
.span9
|
||||
- if conference.cfp_open?
|
||||
- if !current_user.nil? && current_user.person.proposal_count(conference) > 0
|
||||
= link_to "View My Proposals", conference_proposal_index_path(conference.short_title), :class => "btn btn-success btn-large pull-right"
|
||||
- else
|
||||
= link_to "Submit Proposal", conference_proposal_index_path(conference.short_title), :class => "btn btn-success btn-large pull-right"
|
||||
= link_to "Register", register_conference_path(conference.short_title), :class => "btn btn-success btn-large"
|
||||
- else
|
||||
%b Registration is closed.
|
||||
.span4
|
||||
= link_to "Schedule", conference_schedule_path(conference.short_title), :class => "btn btn-success btn-large"
|
||||
.span4
|
||||
- if conference.cfp_open?
|
||||
- if !current_user.nil? && current_user.person.proposal_count(conference) > 0
|
||||
= link_to "View My Proposals", conference_proposal_index_path(conference.short_title), :class => "btn btn-success btn-large pull-right"
|
||||
- else
|
||||
= link_to "Submit Proposal", conference_proposal_index_path(conference.short_title), :class => "btn btn-success btn-large pull-right"
|
||||
- else
|
||||
%b.pull-right Call for Papers is closed.
|
||||
|
|
|
|||
64
app/views/schedule/index.html.erb
Normal file
64
app/views/schedule/index.html.erb
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<div id="schedule-content">
|
||||
<h2> Schedule for <%= @conference.title %></h2>
|
||||
<ul class="nav nav-tabs">
|
||||
<% @dates.each do |date| %>
|
||||
<li <%= "class=active" if @dates.first == date %>>
|
||||
<%= link_to date, "#" + "#{date}", "data-toggle" => "tab" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<% @dates.each do |date| %>
|
||||
<div class="tab-pane <%= 'active' if @dates.first == date %>" id ="<%= date %>" >
|
||||
<table class="table table-striped table-bordered" width="100%">
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<% @rooms.each do |room| %>
|
||||
<th><%= room.name %></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
|
||||
<% span = {} %>
|
||||
<% @rooms.each do |room| %>
|
||||
<% span[room.id] = 1 %>
|
||||
<% end %>
|
||||
|
||||
<% conf_start = DateTime.parse("#{date} 09:00") %>
|
||||
<% conf_end = DateTime.parse("#{date} 19:00") %>
|
||||
|
||||
<% while conf_start < conf_end %>
|
||||
|
||||
<tr>
|
||||
<td style="width:10%">
|
||||
<%= conf_start.strftime("%H:%M") %>
|
||||
</td>
|
||||
|
||||
<% @rooms.each do |room| %>
|
||||
<% event = @events.find_all{|event|event.start_time and event.start_time.strftime("%Y-%m-%d %H:%M").eql? conf_start.strftime("%Y-%m-%d %H:%M") and event.room_id == room.id } %>
|
||||
<% 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:45%" rowspan ="<%= span[room.id] %>">
|
||||
<%= event[0].title %><br>
|
||||
</td>
|
||||
<% span[room.id] = span[room.id] + 1 %>
|
||||
<% end %>
|
||||
<% if span[room.id] == 1 %>
|
||||
<!-- span equals 1 show an empty td -->
|
||||
<td style="width:45%"class="empty <%= "room" + "#{room.id}" %>">
|
||||
Empty
|
||||
</td>
|
||||
<% end %>
|
||||
<% if span[room.id] > 1 %>
|
||||
<!-- span is <%= span[room.id] %> and bigger than 1, substract 1 from span -->
|
||||
<% span[room.id] = ( span[room.id] - 1 ) if span[room.id] > 1 %>
|
||||
<% end %>
|
||||
<%end %>
|
||||
</tr>
|
||||
<% conf_start += 15.minutes %>
|
||||
<%end %>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue