Merge pull request #417 from khornberg/feature/list

Search repos by name
This commit is contained in:
Klaus Silveira
2014-03-28 21:55:52 -03:00
5 changed files with 51 additions and 20 deletions

View File

@@ -1,15 +1,21 @@
<div class="btn-group pull-left space-right">
<div class="btn-group pull-left space-right" id="branchList">
<button class="btn dropdown-toggle" data-toggle="dropdown">browsing: <strong>{{ branch }}</strong> <span class="caret"></span></button>
<ul class="dropdown-menu">
<div class="dropdown-menu">
<div class="search">
<input class="search" placeholder="Filter branch/tags" autofocus>
</div>
<ul class="unstyled list">
<li class="dropdown-header">Branches</li>
{% for item in branches %}
<li><a href="{{ path('branch', {repo: repo, branch: item}) }}">{{ item }}</a></li>
<li><a href="{{ path('branch', {repo: repo, branch: item}) }}"><span class="item">{{ item }}</span></a></li>
{% endfor %}
{% if tags %}
<li class="dropdown-header">Tags</li>
{% for item in tags %}
<li><a href="{{ path('branch', {repo: repo, branch: item}) }}">{{ item }}</a></li>
<li><a href="{{ path('branch', {repo: repo, branch: item}) }}"><span class="item">{{ item }}</span></a></li>
{% endfor %}
{% endif %}
</ul>
</div>
</div>

View File

@@ -4,23 +4,28 @@
{% block body %}
{% include 'navigation.twig' %}
<div class="container">
{% for repository in repositories %}
<div class="repository">
<div class="repository-header">
<i class="icon-folder-open icon-spaced"></i> <a href="{{ path('repository', {repo: repository.name}) }}">{{ repository.name }}</a>
<a href="{{ path('rss', {repo: repository.name, branch: 'master'}) }}"><i class="rss pull-right"></i></a>
</div>
<div class="repository-body">
{% if repository.description %}
<p>{{ repository.description }}</p>
{% else %}
<p>There is no repository description file. Please, create one to remove this message.</p>
{% endif %}
</div>
<div class="container" id="repositories">
<div class="search">
<input class="search" placeholder="search" autofocus>
</div>
<div class="list">
{% for repository in repositories %}
<div class="repository">
<div class="repository-header">
<i class="icon-folder-open icon-spaced"></i> <a href="{{ path('repository', {repo: repository.name}) }}"><span class="name">{{ repository.name }}</span></a>
<a href="{{ path('rss', {repo: repository.name, branch: 'master'}) }}"><i class="rss pull-right"></i></a>
</div>
<div class="repository-body">
{% if repository.description %}
<p>{{ repository.description }}</p>
{% else %}
<p>There is no repository description file. Please, create one to remove this message.</p>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endfor %}
<hr />

View File

@@ -18,6 +18,7 @@
<script src="{{ app.request.basepath }}/web/js/codemirror.js"></script>
<script src="{{ app.request.basepath }}/web/js/showdown.js"></script>
<script src="{{ app.request.basepath }}/web/js/table.js"></script>
<script src="{{ app.request.basepath }}/web/js/list.min.js"></script>
<script src="{{ app.request.basepath }}/web/js/main.js"></script>
<script src="{{ app.request.basepath }}/web/js/networkGraph.js"></script>
</body>

1
web/js/list.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -41,3 +41,21 @@ $(function () {
}
paginate();
});
if ($('#repositories').length) {
var listOptions = {
valueNames: ['name']
};
var repoList = new List('repositories', listOptions);
}
if ($('#branchList').length) {
var listBranchOptions = {
valueNames: ['item']
};
var repoList = new List('branchList', listBranchOptions);
}
$('.search').click(function (e) {
e.stopPropagation();
});