Skip to content

Commit 264d8cd

Browse files
committed
Merge branch 'master' into fix_js
2 parents ad7284a + 08ecd07 commit 264d8cd

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app/model/post.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import (
88
"strings"
99
"time"
1010

11+
"net/http"
12+
1113
"github.com/dingoblog/dingo/app/utils"
1214
"github.com/russross/meddler"
13-
"net/http"
1415
)
1516

1617
const stmtGetPostById = `SELECT * FROM posts WHERE id = ?`
@@ -215,6 +216,7 @@ func (p *Post) Update() error {
215216

216217
func (p *Post) UpdateFromRequest(r *http.Request) {
217218
p.Title = r.FormValue("title")
219+
p.Image = r.FormValue("image")
218220
p.Slug = r.FormValue("slug")
219221
p.Markdown = r.FormValue("content")
220222
p.Html = utils.Markdown2Html(p.Markdown)

view/admin/edit_post.html

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ <h3><i class="material-icons f-left m-r-5">info</i> Content information</h3>
4242
</div>
4343
</div>
4444

45+
<div class="mdl-cell mdl-cell--12-col mdl-cell--12-col-tablet mdl-cell--12-col-phone">
46+
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label fullwidth">
47+
<input class="mdl-textfield__input" type="text" name="image" id="image" value="{{ .Post.Image }}">
48+
<label class="mdl-textfield__label" for="image">Cover Image</label>
49+
</div>
50+
</div>
51+
4552
<div class="mdl-cell mdl-cell--12-col mdl-cell--12-col-tablet mdl-cell--12-col-phone">
4653
<textarea name="content" id="content" class="ipt">{{Html .Post.Markdown}}</textarea>
4754
</div>

0 commit comments

Comments
 (0)