Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto Pro
  • Loading branch information
SpotlightForBugs committed Aug 5, 2022
2 parents 74bc442 + 143813b commit fc6a8b1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
17 changes: 17 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,24 @@ def kill_player(name,rolle,name_kill):
file.write(name_kill)

return(render_template('Dashboards/Dash_Dorfbewohner.html'))


@app.route("/<name>/Armor_aktion/<player1>/<player2>") #player auswahl
def armor_player(player1, player2, name):
rolle = "Armor"

wort = name+" = "+rolle # create a string with the name and the role
file = open('rollen_log.txt', "r") # open the log file
players_vorhanden = file.read() # read the log file

if wort in players_vorhanden:
lover_one = player1
lover_two = player2

print(lover_one+" LIEBT "+lover_two)

return(render_template('Dashboards/Dash_Armor.html'))


##Übersicht der Spieler

Expand Down
16 changes: 12 additions & 4 deletions templates/Dashboards/Dash_Armor.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ <h2>Hallo, {{name}}</h2> <br>

<!--TODO- #21 Auswahl der beiden Partner:innen-->
<script>
let link = "";

let link = "../../{{name}}/{{rolle}}_aktion"
counter_link = 0;

function addToLink(nextString) {
counter_link++;
link = link.concat("/", nextString);
console.log(link);
if (counter_link == 2) {
window.location.href = link;
}
}
</script>

Expand All @@ -27,14 +31,18 @@ <h2>Hallo, {{name}}</h2> <br>

//name/rolle/partner1/partner2


console.log("test")
console.log("{{el}}");
var text = "{{el}}";

if (text.includes("Erzaehler")==false) {

document.write("<li><button onclick=addToLink({{el}}) class='chooseplayer' id='"+text+"' >"+text+"</p></button></li><br>");
document.write("<li><button class='chooseplayer' id='"+text+"' >"+text+"</p></button></li><br>");
btn = document.getElementById(text);
btn.addEventListener("click", function() {
console.log("{{el}}");
addToLink("{{el}}");
});
}


Expand Down

0 comments on commit fc6a8b1

Please sign in to comment.