mirror of
https://github.com/YunoHost/tartiflette.git
synced 2024-09-03 20:06:08 +02:00
Handle urls poiting directly to a specific maintainer
This commit is contained in:
parent
51604a9fe4
commit
63499d6f0e
2 changed files with 13 additions and 3 deletions
|
@ -156,7 +156,11 @@ def appsobservatory_unlisted():
|
||||||
return render_template("unlistedapps.html", apps=apps)
|
return render_template("unlistedapps.html", apps=apps)
|
||||||
|
|
||||||
@main.route('/app_maintainer_dash')
|
@main.route('/app_maintainer_dash')
|
||||||
def app_maintainer_dash():
|
@main.route('/app_maintainer_dash/<maintainer>')
|
||||||
|
def app_maintainer_dash(maintainer=None):
|
||||||
|
|
||||||
|
if maintainer:
|
||||||
|
maintainer = maintainer.lower().replace(" ", "")
|
||||||
|
|
||||||
maintainers = set()
|
maintainers = set()
|
||||||
apps = App.query.all()
|
apps = App.query.all()
|
||||||
|
@ -175,5 +179,5 @@ def app_maintainer_dash():
|
||||||
maintainers = sorted(maintainers, key=lambda m: m.lower())
|
maintainers = sorted(maintainers, key=lambda m: m.lower())
|
||||||
apps = sorted(apps, key=lambda app: app.name.lower())
|
apps = sorted(apps, key=lambda app: app.name.lower())
|
||||||
|
|
||||||
return render_template("maintainer.html", maintainers=maintainers, apps=apps)
|
return render_template("maintainer.html", maintainers=maintainers, apps=apps, maintainer=maintainer)
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="mx-auto">
|
<div class="mx-auto">
|
||||||
|
Active maintainers :
|
||||||
<select id="maintainer-select">
|
<select id="maintainer-select">
|
||||||
<option value="all">All</option>
|
<option value="all">All</option>
|
||||||
<option value="nobody">Nobody / Unmaintained</option>
|
<option value="nobody">Nobody / Unmaintained</option>
|
||||||
|
@ -151,6 +152,7 @@
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
$('#maintainer-select').on('change', function() {
|
$('#maintainer-select').on('change', function() {
|
||||||
var maintainer = this.value;
|
var maintainer = this.value;
|
||||||
|
window.history.pushState("?", "YunoHost dashboard", "{{ url_for('main.app_maintainer_dash') }}/"+maintainer);
|
||||||
if (maintainer == "all")
|
if (maintainer == "all")
|
||||||
{
|
{
|
||||||
$(".appline").show();
|
$(".appline").show();
|
||||||
|
@ -181,7 +183,11 @@ $('#maintainer-select').on('change', function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
{% if maintainer %}
|
||||||
|
$('#maintainer-select').val('{{ maintainer }}');
|
||||||
|
$('#maintainer-select').change();
|
||||||
|
{% endif %}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue