{"size": 731, "ext": "js", "max_stars_repo_path": "app/patterns/controllers/+_layout.js", "max_stars_repo_name": "originaltrilogy/comitium", "max_stars_repo_stars_event_min_datetime": "2015-10-27T05:03:09.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-16T20:36:04.000Z", "max_issues_repo_path": "app/patterns/controllers/+_layout.js", "max_issues_repo_name": "originaltrilogy/comitium", "max_issues_repo_issues_event_min_datetime": "2015-05-10T20:55:58.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-13T00:40:15.000Z", "max_forks_repo_path": "app/patterns/controllers/+_layout.js", "max_forks_repo_name": "originaltrilogy/comitium", "max_forks_repo_forks_event_min_datetime": "2015-07-19T21:34:13.000Z", "max_forks_repo_forks_event_max_datetime": "2015-07-19T21:34:13.000Z"}
{"max_stars_count": 3, "max_issues_count": 193, "max_forks_count": 1, "avg_line_length": 25.2068965517, "max_line_length": 142, "alphanum_fraction": 0.5991792066}
// layout controller

export const handler = async (params) => {
  let controllerChain = ''
  for ( let link in params.route.chain ) {
    controllerChain += params.route.chain[link].controller + '-' + params.route.chain[link].action + '-' + params.route.chain[link].view + ','
  }
  // Get rid of the extra comma
  controllerChain = controllerChain.substring(0, controllerChain.length-1)

  return {
    public: {
      controllerChain: controllerChain
    },
    include: {
      _head: {
        controller: '_head'
      },
      _header: {
        controller: '+_header',
        view: params.session.username ? '+_header-authenticated' : '+_header'
      },
      _footer: {
        controller: '_footer'
      }
    }
  }
}
