Mercurial > kallithea
diff rhodecode/templates/search/search.html @ 556:65b2f150beb7
Added searching for file names within the repository in rhodecode
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 07 Oct 2010 17:32:24 +0200 |
parents | b75b77ef649d |
children | ff15232ce9d2 |
line wrap: on
line diff
--- a/rhodecode/templates/search/search.html Wed Oct 06 18:26:59 2010 +0200 +++ b/rhodecode/templates/search/search.html Thu Oct 07 17:32:24 2010 +0200 @@ -36,52 +36,43 @@ %endif <div class="form"> <div class="fields"> - - <div class="field "> - <div class="label"> - <label for="q">${_('Search')}:</label> + <div class="field field-first field-noborder"> + <div class="label"> + <label for="q">${_('Search term')}</label> + </div> + <div class="input">${h.text('q',c.cur_query,class_="small")}</div> + <div class="button highlight"> + <input type="submit" value="${_('Search')}" class="ui-button ui-widget ui-state-default ui-corner-all"/> </div> - <div class="input"> - ${h.text('q',c.cur_query,class_="small")} - <div class="button highlight"> - <input type="submit" value="${_('Search')}" class="ui-button ui-widget ui-state-default ui-corner-all"/> - </div> - <div style="font-weight: bold;clear:both;padding: 5px">${c.runtime}</div> - </div> + <div style="font-weight: bold;clear:Both;margin-left:200px">${c.runtime}</div> </div> + + <div class="field"> + <div class="label"> + <label for="type">${_('Search in')}</label> + </div> + <div class="select"> + ${h.select('type',c.cur_type,[('content',_('Source codes')), + ##('commit',_('Commit messages')), + ('path',_('File names')), + ##('repository',_('Repository names')), + ])} + </div> + </div> + </div> </div> ${h.end_form()} - %for cnt,sr in enumerate(c.formated_results): - %if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(sr['repository'],'search results check'): - <div class="table"> - <div id="body${cnt}" class="codeblock"> - <div class="code-header"> - <div class="revision">${h.link_to(h.literal('%s » %s' % (sr['repository'],sr['f_path'])), - h.url('files_home',repo_name=sr['repository'],revision='tip',f_path=sr['f_path']))}</div> - </div> - <div class="code-body"> - <pre>${h.literal(sr['content_short_hl'])}</pre> - </div> - </div> - </div> - %else: - %if cnt == 0: - <div class="table"> - <div id="body${cnt}" class="codeblock"> - <div class="error">${_('Permission denied')}</div> - </div> - </div> - %endif - - %endif - %endfor - %if c.cur_query: - <div class="pagination-wh pagination-left"> - ${c.formated_results.pager('$link_previous ~2~ $link_next')} - </div> - %endif + %if c.cur_search == 'content': + <%include file='search_content.html'/> + %elif c.cur_search == 'path': + <%include file='search_path.html'/> + %elif c.cur_search == 'commit': + <%include file='search_commit.html'/> + %elif c.cur_search == 'repository': + <%include file='search_repository.html'/> + %endif </div> </%def>