From: Ira W. Snyder Date: Mon, 26 Nov 2007 05:55:26 +0000 (-0800) Subject: Add Rental Policies and Limits X-Git-Tag: turned-in~30 X-Git-Url: https://www.irasnyder.com/gitweb/?a=commitdiff_plain;h=53634274872ef0ba36cbf94e23df4443ea5613d5;p=cs356-p2-videostore.git Add Rental Policies and Limits Signed-off-by: Ira W. Snyder --- diff --git a/app/controllers/game_policy_controller.rb b/app/controllers/game_policy_controller.rb index 1d5dc09..f2ca039 100644 --- a/app/controllers/game_policy_controller.rb +++ b/app/controllers/game_policy_controller.rb @@ -1,4 +1,5 @@ class GamePolicyController < ApplicationController + layout "admin" # Make sure that the user has logged in before they can take any action before_filter :authorize, :only => [:index, :list, :show] diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index 7ca9b85..53cd00b 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -11,6 +11,10 @@ class LoginController < ApplicationController render :action => 'maintenence' end + def limits + render :action => 'limits' + end + def add_user @user = User.new(params[:user]) if request.post? and @user.save diff --git a/app/controllers/rentable_policy_controller.rb b/app/controllers/rentable_policy_controller.rb index 84c4e7c..4151e6a 100644 --- a/app/controllers/rentable_policy_controller.rb +++ b/app/controllers/rentable_policy_controller.rb @@ -1,4 +1,5 @@ class RentablePolicyController < ApplicationController + layout "admin" # Make sure that a user logs in before doing any action here before_filter :authorize, :only => [:index, :list, :show] diff --git a/app/controllers/video_policy_controller.rb b/app/controllers/video_policy_controller.rb index 918c2e4..7999bc0 100644 --- a/app/controllers/video_policy_controller.rb +++ b/app/controllers/video_policy_controller.rb @@ -1,4 +1,5 @@ class VideoPolicyController < ApplicationController + layout "admin" # Make sure that a user logs in before doing any action here before_filter :authorize, :only => [:index, :list, :show] diff --git a/app/views/game_policy/list.rhtml b/app/views/game_policy/list.rhtml index 761de30..03b7b37 100644 --- a/app/views/game_policy/list.rhtml +++ b/app/views/game_policy/list.rhtml @@ -1,6 +1,6 @@ -

Listing game_policies

+

Game Rental Policies

- +
<% for column in GamePolicy.content_columns %> @@ -12,9 +12,8 @@ <% for column in GamePolicy.content_columns %> <% end %> - + - <% end %>
<%= column.human_name %><%=h game_policy.send(column.name) %><%= link_to 'Show', :action => 'show', :id => game_policy %><%= link_to 'View', :action => 'show', :id => game_policy %> <%= link_to 'Edit', :action => 'edit', :id => game_policy %><%= link_to 'Destroy', { :action => 'destroy', :id => game_policy }, :confirm => 'Are you sure?', :method => :post %>
diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml index 13cf017..420c1ad 100644 --- a/app/views/layouts/admin.rhtml +++ b/app/views/layouts/admin.rhtml @@ -22,6 +22,7 @@

<%= link_to "Customer Maintenence", :controller => 'customer', :action => 'index' %>

<%= link_to "Financial Information", :controller => 'purchase', :action => 'index' %>

<%= link_to "System Maintenence", :controller => 'login', :action => 'maintenence' %>

+

<%= link_to "Rental Policies and Limits", :controller => 'login', :action => 'limits' %>


<%= link_to "Logout", :controller => 'login', :action => 'logout' %>

diff --git a/app/views/login/limits.rhtml b/app/views/login/limits.rhtml new file mode 100644 index 0000000..5d86493 --- /dev/null +++ b/app/views/login/limits.rhtml @@ -0,0 +1,9 @@ +

Rental Limits and Pricing

+ +

Actions

+ + diff --git a/app/views/rentable_policy/list.rhtml b/app/views/rentable_policy/list.rhtml index b5a4833..c1c0e57 100644 --- a/app/views/rentable_policy/list.rhtml +++ b/app/views/rentable_policy/list.rhtml @@ -1,6 +1,6 @@ -

Listing rentable_policies

+

Rental Policies

- +
<% for column in RentablePolicy.content_columns %> @@ -12,9 +12,8 @@ <% for column in RentablePolicy.content_columns %> <% end %> - + - <% end %>
<%= column.human_name %><%=h rentable_policy.send(column.name) %><%= link_to 'Show', :action => 'show', :id => rentable_policy %><%= link_to 'View', :action => 'show', :id => rentable_policy %> <%= link_to 'Edit', :action => 'edit', :id => rentable_policy %><%= link_to 'Destroy', { :action => 'destroy', :id => rentable_policy }, :confirm => 'Are you sure?', :method => :post %>
diff --git a/app/views/video_policy/list.rhtml b/app/views/video_policy/list.rhtml index 2b916c6..0573275 100644 --- a/app/views/video_policy/list.rhtml +++ b/app/views/video_policy/list.rhtml @@ -1,6 +1,6 @@ -

Listing video_policies

+

Video Rental Policies

- +
<% for column in VideoPolicy.content_columns %> @@ -12,9 +12,8 @@ <% for column in VideoPolicy.content_columns %> <% end %> - + - <% end %>
<%= column.human_name %><%=h video_policy.send(column.name) %><%= link_to 'Show', :action => 'show', :id => video_policy %><%= link_to 'View', :action => 'show', :id => video_policy %> <%= link_to 'Edit', :action => 'edit', :id => video_policy %><%= link_to 'Destroy', { :action => 'destroy', :id => video_policy }, :confirm => 'Are you sure?', :method => :post %>