Skip to content

Instantly share code, notes, and snippets.

@jeffleeismyhero
Created April 20, 2015 20: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 jeffleeismyhero/a16b60d07c91774afc50 to your computer and use it in GitHub Desktop.
Save jeffleeismyhero/a16b60d07c91774afc50 to your computer and use it in GitHub Desktop.
Ticket JSON
{
"groups":[
{
"id":"customer-details",
"title":"Customer Details",
"sections":[
{
"id":"customer-details-0",
"fields":[
{
"id":"first_name",
"title":"First name",
"info":"Primary Purchaser's Name",
"type":"name",
"size":{
"width":30,
"height":1
},
"validations":{
"required":false,
"min_length":1
}
},
{
"id":"last_name",
"title":"Last name",
"type":"name",
"info":"Primary Purchaser's Name",
"size":{
"width":30,
"height":1
},
"validations":{
"required":false,
"min_length":1
}
},
{
"id":"phone",
"title":"Phone number",
"type":"text",
"input_type":"number",
"info":"Include the area code",
"size":{
"width":25,
"height":1
}
},
]
},
]
},
{
"id":"tickets",
"title":"Tickets",
"sections":[
{
"id":"more-tickets",
"type":"dynamic",
"action_title":"ADD TICKET ✛",
"fields":null
},
]
}
],
"templates":{
"fields":null,
"sections":[
{
"id":"more-tickets",
"fields":[
{
"id":"ticket_type",
"title":"Ticket Type",
"info":"Type of ticket",
"type":"select",
"size":{
"width":100,
"height":1
},
"values":[
{
"id":0,
"title":"Adult Ticket",
"default":true,
"targets":[
{
"id":"tickets[:index].price",
"type":"field",
"action":"update",
"value":39
},
{
"id":"tickets[:index].quantity",
"type":"field",
"action":"update",
"value": 1,
}
]
},
{
"id":1,
"title":"Child Ticket",
}
]
},
{
"id":"start_date",
"title":"Start date",
"type":"date",
"size":{
"width":25,
"height":1
},
"info":"Tickets are valid starting on this date",
"validations":{
"required":true,
}
},
{
"id":"tickets[:index].quantity",
"title":"Quantity",
"type":"float",
"value":1,
"size":{
"width":20,
"height":1
},
"targets":[
{
"id":"total",
"type":"field",
"action":"update"
}
],
"validations":{
"max_value":100,
"min_value":1,
"required":true
}
},
{
"id":"tickets[:index].price",
"title":"Price",
"type":"float",
"size":{
"width":30,
"height":1
},
"targets":[
{
"id":"total",
"type":"field",
"action":"update"
}
],
"validations":{
"max_value":100,
"min_value":1
}
},
{
"id":"total",
"title":"Total",
"type":"float",
"size":{
"width":25,
"height":1
},
"disabled":true,
"formula":"$tickets[:index].quantity * $tickets[:index].price"
},
{
"id":"tickets[:index].remove",
"title":"Remove",
"type":"button",
"size":{
"width":20,
"height":1
}
},
]
},
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment