gtjnfr;
This commit is contained in:
parent
863ab8cce7
commit
7da4c46e47
4 changed files with 6 additions and 3 deletions
|
|
@ -70,7 +70,7 @@ var TplCommonMap = map[string]string{
|
||||||
</div>
|
</div>
|
||||||
<div class="number">
|
<div class="number">
|
||||||
What's your current word count?
|
What's your current word count?
|
||||||
<input type="number" id="wordcount" name="word count" min="1" max="1000000000" required>
|
<input type="number" name="number" value="{{ .Number }}" min="1" max="1000000000" required>
|
||||||
<br><div class="field">
|
<br><div class="field">
|
||||||
<textarea class="edit-status" name="content" maxlength="140" placeholder="What project are you working on?" required autofocus>{{ .Content }}</textarea>
|
<textarea class="edit-status" name="content" maxlength="140" placeholder="What project are you working on?" required autofocus>{{ .Content }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,16 @@ type StatusForm struct {
|
||||||
Content string
|
Content string
|
||||||
Face string
|
Face string
|
||||||
Error string
|
Error string
|
||||||
}
|
Number int }
|
||||||
|
|
||||||
func NewStatusForm(r *http.Request) *StatusForm {
|
func NewStatusForm(r *http.Request) *StatusForm {
|
||||||
var id int64
|
var id int64
|
||||||
id, _ = strconv.ParseInt(r.FormValue("id"), 10, 64)
|
id, _ = strconv.ParseInt(r.FormValue("id"), 10, 64)
|
||||||
|
number, _ := strconv.Atoi(r.FormValue("number"))
|
||||||
return &StatusForm{
|
return &StatusForm{
|
||||||
Id: id,
|
Id: id,
|
||||||
Content: r.FormValue("content"),
|
Content: r.FormValue("content"),
|
||||||
Face: r.FormValue("face"),
|
Face: r.FormValue("face"),
|
||||||
|
Number: number,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="number">
|
<div class="number">
|
||||||
What's your current word count?
|
What's your current word count?
|
||||||
<input type="number" id="wordcount" name="word count" min="1" max="1000000000" required>
|
<input type="number" name="number" value="{{ .Number }}" min="1" max="1000000000" required>
|
||||||
<br><div class="field">
|
<br><div class="field">
|
||||||
<textarea class="edit-status" name="content" maxlength="140" placeholder="What project are you working on?" required autofocus>{{ .Content }}</textarea>
|
<textarea class="edit-status" name="content" maxlength="140" placeholder="What project are you working on?" required autofocus>{{ .Content }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ func (h *Handler) saveStatus(w http.ResponseWriter, r *http.Request) {
|
||||||
User: user,
|
User: user,
|
||||||
Content: f.Content,
|
Content: f.Content,
|
||||||
Face: f.Face,
|
Face: f.Face,
|
||||||
|
Number: f.Number,
|
||||||
}
|
}
|
||||||
if err := status.Validate(); err != nil {
|
if err := status.Validate(); err != nil {
|
||||||
f.Error = err.Error()
|
f.Error = err.Error()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue