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)
|
||||
|
||||
@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()
|
||||
apps = App.query.all()
|
||||
|
@ -175,5 +179,5 @@ def app_maintainer_dash():
|
|||
maintainers = sorted(maintainers, key=lambda m: m.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="mx-auto">
|
||||
Active maintainers :
|
||||
<select id="maintainer-select">
|
||||
<option value="all">All</option>
|
||||
<option value="nobody">Nobody / Unmaintained</option>
|
||||
|
@ -151,6 +152,7 @@
|
|||
window.onload = function () {
|
||||
$('#maintainer-select').on('change', function() {
|
||||
var maintainer = this.value;
|
||||
window.history.pushState("?", "YunoHost dashboard", "{{ url_for('main.app_maintainer_dash') }}/"+maintainer);
|
||||
if (maintainer == "all")
|
||||
{
|
||||
$(".appline").show();
|
||||
|
@ -181,7 +183,11 @@ $('#maintainer-select').on('change', function() {
|
|||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
{% if maintainer %}
|
||||
$('#maintainer-select').val('{{ maintainer }}');
|
||||
$('#maintainer-select').change();
|
||||
{% endif %}
|
||||
};
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue