File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ import (
8
8
"strings"
9
9
"time"
10
10
11
+ "net/http"
12
+
11
13
"github.com/dingoblog/dingo/app/utils"
12
14
"github.com/russross/meddler"
13
- "net/http"
14
15
)
15
16
16
17
const stmtGetPostById = `SELECT * FROM posts WHERE id = ?`
@@ -215,6 +216,7 @@ func (p *Post) Update() error {
215
216
216
217
func (p * Post ) UpdateFromRequest (r * http.Request ) {
217
218
p .Title = r .FormValue ("title" )
219
+ p .Image = r .FormValue ("image" )
218
220
p .Slug = r .FormValue ("slug" )
219
221
p .Markdown = r .FormValue ("content" )
220
222
p .Html = utils .Markdown2Html (p .Markdown )
Original file line number Diff line number Diff line change @@ -42,6 +42,13 @@ <h3><i class="material-icons f-left m-r-5">info</i> Content information</h3>
42
42
</ div >
43
43
</ div >
44
44
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
+
45
52
< div class ="mdl-cell mdl-cell--12-col mdl-cell--12-col-tablet mdl-cell--12-col-phone ">
46
53
< textarea name ="content " id ="content " class ="ipt "> {{Html .Post.Markdown}}</ textarea >
47
54
</ div >
You can’t perform that action at this time.
0 commit comments