diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2012-05-01 20:40:24 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2012-05-01 20:40:24 +0200 |
| commit | 1a8bb56c72ad34cf159e03b97a467e5e35a614c5 (patch) | |
| tree | 9a2d3f9a369aed9c967cf8001a883a2a60f3a002 /data | |
| parent | c78bab0c18fb9db18408f1601280997ee8b0779f (diff) | |
| download | phorkie-1a8bb56c72ad34cf159e03b97a467e5e35a614c5.tar.gz phorkie-1a8bb56c72ad34cf159e03b97a467e5e35a614c5.zip | |
searching works now (pager missing)
Diffstat (limited to 'data')
| -rw-r--r-- | data/config.default.php | 17 | ||||
| -rw-r--r-- | data/config.php.dist | 1 | ||||
| -rw-r--r-- | data/templates/base.htm | 4 | ||||
| -rw-r--r-- | data/templates/list.htm | 7 | ||||
| -rw-r--r-- | data/templates/repo-list.htm | 6 | ||||
| -rw-r--r-- | data/templates/search.htm | 20 |
6 files changed, 38 insertions, 17 deletions
diff --git a/data/config.default.php b/data/config.default.php index 4ef5d05..c1446cc 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -1,13 +1,14 @@ <?php $GLOBALS['phorkie']['cfg'] = array( - 'debug' => false, - 'gitdir' => __DIR__ . '/../repos/git/', - 'workdir' => __DIR__ . '/../repos/work/', - 'tpl' => __DIR__ . '/templates/', - 'css' => 'http://twitter.github.com/bootstrap/assets/css/bootstrap.css', - 'title' => 'phorkie', - 'topbar' => '', - 'setupcheck' => true, + 'debug' => false, + 'gitdir' => __DIR__ . '/../repos/git/', + 'workdir' => __DIR__ . '/../repos/work/', + 'tpl' => __DIR__ . '/templates/', + 'css' => 'http://twitter.github.com/bootstrap/assets/css/bootstrap.css', + 'title' => 'phorkie', + 'topbar' => '', + 'setupcheck' => true, + 'elasticsearch' => null, ); $GLOBALS['phorkie']['tools'] = array( '\\phorkie\\Tool_Xmllint' => true, diff --git a/data/config.php.dist b/data/config.php.dist index 04b42a6..c9b891e 100644 --- a/data/config.php.dist +++ b/data/config.php.dist @@ -3,5 +3,6 @@ //$GLOBALS['phorkie']['cfg']['workdir'] = '/var/cache/git/paste/work/'; //$GLOBALS['phorkie']['cfg']['git']['public'] = 'git://bogo/git/paste/'; //$GLOBALS['phorkie']['cfg']['git']['private'] = 'ssh://git@bogo:paste/'; +//$GLOBALS['phorkie']['cfg']['elasticsearch'] = 'http://localhost:9020/phorkie/'; //$GLOBALS['phorkie']['cfg']['setupcheck'] = false; ?> diff --git a/data/templates/base.htm b/data/templates/base.htm index 867481c..906453e 100644 --- a/data/templates/base.htm +++ b/data/templates/base.htm @@ -23,13 +23,11 @@ <li> <a href="/list">List all</a> </li> - <!-- <li> <form class="navbar-search pull-left" action="/search" method="get"> - <input type="text" class="search-query" name="q" placeholder="Search"/> + <input type="text" class="search-query" name="q" placeholder="Search" value="{{query}}"/> </form> </li> - --> </ul> </div> </div> diff --git a/data/templates/list.htm b/data/templates/list.htm index 4e2e4a6..b92e588 100644 --- a/data/templates/list.htm +++ b/data/templates/list.htm @@ -4,12 +4,7 @@ {% block content %} <ul class="nav nav-pills nav-stacked"> {% for repo in repos %} - <li> - <a href="{{repo.getLink('display')}}"> - {{repo.id}} - {{repo.getDescription}} - </a> - </li> + {% include 'repo-list.htm' %} {% endfor %} </ul> diff --git a/data/templates/repo-list.htm b/data/templates/repo-list.htm new file mode 100644 index 0000000..80c8f6c --- /dev/null +++ b/data/templates/repo-list.htm @@ -0,0 +1,6 @@ + <li> + <a href="{{repo.getLink('display')}}"> + {{repo.id}} + {{repo.getDescription}} + </a> + </li> diff --git a/data/templates/search.htm b/data/templates/search.htm new file mode 100644 index 0000000..cb03cec --- /dev/null +++ b/data/templates/search.htm @@ -0,0 +1,20 @@ +{% extends "base.htm" %} +{% block title %}Search results{% endblock %} + +{% block content %} +{% if sres.results == 0 %} + <p> + Sorry, no results for "<tt>{{query}}</tt>". + </p> +{% else %} + <p> + Found {{sres.results}} search results for "<tt>{{query}}</tt>": + </p> + <ul class="nav nav-pills nav-stacked"> + {% for repo in sres.repos %} + {% include 'repo-list.htm' %} + {% endfor %} + </ul> +{% endif %} + +{% endblock %} |
