Skip to content

Commit be0e3a6

Browse files
committed
task view improvements: show project neighborhood, remove ming I prefixes on args/kwargs
1 parent 3a28d8f commit be0e3a6

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Allura/allura/controllers/site_admin.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
from urllib.parse import urlparse
5252
import six
5353

54+
from ming.odm.icollection import deinstrument
5455

5556
log = logging.getLogger(__name__)
5657

@@ -576,7 +577,12 @@ def view(self, task_id):
576577
task.app_config = M.AppConfig.query.get(
577578
_id=task.context.app_config_id)
578579
task.user = M.User.query.get(_id=task.context.user_id)
579-
return dict(task=task)
580+
task_args = [deinstrument(a) for a in task.args]
581+
task_kwargs = {k: deinstrument(v) for k,v in task.kwargs.items()}
582+
else:
583+
task_args = []
584+
task_kwargs = {}
585+
return dict(task=task, task_args=task_args, task_kwargs=task_kwargs)
580586

581587
@expose('jinja:allura:templates/site_admin_task_new.html')
582588
@without_trailing_slash

Allura/allura/templates/site_admin_task_view.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ <h2>Task Details</h2>
121121
</tr>
122122
<tr>
123123
<th class="side-header">Project</th>
124-
<td>{{ task.project.shortname if task.project }}</td>
124+
<td>{{ task.project.url() if task.project }}</td>
125125
<td class="spacer"></td>
126126
<th class="second-column-headers side-header">Queued</th>
127127
<td>{{ task.time_queue.strftime('%Y/%m/%d %H:%M:%S') if task.time_queue }}</td>
@@ -147,16 +147,16 @@ <h2>Task Details</h2>
147147
<td class="second-column-headers"></td>
148148
<th>Keyword Args</th>
149149
</tr>
150-
{% if task.args|length > task.kwargs|length %}
151-
{% set indexes = range(task.args|length) %}
150+
{% if task_args|length > task_kwargs|length %}
151+
{% set indexes = range(task_args|length) %}
152152
{% else %}
153-
{% set indexes = range(task.kwargs|length) %}
153+
{% set indexes = range(task_kwargs|length) %}
154154
{% endif %}
155-
{% set kwargs = task.kwargs.items()|list %}
155+
{% set kwargs = task_kwargs.items()|list %}
156156
{% for i in indexes %}
157157
<tr>
158158
<td class="first-column-headers"></td>
159-
<td>{{ task.args[i] }}</td>
159+
<td>{{ task_args[i] }}</td>
160160
<td class="spacer"></td>
161161
{% if kwargs[i] %}
162162
<th class="second-column-headers side-header">{{ kwargs[i][0] }}</th>

0 commit comments

Comments
 (0)