Skip to content
Merged
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
36 changes: 36 additions & 0 deletions src/views/admin/controllers/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,33 @@
<p class="endorsement_category_explainer">Tier Two</p>
</div>
</div>
<div class="input-field col s7">
<div id="certs_container">
<span
id="CPALocal"
:class="{ active: form.certs.CPALocal }"
class="cert cert_cpa"
@click="toggleCert"
>Local Data</span>

<span
id="CPATerminal"
:class="{ active: form.certs.CPATerminal }"
class="cert cert_cpa"
@click="toggleCert"
>Terminal Data</span>

<span
id="CPAEnroute"
:class="{ active: form.certs.CPAEnroute }"
class="cert cert_cpa"
@click="toggleCert"
>Enroute Data</span>
</div>
<div id="tier_two_explainer">
<p class="endorsement_category_explainer">Combined Position Authority</p>
</div>
</div>
<div class="input-field col s12">
<label for="roles" class="active">Roles</label>
<div id="roles_container">
Expand All @@ -104,6 +131,7 @@
<span id="mtr" class="cert cert_training" :class="{active: form.roles.mtr}" @click="toggleRole">MTR</span>
<span id="dta" class="cert cert_training" :class="{active: form.roles.dta}" @click="toggleRole">DTA</span>
<span id="vis" class="cert cert_training" :class="{active: form.vis}" @click="toggleVis">VIS</span>
<span id="cm" class="cert cert_training" :class="{active: form.roles.cm}" @click="toggleRole">CM</span>
</div>
</div>
<div class="input-field col s12">
Expand Down Expand Up @@ -142,6 +170,10 @@ export default {
wm: false,
ins: false,
mtr: false,
dta: false,
cpa: false,
cm: false,

},
}
};
Expand Down Expand Up @@ -258,6 +290,10 @@ export default {
background: $secondary-color-light;
color: #fff;
}
&.cert_cpa {
background: #2e7d32;
color: #fff;
}
}

}
Expand Down
35 changes: 27 additions & 8 deletions src/views/controllers/Roster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,31 @@ export default {
},
reduceControllerCerts(certs) {
if (!certs) return [];
const hasCerts = certs.map((cert) => cert.code);
let certsToShow = [];
certs.forEach(cert => {
if(cert.class === "tier-one" || cert.class === "tier-two") {
certsToShow.push(cert);
}
});

certsToShow = certsToShow.sort((a, b) => a.class.localeCompare(b.class, 'en', { numeric: true }) || a.order - b.order)
certs.forEach((cert) => {
const cls = String(cert.class || "").toLowerCase();
if (["tier-one", "tier-two", "cpa"].includes(cls)) {
certsToShow.push({ ...cert, class: cls });
}
});

const classPriority = {
"tier-one": 1,
"tier-two": 2,
"cpa": 3,
};

certsToShow = certsToShow.sort((a, b) => {
const ap = classPriority[a.class] ?? 99;
const bp = classPriority[b.class] ?? 99;
if (ap !== bp) return ap - bp;
return (a.order ?? 999) - (b.order ?? 999);
});


return certsToShow;
},
}
},
computed: {
...mapState("user", ["user"]),
Expand Down Expand Up @@ -279,6 +293,11 @@ td {
&.cert_tier-two {
background: $secondary-color-light;
}
&.cert_cpa {
background: #2e7d32;
color: #fff;
}

}

.tooltipped {
Expand Down
33 changes: 33 additions & 0 deletions src/views/instructor/controllers/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,33 @@
<p class="endorsement_category_explainer">Tier Two</p>
</div>
</div>
<div class="input-field col s7">
<div id="certs_container">
<span
id="CPALocal"
:class="{ active: form.certs.CPALocal }"
class="cert cert_cpa"
@click="toggleCert"
>Local Data</span>

<span
id="CPATerminal"
:class="{ active: form.certs.CPATerminal }"
class="cert cert_cpa"
@click="toggleCert"
>Terminal Data</span>

<span
id="CPAEnroute"
:class="{ active: form.certs.CPAEnroute }"
class="cert cert_cpa"
@click="toggleCert"
>Enroute Data</span>
</div>
<div id="tier_two_explainer">
<p class="endorsement_category_explainer">Combined Position Authority</p>
</div>
</div>
<div class="input-field col s12">
<label for="roles" class="active">Roles</label>
<div id="roles_container">
Expand All @@ -99,6 +126,7 @@
<span id="ins" class="cert cert_training" :class="{active: form.roles.ins}">INS</span>
<span id="mtr" class="cert cert_training" :class="{active: form.roles.mtr}">MTR</span>
<span id="vis" class="cert cert_training" :class="{active: form.vis}">VIS</span>
<span id="cpa" class="cert cert_training" :class="{active: form.roles.cm}">CM</span>
</div>
</div>
<div class="input-field col s12">
Expand Down Expand Up @@ -137,6 +165,7 @@ export default {
wm: false,
ins: false,
mtr: false,
cm: false,
},
}
};
Expand Down Expand Up @@ -234,6 +263,10 @@ export default {
background: $secondary-color-light;
color: #fff;
}
&.cert_cpa {
background: #2e7d32;
color: #fff;
}
}

}
Expand Down