Cotton code
165 lines · 3.1 KB · JSONRaw
{  "format_version": 1,  "id": "music_album",  "name": "Album",  "plural": "Albums",  "picture": null,  "builtin": false,  "visibility": "owner",  "engine": null,  "columns": [    {      "key": "title",      "name": "Title",      "type": "text",      "required": true,      "placeholder": "Name this album"    },    {      "key": "artist",      "name": "Artist",      "type": "link",      "link_to": "artist"    },    {      "key": "cover",      "name": "Cover",      "type": "photo"    },    {      "key": "year",      "name": "Year",      "type": "text"    },    {      "key": "artist_name",      "name": "By",      "type": "text",      "computed": {        "lookup": {          "through": "artist",          "column": "name"        }      }    },    {      "key": "songs",      "name": "Songs",      "type": "number",      "units": {        "one": "song",        "other": "songs"      },      "computed": {        "rollup": {          "table": "track",          "link": "album",          "op": "count"        }      }    },    {      "key": "length",      "name": "Length",      "type": "number",      "format": "duration",      "computed": {        "rollup": {          "table": "track",          "link": "album",          "op": "sum",          "column": "duration"        }      }    }  ],  "title": "title",  "date": null,  "project": null,  "order": null,  "slip": {    "title": "title",    "subtitle": [      "artist_name",      "year"    ],    "trailing": "songs",    "photo": "cover",    "toggle": null  },  "tile": {    "face": "slip-list"  },  "page": [    {      "heading": null,      "columns": [        "cover",        "title",        "artist",        "year"      ]    },    {      "heading": "Songs",      "list": {        "table": "track",        "link": "album",        "empty": {          "title": "No songs on this album",          "message": "Add a song and choose this album for it."        },        "add": "Add a song"      }    }  ],  "sort": {    "column": "title",    "descending": false  },  "empty": {    "title": "No albums yet",    "message": "Add an album, then its songs."  },  "create": {    "label": "Add an album"  },  "instructions": "One row per album: its title, its artist (a link), its cover photo and the year it came out, as the person says it. Its songs are the songs whose album links it, in track order; songs counts them. Never guess a year.",  "card": {    "face": "album",    "fields": [      {        "slot": "photo",        "column": "cover"      },      {        "slot": "title",        "column": "title"      },      {        "slot": "subtitle",        "column": "artist_name"      },      {        "slot": "year",        "column": "year"      },      {        "slot": "count",        "column": "songs"      },      {        "slot": "length",        "column": "length",        "form": "clock"      }    ],    "opens": {      "table": "track",      "by": "album",      "order": [        "track_number"      ]    }  }}