Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added iframe page for challenge

  • Loading branch information...
commit 3e622fab379c925d3b6b1c8806285e5c0d263802 1 parent a199733
@jeffdonthemic jeffdonthemic authored
View
7 app/controllers/challenges_controller.rb
@@ -381,6 +381,13 @@ def recent
format.json { render :json => @challenges }
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
show_open = false
View
13 app/views/challenges/iframe.html.erb
@@ -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>
View
3  config/routes.rb
@@ -52,7 +52,8 @@
match 'challenges/feed/recent', :to => 'challenges#feed_recent', :as => :feed_recent, :defaults => { :format => 'atom' }
match 'challenges/recent', :to => 'challenges#recent'
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/register', :to => 'challenges#register', :as => :register
match 'challenges/:id/agree_to_tos', :to => 'challenges#register_agree_to_tos', :as => :agree_tos
View
BIN  db/development.sqlite3
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.