Skip to content

Instantly share code, notes, and snippets.

@GeoffWilliams
Last active August 12, 2019 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GeoffWilliams/936f56415c68bc9e65777bd1beea551c to your computer and use it in GitHub Desktop.
Save GeoffWilliams/936f56415c68bc9e65777bd1beea551c to your computer and use it in GitHub Desktop.
atlassian soy examples
/**
* @param? config
* @param? errors
* The annotations are essential to inject $config and $errors!
* If you don't use a doc-string variable you injected... Whole form crashes until you remove it!
* Browsers cache compiled soy.. clear cache and reload if its not updating!
*/
{template .view}
</h1>This is just a brain dump</h1>
<h2>Text Field</h2>
{call aui.form.textField}
{param id: 'customRulesUri' /}
{param value: $config ? $config['customRulesUri'] : null /}
{param labelContent: 'URI' /}
{param descriptionText: 'Load custom rules from this URI' /}
{param errorTexts: $errors ? $errors['customRulesUri'] : null /}
{/call}
<h2>Radio button</h2>
{call aui.form.radioField}
{param id : 'radio-field' /}
{param legendContent: 'Include/Exclude' /}
{param fields: [[
'id' : 'include',
'value' : 'include',
'labelText': 'Include',
'isChecked': ($config['radio-field'] == 'include') ? true : false
],[
'id' : 'exclude',
'value' : 'exclude',
'labelText': 'Exclude',
'isChecked': ($config['radio-field'] == 'exclude') ? true : false
]] /}
{param isRequired: true /}
{param descriptionText: 'description' /}
{/call}
<h2>checkbox</h2>
{call aui.form.checkboxField}
{param legendContent: 'Redress tickets enabled' /}
{param fields: [[
'id' : 'redressTicketsEnabled',
'labelText' : 'Allow overrides via Jira tickets',
'isChecked': (length(keys($config)) == 0) ? true: $config['redressTicketsEnabled']
]] /}
{/call}
<h2>Hidden Field</h2>
<input type="hidden" id="selectedProject" value="{ $config ? $config['redressTicketProjectBox'] : null }" />
<h2>Drop down list/HTML select</h2>
{call aui.form.selectField}
{param id: 'statusApproveBox' /}
{param labelContent: 'Approve tickets' /}
{param descriptionText: 'Resolution to allow overrides' /}
{param options: [] /}
{/call}
<h2>Button</h2>
{call aui.buttons.button}
{param text: 'Button'/}
{/call}
{/template}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment