Render due dates without url for `LEARNING_MENTOR`
This commit is contained in:
parent
bb57591387
commit
daa8a16e55
|
|
@ -30,6 +30,12 @@ const urlText = computed(() => {
|
|||
return result.trim();
|
||||
});
|
||||
|
||||
const showAsUrl = computed(() => {
|
||||
return ["SUPERVISOR", "EXPERT", "MEMBER"].includes(
|
||||
props.dueDate.course_session.my_role
|
||||
);
|
||||
});
|
||||
|
||||
const url = computed(() => {
|
||||
if (["SUPERVISOR", "EXPERT"].includes(props.dueDate.course_session.my_role)) {
|
||||
return props.dueDate.url_expert;
|
||||
|
|
@ -45,18 +51,24 @@ const url = computed(() => {
|
|||
>
|
||||
<div class="space-y-1">
|
||||
<div>
|
||||
<a :href="url">
|
||||
<a v-if="showAsUrl" :href="url">
|
||||
<span class="text-bold text-gray-900">
|
||||
{{ dayjs(props.dueDate.start).format("dddd D. MMMM YYYY") }}
|
||||
</span>
|
||||
</a>
|
||||
<span v-else class="text-bold text-gray-900">
|
||||
{{ dayjs(props.dueDate.start).format("dddd D. MMMM YYYY") }}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<a class="underline" :href="url">
|
||||
<a v-if="showAsUrl" class="underline" :href="url">
|
||||
<span class="text-bold">
|
||||
{{ urlText }}
|
||||
</span>
|
||||
</a>
|
||||
<span v-else class="text-bold">
|
||||
{{ urlText }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-small text-gray-900">
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -117,11 +117,13 @@ def has_cs_role(roles: Set[str]) -> bool:
|
|||
|
||||
|
||||
def user_role(roles: Set[str]) -> str:
|
||||
return (
|
||||
"SUPERVISOR"
|
||||
if "SUPERVISOR" in roles
|
||||
else ("EXPERT" if "EXPERT" in roles else "MEMBER")
|
||||
)
|
||||
if "SUPERVISOR" in roles:
|
||||
return "SUPERVISOR"
|
||||
if "EXPERT" in roles:
|
||||
return "EXPERT"
|
||||
if "MEMBER" in roles:
|
||||
return "MEMBER"
|
||||
return "LEARNING_MENTOR"
|
||||
|
||||
|
||||
@api_view(["GET"])
|
||||
|
|
|
|||
Loading…
Reference in New Issue