-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5675 from WoltLab/admin-dashboard
Admin dashboard
- Loading branch information
Showing
34 changed files
with
1,493 additions
and
493 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
ts/WoltLabSuite/Core/Acp/Controller/Dashboard/Configure.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Shows the dialog that allows the user to configure the dashboard boxes. | ||
* | ||
* @author Marcel Werk | ||
* @copyright 2001-2023 WoltLab GmbH | ||
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> | ||
* @since 6.1 | ||
*/ | ||
|
||
import { dialogFactory } from "WoltLabSuite/Core/Component/Dialog"; | ||
import { promiseMutex } from "WoltLabSuite/Core/Helper/PromiseMutex"; | ||
import { show as showNotification } from "WoltLabSuite/Core/Ui/Notification"; | ||
|
||
async function showDialog(url: string): Promise<void> { | ||
const { ok } = await dialogFactory().usingFormBuilder().fromEndpoint<Response>(url); | ||
|
||
if (ok) { | ||
showNotification(undefined, () => { | ||
window.location.reload(); | ||
}); | ||
} | ||
} | ||
|
||
export function setup(button: HTMLElement): void { | ||
button.addEventListener( | ||
"click", | ||
promiseMutex(() => showDialog(button.dataset.url!)), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
wcfsetup/install/files/acp/database/update_com.woltlab.wcf_6.1.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
/** | ||
* Updates the database layout during the update from 6.0 to 6.1. | ||
* | ||
* @author Marcel Werk | ||
* @copyright 2001-2023 WoltLab GmbH | ||
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> | ||
*/ | ||
|
||
use wcf\system\database\table\column\DefaultFalseBooleanDatabaseTableColumn; | ||
use wcf\system\database\table\column\NotNullInt10DatabaseTableColumn; | ||
use wcf\system\database\table\column\NotNullVarchar191DatabaseTableColumn; | ||
use wcf\system\database\table\DatabaseTable; | ||
use wcf\system\database\table\index\DatabaseTableForeignKey; | ||
use wcf\system\database\table\index\DatabaseTableIndex; | ||
|
||
return [ | ||
DatabaseTable::create('wcf1_acp_dashboard_box_to_user') | ||
->columns([ | ||
NotNullVarchar191DatabaseTableColumn::create('boxName'), | ||
NotNullInt10DatabaseTableColumn::create('userID'), | ||
DefaultFalseBooleanDatabaseTableColumn::create('enabled'), | ||
NotNullInt10DatabaseTableColumn::create('showOrder') | ||
->defaultValue(0), | ||
])->indices([ | ||
DatabaseTableIndex::create('boxToUser') | ||
->columns(['boxName', 'userID']) | ||
->type(DatabaseTableIndex::UNIQUE_TYPE), | ||
]) | ||
->foreignKeys([ | ||
DatabaseTableForeignKey::create() | ||
->columns(['userID']) | ||
->referencedTable('wcf1_user') | ||
->referencedColumns(['userID']) | ||
->onDelete('CASCADE'), | ||
]), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
wcfsetup/install/files/acp/templates/__dashboardBoxesConfigurationFormField.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<div id="acpDashboardSortableContainer" class="sortableListContainer"> | ||
<ul class="sortableList" id="{$field->getPrefixedId()}_list"> | ||
{foreach from=$field->getNestedOptions() item=__fieldNestedOption} | ||
<li{if $__fieldNestedOption[depth] > 0} style="padding-left: {$__fieldNestedOption[depth]*20}px"{/if}> | ||
<span class="sortableHandle"> | ||
{icon name='arrows-up-down'} | ||
</span> | ||
|
||
<label> | ||
<input {* | ||
*}type="checkbox" {* | ||
*}name="{$field->getPrefixedId()}[]" {* | ||
*}value="{$__fieldNestedOption[value]}"{* | ||
*}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* | ||
*}{if $field->getValue() !== null && $__fieldNestedOption[value]|in_array:$field->getValue() && $__fieldNestedOption[isSelectable]} checked{/if}{* | ||
*}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{* | ||
*}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* | ||
*}> | ||
{@$__fieldNestedOption[label]} | ||
</label> | ||
</li> | ||
{/foreach} | ||
</ul> | ||
</div> | ||
|
||
<script data-relocate="true"> | ||
$(() => { | ||
new window.WCF.Sortable.List( | ||
'acpDashboardSortableContainer', | ||
'', | ||
0, | ||
{ | ||
handle: '.sortableHandle' | ||
}, | ||
true, | ||
{}, | ||
); | ||
}); | ||
</script> |
64 changes: 64 additions & 0 deletions
64
wcfsetup/install/files/acp/templates/creditsAcpDashboardBox.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<div class="acpDashboardBox__keyValueGroup"> | ||
<dl class="plain acpDashboardBox__keyValue"> | ||
<dt class="acpDashboardBox__keyValue__key">{lang}wcf.acp.dashboard.box.credits.developedBy{/lang}</dt> | ||
<dd class="acpDashboardBox__keyValue__value"><a href="https://www.woltlab.com/{if $__wcf->getLanguage()->getFixedLanguageCode() === 'de'}de/{/if}" class="externalURL"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank" rel="noopener"{/if}>WoltLab® GmbH</a></dd> | ||
</dl> | ||
|
||
<dl class="plain acpDashboardBox__keyValue"> | ||
<dt class="acpDashboardBox__keyValue__key">{lang}wcf.acp.dashboard.box.credits.productManager{/lang}</dt> | ||
<dd class="acpDashboardBox__keyValue__value"> | ||
<ul class="acpDashboardBox__keyValue__list"> | ||
<li>Marcel Werk</li> | ||
</ul> | ||
</dd> | ||
</dl> | ||
|
||
<dl class="plain acpDashboardBox__keyValue"> | ||
<dt class="acpDashboardBox__keyValue__key">{lang}wcf.acp.dashboard.box.credits.developer{/lang}</dt> | ||
<dd class="acpDashboardBox__keyValue__value"> | ||
<ul class="acpDashboardBox__keyValue__list"> | ||
<li>Olaf Braun</li> | ||
<li>Tim Düsterhus</li> | ||
<li>Alexander Ebert</li> | ||
<li>Joshua Rüsweg</li> | ||
<li>Matthias Schmidt</li> | ||
<li>Marcel Werk</li> | ||
</ul> | ||
</dd> | ||
</dl> | ||
|
||
<dl class="plain acpDashboardBox__keyValue"> | ||
<dt class="acpDashboardBox__keyValue__key">{lang}wcf.acp.dashboard.box.credits.designer{/lang}</dt> | ||
<dd class="acpDashboardBox__keyValue__value"> | ||
<ul class="acpDashboardBox__keyValue__list"> | ||
<li>Alexander Ebert</li> | ||
<li>Marcel Werk</li> | ||
</ul> | ||
</dd> | ||
</dl> | ||
|
||
<dl class="plain acpDashboardBox__keyValue"> | ||
<dt class="acpDashboardBox__keyValue__key">{lang}wcf.acp.dashboard.box.credits.contributor{/lang}</dt> | ||
<dd class="acpDashboardBox__keyValue__value"> | ||
<ul class="acpDashboardBox__keyValue__list"> | ||
<li>Andrea Berg</li> | ||
<li>Thorsten Buitkamp</li> | ||
<li> | ||
<a href="https://github.com/WoltLab/WCF/contributors" class="externalURL"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank" rel="noopener"{/if}>{lang}wcf.acp.dashboard.box.credits.contributor.more{/lang}</a> | ||
</li> | ||
</ul> | ||
</dd> | ||
</dl> | ||
</div> | ||
|
||
<div class="acpDashboardBox__keyValueGroup"> | ||
<p class="acpDashboardBox__keyValue__text"> | ||
Copyright © 2001-{TIME_NOW|date:'Y'} WoltLab® GmbH. All rights reserved. | ||
</p> | ||
</div> | ||
|
||
<div class="acpDashboardBox__keyValueGroup"> | ||
<p class="acpDashboardBox__keyValue__text"> | ||
{lang}wcf.acp.dashboard.box.credits.trademarks{/lang} | ||
</p> | ||
</div> |
Oops, something went wrong.