config.ftl 26.8 KB
Newer Older
Y
yadong.zhang 已提交
1 2
<#include "include/macros.ftl">
<@header></@header>
Y
yadong.zhang 已提交
3 4 5 6
<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
Y
yadong.zhang 已提交
7
                <h2>系统配置 </h2>
Y
yadong.zhang 已提交
8 9 10 11 12 13 14
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <div class="col-md-12 col-sm-12 col-xs-12 profile_left">
                    <div class="" role="tabpanel" data-example-id="togglable-tabs">
                        <ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
                            <li role="presentation" class="active">
Y
yadong.zhang 已提交
15 16 17 18 19 20 21 22 23 24
                                <a href="#tab_basic" id="basic-tab" role="tab" data-toggle="tab" aria-expanded="true">基本信息</a>
                            </li>
                            <li role="presentation">
                                <a href="#tab_seo" id="seo-tab" role="tab" data-toggle="tab" aria-expanded="true">SEO设置</a>
                            </li>
                            <li role="presentation">
                                <a href="#tab_praise" id="praise-tab" role="tab" data-toggle="tab" aria-expanded="true">赞赏码配置</a>
                            </li>
                            <li role="presentation">
                                <a href="#tab_qiniu" id="qiniu-tab" role="tab" data-toggle="tab" aria-expanded="true">七牛云配置</a>
Y
yadong.zhang 已提交
25 26
                            </li>
                            <li role="presentation" class="">
Y
yadong.zhang 已提交
27
                                <a href="#tab_contact" role="tab" id="contact-tab" data-toggle="tab" aria-expanded="false">联系方式</a>
Y
yadong.zhang 已提交
28 29
                            </li>
                            <li role="presentation" class="">
Y
yadong.zhang 已提交
30
                                <a href="#tab_setting" role="tab" id="setting-tab" data-toggle="tab" aria-expanded="false">系统配置</a>
Y
yadong.zhang 已提交
31 32 33
                            </li>
                        </ul>
                        <div id="myTabContent" class="tab-content">
Y
yadong.zhang 已提交
34
                            <div role="tabpanel" class="tab-pane fade active in" id="tab_basic" aria-labelledby="basic-tab">
Y
yadong.zhang 已提交
35 36 37
                                <form class="form-horizontal form-label-left" novalidate>
                                    <input type="hidden" name="id">
                                    <div class="item form-group">
Y
yadong.zhang 已提交
38 39 40 41 42 43 44 45
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="domain">根域名<span class="required">*</span></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="domain" id="domain"
                                                   required="required" placeholder="请输入网站主域名:zhyd.me"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="siteName">站点名<span
Y
yadong.zhang 已提交
46 47
                                                class="required">*</span></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
48 49
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="siteName" id="siteName"
                                                   required="required" placeholder="请输入站点名"/>
Y
yadong.zhang 已提交
50 51 52
                                        </div>
                                    </div>
                                    <div class="item form-group">
Y
yadong.zhang 已提交
53
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="siteUrl">站点地址<span
Y
yadong.zhang 已提交
54 55
                                                class="required">*</span></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
56 57
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="siteUrl" id="siteUrl"
                                                   required="required" placeholder="请输入站点地址"/>
Y
yadong.zhang 已提交
58 59 60
                                        </div>
                                    </div>
                                    <div class="item form-group">
Y
yadong.zhang 已提交
61 62
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="siteDesc">站点详情<span
                                                class="required">*</span></label>
Y
yadong.zhang 已提交
63
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
64
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="siteDesc" id="siteDesc" required="required" placeholder="请输入站点详情"/>
Y
yadong.zhang 已提交
65 66 67
                                        </div>
                                    </div>
                                    <div class="item form-group">
Y
yadong.zhang 已提交
68 69
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="siteFavicon">站点LOGO<span
                                                class="required">*</span></label>
Y
yadong.zhang 已提交
70
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
71 72
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="siteFavicon" id="siteFavicon"
                                                   required="required" placeholder="请输入站点LOGO"/>
Y
yadong.zhang 已提交
73 74 75
                                        </div>
                                    </div>
                                    <div class="item form-group">
Y
yadong.zhang 已提交
76 77
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="staticWebSite">资源文件域名<span
                                                class="required">*</span></label>
Y
yadong.zhang 已提交
78
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
79 80
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="staticWebSite" id="staticWebSite"
                                                   required="required" placeholder="请输入资源文件域名"/>
Y
yadong.zhang 已提交
81 82
                                        </div>
                                    </div>
83 84 85 86 87 88 89 90
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="staticWebSite">CMS后管系统地址<span
                                                class="required">*</span></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="cmsUrl" id="cmsUrl"
                                                   required="required" placeholder="请输入CMS后管系统地址"/>
                                        </div>
                                    </div>
Y
yadong.zhang 已提交
91
                                    <div class="item form-group">
Y
yadong.zhang 已提交
92
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
Y
yadong.zhang 已提交
93
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
94
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
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
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div role="tabpanel" class="tab-pane fade" id="tab_seo" aria-labelledby="seo-tab">
                                <form class="form-horizontal form-label-left" novalidate>
                                    <input type="hidden" name="id">
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="homeDesc">Description <span
                                                class="required">*</span></label>
                                        <div class="col-md-6 col-sm-7 col-xs-12">
                                            <textarea class="form-control col-md-7 col-xs-12" id="homeDesc" name="homeDesc" required="required" placeholder="请输入首页描述" rows="5"></textarea>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="homeKeywords">Keywords <span
                                                class="required">*</span></label>
                                        <div class="col-md-6 col-sm-7 col-xs-12">
                                            <textarea class="form-control col-md-7 col-xs-12" id="homeKeywords" name="homeKeywords" required="required" placeholder="请输入首页关键字(半角逗号分隔)" rows="5"></textarea>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="homeKeywords">百度推送Token <span
                                                class="required">*</span></label>
                                        <div class="col-md-6 col-sm-7 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="baiduPushToken" id="baiduPushToken"
                                                   required="required" placeholder="请输入百度推送Token"/>
Y
yadong.zhang 已提交
122 123
                                        </div>
                                    </div>
Y
yadong.zhang 已提交
124 125 126 127
                                    <div class="item">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
                                        <div class="col-md-6 col-sm-7 col-xs-12"><small>获取地址:<a href="https://ziyuan.baidu.com/linksubmit/index" target="_blank">点击获取百度推送Token</a></small></div>
                                    </div>
Y
yadong.zhang 已提交
128
                                    <div class="clearfix"></div>
Y
yadong.zhang 已提交
129 130 131
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-7 col-xs-12">
Y
yadong.zhang 已提交
132
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
133 134 135 136 137 138 139
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div role="tabpanel" class="tab-pane fade" id="tab_praise" aria-labelledby="praise-tab">
                                <form class="form-horizontal form-label-left" novalidate>
                                    <input type="hidden" name="id">
Y
yadong.zhang 已提交
140
                                    <div class="item form-group">
Y
yadong.zhang 已提交
141
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="homeDesc">微信赞赏码 </label>
Y
yadong.zhang 已提交
142
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
143 144 145
                                            <input type="file" class="form-control col-md-7 col-xs-12 uploadPreview" data-preview-container="#wxPraiseCodeFilePreview" name="wxPraiseCodeFile" id="wxPraiseCodeFile"/>
                                        </div>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
146
                                            <div id="wxPraiseCodeFilePreview" style="width: 200px;height: auto"></div>
Y
yadong.zhang 已提交
147 148 149
                                        </div>
                                    </div>
                                    <div class="item form-group">
Y
yadong.zhang 已提交
150
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="homeKeywords">支付宝赞赏码 </label>
Y
yadong.zhang 已提交
151
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
152 153 154
                                            <input type="file" class="form-control col-md-7 col-xs-12 uploadPreview" data-preview-container="#zfbPraiseCodeFilePreview" id="zfbPraiseCodeFile" name="zfbPraiseCodeFile"/>
                                        </div>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
155
                                            <div id="zfbPraiseCodeFilePreview" style="width: 200px;height: auto"></div>
Y
yadong.zhang 已提交
156 157 158 159 160
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
161
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
162 163 164 165
                                        </div>
                                    </div>
                                </form>
                            </div>
Y
yadong.zhang 已提交
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
                            <div role="tabpanel" class="tab-pane fade" id="tab_qiniu" aria-labelledby="qiniu-tab">
                                <form class="form-horizontal form-label-left" novalidate>
                                    <input type="hidden" name="id">
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qiniuAccessKey">七牛ACCESS_KEY <span class="required">*</span></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="qiniuAccessKey" id="qiniuAccessKey"
                                                  required="required" placeholder="请输入七牛ACCESS_KEY"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qiniuSecretKey">七牛SECRET_KEY <span class="required">*</span></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="qiniuSecretKey" id="qiniuSecretKey"
                                                   required="required" placeholder="请输入七牛SECRET_KEY"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qiniuBucketName">七牛BUCKET_NAME <span class="required">*</span></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="qiniuBucketName" id="qiniuBucketName"
                                                   required="required" placeholder="请输入七牛BUCKET_NAME"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qiuniuBasePath">七牛路径 <span class="required">*</span></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="qiuniuBasePath" id="qiuniuBasePath"
                                                   required="required" placeholder="请输入七牛路径"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
200
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
201 202 203 204 205
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div role="tabpanel" class="tab-pane fade" id="tab_contact" aria-labelledby="contact-tab">
Y
yadong.zhang 已提交
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
                                <form class="form-horizontal form-label-left" novalidate>
                                    <input type="hidden" name="id">
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="authorName">站长名称</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="authorName" id="authorName"
                                                   placeholder="请输入站长名称"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="authorEmail">站长邮箱</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="authorEmail" id="authorEmail"
                                                   placeholder="请输入站长邮箱"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="wxCode">微信二维码</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="wxCode" id="wxCode"
                                                   placeholder="请输入微信二维码"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qq">QQ</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="qq" id="qq" placeholder="请输入QQ"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="weibo">微博</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="weibo" id="weibo" placeholder="请输入微博"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="github">GitHub</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="github" id="github"
                                                   placeholder="请输入GitHub"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
251
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
252 253 254 255
                                        </div>
                                    </div>
                                </form>
                            </div>
Y
yadong.zhang 已提交
256
                            <div role="tabpanel" class="tab-pane fade" id="tab_setting" aria-labelledby="setting-tab">
Y
yadong.zhang 已提交
257 258
                                <form class="form-horizontal form-label-left" novalidate>
                                    <input type="hidden" name="id">
Y
yadong.zhang 已提交
259 260 261 262 263 264 265 266 267 268 269 270
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="authorName">百度Api的AK</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="baiduApiAk" id="baiduApiAk"
                                                   placeholder="请输入百度Api的AK"/>
                                        </div>
                                    </div>
                                    <div class="item">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
                                        <div class="col-md-6 col-sm-7 col-xs-12"><small>获取地址:<a href="http://lbsyun.baidu.com/apiconsole/key" target="_blank">点击获取百度Api AK</a></small></div>
                                    </div>
                                    <div class="clear"></div>
Y
yadong.zhang 已提交
271 272 273 274
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="maintenance">首页显示维护通知</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <ul class="list-unstyled list-inline">
Y
yadong.zhang 已提交
275 276
                                                <li><input type="radio" class="square" checked name="maintenance" value="1"> 显示</li>
                                                <li><input type="radio" class="square" name="maintenance" value="0"> 关闭</li>
Y
yadong.zhang 已提交
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="maintenanceData">维护日期</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <div class='input-group date myDatepicker'>
                                                <input type='text' class="form-control" required="required" readonly="readonly" id="maintenanceData" name="maintenanceData" placeholder="请输入维护日期"/>
                                                <span class="input-group-addon">
                                                   <span class="glyphicon glyphicon-calendar"></span>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment">开启评论</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <ul class="list-unstyled list-inline">
Y
yadong.zhang 已提交
295 296
                                                <li><input type="radio" class="square" checked name="comment" value="1"> 开启</li>
                                                <li><input type="radio" class="square" name="comment" value="0"> 关闭</li>
Y
yadong.zhang 已提交
297 298 299 300 301 302
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
303
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
304 305 306 307 308 309 310 311 312 313 314 315
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
Y
yadong.zhang 已提交
316 317 318 319 320 321 322 323 324 325 326
<@footer>
    <script type="text/javascript">
        $(function () {
            $.ajax({
                url: '/config/get',
                type: 'POST',
                success: function (json) {
                    var data = json.data;
                    $("#myTabContent").find("input, select, textarea").each(function () {
                        clearText($(this), this.type, data);
                    });
Y
yadong.zhang 已提交
327

Y
yadong.zhang 已提交
328 329 330 331
                    data.zfbPraiseCode && $("#zfbPraiseCodeFilePreview").html('<img src="' + data.qiuniuBasePath + data.zfbPraiseCode + '" alt="支付宝赞赏码" class="img-responsive img-rounded auto-shake">');
                    data.wxPraiseCode && $("#wxPraiseCodeFilePreview").html('<img src="' + data.qiuniuBasePath + data.wxPraiseCode + '" alt="微信赞赏码" class="img-responsive img-rounded auto-shake">');
                }
            });
Y
yadong.zhang 已提交
332

Y
yadong.zhang 已提交
333 334 335 336 337 338 339
            $(".saveBtn").click(function () {
                var $this = $(this);
                var $form = $this.parents("form");
                if(validator.checkAll($form)) {
                    $form.ajaxSubmit({
                        type: "POST",
                        url: '/config/edit',
340 341 342
                        success: function (json) {
                            $.alert.ajaxSuccess(json);
                        },
Y
yadong.zhang 已提交
343 344 345 346
                        error: $.alert.ajaxError
                    });
                }
            });
Y
yadong.zhang 已提交
347

Y
yadong.zhang 已提交
348 349 350
        });
    </script>
</@footer>