1 <dl id="{@$field->getPrefixedId()}Container"{*
2 *}{if !$field->getClasses()|empty} class="{implode from=$field->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
3 *}{foreach from=$field->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
4 *}{if !$field->checkDependencies()} style="display: none;"{/if}{*
6 <dt>{if $field->getLabel() !== null}<label for="{@$field->getPrefixedId()}">{@$field->getLabel()}</label>{/if}</dt>
8 <div class="row rowColGap formGrid">
9 <dl class="col-xs-12 col-md-10">
12 <select id="{@$field->getPrefixedId()}_instructionsType">
13 <option value="" selected disabled>{lang}wcf.acp.devtools.project.instructions.type{/lang}</option>
14 <option value="install">{lang}wcf.acp.devtools.project.instructions.type.install{/lang}</option>
15 <option value="update">{lang}wcf.acp.devtools.project.instructions.type.update{/lang}</option>
20 <dl class="col-xs-12 col-md-5" style="display: none;">
23 <input type="text" id="{@$field->getPrefixedId()}_fromVersion" class="long" placeholder="{lang}wcf.acp.devtools.project.instructions.update.fromVersion{/lang}">
24 <small>{lang}wcf.acp.devtools.project.instructions.update.fromVersion.description{/lang}</small>
28 <dl class="col-xs-12 col-md-2 text-right">
31 <a href="#" class="button small" id="{@$field->getPrefixedId()}_addButton">{lang}wcf.global.button.add{/lang}</a>
36 <ul id="{@$field->getPrefixedId()}_instructionsList"></ul>
38 {capture assign='instructionsTemplate'}
39 <header class="sectionHeader">
40 <h2 class="sectionTitle">
41 {literal}{if $type === 'update'}{/literal}
42 <span class="icon icon16 fa-pencil pointer jsTooltip" id="{@$field->getPrefixedId()}_instructions{literal}{$instructionsId}{/literal}_editButton" title="{lang}wcf.global.button.edit{/lang}"></span>
43 <span class="icon icon16 fa-times pointer jsTooltip" id="{@$field->getPrefixedId()}_instructions{literal}{$instructionsId}{/literal}_deleteButton" title="{lang}wcf.global.button.delete{/lang}"></span>
44 {literal}{/if}{/literal}
45 {literal}<span class="jsInstructionsTitle">{$sectionTitle}</span>{/literal}
47 <p class="sectionDescription">{lang}wcf.acp.devtools.project.instructions.instructions.description{/lang}</p>
50 <div id="{@$field->getPrefixedId()}_instructions{literal}{$instructionsId}{/literal}_instructionListContainer">
51 <ol class="sortableList nativeList" id="{@$field->getPrefixedId()}_instructions{literal}{$instructionsId}{/literal}_instructionList"></ol>
54 <div class="row rowColGap formGrid">
55 <dl class="col-xs-12 col-md-3">
58 <select id="{@$field->getPrefixedId()}_instructions{literal}{$instructionsId}{/literal}_pip">
59 <option value="" selected disabled>{lang}wcf.acp.devtools.project.instruction.packageInstallationPlugin{/lang}</option>
60 {foreach from=$packageInstallationPlugins item=packageInstallationPlugin}
61 <option value="{@$packageInstallationPlugin->pluginName}">{@$packageInstallationPlugin->pluginName}</option>
67 <dl class="col-xs-12 col-md-9">
70 <input type="text" id="{@$field->getPrefixedId()}_instructions{literal}{$instructionsId}{/literal}_value" class="long" placeholder="{lang}wcf.acp.devtools.project.instruction.value{/lang}">
71 <small id="{@$field->getPrefixedId()}_instructions{literal}{$instructionsId}{/literal}_valueDescription">{lang}wcf.acp.devtools.project.instruction.value.description{/lang}</small>
75 <dl class="col-xs-12 col-md-2" style="display: none;">
78 <select id="{@$field->getPrefixedId()}_instructions{literal}{$instructionsId}{/literal}_application">
79 <option value="" selected disabled>{lang}wcf.acp.devtools.project.instruction.application{/lang}</option>
80 {foreach from=$apps item=app}
81 <option value="{@$app->getAbbreviation()}">{@$app->getAbbreviation()}</option>
87 <dl class="col-xs-12 col-md-10">
90 <label><input type="checkbox" id="{@$field->getPrefixedId()}_instructions{literal}{$instructionsId}{/literal}_runStandalone" value="1"> {lang}wcf.acp.devtools.project.instruction.runStandalone{/lang}</label>
91 <small>{lang}wcf.acp.devtools.project.instruction.runStandalone.description{/lang}</small>
95 <dl class="col-xs-12 col-md-2 text-right">
98 <a href="#" class="button small" id="{@$field->getPrefixedId()}_instructions{literal}{$instructionsId}{/literal}_addButton">{lang}wcf.global.button.add{/lang}</a>
104 {capture assign='instructionsEditDialogContent'}
105 <div class="section">
107 <dt>{lang}wcf.acp.devtools.project.instructions.update.fromVersion{/lang}</dt>
109 <input type="text" name="fromVersion" class="long" value="{literal}{$fromVersion}{/literal}" autofocus />
110 <small>{lang}wcf.acp.devtools.project.instructions.update.fromVersion.description{/lang}</small>
115 <div class="formSubmit">
116 <button data-type="submit" class="buttonPrimary">{lang}wcf.global.button.submit{/lang}</button>
120 {capture assign='instructionEditDialogContent'}
121 <div class="section">
123 <dt>{lang}wcf.acp.devtools.project.instruction.packageInstallationPlugin{/lang}</dt>
126 <option value="" selected>{lang}wcf.global.noSelection{/lang}</option>
127 {foreach from=$packageInstallationPlugins item=packageInstallationPlugin}
128 <option value="{@$packageInstallationPlugin->pluginName}">{@$packageInstallationPlugin->pluginName}</option>
135 <dt>{lang}wcf.acp.devtools.project.instruction.value{/lang}</dt>
137 <input type="text" name="value" class="long" value="{literal}{$value}{/literal}">
138 <small class="jsInstructionValueDescription">{lang}wcf.acp.devtools.project.instruction.value.description{/lang}</small>
142 <dl style="display: none;">
143 <dt>{lang}wcf.acp.devtools.project.instruction.application{/lang}</dt>
145 <select name="application">
146 <option value="" selected>{lang}wcf.global.noSelection{/lang}</option>
147 {foreach from=$apps item=app}
148 <option value="{@$app->getAbbreviation()}">{@$app->getAbbreviation()}</option>
157 <label><input type="checkbox" name="runStandalone" value="1"{literal}{if $runStandalone} checked{/if}{/literal}> {lang}wcf.acp.devtools.project.instruction.runStandalone{/lang}</label>
158 <small>{lang}wcf.acp.devtools.project.instruction.runStandalone.description{/lang}</small>
163 <div class="formSubmit">
164 <button data-type="submit" class="buttonPrimary">{lang}wcf.global.button.submit{/lang}</button>
168 {include file='__formFieldDescription'}
169 {include file='__formFieldDependencies'}
170 {include file='__formFieldDataHandler'}
175 <script data-relocate="true">
178 'WoltLabSuite/Core/Acp/Form/Builder/Field/Devtools/Project/Instructions',
179 'WoltLabSuite/Core/Template'
182 InstructionsFormField,
186 'wcf.acp.devtools.project.instruction.delete.confirmMessages': '{lang}wcf.acp.devtools.project.instruction.delete.confirmMessages{/lang}',
187 'wcf.acp.devtools.project.instruction.edit': '{lang}wcf.acp.devtools.project.instruction.edit{/lang}',
188 'wcf.acp.devtools.project.instruction.instruction': '{capture assign=__languageItem}{lang __literal=true}wcf.acp.devtools.project.instruction.instruction{/lang}{/capture}{@$__languageItem|encodeJS}',
189 'wcf.acp.devtools.project.instruction.value.description': '{lang}wcf.acp.devtools.project.instruction.value.description{/lang}',
190 'wcf.acp.devtools.project.instruction.value.description.defaultFilename': '{lang __literal=true}wcf.acp.devtools.project.instruction.value.description.defaultFilename{/lang}',
191 'wcf.acp.devtools.project.instructions.delete.confirmMessages': '{lang}wcf.acp.devtools.project.instructions.delete.confirmMessages{/lang}',
192 'wcf.acp.devtools.project.instructions.edit': '{lang}wcf.acp.devtools.project.instructions.edit{/lang}',
193 'wcf.acp.devtools.project.instructions.instructions.description': '{lang}wcf.acp.devtools.project.instructions.instructions.description{/lang}',
194 'wcf.acp.devtools.project.instructions.type.install.title': '{lang}wcf.acp.devtools.project.instructions.type.install.title{/lang}',
195 'wcf.acp.devtools.project.instructions.type.update.error.duplicate': '{lang}wcf.acp.devtools.project.instructions.type.update.error.duplicate{/lang}',
196 'wcf.acp.devtools.project.instructions.type.update.title': '{lang __literal=true}wcf.acp.devtools.project.instructions.type.update.title{/lang}',
197 'wcf.global.form.error.noValidSelection': '{lang}wcf.global.form.error.noValidSelection{/lang}'
200 var instructionsTemplate = new Template('{@$instructionsTemplate|encodeJS}');
201 var instructionsEditDialogTemplate = new Template('{@$instructionsEditDialogContent|encodeJS}');
202 var instructionEditDialogTemplate = new Template('{@$instructionEditDialogContent|encodeJS}');
204 new InstructionsFormField(
205 '{@$field->getPrefixedId()}',
206 instructionsTemplate,
207 instructionsEditDialogTemplate,
208 instructionEditDialogTemplate,
210 {implode from=$packageInstallationPlugins item=packageInstallationPlugin}
211 '{$packageInstallationPlugin->pluginName}': '{$packageInstallationPlugin->getDefaultFilename()}'
215 {implode from=$field->getValue() key=instructionsKey item=instructions}
218 {assign var='__instructionsHasError' value=false}
219 {foreach from=$field->getValidationErrors() item=validationError}
220 {if $validationError->getInformation()[instructions]|isset && $validationError->getInformation()[instructions] === $instructionsKey && !$validationError->getInformation()[instruction]|isset}
221 {if $__instructionsHasError},{/if}
222 '{@$validationError->getMessage()|encodeJS}'
224 {assign var='__instructionsHasError' value=true}
228 {if $instructions[type] === 'update'}
229 fromVersion: '{$instructions[fromVersion]}',
232 {if !$instructions[instructions]|empty}
233 {implode from=$instructions[instructions] key=instructionKey item=instruction}
235 application: '{if $instruction[application]|isset}{$instruction[application]}{/if}',
237 {assign var='__instructionHasError' value=false}
238 {foreach from=$field->getValidationErrors() item=validationError}
239 {if $validationError->getInformation()[instructions]|isset && $validationError->getInformation()[instructions] === $instructionsKey && $validationError->getInformation()[instruction]|isset && $validationError->getInformation()[instruction] === $instructionKey}
240 {if $__instructionHasError},{/if}
241 '{@$validationError->getMessage()|encodeJS}'
243 {assign var='__instructionHasError' value=true}
247 pip: '{$instruction[pip]}',
248 runStandalone: {$instruction[runStandalone]|intval},
249 value: '{$instruction[value]|encodeJS}'
254 type: '{@$instructions[type]}'