Fixing tasks not loading on landing page when not logged in
This commit is contained in:
parent
94bdf28db8
commit
75684cd4ef
@ -846,6 +846,9 @@ ol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 40rem) {
|
@media screen and (max-width: 40rem) {
|
||||||
|
#landing section {
|
||||||
|
align-content: flex-start;
|
||||||
|
}
|
||||||
#landing section > div:first-of-type {
|
#landing section > div:first-of-type {
|
||||||
padding: 3rem 0;
|
padding: 3rem 0;
|
||||||
}
|
}
|
||||||
|
|||||||
2
css/main.min.css
vendored
2
css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -801,7 +801,6 @@ ol {
|
|||||||
grid-template-rows: auto 1fr;
|
grid-template-rows: auto 1fr;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
|
||||||
section {
|
section {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
@ -910,6 +909,8 @@ ol {
|
|||||||
@media screen and (max-width: 40rem) {
|
@media screen and (max-width: 40rem) {
|
||||||
#landing {
|
#landing {
|
||||||
section {
|
section {
|
||||||
|
align-content: flex-start;
|
||||||
|
|
||||||
&>div:first-of-type {
|
&>div:first-of-type {
|
||||||
padding: 3rem 0;
|
padding: 3rem 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -736,6 +736,7 @@ const render = {
|
|||||||
task(details = {}) {
|
task(details = {}) {
|
||||||
const { title, description, date, id, status, deadline, category } = details;
|
const { title, description, date, id, status, deadline, category } = details;
|
||||||
let actions = '';
|
let actions = '';
|
||||||
|
if (floGlobals.isUserLoggedIn) {
|
||||||
if (floGlobals.isSubAdmin) {
|
if (floGlobals.isSubAdmin) {
|
||||||
actions = html`
|
actions = html`
|
||||||
<button class="button button--outlined" onclick=${() => editTask(id)}>Edit</button>
|
<button class="button button--outlined" onclick=${() => editTask(id)}>Edit</button>
|
||||||
@ -748,6 +749,7 @@ const render = {
|
|||||||
<button class=${`button ${applied ? '' : 'button--outlined'}`} data-task-id=${id} onclick=${() => applyToTask(id)} ?disabled=${applied}>${applied ? 'Applied' : 'Apply'}</button>
|
<button class=${`button ${applied ? '' : 'button--outlined'}`} data-task-id=${id} onclick=${() => applyToTask(id)} ?disabled=${applied}>${applied ? 'Applied' : 'Apply'}</button>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return html`
|
return html`
|
||||||
<li class="task-card" .dataset=${{ id }}>
|
<li class="task-card" .dataset=${{ id }}>
|
||||||
<h4>${title}</h4>
|
<h4>${title}</h4>
|
||||||
@ -764,8 +766,8 @@ const render = {
|
|||||||
`
|
`
|
||||||
},
|
},
|
||||||
availableTasks(target = 'available_tasks_list') {
|
availableTasks(target = 'available_tasks_list') {
|
||||||
if (floGlobals.appObjects?.rmInterns?.tasks?.length === 0)
|
if ((floGlobals.appObjects?.rmInterns.tasks || []).length === 0)
|
||||||
return renderElem(getRef(target), html`<p>No tasks available</p>`)
|
return renderElem(getRef(target), html`<p>No tasks available</p>`);
|
||||||
const tasksList = floGlobals.appObjects.rmInterns.tasks.map(render.task);
|
const tasksList = floGlobals.appObjects.rmInterns.tasks.map(render.task);
|
||||||
renderElem(getRef(target), html`${tasksList}`)
|
renderElem(getRef(target), html`${tasksList}`)
|
||||||
}
|
}
|
||||||
@ -834,7 +836,7 @@ router.addRoute('landing', (state) => {
|
|||||||
</h1>
|
</h1>
|
||||||
<svg id="emblem" width="77" height="77" viewBox="0 0 77 77" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="38.4806" cy="29.7768" r="29.1831"/> <circle cx="38.4806" cy="47.2232" r="29.1831"/> <circle cx="47.2038" cy="38.5" r="29.1831" transform="rotate(90 47.2038 38.5)"/> <circle cx="29.7574" cy="38.5" r="29.1831" transform="rotate(90 29.7574 38.5)"/> </svg>
|
<svg id="emblem" width="77" height="77" viewBox="0 0 77 77" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="38.4806" cy="29.7768" r="29.1831"/> <circle cx="38.4806" cy="47.2232" r="29.1831"/> <circle cx="47.2038" cy="38.5" r="29.1831" transform="rotate(90 47.2038 38.5)"/> <circle cx="29.7574" cy="38.5" r="29.1831" transform="rotate(90 29.7574 38.5)"/> </svg>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-direction-column gap-1-5">
|
<div class="flex flex-direction-column gap-1-5" style="min-width: 12rem">
|
||||||
<h4>Available</h4>
|
<h4>Available</h4>
|
||||||
<ul id="available_tasks_list" class="grid">
|
<ul id="available_tasks_list" class="grid">
|
||||||
<sm-spinner></sm-spinner>
|
<sm-spinner></sm-spinner>
|
||||||
|
|||||||
6
scripts/app.min.js
vendored
6
scripts/app.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user