 VM = new CircleViewModel()
 stripTrailingSlash = (str) =>
   str.replace(/(.+)\/$/, "$1")
-
 
 $(document).ready () ->
   Sammy('#app', () ->

    $.post('/logout', () =>
       window.location = "/")

  projects_with_status: (filter) => @komp =>
    p for p in @projects() when p.status() == filter


    @get('/gh/:username/:project', (cx) -> VM.loadProject cx, cx.params.username, cx.params.project)
    @get('/logout', (cx) -> VM.logout(cx))
    @get('/admin(.*)', (cx) -> VM.loadAdminPage(cx, cx.params.splat))
    @get('(.*)', (cx) -> VM.unsupportedRoute(cx))
  ).run stripTrailingSlash(window.location.pathname)


