forked from TruthHun/BookStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathads.html
More file actions
169 lines (161 loc) · 8.94 KB
/
ads.html
File metadata and controls
169 lines (161 loc) · 8.94 KB
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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>广告管理 - {{.SITE_NAME}}</title>
<link href="{{$.StaticDomain}}/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="{{$.StaticDomain}}/static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="/static/css/main.css?version={{$.Version}}" rel="stylesheet">
{{/*<script src="/static/html5shiv/3.7.3/html5shiv.min.js"></script>*/}}
<script src="{{$.StaticDomain}}/static/html5shiv/3.7.3/html5shiv.min.js"></script>
{{/*<script src="/static/respond.js/1.4.2/respond.min.js"></script>*/}}
<script src="{{$.StaticDomain}}/static/respond.js/1.4.2/respond.min.js"></script>
<link rel="stylesheet" href="/static/css/toast.css">
<style>
td{vertical-align: middle}
</style>
</head>
<body>
<div class="manual-reader">
{{template "widgets/header.html" .}}
<div class="container manual-body">
<div class="row">
<div class="page-left">
{{template "manager/menu.html" .}}
</div>
<div class="page-right">
<div class="m-box">
<div class="box-head">
<strong class="box-title">广告管理</strong>
<a href="javascript:void(0);" class="pull-right btn btn-success" data-toggle="modal" data-target="#addAds"><i class="fa fa-plus"></i> 新增广告</a>
</div>
</div>
<div class="box-body" id="bookList">
<ul class="nav nav-tabs">
<li {{if eq .Mobile "0"}}class="active"{{end}}><a href="{{urlfor "ManagerController.Ads"}}?mobile=0">PC广告</a></li>
<li {{if eq .Mobile "1"}}class="active"{{end}}><a href="{{urlfor "ManagerController.Ads"}}?mobile=1">移动广告</a></li>
</ul>
<br>
<table class="table table-hover table-striped">
<thead>
<tr>
<th>位置</th>
<th>广告名称</th>
<th>广告代码</th>
<th>起止时间</th>
<th>广告状态</th>
<th>操作管理</th>
</tr>
</thead>
<tbody>
{{range $i,$item:=.Lists}}
<tr>
<td>
<select data-refresh="true" data-url="{{urlfor "ManagerController.UpdateAds"}}?id={{$item.Id}}" name="pid" class="form-control change-update">
{{range $idx,$p:=$.Positions}}
<option {{if eq $item.Pid $p.Id}}selected{{end}} value="{{$p.Id}}">
{{if $p.IsMobile}}【移动广告】{{else}}【PC广告】{{end}}{{$p.Title}}
</option>
{{end}}
</select>
</td>
<td>
<input type="text" name="title" class="form-control change-update" data-url="{{urlfor "ManagerController.UpdateAds"}}?id={{$item.Id}}" value="{{$item.Title}}">
</td>
<td>
<textarea name="code" class="form-control change-update" data-method="post" data-url="{{urlfor "ManagerController.UpdateAds"}}?id={{$item.Id}}" rows="3">{{$item.Code}}</textarea>
</td>
<td>
<span>{{$item.StartTime}}</span>
<br>
<span>{{$item.EndTime}}</span>
</td>
<td>
{{if $item.Status}}
<span class="text-success">启用</span>
{{else}}
<span class="text-danger">关闭</span>
{{end}}
</td>
<td>
{{if $item.Status}}
<a href="{{urlfor "ManagerController.UpdateAds"}}?id={{$item.Id}}&field=status&value=0" class="ajax-get">关闭</a>
{{else}}
<a href="{{urlfor "ManagerController.UpdateAds"}}?id={{$item.Id}}&field=status&value=1" class="ajax-get">启用</a>
{{end}}
<br>
<a href="{{urlfor "ManagerController.DelAds"}}?id={{$item.Id}}" class="ajax-get confirm">删除</a>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="addAds" tabindex="-1" role="dialog" aria-labelledby="addAdsLabel">
<div class="modal-dialog" role="document">
<form method="post" autocomplete="off" class="form-horizontal ajax-form" action="{{urlfor "ManagerController.Ads"}}" id="addAdsForm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">新增广告</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label class="col-sm-12">广告位置</label>
<div class="col-sm-12">
<select class="form-control" name="pid">
{{range .Positions}}
<option value="{{.Id}}">
{{if .IsMobile}}【移动广告】{{else}}【PC广告】{{end}}{{.Title}}
</option>
{{end}}
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-12">广告名称</label>
<div class="col-sm-12">
<input type="text" class="form-control" name="title">
</div>
</div>
<div class="form-group">
<label class="col-sm-12">起止时间</label>
<div class="col-sm-12">
<div class="input-group input-group-sm">
<input type="date" name="start" value="{{.Now}}" class="form-control" placeholder="开始时间">
<span class="input-group-addon">-</span>
<input type="date" name="end" value="{{.Next}}" class="form-control" placeholder="截止时间">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-12">广告代码</label>
<div class="col-sm-12">
<textarea name="code" id="cates" rows="5" class="form-control" placeholder="多个分类名称,请用换行分隔"></textarea>
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="modal-footer">
<span id="form-error-message"></span>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="submit" class="btn btn-success" data-loading-text="保存中..." id="btnCreateCategory">保存</button>
</div>
</div>
</form>
</div>
</div><!--END Modal-->
{{/*<script src="/static/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>*/}}
<script src="{{$.StaticDomain}}/static/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>
{{/*<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>*/}}
<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="{{$.StaticDomain}}/static/js/toast.script.js"></script>
<script src="/static/js/main.js?version={{$.Version}}" type="text/javascript"></script>
</body>
</html>