Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtrovací políčko na homepage #17

Merged
merged 1 commit into from Mar 9, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 25 additions & 1 deletion app/templates/Homepage/default.latte
Expand Up @@ -12,7 +12,31 @@
<h1>Generated documentations <small>Projects already having API docs generated by ApiGen</small></h1>
</div>

<table n:if="$repos" class="table table-striped table-bordered">
{if $repos}
<script>
function filterRepos(text) {
$("#repos tbody tr").each(function () {
var tr = $(this);

if (text === '') {
tr.show();
return;
}

if (tr.find('td:eq(0), td:eq(1)').text().toLowerCase().indexOf(text.toLowerCase()) !== -1) {
tr.show();
} else {
tr.hide();
}
});
}
</script>
<form>
<p>Filter: <input type="text" id="filter" onkeyup="filterRepos(this.value)"></p>
</form>
{/if}

<table n:if="$repos" class="table table-striped table-bordered" id="repos">
<thead><tr>
{* <th>#</th> *}
<th>Project name</th>
Expand Down