diff --git a/module/repo/ui/log.html.php b/module/repo/ui/log.html.php
index 0d065252af..a685ca5653 100644
--- a/module/repo/ui/log.html.php
+++ b/module/repo/ui/log.html.php
@@ -54,28 +54,13 @@ foreach($logs as $log)
{
$log->revision = substr($log->revision, 0, 10);
$log->designName = '';
- if(!empty($log->relations['stroies']))
+ foreach(array('stroies', 'designs', 'tasks', 'bugs') as $value)
{
- $log->designName .= html::commonButton($lang->repo->story , '', 'btn size-sm mx-2');
- foreach($log->relations['stroies'] as $item) $log->designName .= html::a($item->url, '#'.$item->id, '_blank');
- }
-
- if(!empty($log->relations['designs']))
- {
- $log->designName .= html::commonButton($lang->design->common , '', 'btn size-sm mx-2');
- foreach($log->relations['designs'] as $item) $log->designName .= html::a($item->url, '#'.$item->id,'_blank');
- }
-
- if(!empty($log->relations['tasks']))
- {
- $log->designName .= html::commonButton($lang->task->common , '', 'btn size-sm mx-2');
- foreach($log->relations['tasks'] as $item) $log->designName .= html::a($item->url, '#'.$item->id,'_blank');
- }
-
- if(!empty($log->relations['bugs']))
- {
- $log->designName .= html::commonButton($lang->bug->common , '', 'btn size-sm mx-2');
- foreach($log->relations['bugs'] as $item) $log->designName .= html::a($item->url, '#'.$item->id,'_blank');
+ if(!empty($log->relations[$value]))
+ {
+ $log->designName .= html::commonButton($lang->repo->{$value} , '', 'btn size-sm mx-2');
+ foreach($log->relations[$value] as $item) $log->designName .= html::a($item->url, '#'.$item->id, '_blank');
+ }
}
}