mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
fix usability mistakes on navigation menu and search input
This commit is contained in:
@@ -45,7 +45,7 @@ class CommitController implements ControllerProviderInterface
|
||||
->value('file', '')
|
||||
->bind('commits');
|
||||
|
||||
$route->post('{repo}/commits/search', function(Request $request, $repo) use ($app) {
|
||||
$route->post('{repo}/commits/{branch}/search', function(Request $request, $repo, $branch = '') use ($app) {
|
||||
$repository = $app['git']->getRepository($app['git.repos'] . $repo);
|
||||
$commits = $repository->searchCommitLog($request->get('query'));
|
||||
|
||||
@@ -57,13 +57,14 @@ class CommitController implements ControllerProviderInterface
|
||||
|
||||
return $app['twig']->render('searchcommits.twig', array(
|
||||
'repo' => $repo,
|
||||
'branch' => 'master',
|
||||
'branch' => $branch,
|
||||
'file' => '',
|
||||
'commits' => $categorized,
|
||||
'branches' => $repository->getBranches(),
|
||||
'tags' => $repository->getTags(),
|
||||
));
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('branch', '[\w-._\/]+')
|
||||
->bind('searchcommits');
|
||||
|
||||
$route->get('{repo}/commit/{commit}/', function($repo, $commit) use ($app) {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
{% if page == 'commits' %}
|
||||
<form class="form-search pull-right" action="{{ app.request.basepath }}/{{repo}}/commits/search" method="POST">
|
||||
{% if page in ['commits', 'searchcommits'] %}
|
||||
<form class="form-search pull-right" action="{{ app.request.basepath }}/{{repo}}/commits/{{branch}}/search" method="POST">
|
||||
<input type="text" name="query" class="input-medium search-query" placeholder="Search commits...">
|
||||
</form>
|
||||
{% else %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<ul class="nav nav-tabs">
|
||||
<li{% if page == 'files' %} class="active"{% endif %}><a href="{{ path('branch', {repo: repo, branch: branch}) }}">Files</a></li>
|
||||
<li{% if page == 'commits' %} class="active"{% endif %}><a href="{{ path('commits', {repo: repo, branch: branch}) }}">Commits</a></li>
|
||||
<li{% if page in ['commits', 'searchcommits'] %} class="active"{% endif %}><a href="{{ path('commits', {repo: repo, branch: branch}) }}">Commits</a></li>
|
||||
<li{% if page == 'stats' %} class="active"{% endif %}><a href="{{ path('stats', {repo: repo, branch: branch}) }}">Stats</a></li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user