|
On August 25 2015 21:18 rsoultin wrote:i think we broke this  again
I saw the voting thread. Onegu needed to have put the Day 3 post right after the Night 2 post. As it is, anyone that is between the first and second Night 2 posts will not have their votes counted. In general, you just do those posts consecutively right after EoD unless you know for some reason you have night voting which no normal will ever have and even few themed games will.
|
That's the problem with voting threads... Less natural to include phase change posts :D
|
ay 3
|
nh...hopefully that'll fix it; if it doesn't i guess i can reenter info again after all my classes lol @.@
|
Even if you edit in the Day 3 post, you still need to re-enter the game since the tool only scan through posts that it hasn't scanned before (meaning that the D3 post is just skipped).
|
On August 25 2015 19:16 Xatalos wrote:Okay  Assuming you've made a fork, you can then just copy your changes to the actual forked folder and make a pull request. If there's something you noticed to fix/add, I mean. Right now there are a couple of issues remaining that could be nice to fix at some point (if you wanted ideas haha): 1) Ordering for the votecount targets (by the amount of voters they have) 2) Get night start games working (currently you can work around the issue by simply not making a correctly formatted N0 post, but naturally it would be nicer if everything worked automatically) 3) Some sort of authentication system (perhaps just requiring some single password for editing the database?) 4) A button for adding new players to a game or something like that
Aye, #4 was the first thing I was going to do. I have the form made, I just need to figure out how to do the clojure stuff on the back end Like, I mostly understand what's going on, but it's still a little confusing about what I actually need lol.
On August 25 2015 19:38 Xatalos wrote: Oh, and about the migrations script... If you want to try running your own Heroku app, then I think it went something like just running the "(migrations)" command once you've loaded the functions in migrations.clj. That should create the tables...
Yea, After I pushed to heroku, i would do "heroku run lein repl" and then "(use 'lobo.core)" then "(migrations)"
But that didn't seem to work.
|
Hmmm... Not sure why then....
I'm not really 100% sure how I'd go about the "adding players", but I'd imagine you could look at how I managed to get the "delete player" and "delete game" functions working (you need a JavaScript function, a route in models.clj, and functions in player.clj and models.clj I'd assume?).
|
Or maybe just a name view file (something like "create_player.clj" like "create_game.clj"?)
|
|
Yea, I have the javascript part done.
In home.clj, I added "(POST "/add-player" [name] (player/add-player name))"
In player.clj, I added "(defn add-player [name] (models/add-player name))"
Then in models.clj I added "(defn add-player [name] (insert player (values name)))"
In the javascript, I call $.post("/add-player", player) where player is an object like {name: "keir"}. However, I get a 404 when I try to run it. I'm not entirely sure why, so it'll take some playing around. Clojure seems kind of hard to debug though
|
The problem might be with the JS part if you get a 404... (wild guess) or possibly with the route?
What is the "player" even, a string, object? The other calls were like this $.post("/delete-game", {id: id});
|
Wait... actually, you also need to include which game the player belongs to (game id).
|
Oh... Apparently the migrations command was (migrate), not (migrations). You could try that instead.
|
And dunno if your HTML link is correct, but you can look at the delete-player / delete-game links for reference
|
On August 26 2015 03:22 Xatalos wrote: The problem might be with the JS part if you get a 404... (wild guess) or possibly with the route?
What is the "player" even, a string, object? The other calls were like this $.post("/delete-game", {id: id}); I said in the post that "player" was an object of the form {name: "keir"} 
How it generates the object is: var player = {"name": document.getElementById("newPlayer").value}.
The newPlayer element is the input box for the player name, of course.
So my call is basically exactly like yours: $.post("/add-player", {name: "keir"}); I'm nearly 100% positive that part is right. Something is wrong with the routing or handling of it in clojure though.
On August 26 2015 03:29 Xatalos wrote: Wait... actually, you also need to include which game the player belongs to (game id).
Yea I realized that when I actually poked around in the database. The player schema has id, game, and name.
Oh herp derp, I figured out the problem with the routing. In the home.clj file that defines the routes, I forgot missed the closing parenthesis on defroutes. So my route wasn't being added 
Would be nice if that threw some kind of error though, instead of compiling and leaving my scratching my head as to why it wasn't working.
Anyways, i added the game id to the add-player calls, etc, and it seems to be working correctly now. When I push the submid button for the form, keir gets added to the db.
I'll clean it up and throw up a pull request soon.
|
Nice. If you want to do the fuzzy matching thing (I think it was you who suggested it?) then go ahead :D I guess on the JS side?
|
So, I'm looking at the pull request before I submit it, but there's a lot of stuff that doesn't need to be merged. I'm not sure how to exclude stuff from the pull request, though. If you're not sure what stuff should be merged, let me know.
There are a couple of things I still want to do:
1) Order the vote counts correctly
2) Add a button to reset the "current post" counter or whatever. Basically force the scanner to do a whole thread rescan, so if something happens again like in Personality again where the host forgets to do the phase change post in the voting thread, they can post it, then his the rescan button and the app will start over scanning from the front again.
Basically, anytime you have to delete a game and re-add it is annoying. I'd like to eliminate the problems that currently make you do that.
3) Fuzzy matching.
|
Hmm... I fear Day 3 of your game might be a lost cause because you can't edit in the Day 3 post properly..... Maybe just count manually for now and then return to the tool by adding Night 4 and Day 4 posts properly?
|
Ok, nice. I guess everything but the database related changes should be merged?
|
I made notes on what should be merged in the pull request.
But yea, basically everything except the gitignore stuff, anything related to db, and the system.properties file.
|
|
|
|