Merge pull request #8 from br0xen/master

Fixed vote validation issue
This commit is contained in:
Brian Buller 2017-07-09 20:21:51 -05:00 committed by GitHub
commit 051d2542c4
3 changed files with 4 additions and 5 deletions

View File

@ -261,7 +261,6 @@ func InitPageData(w http.ResponseWriter, req *http.Request) *pageData {
if p.FlashClass == "" { if p.FlashClass == "" {
p.FlashClass = "hidden" p.FlashClass = "hidden"
} }
fmt.Println("Flash Message: " + p.FlashMessage + " (" + p.FlashClass + ")")
// Build the menu // Build the menu
if p.LoggedIn { if p.LoggedIn {

View File

@ -1,7 +1,6 @@
package main package main
import ( import (
"fmt"
"math/rand" "math/rand"
"net/http" "net/http"
"strings" "strings"
@ -37,7 +36,6 @@ func loadVotingPage(w http.ResponseWriter, req *http.Request) {
rand.Seed(time.Now().Unix()) rand.Seed(time.Now().Unix())
for len(tms) > 0 { for len(tms) > 0 {
i := rand.Intn(len(tms)) i := rand.Intn(len(tms))
fmt.Println("Chose Team: " + tms[i].Name)
vpd.Teams = append(vpd.Teams, tms[i]) vpd.Teams = append(vpd.Teams, tms[i])
tms = append(tms[:i], tms[i+1:]...) tms = append(tms[:i], tms[i+1:]...)
} }

View File

@ -268,9 +268,11 @@ function getRanked() {
function gameTableToArray(tbl) { function gameTableToArray(tbl) {
var ret = []; var ret = [];
var trs = snack.wrap('#'+tbl+'-table>tbody>tr') var trs = snack.wrap('#'+tbl+'-table>tbody>tr')
if(trs[0].length > 0) { if(trs.length > 0) {
trs.each(function(ele, idx) { trs.each(function(ele, idx) {
if(ele.dataset != null && ele.dataset.teamid != null) {
ret = ret.concat(getTeamObj(ele.dataset.teamid)); ret = ret.concat(getTeamObj(ele.dataset.teamid));
}
}); });
} }
return ret; return ret;