Source

solreyes / templates / solreyes.mako

Full commit
<html>
<head>
    <title>SolrEyes</title>
</head>

<body>
    
    <table align="center">
    
    <tr>
        <td>
            <a href="/">
            <img src="/static/Eye_of_Horus_bw.png" alt="The Eye of Horus"/></a><br/><br/>
        </td>
        <td valign="top">
            <h1>SolrEyes</h1>
        </td>
    </tr>
    
    <tr>
    
    <!-- Faceted Navigation -->
        <td valign="top">
%   for facet in c['config'].display_facet_order:
%       if c['results'].has_values(facet):
            <strong>${c['config'].get_facet_display(facet)}</strong><br/>
    %       if facet in c['config'].facet_ranges.keys():
    
    %           if c['results'].in_args(facet):
    %               if c['results'].get_selected_range_end(facet) != -1:
                        <em>${c['results'].get_selected_range_start(facet)} - ${c['results'].get_selected_range_end(facet)}
                        (${c['results'].numFound()})
                        </em>&nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet)}">x</a><br/>
    %               else:
                        <em>${c['results'].get_selected_range_start(facet)}+
                        (${c['results'].numFound()})
                        </em>&nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet)}">x</a><br/>
    %               endif
    %           else:
    %               for lower, upper, count in c['results'].get_ordered_facets(facet):
                        <a href="${c['url_manager'].get_add_url(facet, lower, upper)}">
    %                   if upper != -1:
                            ${lower} - ${upper} (${count})
    %                   else:
                            ${lower}+ (${count})
    %                   endif
                        </a><br/>
    %               endfor
    %           endif
    %       elif facet in c['config'].facet_dates.keys():
    
    %           if c['results'].in_args(facet):
    %               if c['results'].get_selected_range_end(facet) != -1:
                        <em>
                            ${c['config'].get_value_display(facet, str(c['results'].get_selected_range_start(facet)))}
        %               if c['config'].display_upper(facet, str(c['results'].get_selected_range_start(facet)), str(c['results'].get_selected_range_end(facet))):
                            - 
                            ${c['config'].get_value_display(facet, str(c['results'].get_selected_range_end(facet)))}
        %               endif
                        (${c['results'].numFound()})
                        </em>
                        &nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet)}">x</a><br/>
    %               else:
                        <em>${c['config'].get_value_display(facet, str(c['results'].get_selected_range_start(facet)))}+
                        (${c['results'].numFound()})
                        </em>&nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet)}">x</a><br/>
    %               endif
    %           else:
    %               for lower, upper, count in c['results'].get_ordered_facets(facet):
                        <a href="${c['url_manager'].get_add_date_url(facet, lower, upper)}">
    %                   if upper != -1:
                            ${c['config'].get_value_display(facet, str(lower))}
        %                   if c['config'].display_upper(facet, str(lower), str(upper)):
                                - 
                                ${c['config'].get_value_display(facet, str(upper))} 
        %                   endif
                            (${count})
    %                   else:
                            ${c['config'].get_value_display(facet, str(lower))}+ (${count})
    %                   endif
                        </a><br/>
    %               endfor
    %           endif 
    
    %       else:
    
    %           for value, count in c['results'].get_ordered_facets(facet):
    %               if c['results'].in_args(facet, value):
                        <em>
    %               else:
                        <a href="${c['url_manager'].get_add_url(facet, value)}">
    %               endif
        
                    ${c['config'].get_value_display(facet, value)} (${count})
        
    %               if c['results'].in_args(facet, value):
                        </em>&nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet, value)}">x</a>
    %               else:
                        </a>
    %               endif
                    <br/>
    %           endfor
    
    %       endif
        <br/>
%       endif
%   endfor
        </td>
            
        <td valign="top">

% if c['results'].set_size() != 0:
<p>
    <!-- Paging -->
    
%   if not c['results'].is_start():
        <a href="${c['url_manager'].get_position_url(0)}">1 - ${c['results'].first_page_end()}</a>
        ...
%   endif

%       for start, finish in c['results'].get_previous(3):
            <a href="${c['url_manager'].get_position_url(start)}">${start + 1} - ${finish}</a>
%       endfor
            <strong>${c['results'].start_offset(1)} - ${c['results'].finish()}</strong>

%       for start, finish in c['results'].get_next(3):
            <a href="${c['url_manager'].get_position_url(start)}">${start + 1} - ${finish}</a>
%       endfor

%   if not c['results'].is_end():
        ...
        <a href="${c['url_manager'].get_position_url(c['results'].last_page_start())}">
        ${c['results'].last_page_start() + 1} - 
        ${c['results'].numFound()}</a>
%   endif
</p>
% endif



<!-- Result set -->

% if c['results'].set_size() == 0:
    There are currently no results to display.  Try selecting some facets
    from the left to start getting some results.  There are ${c['results'].numFound()} 
    records in the index.
% else:
    <!-- sorting and result sizes -->
<p>
    Results per page: 
% for rpp in c['config'].results_per_page_options:
%   if rpp == c['results'].page_size():
    <strong>${rpp}</strong>
%   else:
    <a href="${c['url_manager'].get_rpp_url(rpp)}">${rpp}</a>
%   endif
% endfor

<br/>
% if len(c['results'].current_sort_fields()) > 0:
    Sorting by: 
% for sortby, direction in c['results'].current_sort_order():
    <strong>
    ${c['config'].sort_fields[sortby].get("display", sortby)}
    % if direction == 'asc':
        (^ <a href="${c['url_manager'].get_sort_url(sortby, 'desc')}">v</a>)
    % endif
    % if direction == 'desc':
        (<a href="${c['url_manager'].get_sort_url(sortby, 'asc')}">^</a> v)
    % endif
    <a href="${c['url_manager'].get_unsort_url(sortby)}">x</a>
    </strong>
    then
% endfor
-
% endif

% if len([f for f in c['config'].sort_fields.keys() if f not in c['results'].current_sort_fields()]) > 0:
% if len(c['results'].current_sort_fields()) == 0:
Sort by:
% endif

% for sortby in c['config'].sort_fields.keys():
%   if sortby not in c['results'].current_sort_fields():
    ${c['config'].sort_fields[sortby].get("display", sortby)} (<a href="${c['url_manager'].get_sort_url(sortby, 'asc')}">^</a> <a href="${c['url_manager'].get_sort_url(sortby, 'desc')}">v</a>)
%   endif
% endfor
% endif

</p>

<%include file="/table-view.mako"/>
% endif

        </td>
    
    </tr></table>
    
</body>
</html>