Commits

Anonymous committed 68a7ac3

add proper html layout and styles to make this smart

Comments (0)

Files changed (9)

static/styless.css

     margin-top: 10px;
 }
 
+.current_sort_option a {
+    text-decoration: none;
+}
+
 .potential_sort_option {
     float: left;
     border: 1px dotted #999999;
     margin-top: 10px;
 }
 
+.potential_sort_option a {
+    text-decoration: none
+}
+
 .sort_label {
     float: left;
     padding: 3px;
     float: left;
     padding: 3px;
     margin-top: 10px;
+    padding-left: 20px;
 }
 
 .potential_rpp {
     float: left;
     margin-top: 10px;
     padding: 3px;
+    padding-bottom: 5px;
+    border: 1px solid #000000;
+    margin-right: 3px;
+}
+
+.potential_rpp:hover {
+    background: #eeeeff;
+}
+
+.potential_rpp a {
+    text-decoration: none;
+    color: #000000;
 }
 
 .current_rpp {
     border-bottom: 3px solid #000000;
     margin-top: 10px;
     padding: 3px;
+    margin-right: 3px;
+    background: #ddddff;
 }
 
 .paging_label {
     float: left;
     margin-top: 10px;
     padding: 3px;
+    padding-bottom: 5px;
+    border: 1px solid #000000;
+    margin-right: 3px;
+}
+
+.potential_page:hover {
+    background: #eeeeff;
+}
+
+.potential_page a {
+    text-decoration: none;
+    color: #000000;
 }
 
 .current_page {
     border-bottom: 3px solid #000000;
     margin-top: 10px;
     padding: 3px;
+    margin-right: 3px;
+    background: #ddddff;
 }
 
 .result_view {
     padding-top: 20px;
     padding-bottom: 20px;
     padding-right: 20px;
+}
+
+.delete_url {
+    text-decoration: none;
+    color: #ff0000;
+    font-weight: bold;
+}
+
+.no_results {
+    padding-top: 50px;
+}
+
+.facet_heading {
+    text-decoration: none;
+    font-weight: bold;
+}
+
+.facet_heading a {
+    text-decoration: none;
+    font-weight: bold;
+    color: #000000;
+}
+
+.facet_value {
+    padding-left: 20px;
+}
+
+.facet {
+    padding-bottom: 15px;
+}
+
+.data_table {
+    border-bottom: 1px solid #000000;
+}
+
+.data_table th {
+    font-weight: bold;
+    background: #999999;
+    color: #ffffff;
+    border-bottom: 1px solid #000000;
+    border-right: 1px solid #000000;
+    padding-left: 3px;
+    padding-right: 3px;
+}
+
+.data_table .odd td {
+    background: #ffffff;
+    border-right: 1px solid #000000;
+    padding-left: 3px;
+    padding-right: 3px;
+}
+
+.data_table .even td {
+    background: #f3f3f3;
+    border-right: 1px solid #000000;
+    padding-left: 3px;
+    padding-right: 3px;
 }

templates/date-selected.mako

 
     (${c['results'].numFound()})
     </em>
-    &nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet)}">x</a>
+    &nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet)}">x</a>
 
 % 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>
+    </em>&nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet)}">x</a>
     
 % endif
 <br/>

templates/facet-extra.mako

 % for facet in c['config'].display_facet_order:
+    <div class="facet">
     % if c['results'].has_values(facet):
-        <a href="" id="fh_${facet}"><strong>${c['config'].get_facet_display(facet)}</strong></a><br/>
-        <div id="selected_${facet}">
+        <div class="facet_heading">
+            <a href="" id="fh_${facet}">+&nbsp;${c['config'].get_facet_display(facet)}</a>
+        </div>
+        <div id="selected_${facet}" class="facet_value">
         
         % if facet in c['config'].facet_ranges.keys():
         
                 % 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/>
+                    </em>&nbsp;<a class="delete_url" 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/>
+                    </em>&nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet)}">x</a><br/>
                 % endif
             % endif
             
                     % 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/>
+                    % endif
+                    (${c['results'].numFound()})
+                    </em>
+                    &nbsp;<a class="delete_url" 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/>
+                    </em>&nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet)}">x</a><br/>
                 % endif
             % endif 
     
                 % if c['results'].in_args(facet, value):
                     <em>
                     ${c['config'].get_value_display(facet, value)} (${count})
-                    </em>&nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet, value)}">x</a>
+                    </em>&nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet, value)}">x</a>
                     <br/>
                 % endif
             % endfor
         % endif
         </div>
         
-        
-    % if c['results'].has_values(facet):
-        <div id="fr_${facet}" style="display:none">
+        <div id="fr_${facet}" style="display:none" class="facet_value">
         % if facet in c['config'].facet_ranges.keys():
             % if not c['results'].in_args(facet):
                 % for lower, upper, count in c['results'].get_ordered_facets(facet):
                 % endif
             % endfor
         % endif
-        </div><br/>
-        
+        </div>
+            
+    % else:
+        <div class="empty_facet">
+            <strong>${c['config'].get_facet_display(facet)}</strong>
+        </div>
     % endif
-    % endif
+    </div>
 % endfor

templates/facet-selected.mako

     % if c['results'].in_args(facet, value):
         <em>
         ${c['config'].get_value_display(facet, value)} (${count})
-        </em>&nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet, value)}">x</a>
+        </em>&nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet, value)}">x</a>
         <br/>
     % endif
 % endfor

templates/noresults.mako

+<div class="no_results">
 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.
+records in the index.
+</div>

templates/range-selected.mako

         ${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>
+    &nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet)}">x</a>
 % 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>
+    &nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet)}">x</a>
 % endif
 <br/>

templates/search-summary.mako

             % else:
                 <em>${c['results'].get_selected_range_start(facet)}+
             % endif
-            &nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet)}">x</a>
+            &nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet)}">x</a>
         </div>
             
     % elif facet in c['config'].facet_dates.keys():
             % else:
                 ${c['config'].get_value_display(facet, str(c['results'].get_selected_range_start(facet)))}+
             % endif
-            &nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet)}">x</a>
+            &nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet)}">x</a>
         </div>
 
     % else:
             <div class="search_constraint">
                 ${c['config'].get_facet_display(facet)} : 
                 ${c['config'].get_value_display(facet, value)}
-                &nbsp;&nbsp;<a href="${c['url_manager'].get_delete_url(facet, value)}">x</a>
+                &nbsp;<a class="delete_url" href="${c['url_manager'].get_delete_url(facet, value)}">x</a>
             </div>
         % endfor
     % endif

templates/sort-options.mako

         <div class="current_sort_option">
         ${c['config'].sort_fields[sortby].get("display", sortby)}
         % if direction == 'asc':
-            (^ <a href="${c['url_manager'].get_sort_url(sortby, 'desc')}">v</a>)
+            (<strong>^</strong> <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)
+            (<a href="${c['url_manager'].get_sort_url(sortby, 'asc')}">^</a> <strong>v</strong>)
         % endif
-        <a href="${c['url_manager'].get_unsort_url(sortby)}">x</a>
+        <a class="delete_url" href="${c['url_manager'].get_unsort_url(sortby)}">x</a>
         </div>
         <div class="sort_label">
             then

templates/table-view.mako

     return
 %>
 
-<table border="1" cellspacing="0">
+<table class="data_table" cellspacing="0">
     <tr>
 % for field in c['config'].display_field_order:
         <th>
         </th>
 % endfor
     </tr>
-% for result in c['results'].set():
-    <tr>
-%   for field in c['config'].display_field_order:
+% for i in range(len(c['results'].set())):
+    <tr class="${'odd' if i % 2 == 0 else 'even'}">
+    % for field in c['config'].display_field_order:
         <td>
-            ${c['results'].get_str(result, field)}
+            ${c['results'].get_str(c['results'].set()[i], field)}
         </td>
-%   endfor
+    % endfor
     </tr>
 % endfor
+
 </table>