Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified tasks and added profile page
- Loading branch information
1 parent
a04123e
commit 8212b76
Showing
13 changed files
with
82 additions
and
12 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,15 @@ | ||
class UsersController < ApplicationController | ||
|
||
|
||
|
||
|
||
def show | ||
@user = User.find(params[:id]) | ||
@tasks_by_name = @user.task_completions.group_by { |t| t.task.name } | ||
end | ||
|
||
|
||
|
||
|
||
|
||
end |
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,6 +1,6 @@ | ||
<% @task_list.each do |task| %> | ||
<% unless task.last_completed.present? %> | ||
<% if task.last_completed == nil %> | ||
<h4><%= task.name %></h4> | ||
<%= render "task_completions/new", :task => task %> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<% @tasks_by_name.sort.each do |name, tasks| %> | ||
<table class="table table-bordered table-striped"> | ||
<thead> | ||
<tr> | ||
<th class="span8"><%= name %></th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% for task in tasks %> | ||
<tr> | ||
<td><%= task.completed_at.strftime("%d %B, %Y")%> </td> | ||
<td><%= task.active_minutes %></td> | ||
</tr> | ||
<% end %> | ||
<tr> | ||
<td class="span8">Total Minutes</td> | ||
<td class="span4"><%= tasks.map { |t| t.active_minutes}.sum %></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<% end %> | ||
|
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,7 @@ | ||
class AddSlugToUsers < ActiveRecord::Migration | ||
def change | ||
add_column :users, :slug, :string | ||
add_index(:users, :slug) | ||
end | ||
|
||
end |
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,8 @@ | ||
class AddUserNameToUsers < ActiveRecord::Migration | ||
def change | ||
add_column :users, :username, :string | ||
add_column :users, :first_name, :string | ||
add_column :users, :last_name, :string | ||
add_column :users, :privacy, :boolean | ||
end | ||
end |
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