[M] Rename time selection to grading period
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
#nav-time-selection
|
||||
#nav-grading-period
|
||||
{
|
||||
// Float right
|
||||
position: absolute;
|
||||
|
||||
@@ -17,7 +17,7 @@ export default class Navigation extends Vue
|
||||
|
||||
@Prop({required: true}) courses: Course[];
|
||||
|
||||
private selectedTime: string = 'All Year';
|
||||
private gradingPeriod: string = 'All Year';
|
||||
|
||||
// Instance
|
||||
public static instance: Navigation;
|
||||
@@ -30,9 +30,9 @@ export default class Navigation extends Vue
|
||||
// Check selected time
|
||||
if (!this.$cookies.isKey('va.selected-time'))
|
||||
{
|
||||
this.$cookies.set('va.selected-time', this.selectedTime, '10y');
|
||||
this.$cookies.set('va.selected-time', this.gradingPeriod, '10y');
|
||||
}
|
||||
this.selectedTime = this.$cookies.get('va.selected-time');
|
||||
this.gradingPeriod = this.$cookies.get('va.selected-time');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,25 +162,25 @@ export default class Navigation extends Vue
|
||||
}
|
||||
|
||||
/**
|
||||
* Select time
|
||||
* Select grading period
|
||||
*
|
||||
* @param command Term 1, Term 2, All Year, etc.
|
||||
*/
|
||||
public selectTime(command: string)
|
||||
public selectGradingPeriod(command: string)
|
||||
{
|
||||
this.selectedTime = command;
|
||||
this.gradingPeriod = command;
|
||||
this.$cookies.set('va.selected-time', command, '10y');
|
||||
|
||||
// Call event
|
||||
this.$emit('select-time', this.getSelectedTimeCode());
|
||||
this.$emit('select-time', this.getSelectedGradingPeriod());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get code for selected time
|
||||
*/
|
||||
public getSelectedTimeCode(): number
|
||||
public getSelectedGradingPeriod(): number
|
||||
{
|
||||
if (this.selectedTime == 'All Year') return -1;
|
||||
else return +this.selectedTime.replace('Term ', '') - 1;
|
||||
if (this.gradingPeriod == 'All Year') return -1;
|
||||
else return +this.gradingPeriod.replace('Term ', '') - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
:key="course.name">{{course.name}}</el-menu-item>
|
||||
</el-submenu>
|
||||
|
||||
<!-- Time selection -->
|
||||
<el-dropdown id="nav-time-selection" @command="selectTime">
|
||||
<!-- Grading period selection -->
|
||||
<el-dropdown id="nav-grading-period" @command="selectTime">
|
||||
<el-button type="primary" size="medium">
|
||||
{{selectedTime}}<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@ export default class Course
|
||||
*/
|
||||
get assignments(): Assignment[]
|
||||
{
|
||||
let timeCode = Navigation.instance.getSelectedTimeCode();
|
||||
let timeCode = Navigation.instance.getSelectedGradingPeriod();
|
||||
|
||||
// All year
|
||||
if (timeCode == -1)
|
||||
|
||||
Reference in New Issue
Block a user