Skip to content

Commit

Permalink
[Object.key() fully removed]
Browse files Browse the repository at this point in the history
  • Loading branch information
rkanik committed Jun 23, 2019
1 parent 1a63929 commit ad318b8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
dist
/dist
12 changes: 6 additions & 6 deletions src/components/EmptyRoom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export default {
},
methods:{
FindEmptyRooms(Routines){
Object.keys(Routines).forEach( day =>{
for( const day in Routines ){
if( day !== 'Labs' ){
Object.keys(Routines[day]).forEach( slot => {
for( const slot in Routines[day]){
Routines[day][slot].forEach( ro => {
if( ro.Room && !ro.Course ){
if( this.emptyRooms[day] ){
Expand All @@ -78,9 +78,9 @@ export default {
}
}
})
})
}
}
})
}
},
SearchByDaySlot(day, slot){
this.emptyByDay=[];this.emptyBySlot=[];
Expand All @@ -105,11 +105,11 @@ export default {
this.emptyByDay=[];this.emptyDaySlot=[];
if( slot !== 'none' ){
this.emptyBySlot={};
Object.keys(this.emptyRooms).forEach( day => {
for( let day in this.emptyRooms ){
if( this.emptyRooms[day] ){
this.emptyBySlot[day] = this.emptyRooms[day][slot];
}
})
}
}else{
this.emptyBySlot = [];
}
Expand Down
24 changes: 11 additions & 13 deletions src/components/Teacher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,16 @@ export default {
let oSlots = ["08:30","10:00","11:30","01:00","02:30","04:00"];
this.ResetRoutine();
this.GetTeacherInfo(key);
Object.keys(this.Routines).forEach( day => {
if( day !== 'Labs' ){
Object.keys(this.Routines[day]).forEach( slot => {
this.Routines[day][slot].forEach( routine => {
if( routine.Teacher === key.toUpperCase() ){
let ind = oSlots.indexOf(slot);
this.Routine[day].splice(ind,1,routine);
}
})
for( let day in this.Routines ){if( day !== 'Labs' ){
for( let slot in this.Routines[day]){
this.Routines[day][slot].forEach( routine => {
if( routine.Teacher === key.toUpperCase() ){
let ind = oSlots.indexOf(slot);
this.Routine[day].splice(ind,1,routine);
}
})
}
else{
}else{
this.Routines.Labs.forEach( rout => {
if( rout.Teacher === key.toUpperCase() ){
rout.Title = this.GetCourseTitle(rout.Course.split('(')[0]);
Expand All @@ -215,17 +213,17 @@ export default {
})
}
this.RemoveOffDayFromRoutine(day);
})
}
},
GetCourseTitle( code ){
let title = '';
Object.keys(this.courses).forEach( levelTerm => {
for( let levelTerm in this.courses ){
this.courses[levelTerm].forEach( course => {
if( course.Code === code ){
title = course.Title;
}
})
});
}
return title;
}
},
Expand Down
3 changes: 3 additions & 0 deletions src/components/admin/Students.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export default {
async FetchVisited(){
let res = await db.collection('UsageHistory').orderBy('last_visited','desc').get()
let visitors = [];res.forEach( doc => {visitors.push(doc.data())})
visitors.forEach( visitor => console.log('ip:'+visitor.ip+'<->'+'last: '+new Date(visitor.last_visited.seconds*1000)))
this.visitedOverview.totalVisitor = visitors.length
visitors.forEach( visitor => {
let lvFromNowInMin = this.GetDifferenceFromNowInMin(visitor.last_visited)
Expand Down
8 changes: 4 additions & 4 deletions src/views/Admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,23 @@ export default {
},
GetUniqueInitials(){
let teachers = [];
Object.keys(Summer19_V3).forEach( day => {
for( let day in Summer19_V3){
if( day !== 'Labs' ){
Object.keys(Summer19_V3[day]).forEach( slot => {
for( let slot in Summer19_V3[day]){
Summer19_V3[day][slot].forEach( rout => {
if( rout.Teacher ){
teachers.push(rout.Teacher);
}
})
})
}
}else{
Summer19_V3.Labs.forEach( rout => {
if( rout.Teacher ){
teachers.push(rout.Teacher);
}
})
}
})
}
let disTeachers = teachers.filter((val, index, self) => {
return self.indexOf(val) === index;
Expand Down

0 comments on commit ad318b8

Please sign in to comment.