Skip to content

Commit

Permalink
Add semantic semester names (#357)
Browse files Browse the repository at this point in the history
* Add names

* lint

* use 1st/2nd/3rd year, etc

* Change year names and apostrophes for years

* Capitalize year
  • Loading branch information
georgiashay authored Feb 6, 2020
1 parent a04f6a9 commit f5ae50b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/Semester.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
<v-container slot="header" grid-list-xs style="padding: 0px; margin-left: 0px;">
<v-layout row align-center style="user-select: none;">
<v-flex xs6>
<span style="width: 6em; display: inline-block;">
<span style="width: 12em; display: inline-block;">
<b>
<v-hover>
<span slot-scope="{ hover }" :class="hover && 'hovering'" @click="openChangeYearDialog">
{{ semesterName }}
{{ semesterType }}
{{ semesterYear }}
<span v-if="index>0">{{ "'" + semesterYear.toString().substring(2) }}</span>
</span>
</v-hover>
</b>
Expand Down Expand Up @@ -313,6 +314,15 @@ export default {
expectedHours: expectedHours
};
},
semesterName: function () {
const yearNames = ['Freshman', 'Sophomore', 'Junior', 'Senior', 'Fifth Year'];
if (this.index === 0) {
return '';
} else {
const yearIndex = Math.floor((this.index - 1) / 3);
return yearNames[yearIndex];
}
},
semesterYear: function () {
return this.index === 0
? ''
Expand Down

0 comments on commit f5ae50b

Please sign in to comment.