aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/request/list.rhtml
blob: 04dc0d010b004a5e52333a8603a1ed15a4d5f459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div id="list_sidebar">
<h1><%= _('Show only...')%></h1>
<ul>
<% for view, description, target in [ 
    ['successful', _('Successful responses'), request_list_successful_url(:view => 'successful')],
    ['recent', _('Recently sent requests'), request_list_recent_url(:view => 'recent')]
] %>
<li>  
    <%= link_to_unless (@view == view), description, target %> 
</li>
<% end %>
</ul>
</div>

<h1><%=@title%></h1>

<% if @track_thing %>
    <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
<% end %>

<% view_cache :ttl => 5.minutes, :tag => [@view, @page, I18n.locale] do %>
    <% if @list_results.empty? %>
        <p> <%= _('No requests of this sort yet.')%></p>
    <% else %>
        <% for result in @list_results%>
            <% if result.class.to_s == 'InfoRequestEvent' %>
                <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result, :info_request => result.info_request } %>
            <% else %>
                <p><strong><%= _('Unexpected search result type') %> <%=result.class.to_s%></strong></p>
            <% end %>
        <% end %>
    <% end %>

    <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @matches_estimated) %>
<% end %>

<% if @track_thing %>
    <p></p>
    <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
<% end %>