Skip to content

Commit fba075f

Browse files
committed
Small dashboard for registrations.
1 parent b08637d commit fba075f

6 files changed

Lines changed: 19 additions & 5 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ config/database.yml
1717
config/gmail_smtp_webmaster.yml
1818

1919
.DS_Store
20+
.env
21+
tmp/

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ gem 'rails', '3.2.15'
44
gem 'rake', '~> 10.1'
55
gem 'thin', '~> 1.6'
66

7-
gem 'mysql2'
87
gem 'devise', '>= 2.1'
98
gem 'cornell_ldap', '>= 1.4.0'
109
gem 'cornell_netid', '>= 1.1.0'
@@ -32,6 +31,7 @@ group :test, :development do
3231
gem "factory_girl_rails" if RUBY_VERSION >= "1.9.2"
3332
gem "brakeman", "~> 1.7.0"
3433
gem "letter_opener"
34+
gem "dotenv-rails"
3535
end
3636

3737
# To use ActiveModel has_secure_password

Gemfile.lock

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ GEM
7272
thread_safe (~> 0.1)
7373
warden (~> 1.2.3)
7474
diff-lcs (1.2.4)
75+
dotenv (2.0.1)
76+
dotenv-rails (2.0.1)
77+
dotenv (= 2.0.1)
7578
erubis (2.7.0)
7679
eventmachine (1.0.8)
7780
exception_notification (3.0.1)
@@ -104,7 +107,6 @@ GEM
104107
treetop (~> 1.4.8)
105108
mime-types (1.25)
106109
multi_json (1.8.2)
107-
mysql2 (0.3.13)
108110
net-ldap (0.3.1)
109111
orm_adapter (0.4.0)
110112
pg (0.18.4)
@@ -198,11 +200,11 @@ DEPENDENCIES
198200
cornell_ldap (>= 1.4.0)
199201
cornell_netid (>= 1.1.0)
200202
devise (>= 2.1)
203+
dotenv-rails
201204
exception_notification (~> 3.0)
202205
factory_girl_rails
203206
jquery-rails
204207
letter_opener
205-
mysql2
206208
pg
207209
rails (= 3.2.15)
208210
rake (~> 10.1)

app/controllers/registrations_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
class RegistrationsController < ApplicationController
2+
http_basic_authenticate_with({
3+
name: ENV['BASIC_AUTH_USERNAME'],
4+
password: ENV['BASIC_AUTH_PASSWORD'],
5+
except: [:new, :create]
6+
})
7+
28
# GET /registrations
39
# GET /registrations.json
410
def index

app/views/registrations/index.html.erb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
<% end %>
2727
</table>
2828

29-
<br />
29+
<% if @registrations.empty? %>
30+
<p>No registrations yet.</p>
31+
<% end %>
3032

31-
<%= link_to 'New Registration', new_registration_path %>
33+
<br />

config/routes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
match 'nyyms' => 'nyyms#create', :via => [:post]
66
match 'mp3s' => 'nyyms#mp3s', :via => [:get]
77

8+
match 'registrations' => 'registrations#index', :via => [:get]
9+
810
root :to => 'registrations#new'
911
end

0 commit comments

Comments
 (0)