mirror of
https://github.com/YunoHost/tartiflette.git
synced 2024-09-03 20:06:08 +02:00
Fix a few things
This commit is contained in:
parent
ae195c15a1
commit
6cde7abf67
3 changed files with 35 additions and 8 deletions
|
@ -112,7 +112,12 @@ class App(db.Model):
|
|||
.first()
|
||||
if most_recent_test:
|
||||
yield most_recent_test
|
||||
|
||||
else:
|
||||
yield AppCIResult(app = self,
|
||||
branch = branch,
|
||||
level = None,
|
||||
date = datetime.datetime.fromtimestamp(0),
|
||||
results = [ None for t in AppCI.tests ])
|
||||
|
||||
class AppCIBranch(db.Model):
|
||||
|
||||
|
@ -156,6 +161,12 @@ class AppCIBranch(db.Model):
|
|||
.first()
|
||||
if most_recent_test:
|
||||
yield most_recent_test
|
||||
else:
|
||||
yield AppCIResult(app = app,
|
||||
branch = self,
|
||||
level = None,
|
||||
date = datetime.datetime.fromtimestamp(0),
|
||||
results = [ None for t in AppCI.tests ])
|
||||
|
||||
|
||||
class AppCIResult(db.Model):
|
||||
|
@ -183,7 +194,7 @@ class AppCIResult(db.Model):
|
|||
|
||||
def score(self):
|
||||
s_dict = { True: +1, False: -1, None: 0 }
|
||||
return sum([ s_dict[result] for result in self.results.values() ])
|
||||
return sum([ s_dict[result] for result in self.results ])
|
||||
|
||||
|
||||
class AppCI():
|
||||
|
|
|
@ -40,11 +40,19 @@
|
|||
</td>
|
||||
{% endfor %}
|
||||
<td class="ci-app-test-info">
|
||||
{% if result.url == None %}
|
||||
{% if result.date == None %}
|
||||
<span class="daysAgo">???</span>
|
||||
{% else %}
|
||||
<span class="daysAgo" timestamp="{{ result.date.timestamp() }}"></span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if result.date == None %}
|
||||
<span class="daysAgo" href="{{ result.url.replace("consoleText", "consoleFull") }}">???</span>
|
||||
{% else %}
|
||||
<span class="daysAgo" timestamp="{{ result.date.timestamp() }}" href="{{ result.url.replace("consoleText", "consoleFull") }}"></span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if result.commit != result.app.master_commit %}
|
||||
<span class="oi oi-clock text-warning"
|
||||
aria-hidden="true"
|
||||
|
|
|
@ -76,11 +76,19 @@
|
|||
</td>
|
||||
{% endfor %}
|
||||
<td class="ci-app-test-info px-0">
|
||||
{% if result.url == None %}
|
||||
{% if result.date == None %}
|
||||
<span class="daysAgo">???</span>
|
||||
{% else %}
|
||||
<span class="daysAgo" timestamp="{{ result.date.timestamp() }}"></span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if result.date == None %}
|
||||
<span class="daysAgo" href="{{ result.url.replace("consoleText", "consoleFull") }}">???</span>
|
||||
{% else %}
|
||||
<span class="daysAgo" timestamp="{{ result.date.timestamp() }}" href="{{ result.url.replace("consoleText", "consoleFull") }}"></span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if result.commit != result.app.master_commit %}
|
||||
<span class="oi oi-clock text-warning"
|
||||
aria-hidden="true"
|
||||
|
|
Loading…
Reference in a new issue