File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
kotlin/org/dropProject/dao Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -201,4 +201,18 @@ data class Assignment(
201201 override fun toString (): String {
202202 return " $id - $name "
203203 }
204+
205+ fun linkToGithub (): String? {
206+ if (gitRepositoryPrivKey == null ) {
207+ return null
208+ }
209+
210+ val parts = gitRepositoryUrl.split(" :" )
211+ val hostAndPath = parts[1 ].removeSuffix(" .git" ).split(" /" )
212+ val username = parts[0 ].substringAfter(" @" )
213+ val host = hostAndPath[0 ]
214+ val repositoryName = hostAndPath[1 ]
215+
216+ return " https://$host /$username /$repositoryName "
217+ }
204218}
Original file line number Diff line number Diff line change @@ -86,7 +86,9 @@ <h1 class="page-header col-sm-11" th:text="'Assignment ' + ${assignment.id}">Ass
8686 </ div >
8787 < div class ="form-group " >
8888 < label class ="col-sm-3 control-label "> Connected to:</ label >
89- < div th:if ="${assignment.gitRepositoryPrivKey != null} " class ="col-sm-9 read-row " th:text ="${assignment.gitRepositoryUrl} "> </ div >
89+ < a th:if ="${assignment.gitRepositoryPrivKey != null} " class ="col-sm-9 read-row "
90+ th:text ="${assignment.gitRepositoryUrl} "
91+ th:href ="${assignment.linkToGithub()} "> link to github</ a >
9092 < div th:if ="${assignment.gitRepositoryPrivKey == null} " class ="col-sm-9 read-row alert alert-warning "> This assignment is not yet connected to a git repository!</ div >
9193 </ div >
9294 < div class ="form-group " th:if ="${lastCommitInfoStr != null} ">
Original file line number Diff line number Diff line change 2323
2424 < h1 class ="page-header " th:text ="'Build report for submission ' + ${submission.id} "> </ h1 >
2525 < h6 >
26- Assignment: < span th:text ="${assignment.id} "> </ span > |
26+ Assignment: < a th:href =" ${assignment.linkToGithub()} " th: text ="${assignment.id} "> </ a > |
2727 Submitted: < span th:text ="${#dates.format(submission.submissionDate, 'dd-MM HH:mm:ss')} "> </ span >
2828 < a th:if ="${isTeacher} "
2929 th:href ="@{'/submissions?assignmentId=' + ${assignment.id} + '&groupId=' + ${submission.group.id}} "> (other submissions)</ a >
You can’t perform that action at this time.
0 commit comments