Skip to content

Commit

Permalink
前段代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
george518 committed May 11, 2018
1 parent cab7382 commit 2c26dbe
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions views/task/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,17 @@ <h4>{{.pageTitle}}</h4>
<a class="btn btn-danger btn-xs" href="{{urlfor "TaskController.Start"}}?id={{$v.id}}">
<span class="glyphicon glyphicon-expand" aria-hidden="true"></span> 激活
</a>
<a class="btn btn-info btn-xs" href="{{urlfor "TaskController.Edit"}}?id={{$v.id}}">
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 编辑
</a>
{{else}}
<a class="btn btn-success btn-xs" href="{{urlfor "TaskController.Pause"}}?id={{$v.id}}">
<span class="glyphicon glyphicon-pause" aria-hidden="true"></span> 暂停
</a>
{{end}}
{{if eq $v.status 0}}
<a class="btn btn-info btn-xs" href="{{urlfor "TaskController.Edit"}}?id={{$v.id}}">
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 编辑
</a>
{{else}}
<a class="btn btn-default btn-xs" href="javascript:return alert('激活状态无法编辑任务,请先暂停任务');">
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 编辑
<a class="btn btn-default btn-xs" href="javascript:void(0)" onclick="alert('激活状态无法编辑任务,请先暂停任务');">
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 编辑
</a>
{{end}}

<a class="btn btn-info btn-run btn-xs" href="{{urlfor "TaskController.Run"}}?id={{$v.id}}">
<span class="glyphicon glyphicon-flash" aria-hidden="true"></span> 执行
</a>
Expand Down

0 comments on commit 2c26dbe

Please sign in to comment.