mirror of
https://github.com/YunoHost/tartiflette.git
synced 2024-09-03 20:06:08 +02:00
Add page for unlisted apps
This commit is contained in:
parent
01cf55c602
commit
f248bc81cb
4 changed files with 42 additions and 10 deletions
|
@ -1,6 +1,7 @@
|
|||
from flask import render_template, make_response, Blueprint
|
||||
from .models.pr import PullRequest
|
||||
from .models.appci import App, AppCI, AppCIBranch
|
||||
from .models.unlistedapps import UnlistedApp
|
||||
from .settings import SITE_ROOT
|
||||
import json
|
||||
|
||||
|
@ -143,3 +144,10 @@ def appsobservatory_rss():
|
|||
response.headers['Content-Type'] = 'application/rss+xml'
|
||||
return response
|
||||
|
||||
@main.route('/appsobservatory/unlisted')
|
||||
def appsobservatory_unlisted():
|
||||
|
||||
apps = sorted(UnlistedApp.query.all(), key=lambda a: a.updated_days_ago)
|
||||
|
||||
return render_template("unlistedapps.html", apps=apps)
|
||||
|
||||
|
|
|
@ -63,16 +63,6 @@ class UnlistedApp(db.Model):
|
|||
|
||||
db.session.commit()
|
||||
|
||||
#apps = sorted(apps, key=lambda x: x["updated_days_ago"])
|
||||
|
||||
#for app in apps:
|
||||
# if app["updated_days_ago"] > 100:
|
||||
# continue
|
||||
# print(app["name"] + " ... " + app["url"] + " ... " + str(app["updated_days_ago"]))
|
||||
|
||||
#with open('apps.json', 'w') as f:
|
||||
# json.dump(apps, f)
|
||||
|
||||
|
||||
def githubDateToDaysAgo(date):
|
||||
now = datetime.datetime.now()
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="{{ url_for('main.appsobservatory_history')}}">History graphs</a>
|
||||
<a class="dropdown-item" href="{{ url_for('main.appsobservatory_rss')}}">RSS</a>
|
||||
<a class="dropdown-item" href="{{ url_for('main.appsobservatory_unlisted')}}">Unlisted apps</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
33
app/templates/unlistedapps.html
Normal file
33
app/templates/unlistedapps.html
Normal file
|
@ -0,0 +1,33 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<h3 class="text-center font-weight-bold my-5">Unlisted apps</h3>
|
||||
<div class="row">
|
||||
<div class="mx-auto">
|
||||
<table id="pullrequests" class="table table-responsive table-sm table-pullrequests">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Description</th>
|
||||
<th>Updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for app in apps %}
|
||||
<tr>
|
||||
<td class="col-md-2 text-center">
|
||||
<a class="btn btn-sm mx-4 py-2 px-3 btn-light text-uppercase
|
||||
font-weight-bold"
|
||||
href="{{ app.url }}">{{ app.owner}}/{{ app.name }}</a>
|
||||
</td>
|
||||
<td class="column-pr-title font-weight-bold">{{ app.description
|
||||
or "" }}</td>
|
||||
<td class="col-md-1 daysAgo" style="font-size: 12px;"
|
||||
>{{app.updated_days_ago}} days ago</td>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in a new issue