Skip to content

Commit

Permalink
Adds working views
Browse files Browse the repository at this point in the history
Signed-off-by: Akash Manohar J <akash@akash.im>
  • Loading branch information
HashNuke committed Mar 9, 2012
1 parent 3698cc0 commit f87789a
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 25 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Expand Up @@ -11,6 +11,7 @@
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require ember-dev
//= require lib/ember-rest.js
Expand Down
@@ -1,9 +1,2 @@
Kandan.ChannelsController = Ember.ResourceController.create({
Kandan.ChannelsController = Ember.ResourceController.create
resourceType: Kandan.Channel


# load: (json)->
# console.log "activity loads..."
# console.log json
# @_super(json)
})
@@ -1,2 +1,2 @@
Kandan.UsersController = Ember.ResourceController.create
resourceType: Kandan.User
resourceType: Kandan.User
@@ -1,4 +1,4 @@
List activitiy boxes for channels here
List activitiy boxes for channels below:
{{#each channels}}
{{view Kandan.ListChannelActivitiesView channelBinding="this"}}
{{/each}}
@@ -1 +1 @@
USER:{{activity.user.id}} {{activity.id}} - {{activity.content}}
{{activity.user.first_name}}: {{activity.content}}
@@ -1,4 +1,5 @@
Kandan.ListActivitiesView = Ember.View.extend({
templateName: 'ember/templates/activities/list_activities'
channelsBinding: 'Kandan.ChannelsController'
activitiesBinding: 'Kandan.ActivitiesController'
})
@@ -1,7 +1,2 @@
Kandan.ListChannelActivitiesView = Ember.View.extend({
templateName: 'ember/templates/activities/list_channel_activities'
channelBinding: 'Kandan.ChannelsController'
activitiesBinding: 'Kandan.ActivitiesController'
# userBinding: 'Kandan.UsersController'

})
Kandan.ListChannelActivitiesView = Ember.View.extend
templateName: 'ember/templates/activities/list_channel_activities'
3 changes: 1 addition & 2 deletions app/assets/javascripts/ember/views/channels/list.js.coffee
@@ -1,7 +1,6 @@
Kandan.ListChannelsView = Ember.View.extend({
Kandan.ListChannelsView = Ember.View.extend
templateName: 'ember/templates/channels/list'
channelsBinding: 'Kandan.ChannelsController'

refreshList: ()->
Kandan.ChannelsController.findAll()
})
2 changes: 2 additions & 0 deletions app/assets/javascripts/init.js.coffee
@@ -0,0 +1,2 @@
$ ->
$(".channels").tabs()
12 changes: 7 additions & 5 deletions app/views/main/index.html.erb
Expand Up @@ -10,12 +10,14 @@
</script>

<%= javascript_tag do %>
$(function() {
$(function()
{
var channels_json = <%= @channels.to_json(
:include => {
:activities => {
:include=>:user
}}).html_safe %>
:include => {
:activities => {
:include=>:user
}
}).html_safe %>
Kandan.ChannelsController.loadAll(channels_json);
});
<%- end %>
Expand Down

0 comments on commit f87789a

Please sign in to comment.