Browse Source

stop new window when icon is gray.

tags/v1.21.12.1
Gitea 4 years ago
parent
commit
0fb4e1e0f3
1 changed files with 17 additions and 2 deletions
  1. +17
    -2
      templates/repo/cloudbrain/index.tmpl

+ 17
- 2
templates/repo/cloudbrain/index.tmpl View File

@@ -169,6 +169,11 @@
.dis {
margin-bottom: 20px;
}
.disabled {
cursor: pointer;
pointer-events: none;
}
</style>

<!-- 弹窗 -->
@@ -261,9 +266,10 @@
</span>
</div>

<!-- 评分 -->
<div class="one wide column">
<span class="ui text center clipboard">
<a class="title" target="_new" href="{{if and (ne .Status "WAITING") (eq .JobType "BENCHMARK")}}{{$.Link}}/{{.JobID}}/benchmark{{else}}javascript:void(0){{end}}" style="{{if and (ne .Status "WAITING") (eq .JobType "BENCHMARK")}}{{else}}color:#CCCCCC{{end}}">
<a class="title" onclick="stop(this)" href="{{if and (ne .Status "WAITING") (eq .JobType "BENCHMARK")}}{{$.Link}}/{{.JobID}}/benchmark{{else}}javascript:void(0);{{end}}" style="{{if and (ne .Status "WAITING") (eq .JobType "BENCHMARK")}}{{else}}color:#CCCCCC{{end}}">
<span class="fitted">评分</span>
</a>
</span>
@@ -282,7 +288,7 @@
<!-- 调试 -->
<div class="one wide column">
<span class="ui text center clipboard">
<a class="title" target="_new" href="{{if not .CanDebug}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/debug{{end}}" style="{{if not .CanDebug}}color:#CCCCCC{{end}}">
<a class="title" onclick="stop(this)" href="{{if not .CanDebug}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/debug{{end}}" style="{{if not .CanDebug}}color:#CCCCCC{{end}}">
<span class="fitted">调试</span>
</a>
</span>
@@ -380,6 +386,15 @@
{{template "base/footer" .}}

<script>
// 调试和评分新开窗口
function stop(obj) {
if (obj.style.color != "rgb(204, 204, 204)") {
obj.target = '_blank'
} else {
return
}
}

// 删除时用户确认
function assertDelete(obj) {
if (obj.style.color == "rgb(204, 204, 204)") {


Loading…
Cancel
Save