Skip to content

Commit

Permalink
Merge branch 'repo'
Browse files Browse the repository at this point in the history
Original pull request: #118
  • Loading branch information
barosl committed Jan 18, 2016
2 parents ca47805 + d3701e8 commit 2104e4b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions homu/html/queue.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ <h1>Homu queue - {{repo_label}}</h1>
<tr>
<th class="hide">Sort key</th>
<th><input type="checkbox"></th>
{% if multiple %}
<th>Repository</th>
{% endif %}
<th>#</th>
<th>Status</th>
<th>Priority</th>
Expand All @@ -67,6 +70,9 @@ <h1>Homu queue - {{repo_label}}</h1>
<tr>
<td class="hide">{{loop.index}}</td>
<td><input type="checkbox" data-num="{{state.num}}"></td>
{% if multiple %}
<td><a href="{{state.repo_url}}">{{state.repo_label}}</a></td>
{% endif %}
<td><a href="{{state.url}}">{{state.num}}</a></td>
<td class="{{state.status}}">{{state.status}}{{state.status_ext}}</td>
<td>{{state.priority}}</td>
Expand Down
5 changes: 5 additions & 0 deletions homu/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ def queue(repo_label):

if repo_label == 'all':
labels = g.repos.keys()
multiple = True
else:
labels = repo_label.split('+')
multiple = len(labels) > 1

states = []
for label in labels:
Expand All @@ -74,6 +76,8 @@ def queue(repo_label):
'head_ref': state.head_ref,
'mergeable': 'yes' if state.mergeable is True else 'no' if state.mergeable is False else '',
'assignee': state.assignee,
'repo_label': state.repo_label,
'repo_url': 'https://github.com/{}/{}'.format(state.owner, state.name),
})

return g.tpls['queue'].render(
Expand All @@ -84,6 +88,7 @@ def queue(repo_label):
approved = len([x for x in pull_states if x.approved_by]),
rolled_up = len([x for x in pull_states if x.rollup]),
failed = len([x for x in pull_states if x.status == 'failure' or x.status == 'error']),
multiple = multiple,
)

@get('/callback')
Expand Down

0 comments on commit 2104e4b

Please sign in to comment.