Changeset 134 for server/trunk/web/root


Ignore:
Timestamp:
12/18/10 17:28:09 (13 years ago)
Author:
nanardon
Message:
  • add search by file
Location:
server/trunk/web/root/templates/html/search
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • server/trunk/web/root/templates/html/search/adv_search.tt

    r129 r134  
    11<!-- $Id$ --> 
     2<table border="1"> 
     3<tr> 
     4    <td></td> 
     5    <td> 
     6<input type="text" name="search" value="[% c.req.param('search') | html %]"> 
     7    </td> 
     8</tr> 
     9<tr> 
     10    <td> 
     11    </td> 
     12    <td> 
    213<select name="type" OnChange=" 
    314    if (value == 'bydep') { 
    4         document.getElementById('deptype').style.display = ''; 
     15        document.getElementById('deptype').style.visibility = ''; 
    516    } else { 
    6         document.getElementById('deptype').style.display = 'none'; 
     17        document.getElementById('deptype').style.visibility = 'hidden'; 
    718    } 
    819"> 
    920<option value="byname"[% " selected=selected" IF c.req.param('type') == 'byname' %]>rpm named</option> 
    10 <option value="bydep"[% " selected=selected" IF c.req.param('type') == 'bydep' 
    11 %]>dependency match</option> 
     21<option value="bydep"[% " selected=selected" IF c.req.param('type') == 'bydep' %]>dependency match</option> 
     22<option value="byfile"[% " selected=selected" IF c.req.param('type') == 'byfile' %]>File</option> 
    1223</select> 
    13 <input type="text" name="search" value="[% c.req.param('search') | html %]"> 
    14 <span id="deptype" style="[% 'display:none;' IF c.req.param('type') != 'bydep' %]"> 
    15 Dep type: 
     24    </td> 
     25</tr> 
     26<tr> 
     27<td> 
     28</td> 
     29<td> 
     30<span id="deptype" style="[% 'visibility:hidden;' IF c.req.param('type') != 'bydep' %]"> 
    1631<select id="deptype" name="deptype"> 
    17     <option value="P">Provides</option> 
    18     <option value="R">Requires</option> 
     32    <option value="P"[% " selected=selected" IF c.req.param('deptype') == 'P' %]>Provides</option> 
     33    <option value="R"[% " selected=selected" IF c.req.param('deptype') == 'R' %]>Requires</option> 
    1934</select> 
    2035</span> 
     36</td> 
     37</tr> 
     38<tr> 
     39<td></td> 
     40<td> 
    2141<input type="submit"> 
     42</td> 
     43</tr> 
     44</table> 
  • server/trunk/web/root/templates/html/search/results.tt

    r94 r134  
    3030[% info.summary | guessencode | html %] 
    3131</p> 
     32 
     33[%# Depending the search, we have to perform a quick search per package to show 
     34result detail %] 
     35[% IF c.req.param('type') == 'bydep' %] 
     36[% sargs.0.pkgid = pkgid %] 
     37<ul> 
     38[% FOREACH dep = c.forward('/search/dep_search', sargs).results %] 
     39<li>[% dep.name | html %] [% dep.sense | html %] [% dep.evr | html %]</li> 
     40[% END %] 
     41</ul> 
     42[% END %] 
     43 
     44[% IF c.req.param('type') == 'byfile' %] 
     45[% sargs.0.pkgid = pkgid %] 
     46<ul class="filename"> 
     47[% FOREACH file = c.forward('/search/file_search', sargs).results %] 
     48<li>[% file.dirname | html -%][%- file.basename | html %]</li> 
     49[% END %] 
     50</ul> 
     51[% END %] 
     52 
    3253</div> 
    3354[% END %] 
Note: See TracChangeset for help on using the changeset viewer.