app/views/calagator/events/index.html.erb in calagator-1.0.0.rc2 vs app/views/calagator/events/index.html.erb in calagator-1.0.0.rc3
- old
+ new
@@ -1,38 +1,49 @@
<%= content_for :title, "Events" %>
-<% tabindex_on '#search_field' %>
-
-<% cache_if(@perform_caching, Calagator::CacheObserver.daily_key_for("events_index", request)) do %>
+<% cache_if(@browse.default?, Calagator::CacheObserver.daily_key_for("events_index", request)) do %>
<div class='list_description'>
- <h2>Viewing <strong><%= @events.size %></strong>
- <%= params[:date] ? 'filtered' : 'future' %> events
- <%= events_sort_label(params[:order]) %></h2>
+ <h2>Viewing <strong><%= @browse.events.size %></strong>
+ <%= @browse.date ? 'filtered' : 'future' %> events
+ <%= events_sort_label(@browse.order) %></h2>
</div>
<div id='list_filters' class='sidebar'>
-
- <h3 class='first'>Filter by date</h3>
+ <h3 class='first'>Filter:</h3>
+
<%= form_tag events_url, :method => 'get' do -%>
+
<div id="date_filter">
+ <h4>by date</h4>
<div id='start_calendar'>
<label for='date_start'>From</label>
- <%= text_field_tag 'date[start]', @start_date.strftime('%Y-%m-%d'), :id => 'date_start', :class => 'date_picker' %>
+ <%= text_field_tag 'date[start]', @browse.start_date, :id => 'date_start', :class => 'date_picker' %>
</div>
<div id='end_calendar'>
<label for='date_end'>To</label>
- <%= text_field_tag 'date[end]', @end_date.strftime('%Y-%m-%d'), :id => 'date_end', :class => 'date_picker' %>
+ <%= text_field_tag 'date[end]', @browse.end_date, :id => 'date_end', :class => 'date_picker' %>
</div>
- <div>
- <label for="commit"> </label>
- <%= submit_tag 'Filter' %>
- <span class="clear_filter"><%= link_to 'Reset', events_url %></span>
+ </div>
+ <div id='time_filter'>
+ <h4>by time</h4>
+ <div id='start_time_picker'>
+ <label for="time_start">Begins after:</label>
+ <%= text_field_tag 'time[start]', @browse.start_time, :id => 'filter_time_start', :class => 'time_picker_filter' %>
</div>
+ <div id='end_time_picker'>
+ <label for="time_end">Ends before:</label>
+ <%= text_field_tag 'time[end]', @browse.end_time, :id => 'filter_time_end', :class => 'time_picker_filter' %>
+ </div>
</div>
+ <div>
+ <label for="commit"> </label>
+ <%= submit_tag 'Filter' %>
+ <span class="clear_filter"><%= link_to 'Reset', events_url %></span>
+ </div>
<% end %>
-
+
<h3>Subscribe to</h3>
<ul>
<li><%= link_to "iCalendar feed", icalendar_feed_link %></li>
<li><%= link_to "Atom feed", atom_feed_link %></li>
<li><%= link_to "Google Calendar", google_events_subscription_link %></li>
@@ -40,12 +51,12 @@
<h3>Export to</h3>
<ul>
<li><%= link_to "iCalendar file", icalendar_export_link %></li>
</ul>
-
+
</div>
<div class='list_items'>
- <%= render :partial => 'table', :locals => { :events => @events } %>
+ <%= render :partial => 'table', :locals => { :events => @browse.events } %>
</div>
<% end %>