Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from LasVegasRubyGroup/see_registrations

looks good, thanks Bob
  • Loading branch information...
commit 1eaadd0a657861d0a29856a94a207747bffd00d1 2 parents 91c9e11 + 3bf1af3
@JuddL333 JuddL333 authored
View
3  app/assets/javascripts/admin.js.coffee
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
View
3  app/assets/stylesheets/admin.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the admin controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
10 app/controllers/admin_controller.rb
@@ -0,0 +1,10 @@
+class AdminController < ApplicationController
+ http_basic_authenticate_with :name => ENV["ADMIN_NAME"], :password => ENV["ADMIN_PASSWORD"]
+
+ def admin
+ @registered = Registration.all
+ @waitlist = Waitlist.all
+ end
+
+
+end
View
2  app/helpers/admin_helper.rb
@@ -0,0 +1,2 @@
+module AdminHelper
+end
View
21 app/views/admin/admin.html.haml
@@ -0,0 +1,21 @@
+.row
+ .tencol.lat
+ %h2
+ =@registered.size
+ Registered
+ %ol
+ - @registered.each do |registered|
+ %li
+ = registered.name
+ = registered.email
+
+ %br
+ -if @waitlist.any?
+ %h2
+ =@waitlist.size
+ Wait List
+ %ol
+ - @waitlist.each do |waitlist|
+ %li
+ = waitlist.name
+ = waitlist.email
View
3  config/environments/development.rb
@@ -27,4 +27,7 @@
# Expands the lines which load the assets
config.assets.debug = true
+
+ ENV["ADMIN_NAME"] = "admin"
+ ENV["ADMIN_PASSWORD"] = "password"
end
View
2  config/routes.rb
@@ -14,7 +14,7 @@
match '/refund_policy', :to => 'pages#refund_policy', :as => :refund_policy
match '/hardware_requirements', :to => 'pages#hardware_requirements', :as => :hardware_requirements
-
+ match '/admin', :to => 'admin#admin', :as => :admin
match '/notification_list', :to => 'waitlists#new', :as => :survey
View
10 db/schema.rb
@@ -30,11 +30,11 @@
end
create_table "waitlists", :force => true do |t|
- t.string "name"
- t.string "email"
- t.string "phone"
- t.timestamp "created_at"
- t.timestamp "updated_at"
+ t.string "name"
+ t.string "email"
+ t.string "phone"
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
end
View
5 spec/controllers/admin_controller_spec.rb
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe AdminController do
+
+end
View
15 spec/helpers/admin_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+# Specs in this file have access to a helper object that includes
+# the AdminHelper. For example:
+#
+# describe AdminHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# helper.concat_strings("this","that").should == "this that"
+# end
+# end
+# end
+describe AdminHelper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
Please sign in to comment.
Something went wrong with that request. Please try again.