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 class="number">
|
||||
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">
|
||||
<textarea class="edit-status" name="content" maxlength="140" placeholder="What project are you working on?" required autofocus>{{ .Content }}</textarea>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,14 +10,16 @@ type StatusForm struct {
|
|||
Content string
|
||||
Face string
|
||||
Error string
|
||||
}
|
||||
Number int }
|
||||
|
||||
func NewStatusForm(r *http.Request) *StatusForm {
|
||||
var id int64
|
||||
id, _ = strconv.ParseInt(r.FormValue("id"), 10, 64)
|
||||
number, _ := strconv.Atoi(r.FormValue("number"))
|
||||
return &StatusForm{
|
||||
Id: id,
|
||||
Content: r.FormValue("content"),
|
||||
Face: r.FormValue("face"),
|
||||
Number: number,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
<div class="number">
|
||||
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">
|
||||
<textarea class="edit-status" name="content" maxlength="140" placeholder="What project are you working on?" required autofocus>{{ .Content }}</textarea>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ func (h *Handler) saveStatus(w http.ResponseWriter, r *http.Request) {
|
|||
User: user,
|
||||
Content: f.Content,
|
||||
Face: f.Face,
|
||||
Number: f.Number,
|
||||
}
|
||||
if err := status.Validate(); err != nil {
|
||||
f.Error = err.Error()
|
||||
|
|
|
|||
Loading…
Reference in a new issue