mirror of
https://github.com/YunoHost/tartiflette.git
synced 2024-09-03 20:06:08 +02:00
Also add official filter on branch page
This commit is contained in:
parent
559f4c1010
commit
4b8eb8291b
1 changed files with 18 additions and 1 deletions
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="mx-auto">
|
<div class="mx-auto">
|
||||||
|
<div style="text-align:center;">
|
||||||
|
<button id="filter_onlyOfficials" type="button" class="btn btn-default btn-lg" href="javascript:void(0)" onclick="toggle(this)">Show only officials</button>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<table class="table table-responsive ci-app-table">
|
<table class="table table-responsive ci-app-table">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -21,7 +24,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for result in app_results %}
|
{% for result in app_results %}
|
||||||
<tr app="{{ result.app.name }}">
|
<tr app="{{ result.app.name }}" class="resultline {% if result.app.list.name == "official" %}official{% endif %}">
|
||||||
<td class="ci-app-row-title">
|
<td class="ci-app-row-title">
|
||||||
{% if result.app.list.name == "official" %}
|
{% if result.app.list.name == "official" %}
|
||||||
<span class="official-star oi oi-star" title="Official" aria-hidden="true"></span>
|
<span class="official-star oi oi-star" title="Official" aria-hidden="true"></span>
|
||||||
|
@ -106,7 +109,21 @@ window.onload = function () {
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
chart.render();
|
chart.render();
|
||||||
|
update_filters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggle(e) {
|
||||||
|
$(e).toggleClass("btn-default");
|
||||||
|
$(e).toggleClass("btn-primary");
|
||||||
|
update_filters();
|
||||||
|
}
|
||||||
|
function update_filters() {
|
||||||
|
var onlyOfficials = $("#filter_onlyOfficials").hasClass("btn-primary");
|
||||||
|
$(".resultline").show();
|
||||||
|
if (onlyOfficials) { $(".resultline:not(.official)").hide(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue