Fixed a crash bug caused by the previous commit.
Renamed a few templates. Added the required attribute to a few form inputs.
This commit is contained in:
parent
409719d10e
commit
34b02336ed
|
@ -225,7 +225,7 @@ var topic_85 []byte = []byte(`
|
|||
<input name="tid" value='`)
|
||||
var topic_86 []byte = []byte(`' type="hidden" />
|
||||
<div class="formrow real_first_child">
|
||||
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
|
||||
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here" required></textarea></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem"><button name="reply-button" class="formbutton">Create Reply</button></div>
|
||||
|
@ -408,7 +408,7 @@ var topic_alt_86 []byte = []byte(`
|
|||
<input name="tid" value='`)
|
||||
var topic_alt_87 []byte = []byte(`' type="hidden" />
|
||||
<div class="formrow">
|
||||
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
|
||||
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here" required></textarea></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem"><button name="reply-button" class="formbutton">Create Reply</button></div>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<form action="/user/edit/avatar/submit/" method="post" enctype="multipart/form-data">
|
||||
<div class="formrow real_first_child">
|
||||
<div class="formitem formlabel"><a>Upload Avatar</a></div>
|
||||
<div class="formitem"><input name="account-avatar" type="file" /></div>
|
||||
<div class="formitem"><input name="account-avatar" type="file" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem"><button name="account-button" class="formbutton">Update</button></div>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>New Username</a></div>
|
||||
<div class="formitem"><input name="account-new-username" type="text" /></div>
|
||||
<div class="formitem"><input name="account-new-username" type="text" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem"><button name="account-button" class="formbutton form_middle_button">Update</button></div>
|
||||
|
|
|
@ -8,15 +8,15 @@
|
|||
<form action="/user/edit/critical/submit/" method="post">
|
||||
<div class="formrow real_first_child">
|
||||
<div class="formitem formlabel"><a>Current Password</a></div>
|
||||
<div class="formitem"><input name="account-current-password" type="password" placeholder="*****" /></div>
|
||||
<div class="formitem"><input name="account-current-password" type="password" placeholder="*****" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>New Password</a></div>
|
||||
<div class="formitem"><input name="account-new-password" type="password" placeholder="*****" /></div>
|
||||
<div class="formitem"><input name="account-new-password" type="password" placeholder="*****" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>Confirm Password</a></div>
|
||||
<div class="formitem"><input name="account-confirm-password" type="password" placeholder="*****" /></div>
|
||||
<div class="formitem"><input name="account-confirm-password" type="password" placeholder="*****" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem"><button name="account-button" class="formbutton form_middle_button">Update</button></div>
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>Topic Name</a></div>
|
||||
<div class="formitem"><input name="topic-name" type="text" placeholder="Topic Name" /></div>
|
||||
<div class="formitem"><input name="topic-name" type="text" placeholder="Topic Name" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>Content</a></div>
|
||||
<div class="formitem"><textarea class="large" name="topic-content" placeholder="Insert content here"></textarea></div>
|
||||
<div class="formitem"><textarea class="large" name="topic-content" placeholder="Insert content here" required></textarea></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem"><button name="topic-button" class="formbutton form_middle_button">Create Topic</button></div>
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
<form action="/accounts/login/submit/" method="post">
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>Account Name</a></div>
|
||||
<div class="formitem"><input name="username" type="text" placeholder="Account Name" /></div>
|
||||
<div class="formitem"><input name="username" type="text" placeholder="Account Name" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>Password</a></div>
|
||||
<div class="formitem"><input name="password" type="password" autocomplete="current-password" placeholder="*****" /></div>
|
||||
<div class="formitem"><input name="password" type="password" autocomplete="current-password" placeholder="*****" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem"><button name="login-button" class="formbutton">Login</div>
|
||||
|
|
|
@ -8,19 +8,19 @@
|
|||
<form action="/accounts/create/submit/" method="post">
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>Account Name</a></div>
|
||||
<div class="formitem"><input name="username" type="text" placeholder="Account Name" /></div>
|
||||
<div class="formitem"><input name="username" type="text" placeholder="Account Name" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>Email</a></div>
|
||||
<div class="formitem"><input name="email" type="email" placeholder="joe.doe@example.com" /></div>
|
||||
<div class="formitem"><input name="email" type="email" placeholder="joe.doe@example.com" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>Password</a></div>
|
||||
<div class="formitem"><input name="password" type="password" autocomplete="new-password" placeholder="*****" /></div>
|
||||
<div class="formitem"><input name="password" type="password" autocomplete="new-password" placeholder="*****" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem formlabel"><a>Confirm Password</a></div>
|
||||
<div class="formitem"><input name="confirm_password" type="password" placeholder="*****" /></div>
|
||||
<div class="formitem"><input name="confirm_password" type="password" placeholder="*****" required /></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem"><button name="register-button" class="formbutton">Create Account</div></div>
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
<form action="/reply/create/" method="post">
|
||||
<input name="tid" value='{{.Topic.ID}}' type="hidden" />
|
||||
<div class="formrow real_first_child">
|
||||
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
|
||||
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here" required></textarea></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem"><button name="reply-button" class="formbutton">Create Reply</button></div>
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
<form action="/reply/create/" method="post">
|
||||
<input name="tid" value='{{.Topic.ID}}' type="hidden" />
|
||||
<div class="formrow">
|
||||
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
|
||||
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here" required></textarea></div>
|
||||
</div>
|
||||
<div class="formrow">
|
||||
<div class="formitem"><button name="reply-button" class="formbutton">Create Reply</button></div>
|
||||
|
|
6
user.go
6
user.go
|
@ -351,7 +351,7 @@ func words_to_score(wcount int, topic bool) (score int) {
|
|||
score = 1
|
||||
}
|
||||
|
||||
settings := settingBox.Load().(map[string]interface{})
|
||||
settings := settingBox.Load().(SettingBox)
|
||||
if wcount >= settings["megapost_min_words"].(int) {
|
||||
score += 4
|
||||
} else if wcount >= settings["bigpost_min_words"].(int) {
|
||||
|
@ -371,7 +371,7 @@ func increase_post_user_stats(wcount int, uid int, topic bool, user User) error
|
|||
base_score = 2
|
||||
}
|
||||
|
||||
settings := settingBox.Load().(map[string]interface{})
|
||||
settings := settingBox.Load().(SettingBox)
|
||||
if wcount >= settings["megapost_min_words"].(int) {
|
||||
_, err := increment_user_megaposts_stmt.Exec(1,1,1,uid)
|
||||
if err != nil {
|
||||
|
@ -411,7 +411,7 @@ func decrease_post_user_stats(wcount int, uid int, topic bool, user User) error
|
|||
base_score = -2
|
||||
}
|
||||
|
||||
settings := settingBox.Load().(map[string]interface{})
|
||||
settings := settingBox.Load().(SettingBox)
|
||||
if wcount >= settings["megapost_min_words"].(int) {
|
||||
_, err := increment_user_megaposts_stmt.Exec(-1,-1,-1,uid)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue