diff --git a/assets/template/navbar-bootstrap5.html b/assets/template/navbar-bootstrap5.html index 4bfa2ff..ae30044 100755 --- a/assets/template/navbar-bootstrap5.html +++ b/assets/template/navbar-bootstrap5.html @@ -48,7 +48,7 @@ {{end}} diff --git a/assets/template/navbar.html b/assets/template/navbar.html index 8bacd9b..b12fb4a 100755 --- a/assets/template/navbar.html +++ b/assets/template/navbar.html @@ -47,7 +47,7 @@ {{end}} diff --git a/assets/template/reviewstatus.html b/assets/template/reviewstatus.html index 28300f6..fb7a01a 100755 --- a/assets/template/reviewstatus.html +++ b/assets/template/reviewstatus.html @@ -8,20 +8,28 @@
@@ -36,20 +44,20 @@
{{range .Reviews}}
-
+
{{.Project}} {{.Name}} - {{.Task}} - {{.AuthorNameKor}} + {{.Task}} + {{.AuthorNameKor}} {{if gt .MainVersion 0 }} - v{{ProductionVersionFormat .MainVersion}} + v{{ProductionVersionFormat .MainVersion}} {{end}} {{if gt .SubVersion 0 }} - w{{ProductionVersionFormat .SubVersion}} + w{{ProductionVersionFormat .SubVersion}} {{end}} - {{.ItemStatus}} + {{.ItemStatus}} {{if ne .ProcessStatus "done"}} - {{.ProcessStatus}} + {{.ProcessStatus}} {{end}}
@@ -111,14 +119,14 @@
Description
- +
- +
- +
@@ -126,14 +134,14 @@
Description
- {{range .Status}} {{end}}
- Comment + Comment
@@ -141,7 +149,7 @@
Description
-
+
diff --git a/db_review.go b/db_review.go index 8bb207d..234411b 100644 --- a/db_review.go +++ b/db_review.go @@ -107,11 +107,10 @@ func searchReview(session *mgo.Session, searchword string) ([]Review, error) { continue } orQueries := []bson.M{} - if strings.HasPrefix(word, "daily:") { - if strings.TrimPrefix(word, "daily:") == "" { - return results, nil + if strings.HasPrefix(word, "createtime:") { + if strings.TrimPrefix(word, "createtime:") != "" { + orQueries = append(orQueries, bson.M{"createtime": &bson.RegEx{Pattern: strings.TrimPrefix(word, "createtime:")}}) } - orQueries = append(orQueries, bson.M{"createtime": &bson.RegEx{Pattern: strings.TrimPrefix(word, "daily:")}}) } else if strings.HasPrefix(word, "status:") { orQueries = append(orQueries, bson.M{"status": &bson.RegEx{Pattern: strings.TrimPrefix(word, "status:")}}) } else if strings.HasPrefix(word, "itemstatus:") { @@ -126,12 +125,14 @@ func searchReview(session *mgo.Session, searchword string) ([]Review, error) { orQueries = append(orQueries, bson.M{"project": &bson.RegEx{Pattern: word}}) orQueries = append(orQueries, bson.M{"name": &bson.RegEx{Pattern: word}}) orQueries = append(orQueries, bson.M{"task": &bson.RegEx{Pattern: word}}) - orQueries = append(orQueries, bson.M{"createtime": &bson.RegEx{Pattern: word}}) orQueries = append(orQueries, bson.M{"updatetime": &bson.RegEx{Pattern: word}}) orQueries = append(orQueries, bson.M{"author": &bson.RegEx{Pattern: word}}) orQueries = append(orQueries, bson.M{"path": &bson.RegEx{Pattern: word}}) orQueries = append(orQueries, bson.M{"description": &bson.RegEx{Pattern: word}}) } + if len(orQueries) == 0 { + return results, nil + } allQueries = append(allQueries, bson.M{"$or": orQueries}) } q := bson.M{"$and": allQueries} diff --git a/handler_review.go b/handler_review.go index f029597..55f1a95 100644 --- a/handler_review.go +++ b/handler_review.go @@ -28,7 +28,7 @@ func handleDailyReviewStatus(w http.ResponseWriter, r *http.Request) { } today := time.Now().Format("2006-01-02") // 오늘날짜를 구하고 리다이렉트한다. - http.Redirect(w, r, "/reviewstatus?searchword=daily:"+today, http.StatusSeeOther) + http.Redirect(w, r, "/reviewstatus?searchword=createtime:"+today, http.StatusSeeOther) } // handleReviewData 함수는 리뷰 영상데이터를 전송한다. @@ -92,7 +92,9 @@ func handleReviewStatusSubmit(w http.ResponseWriter, r *http.Request) { searchword := r.FormValue("searchword") reviewProject := r.FormValue("reviewproject") itemStatus := r.FormValue("itemstatus") - redirectURL := fmt.Sprintf("/reviewstatus?searchword=%s&project=%s&itemstatus=%s", searchword, reviewProject, itemStatus) + createtime := r.FormValue("review-createtime") + task := r.FormValue("review-task") + redirectURL := fmt.Sprintf("/reviewstatus?searchword=%s&project=%s&itemstatus=%s&createtime=%s&task=%s", searchword, reviewProject, itemStatus, createtime, task) http.Redirect(w, r, redirectURL, http.StatusSeeOther) } @@ -277,12 +279,17 @@ func handleReviewStatus(w http.ResponseWriter, r *http.Request) { TasksettingNames []string Project string ItemStatus string + Createtime string + Task string Setting } rcp := recipe{} rcp.Setting = CachedAdminSetting rcp.Project = q.Get("project") rcp.ItemStatus = q.Get("itemstatus") + rcp.Createtime = q.Get("createtime") + rcp.Task = q.Get("task") + rcp.Searchword = q.Get("searchword") id := q.Get("id") err = rcp.SearchOption.LoadCookie(session, r) @@ -313,7 +320,9 @@ func handleReviewStatus(w http.ResponseWriter, r *http.Request) { } rcp.Searchword = setSearchFilter(rcp.Searchword, "project", rcp.Project) rcp.Searchword = setSearchFilter(rcp.Searchword, "itemstatus", rcp.ItemStatus) - + rcp.Searchword = setSearchFilter(rcp.Searchword, "task", rcp.Task) + rcp.Searchword = setSearchFilter(rcp.Searchword, "createtime", rcp.Createtime) + rcp.Reviews, err = searchReview(session, rcp.Searchword) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError)