Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

835 feature request redesign pathway page #845

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 55 additions & 52 deletions src/web/src/pages/Pathway.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,35 @@
<b-breadcrumb :items="breadcrumbNav"></b-breadcrumb>

<!-- button to switch between alphabet order and category order -->
<div style="float: left;" class="w-10">
<b-button
@click="listAlphabet()"
style="
margin-top: 10px;
color: #007bff;
border: solid #007bff;
background-color: transparent;
"
>
List by Alphabet
</b-button>
<br />
<b-button
@click="listCate()"
style="
margin-top: 10px;
color: #007bff;
border: solid #007bff;
background-color: transparent;
"
>
List by Category
</b-button>
</div>
<b-dropdown id="dropdown-1" text="Sort By" variant="link" class="dropdown-custom">
<b-dropdown-item @click="listAlphabet">A - Z</b-dropdown-item>
<b-dropdown-item @click="listCate">Category</b-dropdown-item>
</b-dropdown>


<div v-if="categories.length > 0" class="mx-auto w-75">
<!-- pop-up window -->
<b-modal ref="my-modal">
<div class="block text-left" v-if="showPath != null" md="10">
<h3
class="text-center"
style="color: #007bff; margin-top: -5px; margin-bottom: 5px;"
>
<b-modal ref="my-modal" scrollable size="lg">
<template #modal-title>
<div style="color: #3395ff;" v-if="showPath != null">
{{ showPath.Name[0] }}
</h3>
<br />
<div v-for="(item, itemName) in showPath" :key="itemName">
<h4 style="color: #3395ff; margin-top: -20px;">
{{ itemName + ": " }}
</h4>
<li
v-for="course in item"
:key="course"
v-on:click="goPage(course)"
class="courseInPath"
>
{{ course }}
</li>
<br />
</div>
</div>
</template>

<b-tabs>
<b-tab v-for="(item, itemName) in noNamePath" :key="itemName" :title="shortenTitle(itemName)">
<div class="block text-left" v-if="showPath != null">
<h5 style="color: #3395ff; margin-top: 15px;">
{{ itemName + ": " }}
</h5>
<b-button style="color: black;" class="pathway-button" v-for="course in item" :key="course" v-on:click="goPage(course)">
{{ course }}
</b-button>
<br />
</div>
</b-tab>
</b-tabs>
</b-modal>

<b-row>
Expand Down Expand Up @@ -280,6 +258,16 @@ export default {
ret.push(col2);
return ret;
},

// A copy of the showPath object without the name aka the first index of the array
noNamePath() {
if (!this.showPath) {
return {};
}
const showPathCopy = { ...this.showPath };
delete showPathCopy[Object.keys(this.showPath)[0]];
return showPathCopy;
},
},
methods: {
listAlphabet() {
Expand Down Expand Up @@ -312,6 +300,22 @@ export default {
);
}
},

// Shorten the title of the pathway in the pop-up window
shortenTitle(title) {
if (title.includes('remaining')) {
return 'Choose Remaining Credits';
}
else if (!title.includes('remaining') && (title.includes('from the following')
|| title.includes('12 credits of the following') || title.includes('from a choice of the following'))) {
return 'Choose from the following';
}
else if (!title.includes('remaining') && title.includes('one of the following a minimum')) {
return 'Choose one of the following';
}
return title
},

},
};
</script>
Expand Down Expand Up @@ -341,16 +345,15 @@ export default {
text-align: justify;
width: 95%;
}

.pathway-button:hover {
background: rgba(108, 90, 90, 0.15) !important;
}

.courseInPath {
cursor: pointer;
.dropdown-custom {
color: #3395ff;
border: 1px #3395ff;
background-color: transparent;
}

.courseInPath:hover {
background-color: rgba(39, 130, 230, 0.5);
}
</style>
2 changes: 1 addition & 1 deletion src/web/src/pages/pathwayV2.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
],
"Required": [
"ARTS 1050 - Art History",
"orARTS 2540 - The Multimedia Century"
"ARTS 2540 - The Multimedia Century"
],
"Choose remaining credits from the following": [
"ARTS 1XXX",
Expand Down
Loading