fixed infinite comment length
This commit is contained in:
@@ -24,7 +24,7 @@ type Comment struct {
|
|||||||
gorm.Model
|
gorm.Model
|
||||||
Id uint `json:"id" gorm:"primaryKey, AUTO_INCREMENT"`
|
Id uint `json:"id" gorm:"primaryKey, AUTO_INCREMENT"`
|
||||||
Date string `json:"date" gorm:"default:NOW()"`
|
Date string `json:"date" gorm:"default:NOW()"`
|
||||||
Author string `json:"author" form:"author"`
|
Author string `json:"author" form:"author" gorm:"type:varchar(50)"`
|
||||||
Content string `json:"content" form:"content"`
|
Content string `json:"content" form:"content" gorm:"type:varchar(500)"`
|
||||||
AssociatedPost string
|
AssociatedPost string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
<h4>Leave a comment!</h4>
|
<h4>Leave a comment!</h4>
|
||||||
<form method="POST" action="/blog/post/comment">
|
<form method="POST" action="/blog/post/comment">
|
||||||
<input type="text" placeholder="Name" name="author"/>
|
<input type="text" placeholder="Name" maxlength="50" name="author"/>
|
||||||
<input type="field" placeholder="Comment" name="content" />
|
<input type="field" placeholder="Comment" maxlength="500" name="content" />
|
||||||
<input type="text" style="display: none;" name="url" value="{{ .Url }}" readonly />
|
<input type="text" style="display: none;" name="url" value="{{ .Url }}" readonly />
|
||||||
<button type="submit">Post</button>
|
<button type="submit">Post</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user