From b5d46c75bc0dd560e625d34493cec8f36d28a58e Mon Sep 17 00:00:00 2001 From: polaris1119 Date: Sat, 23 Jun 2018 17:51:29 +0800 Subject: [PATCH 001/140] =?UTF-8?q?updated=5Fat=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=A2=91=E7=B9=81=EF=BC=8C=E4=B8=8D=E9=80=82=E5=90=88=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20atom=20=E7=9A=84=20updated=5Fat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/solr_schema.xml | 224 +++++++++++++++++----------------- src/http/controller/feed.go | 2 +- template/articles/detail.html | 23 ++-- 3 files changed, 126 insertions(+), 123 deletions(-) diff --git a/config/solr_schema.xml b/config/solr_schema.xml index 12c3c40c..7a6550f1 100644 --- a/config/solr_schema.xml +++ b/config/solr_schema.xml @@ -16,10 +16,10 @@ limitations under the License. --> - @@ -67,7 +67,7 @@ + --> - + + --> @@ -146,7 +146,7 @@ - + @@ -166,11 +166,11 @@ --> - + @@ -208,16 +208,16 @@ - + - - id @@ -244,18 +244,18 @@ - - - + - - + + + --> - + @@ -610,7 +610,7 @@ @@ -642,7 +642,7 @@ - @@ -656,12 +656,12 @@ + any data added to them will be ignored outright. --> - + - + @@ -721,26 +721,26 @@ - - + + - - + + - + - + - + - + @@ -767,27 +767,27 @@ - + - + - + - + - + - + - + @@ -797,10 +797,10 @@ - + - + @@ -808,10 +808,10 @@ - + - + @@ -819,17 +819,17 @@ - + - + - + @@ -842,10 +842,10 @@ - + - + @@ -853,10 +853,10 @@ - + - + @@ -867,10 +867,10 @@ - + - + @@ -881,10 +881,10 @@ - + - + @@ -892,10 +892,10 @@ - + - + @@ -906,31 +906,31 @@ - + - + - + - + - + - + - + @@ -938,10 +938,10 @@ - + - + @@ -951,11 +951,11 @@ - + @@ -1004,20 +1004,20 @@ - + - + - + - + @@ -1025,10 +1025,10 @@ - + - + @@ -1038,10 +1038,10 @@ - + - + @@ -1051,20 +1051,20 @@ - + - + - + - + @@ -1072,10 +1072,10 @@ - + - + @@ -1083,19 +1083,19 @@ - + - + - + - + @@ -1113,8 +1113,8 @@ - \ No newline at end of file + diff --git a/src/http/controller/feed.go b/src/http/controller/feed.go index b4d116e1..1d4506bd 100644 --- a/src/http/controller/feed.go +++ b/src/http/controller/feed.go @@ -80,7 +80,7 @@ func (self FeedController) List(ctx echo.Context) error { Author: &feeds.Author{Name: doc.Author}, Description: doc.Content, Created: time.Time(doc.SortTime), - Updated: time.Time(doc.UpdatedAt), + Updated: time.Time(doc.SortTime), } } diff --git a/template/articles/detail.html b/template/articles/detail.html index 98c610f8..6da27c59 100644 --- a/template/articles/detail.html +++ b/template/articles/detail.html @@ -38,8 +38,8 @@

{{.article.AuthorTxt}} {{end}} {{end}} - · · {{.article.Viewnum}} 次点击 · - · + · · {{.article.Viewnum}} 次点击 · + · 开始浏览     {{if canEdit .me .article}} {{if .article.Markdown}} @@ -56,7 +56,7 @@

{{if .article.Markdown}}
{{.article.Content}}
- + {{if .article.GCTT}}

via: {{.article_gctt.URL}}

@@ -92,10 +92,10 @@

{{end}} - +
{{.article.Viewnum}} 次点击  {{if .article.Likenum}}∙  {{.article.Likenum}} 赞   {{end}}
- {{if .hadcollect}}取消收藏{{else}}加入收藏{{end}} + {{if .hadcollect}}取消收藏{{else}}加入收藏{{end}} 微博
{{if .likeflag}}取消赞{{else}}赞{{end}} @@ -155,7 +155,7 @@

{{template "comment" .}} {{include "common/view_stat.html" .}} - +

@@ -171,7 +171,7 @@

{{end}} {{include "sidebar/view_rank.html" (parseJSON `{"rank_title":"今日阅读排行","objtype":1,"limit":10,"rank_type":"today"}`)}} - + {{if .pos_ad.right2}}

@@ -196,6 +196,9 @@

{{end}} {{define "css"}} + {{if .article.Css}} @@ -222,10 +225,10 @@

{{if .article.Markdown}} new SG.Articles().parseContent($('.page .content')); {{end}} - + // 文本框自动伸缩 $('.need-autogrow').autoGrow(); - + loadComments(); // 文章链接,在本站的 iframe 中打开 From e48abd9b8f9011f4dc3610cfdd2e78fd9163cfae Mon Sep 17 00:00:00 2001 From: polaris1119 Date: Mon, 25 Jun 2018 22:58:03 +0800 Subject: [PATCH 002/140] =?UTF-8?q?feed=20=E9=81=BF=E5=85=8D=E9=87=8D?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/solr_schema.xml | 1 + src/http/controller/feed.go | 4 ++-- src/model/document.go | 5 +++++ template/common/layout.html | 12 ++++++------ template/sidebar/concern.html | 3 ++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/config/solr_schema.xml b/config/solr_schema.xml index 7a6550f1..e3e931b1 100644 --- a/config/solr_schema.xml +++ b/config/solr_schema.xml @@ -145,6 +145,7 @@ + diff --git a/src/http/controller/feed.go b/src/http/controller/feed.go index 1d4506bd..34da4cb5 100644 --- a/src/http/controller/feed.go +++ b/src/http/controller/feed.go @@ -79,8 +79,8 @@ func (self FeedController) List(ctx echo.Context) error { Link: &feeds.Link{Href: url}, Author: &feeds.Author{Name: doc.Author}, Description: doc.Content, - Created: time.Time(doc.SortTime), - Updated: time.Time(doc.SortTime), + Created: time.Time(doc.CreatedAt), + Updated: time.Time(doc.CreatedAt), } } diff --git a/src/model/document.go b/src/model/document.go index d98fffe4..90199cdc 100644 --- a/src/model/document.go +++ b/src/model/document.go @@ -32,6 +32,7 @@ type Document struct { Lastreplyuid int `json:"lastreplyuid"` Lastreplytime OftenTime `json:"lastreplytime"` + CreatedAt OftenTime `json:"created_at"` UpdatedAt OftenTime `json:"updated_at"` // 排序用的时间 @@ -88,6 +89,7 @@ func NewDocument(object interface{}, objectExt interface{}) *Document { Top: objdoc.Top, Lastreplyuid: objdoc.Lastreplyuid, Lastreplytime: objdoc.Lastreplytime, + CreatedAt: objdoc.Ctime, UpdatedAt: objdoc.Mtime, SortTime: sortTime, } @@ -123,6 +125,7 @@ func NewDocument(object interface{}, objectExt interface{}) *Document { Top: objdoc.Top, Lastreplyuid: objdoc.Lastreplyuid, Lastreplytime: objdoc.Lastreplytime, + CreatedAt: objdoc.Ctime, UpdatedAt: objdoc.Mtime, SortTime: sortTime, } @@ -162,6 +165,7 @@ func NewDocument(object interface{}, objectExt interface{}) *Document { Top: 0, Lastreplyuid: objdoc.Lastreplyuid, Lastreplytime: objdoc.Lastreplytime, + CreatedAt: objdoc.Ctime, UpdatedAt: objdoc.Mtime, SortTime: sortTime, } @@ -193,6 +197,7 @@ func NewDocument(object interface{}, objectExt interface{}) *Document { Top: 0, Lastreplyuid: objdoc.Lastreplyuid, Lastreplytime: objdoc.Lastreplytime, + CreatedAt: objdoc.Ctime, UpdatedAt: objdoc.Mtime, SortTime: sortTime, } diff --git a/template/common/layout.html b/template/common/layout.html index aee046a2..513630ba 100644 --- a/template/common/layout.html +++ b/template/common/layout.html @@ -15,7 +15,7 @@ - + {{template "css" .}} @@ -137,10 +137,10 @@