Permalink
Browse files

adding the assignment dashboard to the myspot

  • Loading branch information...
eliboldr committed Jan 15, 2010
1 parent 67ca6d8 commit 70442e6c2d44e95e2a915c663de963b07830f56b
@@ -0,0 +1,10 @@
+class Myspot::AssignmentsController < ApplicationController
+ before_filter :login_required
+ resources_controller_for :assignments, :only => :index
+
+ private
+
+ def find_resources
+ current_user.assignments
+ end
+end
@@ -0,0 +1,2 @@
+module Myspot::AssignmentsHelper
+end
View
@@ -90,6 +90,7 @@ def pitch_sum(pitch)
has_many :jobs
has_many :samples
has_many :credits
+ has_many :assignments
has_many :comments
has_many :contributor_applications
@@ -7,4 +7,5 @@
%li= link_to "Blog Posts (#{current_user.posts.count})", myspot_posts_path, :id => "dashboard_posts_tab"
%li= link_to "Tips (#{current_user.tips.count})", myspot_tips_path, :id => "dashboard_tips_tab"
%li= link_to "Comments (#{current_user.comments.count})", myspot_comments_path, :id => "dashboard_comments_tab"
+ %li= link_to "Assignments (#{current_user.assignments.count})", myspot_assignments_path, :id => "dashboard_assignments_tab"
.clear
@@ -0,0 +1,9 @@
+%tr
+ %td.tip
+ %p
+ Assignment:
+ = assignment.title
+ = assignment.body
+ Assignment associated with:
+ = link_to h(assignment.pitch.headline), pitch_url(assignment.pitch)
+ %td.created= assignment.created_at.to_s(:date)
@@ -0,0 +1,3 @@
+%tr
+ %td{:colspan => 4}
+ %hr
@@ -0,0 +1,19 @@
+%h2 My Spot
+
+= render :partial => "myspot/nav"
+
+.span-715.box_white
+ = render :partial => "myspot/dashboard_nav"
+ %table.tips
+ %tr
+ %th.tip_header Assignment
+ %th.created_header Created
+ %tr
+ %td{:colspan => 4}
+ .double_content_border
+ = render :partial => "myspot/assignments/assignment", :collection => @assignments, :spacer_template => "myspot/assignments/assignment_spacer"
+ .double_content_border
+
+
+.span-160.box_white
+ = render :partial => "layouts/common_questions"
View
@@ -75,6 +75,7 @@
myspot.resources :purchases, :collection => {:paypal_return => :get, :paypal_ipn => :post}
myspot.resources :tips
myspot.resources :comments
+ myspot.resources :assignments
end
map.connect '*path', :controller => 'homes', :action => 'show'

0 comments on commit 70442e6

Please sign in to comment.