1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use yii\helpers\Html; |
4
|
|
|
use yii\grid\GridView; |
5
|
|
|
|
6
|
|
|
$this->title = $git->repository; |
7
|
|
|
$this->params['breadcrumbs'][] = ['label' => 'Repositories', 'url' => ['index']]; |
8
|
|
|
$this->params['breadcrumbs'][] = $this->title; |
9
|
|
|
?> |
10
|
|
|
|
11
|
|
|
<p> |
12
|
|
|
<?= Html::a('Gráfica', ['graph', 'id' => $git->repository], ['class' => 'btn btn-success']) ?> |
13
|
|
|
<?= Html::a('Estadisticas', ['stats', 'id' => $git->repository], ['class' => 'btn btn-success']) ?> |
14
|
|
|
</p> |
15
|
|
|
|
16
|
|
|
<h1><?= Html::encode($this->title) ?></h1> |
17
|
|
|
|
18
|
|
|
<h2>Commits</h2> |
19
|
|
|
|
20
|
|
|
<?= GridView::widget([ |
21
|
|
|
'id' => 'commit-grid', |
22
|
|
|
'dataProvider' => $providerRevList, |
23
|
|
|
'columns' => [ |
24
|
|
|
[ |
25
|
|
|
'attribute' => 'h', |
26
|
|
|
'format' => 'html', |
27
|
|
|
'label' => 'Commit', |
28
|
|
|
'value' => function($data) { |
29
|
|
|
return substr($data['h'], 0, 7) . $data['rev']; |
30
|
|
|
} |
31
|
|
|
], |
32
|
|
|
[ |
33
|
|
|
'attribute' => 'author_datetime', |
34
|
|
|
'label' => 'Datetime', |
35
|
|
|
], |
36
|
|
|
[ |
37
|
|
|
'attribute' => 'author_name', |
38
|
|
|
'label' => 'Author Name', |
39
|
|
|
], |
40
|
|
|
[ |
41
|
|
|
'attribute' => 'author_mail', |
42
|
|
|
'label' => 'Author Mail', |
43
|
|
|
], |
44
|
|
|
[ |
45
|
|
|
'attribute' => 'subject', |
46
|
|
|
'label' => 'Subject', |
47
|
|
|
], |
48
|
|
|
[ |
49
|
|
|
'class' => 'yii\grid\ActionColumn', |
50
|
|
|
'template'=>'{view}', |
51
|
|
|
'buttons' => [ |
52
|
|
View Code Duplication |
'view' => function ($url, $model) use ($git) { |
|
|
|
|
53
|
|
|
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', |
54
|
|
|
['commitview', 'id' => $git->repository, 'hash' => $model["h"]], |
55
|
|
|
['title' => Yii::t('app', 'View commit ' . substr($model['h'], 0, 7))]); |
56
|
|
|
}, |
57
|
|
|
], |
58
|
|
|
], |
59
|
|
|
], |
60
|
|
|
]); |
61
|
|
|
?> |
62
|
|
|
|
63
|
|
|
<h2>Tags</h2> |
64
|
|
|
|
65
|
|
|
<?= GridView::widget([ |
66
|
|
|
'id' => 'tags-grid', |
67
|
|
|
'dataProvider' => $providerTags, |
68
|
|
|
'columns' => [ |
69
|
|
|
[ |
70
|
|
|
'attribute' => 'tag', |
71
|
|
|
], |
72
|
|
|
[ |
73
|
|
|
'attribute' => 'h', |
74
|
|
|
'format' => 'html', |
75
|
|
|
'label' => 'Commit', |
76
|
|
|
'value' => function($data){ |
77
|
|
|
return substr($data['h'], 0, 7); |
78
|
|
|
} |
79
|
|
|
], |
80
|
|
|
[ |
81
|
|
|
'attribute' => 'datetime', |
82
|
|
|
'label' => 'Datetime', |
83
|
|
|
], |
84
|
|
|
[ |
85
|
|
|
'attribute' => 'message_short', |
86
|
|
|
'format' => 'html', |
87
|
|
|
'label' => 'Message', |
88
|
|
|
], |
89
|
|
|
[ |
90
|
|
|
'class' => 'yii\grid\ActionColumn', |
91
|
|
|
'template'=>'{view}', |
92
|
|
|
'buttons' => [ |
93
|
|
|
'view' => function ($url, $model) use ($git) { |
94
|
|
|
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', |
95
|
|
|
['tagview', 'id' => $git->repository, 'tag' => $model["tag"]], |
96
|
|
|
['title' => Yii::t('app', 'Detail of tag ' . $model["tag"])]); |
97
|
|
|
}, |
98
|
|
|
], |
99
|
|
|
], |
100
|
|
|
], |
101
|
|
|
]); |
102
|
|
|
?> |
103
|
|
|
|
104
|
|
|
<h2>Branches</h2> |
105
|
|
|
|
106
|
|
|
<?= GridView::widget([ |
107
|
|
|
'id' => 'branches-grid', |
108
|
|
|
'dataProvider' => $providerBranches, |
109
|
|
|
'columns' => [ |
110
|
|
|
[ |
111
|
|
|
'attribute' => 'branch', |
112
|
|
|
], |
113
|
|
|
[ |
114
|
|
|
'attribute' => 'active', |
115
|
|
|
'label' => 'Status', |
116
|
|
|
'value' => function($data){ |
117
|
|
|
return $data['active']?"Active":""; |
118
|
|
|
} |
119
|
|
|
], |
120
|
|
|
[ |
121
|
|
|
'class' => 'yii\grid\ActionColumn', |
122
|
|
|
'template'=>'{view}', |
123
|
|
|
'buttons' => [ |
124
|
|
|
'view' => function ($url, $model) use ($git) { |
125
|
|
|
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', |
126
|
|
|
['shortlog', 'id' => $git->repository, 'branch' => $model["branch"]], |
127
|
|
|
['title' => Yii::t('app', 'Detail of brach ' . $model["branch"])]); |
128
|
|
|
}, |
129
|
|
|
], |
130
|
|
|
], |
131
|
|
|
], |
132
|
|
|
]); |
133
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.