Skip to content

Commit

Permalink
added iframe page for challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdonthemic committed Sep 7, 2012
1 parent a199733 commit 3e622fa
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/controllers/challenges_controller.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -381,6 +381,13 @@ def recent
format.json { render :json => @challenges } format.json { render :json => @challenges }
end end
end end

# no need to check if challenge exists. taken care of in the view
def iframe
@challenge_detail = current_challenge
determine_page_title
render :layout => "blank"
end


def feed def feed
show_open = false show_open = false
Expand Down
13 changes: 13 additions & 0 deletions app/views/challenges/iframe.html.erb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,13 @@
<div>
<% if @challenge_detail %>
<%= link_to @challenge_detail['Name'], challenge_preview_path, :target => '_blank' %><br/>
Top Prize: <%= @challenge_detail["Top_Prize__c"] %><br/>
Starts: <%= DateTime.parse(@challenge_detail["Start_Date__c"]).strftime("%B %e, %Y at %I:%M%p") %><br/>
Ends: <%= DateTime.parse(@challenge_detail["End_Date__c"]).strftime("%B %e, %Y at %I:%M%p") %><br/>
Winner Announced: <%= Date.parse(@challenge_detail["Winner_Announced__c"]).strftime("%B %e, %Y") %><br/>
<%= link_to "View all submission files", all_submissions_path, :target => '_blank' %><br/>
<%= link_to "Score submissions", outstanding_reviews_path, :target => '_blank' %>
<% else %>
No challenge found.
<% end %>
</div>
3 changes: 2 additions & 1 deletion config/routes.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
match 'challenges/feed/recent', :to => 'challenges#feed_recent', :as => :feed_recent, :defaults => { :format => 'atom' } match 'challenges/feed/recent', :to => 'challenges#feed_recent', :as => :feed_recent, :defaults => { :format => 'atom' }
match 'challenges/recent', :to => 'challenges#recent' match 'challenges/recent', :to => 'challenges#recent'
match 'challenges/:id', :to => 'challenges#show', :as => :challenge match 'challenges/:id', :to => 'challenges#show', :as => :challenge
match 'challenges/:id/preview', :to => 'challenges#preview' match 'challenges/:id/iframe', :to => 'challenges#iframe', :as => :challenge_iframe
match 'challenges/:id/preview', :to => 'challenges#preview', :as => :challenge_preview
match 'challenges/:id/registrants', :to => 'challenges#registrants', :as => :registrants match 'challenges/:id/registrants', :to => 'challenges#registrants', :as => :registrants
match 'challenges/:id/register', :to => 'challenges#register', :as => :register match 'challenges/:id/register', :to => 'challenges#register', :as => :register
match 'challenges/:id/agree_to_tos', :to => 'challenges#register_agree_to_tos', :as => :agree_tos match 'challenges/:id/agree_to_tos', :to => 'challenges#register_agree_to_tos', :as => :agree_tos
Expand Down
Binary file modified db/development.sqlite3
Binary file not shown.

0 comments on commit 3e622fa

Please sign in to comment.