Fixed an issue with relative times breaking onto multiple lines.
Fixed an issue with new reports not pushing the latest time onto the report forum. Editing topics no longer crashes Gosora. Mod action posts for topic edits now update the latest relative time for the topic's parent forum. The JS for the topic editor now locks onto the parent form properly.
This commit is contained in:
parent
166d96e3b2
commit
bfff7f3dee
@ -4,12 +4,14 @@ import (
|
||||
//"log"
|
||||
//"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
"net"
|
||||
"net/http"
|
||||
"html"
|
||||
)
|
||||
|
||||
func route_edit_topic(w http.ResponseWriter, r *http.Request, user User) {
|
||||
//log.Print("in route_edit_topic")
|
||||
err := r.ParseForm()
|
||||
if err != nil {
|
||||
PreError("Bad Form",w,r)
|
||||
@ -80,14 +82,13 @@ func route_edit_topic(w http.ResponseWriter, r *http.Request, user User) {
|
||||
InternalError(err,w)
|
||||
return
|
||||
}
|
||||
|
||||
_, err = add_replies_to_topic_stmt.Exec(1, tid)
|
||||
_, err = add_replies_to_topic_stmt.Exec(1, user.ID, tid)
|
||||
if err != nil {
|
||||
InternalError(err,w)
|
||||
return
|
||||
}
|
||||
_, err = update_forum_cache_stmt.Exec(topic_name, tid, user.Name, user.ID, 1)
|
||||
if err != nil {
|
||||
err = fstore.UpdateLastTopic(topic_name,tid,user.Name,user.ID,time.Now().Format("2006-01-02 15:04:05"),old_topic.ParentID)
|
||||
if err != nil && err != ErrNoRows {
|
||||
InternalError(err,w)
|
||||
return
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ $(document).ready(function(){
|
||||
else conn = false;
|
||||
|
||||
$(".open_edit").click(function(event){
|
||||
//console.log("Clicked on edit");
|
||||
//console.log("clicked on .open_edit");
|
||||
event.preventDefault();
|
||||
$(".hide_on_edit").hide();
|
||||
$(".show_on_edit").show();
|
||||
@ -197,6 +197,7 @@ $(document).ready(function(){
|
||||
|
||||
$(".topic_item .submit_edit").click(function(event){
|
||||
event.preventDefault();
|
||||
console.log("clicked on .topic_item .submit_edit");
|
||||
$(".topic_name").html($(".topic_name_input").val());
|
||||
$(".topic_content").html($(".topic_content_input").val());
|
||||
$(".topic_status_e:not(.open_edit)").html($(".topic_status_input").val());
|
||||
@ -207,9 +208,10 @@ $(document).ready(function(){
|
||||
var topic_name_input = $('.topic_name_input').val();
|
||||
var topic_status_input = $('.topic_status_input').val();
|
||||
var topic_content_input = $('.topic_content_input').val();
|
||||
var form_action = $(this).closest('form').attr("action");
|
||||
var form_action = this.form.getAttribute("action");
|
||||
//console.log("New Topic Name: " + topic_name_input);
|
||||
//console.log("New Topic Status: " + topic_status_input);
|
||||
//console.log("New Topic Content: " + topic_content_input);
|
||||
//console.log("Form Action: " + form_action);
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
|
@ -1312,8 +1312,8 @@ func route_report_submit(w http.ResponseWriter, r *http.Request, user User, site
|
||||
InternalError(err,w)
|
||||
return
|
||||
}
|
||||
_, err = update_forum_cache_stmt.Exec(title, lastId, user.Name, user.ID, fid)
|
||||
if err != nil {
|
||||
err = fstore.UpdateLastTopic(title,int(lastId),user.Name,user.ID,time.Now().Format("2006-01-02 15:04:05"),fid)
|
||||
if err != nil && err != ErrNoRows {
|
||||
InternalError(err,w)
|
||||
return
|
||||
}
|
||||
|
@ -473,6 +473,9 @@ input, select, textarea {
|
||||
.topic_list .rowitem:last-child {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.topic_list .lastReplyAt {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Profiles */
|
||||
#profile_left_lane {
|
||||
|
Loading…
Reference in New Issue
Block a user