You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.9 KiB
83 lines
2.9 KiB
{namespace com.englishtown.bitbucket.hook} |
|
|
|
/** |
|
* @param config |
|
* @param? errors |
|
*/ |
|
{template .view} |
|
|
|
// Always add one subview |
|
{call .subview data="all"} |
|
{param index: 0 /} |
|
{/call} |
|
|
|
// Add additional mirrors, up to 10 total |
|
{foreach $index in [1, 2, 3, 4, 5, 6, 7, 8, 9]} |
|
{if $config['mirrorRepoUrl' + $index] or $config['username' + $index]} |
|
{call .subview data="all"} |
|
{param index: $index /} |
|
{/call} |
|
{/if} |
|
{/foreach} |
|
|
|
// Button to add additional mirrors |
|
{call aui.buttons.button} |
|
{param id: 'et-add-button' /} |
|
{param text: 'Add Mirror' /} |
|
{param extraAttributes: 'type=button' /} |
|
{/call} |
|
|
|
// Call init method with subview callback |
|
<script> |
|
require("et/hook/mirror").init(com.englishtown.bitbucket.hook.subview, aui.buttons.button); |
|
</script> |
|
{/template} |
|
|
|
/** |
|
* @param config |
|
* @param? errors |
|
* @param index |
|
*/ |
|
{template .subview} |
|
<fieldset class="et-mirror-group"> |
|
{call aui.form.textField} |
|
{param id: 'mirrorRepoUrl' + $index /} |
|
{param value: $config['mirrorRepoUrl' + $index] /} |
|
{param labelContent} |
|
{getText('mirror-repository-hook.mirrorRepoUrl.label')} |
|
{/param} |
|
{param isRequired: true /} |
|
{param descriptionText: getText('mirror-repository-hook.mirrorRepoUrl.description') /} |
|
{param extraClasses: 'et-mirror-repo' /} |
|
{param errorTexts: $errors ? $errors['mirrorRepoUrl' + $index] : null /} |
|
{/call} |
|
{call aui.form.textField} |
|
{param id: 'username' + $index /} |
|
{param value: $config['username' + $index] /} |
|
{param labelContent} |
|
{getText('mirror-repository-hook.username.label')} |
|
{/param} |
|
{param descriptionText: getText('mirror-repository-hook.username.description') /} |
|
{param errorTexts: $errors ? $errors['username' + $index] : null /} |
|
{/call} |
|
{call aui.form.passwordField} |
|
{param id: 'password' + $index /} |
|
{param value: $config['password' + $index] /} |
|
{param labelContent} |
|
{getText('mirror-repository-hook.password.label')} |
|
{/param} |
|
{param descriptionText: getText('mirror-repository-hook.password.description') /} |
|
{param errorTexts: $errors ? $errors['password' + $index] : null /} |
|
{/call} |
|
{call aui.form.textareaField} |
|
{param id: 'refspec' + $index /} |
|
{param value: $config['refspec' + $index] /} |
|
{param labelContent} |
|
{getText('mirror-repository-hook.refspec.label')} |
|
{/param} |
|
{param descriptionText: getText('mirror-repository-hook.refspec.description') /} |
|
{param fieldWidth: 'long' /} |
|
{param errorTexts: $errors ? $errors['refspec' + $index] : null /} |
|
{/call} |
|
</fieldset> |
|
{/template}
|
|
|