/src/main/resources/static/my-post-receive-repository-hook.soy
https://bitbucket.org/HeadOnAPlate/slyoldfox_notifier · Closure Template · 122 lines · 105 code · 1 blank · 16 comment · 9 complexity · 72c1c08e953e10fe8a6bab12c278a1d3 MD5 · raw file
- {namespace be.foreach.stash.hook.mypostreceiverepositoryhook}
- /**
- * @param? config
- * @param? errors
- */
- {template .view}
- /**
- * General settings
- */
- <h3>General</h3>
- {call aui.form.textField}
- {param id: 'branchFilter' /}
- {param value: $config ? $config['branchFilter'] : null /}
- {param labelContent: 'Exclude branches containing' /}
- {param descriptionText: 'If a branch contains this text, it is not notified (separated by ; for multiple filters)' /}
- {param errorTexts: $errors ? $errors['branchFilter'] : null /}
- {/call}
- {call aui.form.checkboxField}
- {param name: 'notificationTypes' /}
- {param legendContent: 'Notification type(s)' /}
- {param errorTexts: $errors ? $errors['notificationTypesError'] : null /}
- {param isRequired: 'true' /}
- {param fields : [
- [ 'id': 'mailNotification', 'value': 'true', 'labelText': 'Mail', 'isChecked': $config['mailToAddress'] or ($errors and $errors['mailToAddress'])],
- [ 'id': 'slackNotification', 'value': 'true', 'labelText': 'Slack', 'isChecked': $config['slackWebHookUrl'] or ($errors and $errors['slackWebHookUrl'])]
- ] /}
- {/call}
- /**
- * Mail settings
- */
- <div id="mailSection" class="hidden">
- <h3>Mail</h3>
- {call aui.form.textField}
- {param id: 'mailToAddress' /}
- {param value: $config ? $config['mailToAddress'] : null /}
- {param labelContent: 'Mail to' /}
- {param descriptionText: 'Whom to send emails to (separated by ; for multiple addresses)' /}
- {param errorTexts: $errors ? $errors['mailToAddress'] : null /}
- {param isRequired: 'true' /}
- {/call}
- {call aui.form.radioField}
- {param name: 'mailOverrideFrom' /}
- {param legendContent : 'Override "From"?' /}
- {param fields : [
- [ 'id': 'override-from-yes', 'value': 'true', 'labelText': 'Yes', 'isChecked': $config['mailOverrideFrom'] == 'true' ],
- [ 'id': 'override-from-nok', 'value': 'false', 'labelText': 'No', 'isChecked': $config['mailOverrideFrom'] != 'true' ]
- ] /}
- {/call}
- {call aui.form.textareaField}
- {param id: 'mailFromTemplate' /}
- {param value: $config ? $config['mailFromTemplate'] : null /}
- {param labelContent}
- <a href="https://bitbucket.org/slyoldfox/notifier/src/b160edc865961baed7861b1b7dc5b1bfe1587fb5/src/main/resources/templates/notifyemailfrom.vm" target="_blank">Example</a>
- {/param}
- {param descriptionText: 'The velocity template that generates the "From"' /}
- {param errorTexts: $errors ? $errors['mailFromTemplate'] : null /}
- {/call}
- {call aui.form.radioField}
- {param name: 'mailOverrideSubject' /}
- {param legendContent : 'Override "Subject"?' /}
- {param fields : [
- [ 'id': 'override-subject-yes', 'value': 'true', 'labelText': 'Yes', 'isChecked': $config['mailOverrideSubject'] == 'true' ],
- [ 'id': 'override-subject-nok', 'value': 'false', 'labelText': 'No', 'isChecked': $config['mailOverrideSubject'] != 'true' ]
- ] /}
- {/call}
- {call aui.form.textareaField}
- {param id: 'mailSubjectTemplate' /}
- {param value: $config ? $config['mailSubjectTemplate'] : null /}
- {param labelContent}
- <a href="https://bitbucket.org/slyoldfox/notifier/src/b160edc865961baed7861b1b7dc5b1bfe1587fb5/src/main/resources/templates/notifyemailsubject.vm" target="_blank">Example</a>
- {/param}
- {param descriptionText: 'The velocity template that generates the "Subject"' /}
- {param errorTexts: $errors ? $errors['mailSubjectTemplate'] : null /}
- {/call}
- {call aui.form.radioField}
- {param name: 'mailOverrideBody' /}
- {param legendContent : 'Override "Body"?' /}
- {param fields : [
- [ 'id': 'override-body-yes', 'value': 'true', 'labelText': 'Yes', 'isChecked': $config['mailOverrideBody'] == 'true' ],
- [ 'id': 'override-body-nok', 'value': 'false', 'labelText': 'No', 'isChecked': $config['mailOverrideBody'] != 'true' ]
- ] /}
- {/call}
- {call aui.form.textareaField}
- {param id: 'mailBodyTemplate' /}
- {param value: $config ? $config['mailBodyTemplate'] : null /}
- {param labelContent}
- <a href="https://bitbucket.org/slyoldfox/notifier/src/b160edc865961baed7861b1b7dc5b1bfe1587fb5/src/main/resources/templates/notifyemail.vm" target="_blank">Example</a>
- {/param}
- {param descriptionText: 'The velocity template that generates the mail body' /}
- {param errorTexts: $errors ? $errors['mailBodyTemplate'] : null /}
- {/call}
- </div>
- /**
- * Slack settings
- */
- <div id="slackSection" class="hidden">
- <h3>Slack settings</h3>
- {call aui.form.textField}
- {param id: 'slackWebHookUrl' /}
- {param value: $config ? $config['slackWebHookUrl'] : null /}
- {param labelContent: 'Slack Webhook URL' /}
- {param descriptionText: 'The Slack web hook Integration URL' /}
- {param errorTexts: $errors ? $errors['slackWebHookUrl'] : null /}
- {param isRequired: 'true' /}
- {/call}
- {call aui.form.textField}
- {param id: 'slackChannels' /}
- {param value: $config ? $config['slackChannels'] : null /}
- {param labelContent: 'Slack channels' /}
- {param descriptionText: 'Which channels or people to direct message on Slack (separated by ; for multiple #channels/@users)' /}
- {param errorTexts: $errors ? $errors['slackChannels'] : null /}
- {param isRequired: 'true' /}
- {/call}
- </div>
- /**
- * Other
- */
- <script type="text/javascript">
- require('notifier/notifier').onReady();
- </script>
- {/template}