实现分享开关

This commit is contained in:
Minho
2018-03-13 19:20:50 +08:00
parent c278b72f15
commit 08e86e0f41
15 changed files with 162 additions and 134 deletions

View File

@@ -129,6 +129,7 @@
</div>
</div>
{{end}}
<div class="form-group">
<label for="autoRelease">自动发布</label>
<div class="controls">
@@ -145,6 +146,14 @@
</div>
</div>
</div>
<div class="form-group">
<label for="autoRelease">开启分享</label>
<div class="controls">
<div class="switch switch-small" data-on="primary" data-off="info">
<input type="checkbox" id="enableShare" name="enable_share"{{if .Model.IsEnableShare }} checked{{end}} data-size="small">
</div>
</div>
</div>
<div class="form-group">
<button type="submit" id="btnSaveBookInfo" class="btn btn-success" data-loading-text="保存中...">保存修改</button>
<span id="form-error-message" class="error-message"></span>
@@ -308,8 +317,7 @@
}).on("show.bs.modal",function () {
window.modalHtml = $("#upload-logo-panel").find(".modal-body").html();
});
$("#autoRelease").bootstrapSwitch();
$("#isDownload").bootstrapSwitch();
$("#autoRelease,#enableShare,#isDownload").bootstrapSwitch();
$('input[name="label"]').tagsinput({
confirmKeys: [13,44],

View File

@@ -61,8 +61,10 @@
</div>
<div class="dropdown pull-right" style="margin-right: 10px;">
{{if eq .Model.PrivatelyOwned 0}}
{{if .Model.IsEnableShare}}
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#shareProject"><i class="fa fa-share-alt" aria-hidden="true"></i> 分享</button>
{{end}}
{{end}}
</div>
{{if .Model.IsDownload}}
<div class="dropdown pull-right" style="margin-right: 10px;">
@@ -211,7 +213,7 @@
</article>
<div class="manual-mask"></div>
</div>
{{if .Model.IsEnableShare}}
<!-- 分享项目 -->
<div class="modal fade" id="shareProject" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
@@ -240,6 +242,7 @@
</div>
</div>
</div>
{{end}}
<!-- 下载项目 -->
<div class="modal fade" id="downloadBookModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
@@ -257,7 +260,7 @@
<div class="form-group">
<label for="password" class="col-sm-2 control-label">项目地址</label>
<div class="col-sm-10">
<input type="text" value="{{.BaseUrl}}{{urlfor "DocumentController.Index" ":key" .Model.Identify}}" class="form-control" onmouseover="this.select()" id="projectUrl" title="项目地址">
<input type="text" value="{{urlfor "DocumentController.Index" ":key" .Model.Identify}}" class="form-control" onmouseover="this.select()" id="projectUrl" title="项目地址">
</div>
<div class="clearfix"></div>
</div>