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