Commit 91bef4dd authored by Geovanny's avatar Geovanny

Added wardate to participation table

parent 7e48d4e8
...@@ -177,7 +177,7 @@ class MyHouseController{ ...@@ -177,7 +177,7 @@ class MyHouseController{
async getParticipation(){ async getParticipation(){
try{ try{
const data = await this.sync.getParticipation(); const data = await this.sync.getParticipation();
this.view.drawParticipationTable(data); this.view.updateParticipationView(data);
}catch(error){ }catch(error){
console.log(error); console.log(error);
} }
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<war-participation> <war-participation>
<table-wrapper> <table-wrapper>
<div class="table_header"> <div class="table_header">
<p class="header_title">Participation:</p> <p id="war_date" class="header_title">Participation:</p>
<button id="yes" class="one">Yes</button> <button id="yes" class="one">Yes</button>
<button id="no" class="two">No</button> <button id="no" class="two">No</button>
<button id="maybe" class="three">Maybe</button> <button id="maybe" class="three">Maybe</button>
......
...@@ -11,6 +11,7 @@ class ParticipationView extends EventTarget{ ...@@ -11,6 +11,7 @@ class ParticipationView extends EventTarget{
super(); super();
this.element = element; this.element = element;
this.war_date = element.querySelector("#war_date")
this.yes_button = element.querySelector("#yes"); this.yes_button = element.querySelector("#yes");
this.maybe_button = element.querySelector("#maybe"); this.maybe_button = element.querySelector("#maybe");
this.no_button = element.querySelector("#no"); this.no_button = element.querySelector("#no");
...@@ -27,6 +28,15 @@ class ParticipationView extends EventTarget{ ...@@ -27,6 +28,15 @@ class ParticipationView extends EventTarget{
}); });
} }
updateParticipation(data){
this.updateWarDate(data.war);
this.drawTable(data.participation);
}
updateWarDate(war){
const day_str = new Date(war.day).toLocaleDateString();
this.war_date.innerText = 'WarDate: ' + day_str;
}
drawTable(data){ drawTable(data){
this.table_view.drawTable(data); this.table_view.drawTable(data);
} }
......
...@@ -50,8 +50,8 @@ class MyHouseController extends EventTarget{ ...@@ -50,8 +50,8 @@ class MyHouseController extends EventTarget{
this.hideArea2(); this.hideArea2();
} }
drawParticipationTable(data){ updateParticipationView(data){
this.participation_view.drawTable(data); this.participation_view.updateParticipation(data);
} }
drawMemberUnitsTable(data){ drawMemberUnitsTable(data){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment