Skip to content

Commit 562bf05

Browse files
committed
增加提交收录的入口
1 parent cdd4ba8 commit 562bf05

6 files changed

Lines changed: 106 additions & 3 deletions

File tree

controllers/SubmitController.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package controllers
2+
3+
type SubmitController struct {
4+
BaseController
5+
}
6+
7+
func (this *SubmitController) Index() {
8+
this.Data["Title"] = "开源书籍和文档收录"
9+
this.Data["IsSubmit"] = true
10+
this.TplName = "submit/index.html"
11+
}
12+
13+
func (this *SubmitController) Post() {
14+
15+
}

models/submit_books.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package models
2+
3+
import "time"
4+
5+
type SubmitBooks struct {
6+
Id int
7+
Uid int
8+
Title string
9+
Url string
10+
UrlMd5 string `orm:"size(32);unique"`
11+
Message string `xorm:"size(512)"`
12+
Status bool
13+
CreatedAt time.Time
14+
UpdatedAt time.Time
15+
}

routers/web.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ func webRouter() {
1111
//beego.Router("/", &controllers.HomeController{}, "*:Index")
1212
beego.Router("/explore", &controllers.HomeController{}, "*:Index")
1313

14+
beego.Router("/submit", &controllers.SubmitController{}, "get:Index")
15+
beego.Router("/submit", &controllers.SubmitController{}, "post:Post")
16+
1417
beego.Router("/login", &controllers.AccountController{}, "*:Login")
1518
beego.Router("/login/:oauth", &controllers.AccountController{}, "*:Oauth")
1619
beego.Router("/logout", &controllers.AccountController{}, "*:Logout")

static/css/main.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,4 +828,12 @@ a{color: #333}
828828

829829
.lang-explore .text-muted{color: #999;}
830830
.lang-explore a{margin-left: 5px;margin-right: 3px;}
831-
.lang-explore a.active{color: #06f}
831+
.lang-explore a.active{color: #06f}
832+
.submit-book{margin-top: 90px;}
833+
.submit-book p{margin-bottom: 0;}
834+
.submit-book form{margin-bottom: 30px;}
835+
.submit-book .form-group{margin-bottom: 30px;}
836+
.submit-book h1{margin:0 0 50px;font-size: 30px;}
837+
.submit-book .right{border-left: 1px solid #EFEFEF;line-height: 180%;}
838+
.submit-book .right div{text-indent: 2em;}
839+
.submit-book .right strong,.submit-book .right h4{font-weight: normal;color: #000;}

views/submit/index.html

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
<head>
4+
{{template "widgets/head.html" .}}
5+
</head>
6+
<body>
7+
<div class="manual-reader manual-container">
8+
{{template "widgets/header.html" .}}
9+
<div class="container manual-body submit-book">
10+
<div class="row">
11+
<div class="col-xs-12 col-sm-6 left">
12+
<h1>开源书籍和文档收录</h1>
13+
<form role="form" method="post" action="{{urlfor "SubmitController.Post"}}" class="ajax-form">
14+
<div class="form-group">
15+
<label>书籍/文档名称 <span class="text-danger">*</span></label>
16+
<input type="text" name="title" class="form-control">
17+
<div class="help-block">书籍或文档的名称,以便书栈网小编视情况优先整理</div>
18+
</div>
19+
<div class="form-group">
20+
<label>书籍/文档地址 <span class="text-danger">*</span></label>
21+
<input type="text" name="url" class="form-control">
22+
<div class="help-block">书籍或文档的URL链接地址</div>
23+
</div>
24+
<div class="form-group">
25+
<label>留言</label>
26+
<textarea name="message" class="form-control" rows="5"></textarea>
27+
<div class="help-block">在这里,您可以简单介绍下书籍/文档的内容,或者是留下您想要个小编捎带的话</div>
28+
</div>
29+
<button type="submit" class="btn btn-default btn-block">提交收录</button>
30+
</form>
31+
</div>
32+
<div class="col-xs-12 col-sm-6 right">
33+
<h4>书栈介绍</h4>
34+
<div class="help-block">分享知识,共享智慧;知识,因分享,传承久远。书栈网,一个专注于开源书籍和文档知识分享的站点。</div>
35+
<h4>收录说明</h4>
36+
<div class="help-block">
37+
<div>您在阅读学习一门技术,但是文档排版和阅读体验太差?</div>
38+
<div>你们公司需要分发用户手册或者开发手册,增加外链以便SEO优化?</div>
39+
<div>您写了一本开源书籍或一系列博客,想要把所学所知分享给每一位读者?</div>
40+
<div>您在阅读外文开发文档,网速太慢或网络不稳定打不开?</div>
41+
<div><strong>我们帮您解决!</strong></div>
42+
<div>您只需要提交相关链接,我们来负责整理和排版,给你我以及每一位读者良好的阅读体验。</div>
43+
<div>书栈网内容转载分发,遵循 <strong>CC-BY-NC</strong><strong>知识共享-署名-非商用</strong>)协议,在转载分发过程中,注明来源,不作商用,并且保留内容中的打赏二维码和赞助链接。</div>
44+
</div>
45+
<h4>书栈开源</h4>
46+
<div class="help-block">
47+
<strong>书栈网 BookStack</strong>
48+
<p>Gitee: <a href="https://gitee.com/truthhun/bookstack" target="_blank">https://gitee.com/truthhun/bookstack</a></p>
49+
<p>GitHub: <a href="https://github.com/truthhun/bookstack" target="_blank">https://github.com/truthhun/bookstack</a></p>
50+
<div><strong>配套微信小程序 BookChat</strong></div>
51+
<p>Gitee: <a href="https://gitee.com/truthhun/BookChat" target="_blank">https://gitee.com/truthhun/BookChat</a></p>
52+
<p>GitHub: <a href="https://github.com/truthhun/bookchat" target="_blank">https://github.com/truthhun/bookchat</a></p>
53+
</div>
54+
</div>
55+
</div>
56+
</div>
57+
</div>
58+
{{template "widgets/footer.html" .}}
59+
</body>
60+
</html>

views/widgets/header.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@
6565
<li class="{{if .IsLabel}}active{{end}}">
6666
<a href="{{urlfor "LabelController.List" }}" title="标签"><i class="fa fa-tags"></i> 标签</a>
6767
</li>
68-
{{/*<li class="hidden-sm"><a href="https://www.bookstack.cn/books/adv" title="软文投稿"><i class="fa fa-check-square-o"></i> 软文<span class="hidden-md">投稿</span></a></li>*/}}
69-
<li><a href="https://gitee.com/TruthHun/BookStack" title="BookStack开源" target="_blank"><i class="fa fa-code"></i> 开源</a></li>
68+
<li class="{{if .IsSubmit}}active{{end}}">
69+
<a href="{{urlfor "SubmitController.Index" }}" title="收录"><i class="fa fa-check-square-o"></i> 收录</a>
70+
</li>
71+
<li class="hidden-sm"><a href="https://gitee.com/TruthHun/BookStack" title="BookStack开源" target="_blank"><i class="fa fa-code"></i> 开源</a></li>
7072
{{if .IsSearch}}
7173
<li class="active">
7274
<a href="{{urlfor "SearchController.Search" }}" title="搜索"><i class="fa fa-search"></i> 搜索</a>

0 commit comments

Comments
 (0)