Permalink
Browse files

Merge branch 'master' of github.com:Illutron/IllutronDashboard

  • Loading branch information...
Johan
Johan committed Oct 9, 2011
2 parents c3dd7c0 + 4d74b39 commit 3083f10cb31eaf3cd4a0eefe87749efbce39f226
Showing with 95 additions and 24 deletions.
  1. BIN html/.sass-cache/120f56602294f138fa2a0d94e7bed1aeec0fd3eb/ie.scssc
  2. BIN html/.sass-cache/120f56602294f138fa2a0d94e7bed1aeec0fd3eb/print.scssc
  3. BIN html/.sass-cache/120f56602294f138fa2a0d94e7bed1aeec0fd3eb/screen.sassc
  4. BIN html/.sass-cache/1ea62f3e5aa4957f8e7fd8b95da48a00cbc08e8e/ie.scssc
  5. BIN html/.sass-cache/1ea62f3e5aa4957f8e7fd8b95da48a00cbc08e8e/print.scssc
  6. BIN html/.sass-cache/1ea62f3e5aa4957f8e7fd8b95da48a00cbc08e8e/screen.sassc
  7. BIN html/.sass-cache/2621575c5f966f9eb691431db12e865fdd4fd7a0/_base.sassc
  8. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_appearance.scssc
  9. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_background-clip.scssc
  10. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_background-origin.scssc
  11. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_background-size.scssc
  12. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_border-radius.scssc
  13. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_box-shadow.scssc
  14. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_box-sizing.scssc
  15. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_box.scssc
  16. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_columns.scssc
  17. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_font-face.scssc
  18. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_gradient.scssc
  19. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_images.scssc
  20. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_inline-block.scssc
  21. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_opacity.scssc
  22. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_shared.scssc
  23. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_text-shadow.scssc
  24. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_transform.scssc
  25. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_transition.scssc
  26. BIN html/.sass-cache/61a879e353332a6743a56b7d105cae890b6454cc/ie.scssc
  27. BIN html/.sass-cache/61a879e353332a6743a56b7d105cae890b6454cc/print.scssc
  28. BIN html/.sass-cache/61a879e353332a6743a56b7d105cae890b6454cc/screen.sassc
  29. BIN html/.sass-cache/7b585b124add732729cf49bca15cc5c458cd73b8/_base.sassc
  30. BIN html/.sass-cache/7c17c5c252c693e7fb9d979622d50f9c15a64c39/_utilities.scssc
  31. BIN html/.sass-cache/a4b6a372988651c0645c7cd2f883b75cb87e190c/_clearfix.scssc
  32. BIN html/.sass-cache/a4b6a372988651c0645c7cd2f883b75cb87e190c/_hacks.scssc
  33. BIN html/.sass-cache/d1b815ffbd075e4ffb86d3300f8f3092795d4e29/_css3.scssc
  34. BIN html/.sass-cache/d1b815ffbd075e4ffb86d3300f8f3092795d4e29/_reset.scssc
  35. BIN html/.sass-cache/d1b815ffbd075e4ffb86d3300f8f3092795d4e29/_support.scssc
  36. BIN html/.sass-cache/e62f1cba5ef2812f66e89a1893601ba1cb52cce7/_base.sassc
  37. +46 −7 static/coffee/main.coffee
  38. +35 −6 static/javascripts/main.js
  39. +14 −11 templates/dashboard.html
View
@@ -1,14 +1,34 @@
$ ()->
+ jsonUrl = "http://illutron.johan.cc/api/"
+
window.Person = Backbone.Model.extend({
+ initialize: -> alert "asd"
defaults: ->
{
- "name": "-"
+ "username": "-"
}
+
+ url: ->
+ u = jsonUrl + '/members'+'/'
+ u = u + this.get("id")
+ u
})
window.PeopleList = Backbone.Collection.extend({
model: Person
+ #url: "http://jive.local:8000/api/latest/"
+ url: jsonUrl+ "members/"
+
+ sync: (method, model, options) ->
+ options.timeout = 10000
+ options.dataType = "jsonp"
+ Backbone.sync(method, model, options)
+
+ # initialize: ->
+ # this.bind("add", this.changed)
+ #
+
})
window.People = new PeopleList
@@ -18,30 +38,49 @@ $ ()->
template: _.template($('#person-template').html())
initialize: ->
+ this.model.bind('change', this.render, this);
+ this.model.bind('destroy', this.remove, this);
+
this
render: ->
$(this.el).html(this.template(this.model.toJSON()))
this
-
-
+
})
- window.AppView = Backbone.View.extend(
+ window.AppView = Backbone.View.extend(
el: $("#app")
initialize: ->
+ People.bind('add', this.addPerson, this);
+ People.bind('reset', this.addAll, this);
+
+ People.fetch()
+
+
+ setInterval( (-> window.People.each( (person) -> person.fetch() )) , 5000);
+
this
render: -> this
-
+
+ addAll: ->
+ alert "asd"
+ People.each(this.addPerson);
+
+
addPerson: (person) ->
+ alert person.url()
view = new PersonView(model: person)
@$("#people-list").append view.render().el
)
window.App = new AppView;
- window.App.addPerson new Person({"name":"Benjamin"})
-
+ #window.App.addPerson new Person({"name":"Benjamin"})
+
+
+
+
View
@@ -1,20 +1,39 @@
(function() {
$(function() {
+ var jsonUrl;
+ jsonUrl = "http://illutron.johan.cc/api/";
window.Person = Backbone.Model.extend({
+ initialize: function() {
+ return alert("asd");
+ },
defaults: function() {
return {
- "name": "-"
+ "username": "-"
};
+ },
+ url: function() {
+ var u;
+ u = jsonUrl + '/members' + '/';
+ u = u + this.get("id");
+ return u;
}
});
window.PeopleList = Backbone.Collection.extend({
- model: Person
+ model: Person,
+ url: jsonUrl + "members/",
+ sync: function(method, model, options) {
+ options.timeout = 10000;
+ options.dataType = "jsonp";
+ return Backbone.sync(method, model, options);
+ }
});
window.People = new PeopleList;
window.PersonView = Backbone.View.extend({
tagName: "div",
template: _.template($('#person-template').html()),
initialize: function() {
+ this.model.bind('change', this.render, this);
+ this.model.bind('destroy', this.remove, this);
return this;
},
render: function() {
@@ -25,22 +44,32 @@
window.AppView = Backbone.View.extend({
el: $("#app"),
initialize: function() {
+ People.bind('add', this.addPerson, this);
+ People.bind('reset', this.addAll, this);
+ People.fetch();
+ setInterval((function() {
+ return window.People.each(function(person) {
+ return person.fetch();
+ });
+ }), 5000);
return this;
},
render: function() {
return this;
},
+ addAll: function() {
+ alert("asd");
+ return People.each(this.addPerson);
+ },
addPerson: function(person) {
var view;
+ alert(person.url());
view = new PersonView({
model: person
});
return this.$("#people-list").append(view.render().el);
}
});
- window.App = new AppView;
- return window.App.addPerson(new Person({
- "name": "Benjamin"
- }));
+ return window.App = new AppView;
});
}).call(this);
View
@@ -2,14 +2,14 @@
<html>
<head>
- <title>Illutron Checkin</title>
- <link href="{{ STATIC_URL }}stylesheets/screen.css" media="all" rel="stylesheet" type="text/css"/>
- <script src="{{ STATIC_URL }}vendor/json/json2.js"></script>
- <script src="{{ STATIC_URL }}vendor/jquery-1.6.4.min.js"></script>
- <script src="{{ STATIC_URL }}vendor/underscore-min.js"></script>
- <script src="{{ STATIC_URL }}vendor/backbone-min.js"></script>
- <!-- <script src="{{ STATIC_URL }}vendor/backbone-localstorage.js"></script> -->
- <script src="{{ STATIC_URL }}javascripts/main.js"></script>
+ <title>Illutron Dashboard</title>
+ <link href="stylesheets/screen.css" media="all" rel="stylesheet" type="text/css"/>
+ <script src="vendor/json/json2.js"></script>
+ <script src="vendor/jquery-1.6.4.min.js"></script>
+ <script src="vendor/underscore-min.js"></script>
+ <script src="vendor/backbone-min.js"></script>
+ <!-- <script src="vendor/backbone-localstorage.js"></script> -->
+ <script src="javascripts/main.js"></script>
</head>
<body>
@@ -19,12 +19,15 @@
</div>
+
+
+
<!-- Templates -->
<script type="text/template" id="person-template">
- <div class="personbox activeperson">
- <img src="http://www.illutron.dk/pictures/0000/3748/benjamin_custom100x100_.jpg?1311535360">
- <p class="person-name"><%= name %></p>
+ <div class="personbox <%= on_illutron == 1 ? 'activeperson' : '' %>">
+ <img src="http://illutron.johan.cc<%= image %>">
+ <p class="person-name"><%= id %> - <%= username %></p>
</div>
</script>

0 comments on commit 3083f10

Please sign in to comment.