-
-
Save langalex/499dabb3c018aa85a9cbf86dfed014aa to your computer and use it in GitHub Desktop.
list all members bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
var subdomain = window.cobot.subdomain; | |
var client = Cobot.Api(window.cobot.access_token); | |
var storage = Cobot.Storage(window.cobot.storage_token); | |
var template = Handlebars.compile($('#app-template').html()); | |
client.get(subdomain, '/memberships', {all: true, attributes: 'name,canceled_to,user'}).done(function(memberships) { | |
$('#app').html(template({memberships: memberships})); | |
Cobot.iframeResize(); | |
}); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>List all Members</title> | |
<meta name="description" content="List all members, including canceled and not yet started."> | |
</head> | |
<body> | |
<div class="page-header"> | |
<h1>All Members</h1> | |
</div> | |
<div id="app">Loading...</div> | |
<script id="app-template" type="x-handlebars/text"> | |
<table class="table table-striped"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Email</th> | |
<th>Canceled to</th> | |
</tr> | |
</thead> | |
<tbody> | |
{{#each memberships}} | |
<tr> | |
<td>{{name}}</td> | |
<td>{{user.email}}</td> | |
<td>{{canceled_to}}</td> | |
</tr> | |
{{/each}} | |
</tbody> | |
</table> | |
</script> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script src="/javascripts/cobot_api.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment