diff --git a/src/IDF/Middleware.php b/src/IDF/Middleware.php index 48eda3e..2028055 100644 --- a/src/IDF/Middleware.php +++ b/src/IDF/Middleware.php @@ -86,6 +86,7 @@ class IDF_Middleware 'timeline' => 'IDF_Template_TimelineFragment', 'markdown' => 'IDF_Template_Markdown', 'showuser' => 'IDF_Template_ShowUser', + 'ashowuser' => 'IDF_Template_AssignShowUser', )); $params['modifiers'] = array_merge($params['modifiers'], array( diff --git a/src/IDF/Template/AssignShowUser.php b/src/IDF/Template/AssignShowUser.php new file mode 100644 index 0000000..1b30cb3 --- /dev/null +++ b/src/IDF/Template/AssignShowUser.php @@ -0,0 +1,55 @@ +context); + $this->context->set($var, + Pluf_Template::markSafe($t->start($user, $request, $text, false))); + } +} diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index c0b0958..1ea0b14 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -53,17 +53,18 @@ class IDF_Views_Source return new Pluf_HTTP_Response_Redirect($url); } $changes = $scm->getChangeLog($commit, 25); + $rchanges = array(); // Sync with the database foreach ($changes as $change) { - IDF_Commit::getOrAdd($change, $request->project); + $rchanges[] = IDF_Commit::getOrAdd($change, $request->project); } - $changes = new Pluf_Template_ContextVars($changes); + $rchanges = new Pluf_Template_ContextVars($rchanges); $scmConf = $request->conf->getVal('scm', 'git'); return Pluf_Shortcuts_RenderToResponse('idf/source/changelog.html', array( 'page_title' => $title, 'title' => $title, - 'changes' => $changes, + 'changes' => $rchanges, 'commit' => $commit, 'branches' => $branches, 'scm' => $scmConf, @@ -216,6 +217,7 @@ class IDF_Views_Source $title = sprintf(__('%s Commit Details'), (string) $request->project); $page_title = sprintf(__('%s Commit Details - %s'), (string) $request->project, $commit); $cobject = $scm->getCommit($commit); + $rcommit = IDF_Commit::getOrAdd($cobject, $request->project); $diff = new IDF_Diff($cobject->changes); $diff->parse(); $scmConf = $request->conf->getVal('scm', 'git'); @@ -228,6 +230,7 @@ class IDF_Views_Source 'commit' => $commit, 'branches' => $branches, 'scm' => $scmConf, + 'rcommit' => $rcommit, ), $request); } diff --git a/src/IDF/templates/idf/downloads/view.html b/src/IDF/templates/idf/downloads/view.html index 660aa82..d509e63 100644 --- a/src/IDF/templates/idf/downloads/view.html +++ b/src/IDF/templates/idf/downloads/view.html @@ -47,7 +47,7 @@ {/if} {/block} {block context} -{assign $submitter = $file.get_submitter()} +{ashowuser 'submitter', $file.get_submitter(), $request}
{trans 'Uploaded:'} {$file.creation_dtime|dateago} {blocktrans}by {$submitter}{/blocktrans}
{if $file.modif_dtime != $file.creation_dtime}{trans 'Updated:'} {$file.modif_dtime|dateago}
{/if} diff --git a/src/IDF/templates/idf/issues/view.html b/src/IDF/templates/idf/issues/view.html index 8280376..a9d9d8a 100644 --- a/src/IDF/templates/idf/issues/view.html +++ b/src/IDF/templates/idf/issues/view.html @@ -3,15 +3,15 @@ {block body} {assign $i = 0} {assign $nc = $comments.count()} -{foreach $comments as $c} -
{blocktrans}Reported by {$who}, {$c.creation_dtime|date}{/blocktrans}
+{blocktrans}Reported by {$submitter}, {$c.creation_dtime|date}{/blocktrans}
{else} {aurl 'url', 'IDF_Views_Issue::view', array($project.shortname, $issue.id)} {assign $id = $c.id} {assign $url = $url~'#ic'~$c.id} -{blocktrans}Comment {$i} by {$who}, {$c.creation_dtime|date}{/blocktrans}
+{blocktrans}Comment {$i} by {$submitter}, {$c.creation_dtime|date}{/blocktrans}
{/if} @@ -118,14 +118,14 @@ {/block} {block context}{trans 'Created:'} {$issue.creation_dtime|dateago} {blocktrans}by {$submitter}{/blocktrans}
+{ashowuser 'submitter', $issue.get_submitter(), $request} +{trans 'Created:'} {$issue.creation_dtime|dateago} {blocktrans}by {$submitter}{/blocktrans}
{if $issue.modif_dtime != $issue.creation_dtime}{trans 'Updated:'} {$issue.modif_dtime|dateago}
{/if}{trans 'Status:'} {$issue.get_status.name}
-{if $issue.get_owner != null}{aurl 'url', 'IDF_Views_User::view', array($issue.get_owner().login)} -{trans 'Owner:'} {$issue.get_owner} +{if $issue.get_owner != null}
+{trans 'Owner:'} {showuser $issue.get_owner(), $request}
{/if}{assign $tags = $issue.get_tags_list()}{if $tags.count()}{trans 'Labels:'}
{foreach $changes as $change} -{aurl 'url', 'IDF_Views_Source::commit', array($project.shortname, $change.commit)} +{aurl 'url', 'IDF_Views_Source::commit', array($project.shortname, $change.scm_id)}diff --git a/src/IDF/templates/idf/source/changelog.html b/src/IDF/templates/idf/source/changelog.html index 124657d..9a594f5 100644 --- a/src/IDF/templates/idf/source/changelog.html +++ b/src/IDF/templates/idf/source/changelog.html @@ -10,15 +10,15 @@
{issuetext $change.full_message, $request}{/if}
{issuetext $change.fullmessage, $request}{/if}