Skip to content

Commit

Permalink
Merge pull request #496 from ethan-nelson/dev4
Browse files Browse the repository at this point in the history
Changing activity wordings; re: #140
  • Loading branch information
Pierre GIRAUD committed Dec 20, 2014
2 parents 00ed11d + a99953a commit 6fbdc44
Showing 1 changed file with 46 additions and 24 deletions.
70 changes: 46 additions & 24 deletions osmtm/templates/task.history.mako
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,59 @@ from osmtm.mako_filters import (
last = "last" if index == len(history) - 1 else ""
unknown = '<span class="text-danger">Unknown</span>'
task_link = '<a href="#task/' + str(step.task_id) + '">#' + str(step.task_id) + '</a>'
contributor = None
if hasattr(step, 'user') and step.user is not None:
contributor = step.user.username
elif hasattr(step, 'author') and step.author is not None:
contributor = step.author.username
if contributor is not None:
user_link = '<a href="/user/' + contributor + '">' + contributor + '</a>'
else:
user_link = 'unknown'
%>

<div class="history ${first} ${last}">
% if section == 'project':
<a href="#task/${step.task_id}">#${step.task_id}</a>
% endif
% if isinstance(step, TaskState):
% if step.state == step.state_done:
<span><i class="glyphicon glyphicon-ok text-success"></i> <b>${_('Marked as done')}</b> ${_('by')} ${step.user.username if step.user is not None else unknown | n}</span>
% elif step.state == step.state_invalidated:
<span><i class="glyphicon glyphicon-thumbs-down text-danger"></i> <b>${_('Invalidated')}</b> ${_('by')} ${step.user.username if step.user is not None else unknown | n}</span>
% elif step.state == step.state_validated:
<span><i class="glyphicon glyphicon-thumbs-up text-success"></i> <b>${_('Validated')}</b> ${_('by')} ${step.user.username if step.user is not None else unknown | n}</span>
% if isinstance(step, TaskState):
% if step.state == step.state_done:
<span><i class="glyphicon glyphicon-ok text-success"></i>
${_('${user} marked ${tasklink} as <b>done</b>', mapping={'user':user_link, 'tasklink':task_link}) | n}</span>
% elif step.state == step.state_invalidated:
<span><i class="glyphicon glyphicon-thumbs-down text-danger"></i>
${_('${user} <b>invalidated</b> ${tasklink}', mapping={'user':user_link, 'tasklink':task_link}) | n}</span>
% elif step.state == step.state_validated:
<span><i class="glyphicon glyphicon-thumbs-up text-success"></i>
${_('${user} <b>validated</b> ${tasklink}', mapping={'user':user_link, 'tasklink':task_link}) | n}</span>
% endif
% endif
% endif
% if isinstance(step, TaskLock):
% if step.lock:
<span><i class="glyphicon glyphicon-lock text-muted"></i> ${_('Locked')} ${_('by')} ${step.user.username}</span>
% else:
<span>${_('Unlocked')}</span>
% else:
% if isinstance(step, TaskState):
% if step.state == step.state_done:
<span><i class="glyphicon glyphicon-ok text-success"></i> <b>${_('Marked as done')}</b> ${_('by')} ${user_link | n}</span>
% elif step.state == step.state_invalidated:
<span><i class="glyphicon glyphicon-thumbs-down text-danger"></i> <b>${_('Invalidated')}</b> ${_('by')} ${user_link | n}</span>
% elif step.state == step.state_validated:
<span><i class="glyphicon glyphicon-thumbs-up text-success"></i> <b>${_('Validated')}</b> ${_('by')} ${user_link | n}</span>
% endif
% elif isinstance(step, TaskLock):
% if step.lock:
<span><i class="glyphicon glyphicon-lock text-muted"></i> ${_('Locked')} ${_('by')} ${user_link | n}</span>
% else:
<span>${_('Unlocked')}</span>
% endif
% elif isinstance(step, TaskComment):
<span><i class="glyphicon glyphicon-comment text-muted"></i> ${_('Comment left')} ${_('by')} ${user_link | n}</span>
<blockquote>
${step.comment | convert_mentions(request), markdown_filter, n}
</blockquote>
% endif
% endif
% if isinstance(step, TaskComment):
<span><i class="glyphicon glyphicon-comment text-muted"></i> ${_('Comment left')} ${_('by')} ${step.author.username if step.author is not None else unknown | n}</span>
<blockquote>
${step.comment | convert_mentions(request), markdown_filter, n}
</blockquote>
% endif
<p class="text-muted">
<em title="${step.date}Z" class="timeago"></em>
</p>

<p class="text-muted">
<em title="${step.date}Z" class="timeago"></em>
</p>
</div>
% endfor

Expand Down

0 comments on commit 6fbdc44

Please sign in to comment.