-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Akash Manohar J <[email protected]>
- Loading branch information
Showing
15 changed files
with
89 additions
and
28 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class Kandan.Helpers.Utils | ||
|
||
@time_to_string: (time) -> | ||
return time if (typeof time != "object") | ||
am = time.getHours() < 12 | ||
hours = time.getHours() | ||
ampm = "AM" if am == true | ||
if am != true | ||
ampm = "PM" | ||
hours = hours - 12 if hours != 12 | ||
minutes = time.getMinutes().toString() | ||
minutes = "0#{minutes}" if minutes.length == 1 | ||
return "#{ time.getFullYear() }-#{ time.getMonth() + 1 }-#{ time.getDate() } #{ hours }:#{ minutes }#{ ampm }" |
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
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
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
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
27 changes: 27 additions & 0 deletions
27
app/assets/javascripts/backbone/views/create_channel.js.coffee
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class Kandan.Views.CreateChannel extends Backbone.View | ||
|
||
template: _.template ''' | ||
<input class="new_channel" type="text"/> | ||
<button>create</button> | ||
''' | ||
|
||
events: | ||
"click button": "create_channel" | ||
|
||
render: ()-> | ||
$(@el).html(@template()) | ||
@ | ||
|
||
create_channel: (event)-> | ||
# TODO check for valid values | ||
channel_name = $(".new_channel").val() | ||
channel = new Kandan.Models.Channel({name: channel_name}) | ||
channel.save({}, { | ||
success: (model)=> | ||
channel_area = "#channels-#{model.get('id')}" | ||
$("#channels").tabs('add', channel_area, model.get('name')) | ||
view = new Kandan.Views.ListActivities({channel: model}) | ||
|
||
$(channel_area).html($(view.render().el).html()) | ||
$(channel_area).data('channel_id', model.get('id')) | ||
}) |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<%- @activity.content %> | ||
<%= activity.created_at %>: <%- @activity.content %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<%= @activity.user.first_name %>: <%- @activity.content %> | ||
<%= @activity.user.first_name %> (<%= @activity.created_at %>): <%- @activity.content %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<%= @activity.user.first_name %> <%= @activity.action %>ed <%= @activity.content %> | ||
<%= @activity.created_at %>: <%= @activity.user.first_name %> <%= @activity.action %>ed <%= @activity.content %> |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,7 @@ | |
}) | ||
<%- end %> | ||
|
||
<div class="create_channel"></div> | ||
|
||
<div class="container"></div> | ||
<div class="sidebar"></div> |