Skip to content
Snippets Groups Projects
Commit c3cf3bb2 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Add links to admin pages for admins

parent 9dab78e5
Branches
Tags
No related merge requests found
This diff is collapsed.
......@@ -10,6 +10,7 @@ function Landing(): ReactElement {
const loggedIn = !!user.id;
const hasNren = loggedIn ? !!user.nrens.length : false;
const activeNren = hasNren ? user.nrens[0] : '';
const isAdmin = loggedIn ? user.permissions.admin : false;
const moveToSurvey = () => {
const currentYear = new Date().getFullYear();
......@@ -37,10 +38,15 @@ function Landing(): ReactElement {
<span>Current registration status:</span>
<br />
<br />
{isAdmin && <ul>
<li><span>You are logged in as a Compendium Administrator</span></li>
<li><span>Click <a href="/survey/admin/surveys">here</a> to access the survey management page.</span></li>
<li><span>Click <a href="/survey/admin/users">here</a> to access the user management page.</span></li>
</ul>}
<ul>
{loggedIn ? <li><span>You are logged in</span></li> : <li><span>You are not logged in</span></li>}
{loggedIn && !hasNren && <li><span>Your access to the survey has not been approved</span></li>}
{loggedIn && !hasNren && <li><span>Once you have been approved, you will immediately be directed to the relevant survey upon visiting this page</span></li>}
{!isAdmin && (loggedIn ? <li><span>You are logged in</span></li> : <li><span>You are not logged in</span></li>)}
{!isAdmin && loggedIn && !hasNren && <li><span>Your access to the survey has not been approved</span></li>}
{!isAdmin && loggedIn && !hasNren && <li><span>Once you have been approved, you will immediately be directed to the relevant survey upon visiting this page</span></li>}
</ul>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment