From ed3f188f0ebc2ce739e32bbf9369d72ecc45673b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 2 May 2016 14:15:25 +0200 Subject: [PATCH] Overhauled 'Add Page' UI --- .../files/acp/templates/__pageAddContent.tpl | 14 ++ .../files/acp/templates/codemirror.tpl | 12 + .../install/files/acp/templates/pageAdd.tpl | 28 +-- .../files/acp/templates/pageAddDialog.tpl | 40 ++++ .../install/files/acp/templates/pageList.tpl | 10 +- .../install/files/acp/templates/wysiwyg.tpl | 221 ++++++++++++++++++ .../files/acp/templates/wysiwygToolbar.tpl | 73 ++++++ .../files/js/WoltLab/WCF/Acp/Ui/Page/Add.js | 64 +++++ .../install/files/js/WoltLab/WCF/Ui/Dialog.js | 4 + .../files/lib/acp/form/PageAddForm.class.php | 57 +++-- .../files/lib/acp/page/PageListPage.class.php | 35 +-- 11 files changed, 499 insertions(+), 59 deletions(-) create mode 100644 wcfsetup/install/files/acp/templates/__pageAddContent.tpl create mode 100644 wcfsetup/install/files/acp/templates/pageAddDialog.tpl create mode 100644 wcfsetup/install/files/acp/templates/wysiwyg.tpl create mode 100644 wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Page/Add.js diff --git a/wcfsetup/install/files/acp/templates/__pageAddContent.tpl b/wcfsetup/install/files/acp/templates/__pageAddContent.tpl new file mode 100644 index 0000000000..3c09c19dd0 --- /dev/null +++ b/wcfsetup/install/files/acp/templates/__pageAddContent.tpl @@ -0,0 +1,14 @@ + +{if $pageType == 'text'} + {capture assign='wysiwygSelector'}content{@$languageID}{/capture} + + {include file='wysiwyg' wysiwygSelector=$wysiwygSelector} +{elseif $pageType == 'html'} + {capture assign='codemirrorSelector'}#content{@$languageID}{/capture} + + {include file='codemirror' codemirrorMode='htmlmixed' codemirrorSelector=$codemirrorSelector} +{elseif $pageType == 'tpl'} + {capture assign='codemirrorSelector'}#content{@$languageID}{/capture} + + {include file='codemirror' codemirrorMode='smartymixed' codemirrorSelector=$codemirrorSelector} +{/if} \ No newline at end of file diff --git a/wcfsetup/install/files/acp/templates/codemirror.tpl b/wcfsetup/install/files/acp/templates/codemirror.tpl index 7b18d11ee3..9edce7d3fd 100644 --- a/wcfsetup/install/files/acp/templates/codemirror.tpl +++ b/wcfsetup/install/files/acp/templates/codemirror.tpl @@ -9,6 +9,18 @@ {if $codemirrorMode|isset} + + {if $codemirrorMode == 'htmlmixed' || $codemirrorMode == 'smartymixed'} + {if $codemirrorMode == 'smartymixed'} + + + {/if} + + + + + {/if} + {/if} {event name='javascriptIncludes'} diff --git a/wcfsetup/install/files/acp/templates/pageAdd.tpl b/wcfsetup/install/files/acp/templates/pageAdd.tpl index bcf74ab7b2..a0cd7f35e2 100644 --- a/wcfsetup/install/files/acp/templates/pageAdd.tpl +++ b/wcfsetup/install/files/acp/templates/pageAdd.tpl @@ -65,27 +65,6 @@ - -
-
- - - {if $errorField == 'pageType'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.page.pageType.error.{@$errorType}{/lang} - {/if} - - {/if} -
- -
@@ -227,7 +206,8 @@
- + {include file='__pageAddContent' languageID=0} + {if $errorField == 'content'} {if $errorType == 'empty'} @@ -321,7 +301,8 @@
- + {include file='__pageAddContent' languageID=$availableLanguage->languageID} + {if $errorField == 'content'} {if $errorType == 'empty'} @@ -377,6 +358,7 @@
+ {@SECURITY_TOKEN_INPUT_TAG}
diff --git a/wcfsetup/install/files/acp/templates/pageAddDialog.tpl b/wcfsetup/install/files/acp/templates/pageAddDialog.tpl new file mode 100644 index 0000000000..088687fc21 --- /dev/null +++ b/wcfsetup/install/files/acp/templates/pageAddDialog.tpl @@ -0,0 +1,40 @@ + + diff --git a/wcfsetup/install/files/acp/templates/pageList.tpl b/wcfsetup/install/files/acp/templates/pageList.tpl index 796423c320..3f39c05e0d 100644 --- a/wcfsetup/install/files/acp/templates/pageList.tpl +++ b/wcfsetup/install/files/acp/templates/pageList.tpl @@ -16,9 +16,7 @@