mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Cache the schedule page, fix empty rooms
This commit is contained in:
parent
f0ff5544c3
commit
2d79e8e692
4 changed files with 10 additions and 8 deletions
|
|
@ -153,7 +153,7 @@ div.dataTables_scrollFoot table {
|
|||
border-top: none;
|
||||
}
|
||||
|
||||
.event {
|
||||
.eventtd {
|
||||
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%);
|
||||
|
|
|
|||
|
|
@ -53,16 +53,18 @@ class Admin::EventsController < ApplicationController
|
|||
if params.has_key? :track_id
|
||||
@event.update_attribute(:track_id, params[:track_id])
|
||||
end
|
||||
expire_page :controller => '/schedule', :action => :index
|
||||
redirect_back_or_to(admin_conference_event_path(@conference.short_title, @event), :notice => "Updated")
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
expire_page :controller => '/schedule', :action => :index
|
||||
end
|
||||
|
||||
def update_state
|
||||
event = Event.find(params[:id])
|
||||
event.send(:"#{params[:transition]}!", :send_mail => params[:send_mail])
|
||||
expire_page :controller => '/schedule', :action => :index
|
||||
redirect_to(admin_conference_events_path(:conference_id => @conference.short_title), :notice => "Updated state")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
class ScheduleController < ApplicationController
|
||||
|
||||
layout "application"
|
||||
|
||||
caches_page :index
|
||||
|
||||
def index
|
||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||
@events = @conference.events
|
||||
|
|
|
|||
|
|
@ -39,7 +39,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 %>%" rowspan ="<%= span[room.id] %>" class="event" >
|
||||
<td style="width: <%= 95 / @rooms.length %>%" rowspan ="<%= span[room.id] %>" class="eventtd" >
|
||||
<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%>
|
||||
<i class="icon-comment"></i>
|
||||
|
|
@ -60,16 +60,15 @@
|
|||
<% end %>
|
||||
</td>
|
||||
<% 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 -->
|
||||
<% span[room.id] = ( span[room.id] - 1 ) if span[room.id] > 1 %>
|
||||
<% end %>
|
||||
<% if span[room.id] == 1 %>
|
||||
<!-- span equals 1 show an empty td -->
|
||||
<td style="width: <%= 95 / @rooms.length %>%">
|
||||
</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 %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue