增加备案信息选项

pull/244/head
Minho 2018-03-19 17:46:47 +08:00
parent 57d47896c7
commit 52f5a44691
8 changed files with 52 additions and 39 deletions

View File

@ -503,6 +503,7 @@ func (c *BookController) Create() {
}
c.JsonResult(6001, "error")
}
//导入
func (c *BookController) Import() {
@ -515,6 +516,12 @@ func (c *BookController) Import() {
beego.Info(moreFile.Filename)
ext := filepath.Ext(moreFile.Filename)
if !strings.EqualFold(ext,".doc") || !strings.EqualFold(ext,".docx") {
c.JsonResult(6004,"不支持的文件类型")
}
tempPath := filepath.Join(os.TempDir(),c.CruSession.SessionID())
os.MkdirAll(tempPath,0766)
@ -525,7 +532,6 @@ func (c *BookController) Import() {
converter.Resolve(tempPath)
}
// CreateToken 创建访问来令牌.

View File

@ -435,7 +435,7 @@ func (c *ManagerController) Setting() {
c.Data["SITE_TITLE"] = c.Option["SITE_NAME"]
for _, item := range options {
c.Data[item.OptionName] = item
c.Data[item.OptionName] = item.OptionValue
}
}

View File

@ -1,5 +0,0 @@
package converter
func GetFooterOrHeaderParams(v string) string {
return "" + v +""
}

View File

@ -1,5 +0,0 @@
package converter
func GetFooterOrHeaderParams(v string) string {
return v
}

View File

@ -154,6 +154,15 @@ func (m *Option) Init() error {
}
}
if !o.QueryTable(m.TableNameWithPrefix()).Filter("option_name", "site_beian").Exist() {
option := NewOption()
option.OptionValue = ""
option.OptionName = "site_beian"
option.OptionTitle = "域名备案"
if _, err := o.Insert(option); err != nil {
return err
}
}
return nil
}

View File

@ -611,22 +611,22 @@ textarea{
}
.footer .container .row{
margin-left: 220px;
border-top: 2px solid #DDDDD9;
padding-top: 20px;
opacity : 0.8;
font-size: 13px;
}
.footer .container .border-top{
border-top: 2px solid #DDDDD9;
}
.manual-container .footer .container .row{
margin-left: 0;
}
.footer li {
display: inline-block;
}
.footer li a{
.footer a{
color: #222;
text-decoration: none;
}
.footer li a:hover {
.footer a:hover {
color: #2b85ae
}
@media screen and (max-width: 840px) {

View File

@ -43,23 +43,27 @@
</div>
<div class="box-body">
<form method="post" id="gloablEditForm" action="{{urlfor "ManagerController.Setting"}}">
<div class="form-group">
<label>网站标题</label>
<input type="text" class="form-control" name="SITE_NAME" id="siteName" placeholder="网站标题" value="{{.SITE_NAME.OptionValue}}">
</div>
<div class="form-group">
<label>网站标题</label>
<input type="text" class="form-control" name="SITE_NAME" id="siteName" placeholder="网站标题" value="{{.SITE_NAME}}">
</div>
<div class="form-group">
<label>域名备案</label>
<input type="text" class="form-control" name="site_beian" id="siteName" placeholder="域名备案" value="{{.site_beian}}" maxlength="50">
</div>
<div class="form-group">
<label>网站描述</label>
<textarea rows="3" class="form-control" name="site_description" style="height: 90px" placeholder="网站描述">{{.site_description.OptionValue}}</textarea>
<textarea rows="3" class="form-control" name="site_description" style="height: 90px" placeholder="网站描述">{{.site_description}}</textarea>
<p class="text">描述信息不超过500个字符</p>
</div>
<div class="form-group">
<label>启用匿名访问</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .ENABLE_ANONYMOUS.OptionValue "true"}}checked{{end}} name="ENABLE_ANONYMOUS" value="true">开启<span class="text"></span>
<input type="radio" {{if eq .ENABLE_ANONYMOUS "true"}}checked{{end}} name="ENABLE_ANONYMOUS" value="true">开启<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .ENABLE_ANONYMOUS.OptionValue "false"}}checked{{end}} name="ENABLE_ANONYMOUS" value="false">关闭<span class="text"></span>
<input type="radio" {{if eq .ENABLE_ANONYMOUS "false"}}checked{{end}} name="ENABLE_ANONYMOUS" value="false">关闭<span class="text"></span>
</label>
</div>
</div>
@ -67,10 +71,10 @@
<label>启用注册</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .ENABLED_REGISTER.OptionValue "true"}}checked{{end}} name="ENABLED_REGISTER" value="true">开启<span class="text"></span>
<input type="radio" {{if eq .ENABLED_REGISTER "true"}}checked{{end}} name="ENABLED_REGISTER" value="true">开启<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .ENABLED_REGISTER.OptionValue "false"}}checked{{end}} name="ENABLED_REGISTER" value="false">关闭<span class="text"></span>
<input type="radio" {{if eq .ENABLED_REGISTER "false"}}checked{{end}} name="ENABLED_REGISTER" value="false">关闭<span class="text"></span>
</label>
</div>
</div>
@ -78,10 +82,10 @@
<label>启用验证码</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .ENABLED_CAPTCHA.OptionValue "true"}}checked{{end}} name="ENABLED_CAPTCHA" value="true">开启<span class="text"></span>
<input type="radio" {{if eq .ENABLED_CAPTCHA "true"}}checked{{end}} name="ENABLED_CAPTCHA" value="true">开启<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .ENABLED_CAPTCHA.OptionValue "false"}}checked{{end}} name="ENABLED_CAPTCHA" value="false">关闭<span class="text"></span>
<input type="radio" {{if eq .ENABLED_CAPTCHA "false"}}checked{{end}} name="ENABLED_CAPTCHA" value="false">关闭<span class="text"></span>
</label>
</div>
</div>
@ -89,13 +93,14 @@
<label>启用文档历史</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .ENABLE_DOCUMENT_HISTORY.OptionValue "true"}}checked{{end}} name="ENABLE_DOCUMENT_HISTORY" value="true">开启<span class="text"></span>
<input type="radio" {{if eq .ENABLE_DOCUMENT_HISTORY "true"}}checked{{end}} name="ENABLE_DOCUMENT_HISTORY" value="true">开启<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .ENABLE_DOCUMENT_HISTORY.OptionValue "false"}}checked{{end}} name="ENABLE_DOCUMENT_HISTORY" value="false">关闭<span class="text"></span>
<input type="radio" {{if eq .ENABLE_DOCUMENT_HISTORY "false"}}checked{{end}} name="ENABLE_DOCUMENT_HISTORY" value="false">关闭<span class="text"></span>
</label>
</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>

View File

@ -1,13 +1,16 @@
<div class="footer">
<div class="container">
<div class="row text-center">
<ul>
<li><a href="https://www.iminho.me">MinDoc</a></li>
<li>&nbsp;·&nbsp;</li>
<li><a href="https://github.com/lifei6671/mindoc/issues" target="_blank">意见反馈</a> </li>
<li>&nbsp;·&nbsp;</li>
<li><a href="https://github.com/lifei6671/mindoc">Github</a> </li>
</ul>
<div class="row text-center border-top">
<span><a href="https://www.iminho.me">MinDoc</a></span>
<span>&nbsp;·&nbsp;</span>
<span><a href="https://github.com/lifei6671/mindoc/issues" target="_blank">意见反馈</a></span>
<span>&nbsp;·&nbsp;</span>
<span><a href="https://github.com/lifei6671/mindoc">Github</a></span>
</div>
{{if ne .site_beian ""}}
<div class="row text-center">
<a href="http://www.miitbeian.gov.cn">{{.site_beian}}</a>
</div>
{{end}}
</div>
</div>