diff --git a/src/resources/projectapi.js b/src/resources/projectapi.js index f3ab99d6..0bcabc99 100644 --- a/src/resources/projectapi.js +++ b/src/resources/projectapi.js @@ -26,6 +26,24 @@ class ProjectApi { static OriginApiUrl = OriginApiUrl; static CachedDonators = {}; + static canUploadProjects() { + return fetch(`${OriginApiUrl}/api/v1/projects/canuploadprojects`) + .then(async res => { + // if this api call fails, expect that all others will fail aswell + if (!res.ok) return false; + return (await res.json()).canUpload; + }) + .catch(() => false); + } + static canViewProjects() { + return fetch(`${OriginApiUrl}/api/v1/projects/canviewprojects`) + .then(async res => { + // if this api call fails, expect that all others will fail aswell + if (!res.ok) return false; + return (await res.json()).viewing; + }) + .catch(() => false); + } static getServerInfo(user) { return new Promise((resolve, reject) => { const url = `${OriginApiUrl}/api/v1/misc/getStats`; diff --git a/src/routes/panel/+page.svelte b/src/routes/panel/+page.svelte index f29d0fe0..c97b78f6 100644 --- a/src/routes/panel/+page.svelte +++ b/src/routes/panel/+page.svelte @@ -1,5 +1,6 @@ @@ -908,935 +143,137 @@
-
-
-
-

Reject Project

-
-
-

Rejecting {rejectingName}

- Image of {rejectingName} - - +
+
+ +
+ +
-

Sounds

-

Click the Mute button to mark it to be muted

- {#each censorMenuDetails.sounds as sound} -
-
{sound.name}
-
- {/each} - {/if} - {#if censorMenuDetails.error} -

- {censorMenuDetails.errorText} -

- {/if} -
-
- {#if censorMenuDetails.uploading} - - {:else} -
-
-
- {/if} - - - -
-
-

Admin Panel

-
-
- -
-
-

- - PenguinMod Moderation Expectations - -

- -
-

Projects

-

- Project ID: - -

- {#if selectedProjectName} - -

- Selected {selectedProjectName} -

- Project Thumbnail -
- {/if} -

Tools

-
-
- -
-
-
-
-

Removed Projects

-

- Target Removed Project: - -

-
- - -
-
- -
- -

- - Project Uploading & Updating Guidelines - -

- -
- -
-

Server Stats

- -
-
- - - -
-

Messages

-

Respond to a project dispute/reply here.

-

Type message ID:

- -

Type reply:

- -
-
- - -
-
-
- -

Global Server Toggles: (applies to all users)

- - - - - -
-
+
-
-
- - -
- {#if !dropdownSelectMenu?.value} -

- Please select what type of reports you wish to view -

- {/if} - -
- {#if dropdownSelectMenu?.value} - {#if contentWithReports.length > 0 || unapprovedProjects.length > 0} - {#if dropdownSelectMenu.value === "user"} -

- Click on a user to expand details -

- {:else} -

- Click on a project to expand details -

- {/if} - {:else} - {#if dropdownSelectMenu.value === "user"} -

- No user reports currently! -

- {:else if dropdownSelectMenu.value === 'removed'} -

- No removed projects currently! -

- {:else} -

- No project reports currently! -

- {/if} - {/if} - {#each unapprovedProjects as project} -
- { - selectProject(project.id, project.name); - }} - /> + {:else if tab === 'misc'} +
+
+
+
+
+ Profanity List +
+
+ +
+
+ +
- {/each} - {#each contentWithReports as content, idx} - {#if dropdownSelectMenu.value === "user"} - - {#if selectedReportDetailed === idx} -
- {#if !reportDetails[content.target]} - - {:else} -
By: {content.reporter}
-

- {content.report} -

- - go to profile -

View reports by

- {#each reportDetails[content.target] as report} -
- - {report.reporter} - - -

- {report.report} -

-
- {/each} - {/if} -
- {/if} - {:else} -
+
+ - {#if selectedReportDetailed === idx} -
-
By: {content.reporter}
-

- {content.report} -

- -

- View project at - - {`${PUBLIC_STUDIO_URL}/#${content.targetID}`} - - or - -

- {#if !reportDetails[content.targetID]} - - {:else} -

View reports by

- {#each reportDetails[content.targetID] as report} -
- - {report.reporter} - - -

- {report.report} -

-
- {/each} - {/if} -
- {/if} - {/if} - {/each} - {/if} + {!canViewProjects ? 'Enable' : 'Dissable'} project viewing + +
+
+
-
+ {/if}