forked from reposense/RepoSense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.jade
260 lines (250 loc) · 13.8 KB
/
index.jade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
html
head
link(rel="stylesheet", href="https://fonts.googleapis.com/css?family=Titillium+Web")
link(rel="stylesheet", href="https://cdn.jsdelivr.net/npm/normalize.css@8.0/normalize.min.css")
link(rel="stylesheet", href="https://cdn.jsdelivr.net/npm/muicss@0.9/dist/css/mui.min.css")
link(rel="stylesheet", href="https://cdn.jsdelivr.net/npm/highlight.js@9.14/styles/color-brewer.min.css")
link(rel="stylesheet", href="https://cdn.jsdelivr.net/npm/vue-loading-spinner@1.0/dist/vue-loading-spinner.css")
link(rel="stylesheet", href="static/css/style.css")
script(src="https://use.fontawesome.com/releases/v5.0.13/js/all.js", defer=True)
script(src="https://cdn.jsdelivr.net/npm/vue@2.5/dist/vue.min.js")
script(src="https://cdn.jsdelivr.net/npm/jszip@3.1/dist/jszip.min.js")
script(src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.14/build/highlight.min.js")
script(src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.14/build/languages/asciidoc.min.js")
script(src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.14/build/languages/gradle.min.js")
script(src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.14/build/languages/plaintext.min.js")
script(src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.14/build/languages/scss.min.js")
script(src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.14/build/languages/yaml.min.js")
script(src="https://cdn.jsdelivr.net/npm/vue-loading-spinner@1.0/dist/vue-loading-spinner.js")
body
div#app
#app-wrapper(v-if="userUpdated", onmousemove="mouseMove(event)",
onmouseup="deregisterMouseMove()", onmouseleave="deregisterMouseMove()")
#tab-resize-guide
#summary-wrapper
.summary-status(v-if="loadedRepo<repoLength") Loading repos ... {{ loadedRepo }} / {{ repoLength }}
v_summary(
v-bind:repos="getUsers()",
v-on:view-authorship="updateTabAuthorship"
)
.timestamp-footer
span Generated by
a(href="https://github.com/reposense/RepoSense")
strong RepoSense
span on {{ creationDate }}
#tabs-wrapper(v-if="isTabActive")
#tab-resize(onmousedown="registerMouseMove()")
.tab-close(v-on:click="isTabActive=false")
i.fas.fa-caret-right
.tab-content
.tab-panes
v_authorship#tab-authorship.tab-pane(
v-if="tabType === 'authorship'"
v-bind:key="generateKey(tabInfo.tabAuthorship)",
v-bind:info="tabInfo.tabAuthorship")
#tab-empty.tab-pane(v-else)
.title
span To view the code attributed to a specific author, click the
i.fas.fa-code
span icon next to that author's name.
br
span To hide the code view, click the
i.fas.fa-caret-right
span icon on the left.
template(v-else)
.empty please enter a report directory or upload a report zip
form#file-upload(onsubmit="return false;")
input(type="file", v-on:change="updateReportZip")
.loader(v-if="isLoading")
circle-spinner
.loading Loading resources...
vuetemplate#v_summary
#summary.wrapper
form.summary-picker.mui-form--inline(v-on:submit.prevent="getFiltered();")
.summary-picker__section
.mui-textfield
input.summary-picker__search(type="text", v-on:change="updateFilterSearch")
label search
.mui-select
select(v-model="filterSort")
option(value="totalCommits") Contribution
option(value="variance") Variance
option(value="displayName") Author Name
option(value="searchPath") Repo/Branch Name
label sort by
.mui-select
select(v-model="filterTimeFrame")
option(value="commit") Commit
option(value="day") Day
option(value="week") Week
label granularity
.summary-picker__section
.mui-textfield.summary-picker__date
input(type="date", v-model="tmpFilterSinceDate", onkeydown="return false",
v-bind:min="minDate", v-bind:max="filterUntilDate")
label since
.mui-textfield.summary-picker__date
input(type="date", v-model="tmpFilterUntilDate", onkeydown="return false",
v-bind:min="filterSinceDate", v-bind:max="maxDate")
label until
.summary-picker__checkboxes.summary-picker__section
label
input(type="checkbox", v-model="filterSortReverse").mui-checkbox.summary-picker__checkbox
span reverse
label
input(type="checkbox", v-model="filterGroupRepos").mui-checkbox.summary-picker__checkbox
span group by repo/branch
label
input(type="checkbox", v-model="filterBreakdown").mui-checkbox.summary-picker__checkbox
span breakdown by file format
#summary-charts
.summary-charts(v-for="repo of filteredRepos")
.summary-charts__title(
v-if="filterGroupRepos",
) {{ repo[0].repoPath }}
.summary-charts__fileformat--breakdown(v-if="filterBreakdown")
template(v-if="filterGroupRepos")
.summary-charts__fileformat--breakdown__legend(
v-for="fileFormat in Object.keys(repo[0].fileFormatContribution)")
i.fas.fa-circle(
v-bind:style="{ 'color' : contributionBarColors[fileFormat] }"
)
span {{ fileFormat }}
template(v-else)
.summary-charts__fileformat--breakdown__legend(
v-for="fileFormat in Object.keys(contributionBarColors)")
i.fas.fa-circle(
v-bind:style="{ 'color' : contributionBarColors[fileFormat] }"
)
span {{ fileFormat }}
.summary-chart(v-for="(user, i) in repo")
.summary-chart__title
.summary-chart__title--index {{ i+1 }}
.summary-chart__title--repo(v-if="!filterGroupRepos") {{ user.repoPath }}
.summary-chart__title--name {{ user.displayName }}
a(
title="click to view author's code",
v-on:click="$emit('view-authorship', \
{author:user.name, repo:user.repoName, name:user.displayName, location:repo[0].location, \
minDate:minDate, maxDate:maxDate, totalCommits:user.totalCommits, \
filesLinesObj:user.fileFormatContribution})"
)
i.summary-chart__title--button.fas.fa-code
a(
v-bind:href="repo[0].location", target="_blank",
title="click to view author's repo"
)
i.summary-chart__title--button.fab.fa-github
.summary-chart__ramp
template(v-if="filterTimeFrame === 'commit'")
template(v-for="(slice, j) in user.commits")
a.summary-chart__ramp__slice(
v-for="(commit, k) in slice.commitResults",
v-if="commit.insertions>0",
v-bind:href="getSliceLink(user, slice)", target="_blank",
v-bind:title="`[${slice.date}] ${commit.message}: ${commit.insertions} lines`",
v-bind:class="'summary-chart__ramp__slice--color' + j % 5",
v-bind:style="{\
zIndex: user.commits.length - j,\
borderLeftWidth: getWidth(commit) + 'em',\
right: ((getSlicePos(j, user.commits.length)\
+ (getSlicePos(k, slice.commitResults.length) / user.commits.length)) * 100) + '%'\
}"
)
template(v-else)
a.summary-chart__ramp__slice(
v-for="(slice, j) in user.commits",
v-if="slice.insertions > 0",
v-bind:title="`[${slice.date}] ${filterTimeFrame === 'day' ? 'Daily' : 'Weekly'} contribution: ${slice.insertions} lines`",
v-bind:href="getSliceLink(user, slice)", target="_blank",
v-bind:class="'summary-chart__ramp__slice--color' + j % 5",
v-bind:style="{\
zIndex: user.commits.length - j,\
borderLeftWidth: getWidth(slice) + 'em',\
right: (getSlicePos(j, user.commits.length) * 100) + '%'\
}"
)
.summary-chart__contribution
template(v-if="filterBreakdown")
.summary-chart__contrib(
v-for="(widths, fileFormat) in getFileFormatContributionBars(user.fileFormatContribution)"
)
.summary-chart__contrib--bar--fileformat(
v-for="width in widths",
v-bind:style="{ width: width + '%',\
'background-color': contributionBarColors[fileFormat] }",
v-bind:title="fileFormat + ': ' + user.fileFormatContribution[fileFormat] + ' lines, '\
+ 'total: ' + user.totalCommits + ' lines ' + '(contribution from ' + minDate + ' to '\
+ maxDate + ')'"
)
template(v-else)
.summary-chart__contrib(
v-bind:title="'Total contribution from ' + minDate + ' to ' + maxDate + ': '\
+ user.totalCommits + ' lines'"
)
.summary-chart__contrib--bar(
v-for="width in getContributionBars(user.totalCommits)",
v-bind:style="{ width: width+'%' }"
)
vuetemplate#v_authorship
#authorship
// TODO: remove in #524
.toolbar(v-if="info.totalCommits > 0")
a(v-if="activeFileCount === 0", v-on:click="expandAll(true)") Expand all
a(v-else, v-on:click="expandAll(false)") Collapse all
.title
a.repoName(
v-bind:href="info.location", target="_blank",
v-bind:title="'Click to open the repo'"
) {{ info.repo }}
.author {{ info.name }} ({{ info.author }}) contribution from {{ info.minDate }} to {{ info.maxDate }}
.contribution(v-if="isLoaded && files.length!=0")
input.radio-button--search(type="radio", name="filter", value="search", v-on:click="enableSearchBar()")
form.file-picker.mui-form--inline(onsubmit="return false")
input#search(type="search", placeholder="Filter by glob", v-on:change="updateFilterSearch", disabled)
button#submit-button(type="submit", disabled) Filter
input.radio-button--checkbox(type="radio", name="filter", value="checkboxes", v-on:click="enableCheckBoxes()",
checked)
div.checkboxes.mui-form--inline(v-if="files.length > 0")
label
input.mui-checkbox--fileformat(type="checkbox" v-on:click="selectAll" v-model="isSelectAllChecked")
span.select(v-bind:title="getTotalFileBlankLineInfo()") All:
span.loc(v-bind:title="getTotalFileBlankLineInfo()") {{ totalLineCount }}
span.bloc(v-bind:title="getTotalFileBlankLineInfo()") ({{ totalBlankLineCount }})
template(v-for="format in Object.keys(getExistingLinesObj)", v-bind:key="format")
label
input.mui-checkbox--fileformat(type="checkbox" :checked="selectedFileFormats.includes(format)"
v-on:change="selectFileFormat(format)")
span(v-bind:title="getFileBlankLineInfo(format)") {{ format }}: {{ getExistingLinesObj[format] }}
span.bloc(v-bind:title="getFileBlankLineInfo(format)") ({{ filesBlankLinesObj[format] }})
.files(v-if="isLoaded")
.empty(v-if="files.length === 0") nothing to see here :(
template(v-for="file in selectedFiles")
.file.active(v-bind:key="file.path")
.title
span.path(onclick="toggleNext(this.parentNode)", v-on:click="updateCount") {{ file.path }}
span.loc ({{ file.lineCount }} lines)
a(
v-bind:href="getFileLink(file, 'commits')", target="_blank",
title="click to view the history view of file"
)
i.button.fas.fa-history
a(
v-bind:href="getFileLink(file, 'blame')", target="_blank",
title="click to view the blame view of file"
)
i.button.fas.fa-user-edit
pre.hljs
div(v-hljs="file.path")
template(v-for="segment in file.segments")
.segment(v-bind:class="{ untouched: !segment.authored, active: segment.lines.length<5 }")
.closer(v-if="!segment.authored && segment.lines.length>4", onclick="toggleNext(this)")
i.fas.fa-ellipsis-h.icon
span.tooltiptext.tooltiptext--close Show untouched code
span.tooltiptext.tooltiptext--open Hide untouched code
.code {{ segment.lines.join("\n") }}
.empty(v-else) loading...
script(src="static/js/api.js")
script(src="static/js/v_summary.js")
script(src="static/js/v_authorship.js")
script(src="static/js/main.js")