Skip to content

Commit

Permalink
Making first changes to code
Browse files Browse the repository at this point in the history
  • Loading branch information
howethomas committed Sep 4, 2009
1 parent 298ef73 commit 4b63893
Show file tree
Hide file tree
Showing 233 changed files with 14,638 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application.rb
Expand Up @@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base
include RoleRequirementSystem

helper :all # include all helpers, all the time
protect_from_forgery :secret => 'b0a876313f3f9195e9bd01473bc5cd06'
# protect_from_forgery :secret => 'b0a876313f3f9195e9bd01473bc5cd06'
filter_parameter_logging :password, :password_confirmation
rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found

Expand Down
85 changes: 85 additions & 0 deletions app/controllers/coupons_controller.rb
@@ -0,0 +1,85 @@
class CouponsController < ApplicationController
# GET /coupons
# GET /coupons.xml
def index
@coupons = Coupon.find(:all)

respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @coupons }
end
end

# GET /coupons/1
# GET /coupons/1.xml
def show
@coupon = Coupon.find(params[:id])

respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @coupon }
end
end

# GET /coupons/new
# GET /coupons/new.xml
def new
@coupon = Coupon.new

respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @coupon }
end
end

# GET /coupons/1/edit
def edit
@coupon = Coupon.find(params[:id])
end

# POST /coupons
# POST /coupons.xml
def create
@coupon = Coupon.new(params[:coupon])

respond_to do |format|
if @coupon.save
flash[:notice] = 'Coupon was successfully created.'
format.html { redirect_to(@coupon) }
format.xml { render :xml => @coupon, :status => :created, :location => @coupon }
else
format.html { render :action => "new" }
format.xml { render :xml => @coupon.errors, :status => :unprocessable_entity }
end
end
end

# PUT /coupons/1
# PUT /coupons/1.xml
def update
@coupon = Coupon.find(params[:id])

respond_to do |format|
if @coupon.update_attributes(params[:coupon])
flash[:notice] = 'Coupon was successfully updated.'
format.html { redirect_to(@coupon) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @coupon.errors, :status => :unprocessable_entity }
end
end
end

# DELETE /coupons/1
# DELETE /coupons/1.xml
def destroy
@coupon = Coupon.find(params[:id])
@coupon.destroy

respond_to do |format|
format.html { redirect_to(coupons_url) }
format.xml { head :ok }
end
end
end
85 changes: 85 additions & 0 deletions app/controllers/subscribers_controller.rb
@@ -0,0 +1,85 @@
class SubscribersController < ApplicationController
# GET /subscribers
# GET /subscribers.xml
def index
@subscribers = Subscriber.find(:all)

respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @subscribers }
end
end

# GET /subscribers/1
# GET /subscribers/1.xml
def show
@subscriber = Subscriber.find(params[:id])

respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @subscriber }
end
end

# GET /subscribers/new
# GET /subscribers/new.xml
def new
@subscriber = Subscriber.new

respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @subscriber }
end
end

# GET /subscribers/1/edit
def edit
@subscriber = Subscriber.find(params[:id])
end

# POST /subscribers
# POST /subscribers.xml
def create
@subscriber = Subscriber.new(params[:subscriber])

respond_to do |format|
if @subscriber.save
flash[:notice] = 'Subscriber was successfully created.'
format.html { redirect_to(@subscriber) }
format.xml { render :xml => @subscriber, :status => :created, :location => @subscriber }
else
format.html { render :action => "new" }
format.xml { render :xml => @subscriber.errors, :status => :unprocessable_entity }
end
end
end

# PUT /subscribers/1
# PUT /subscribers/1.xml
def update
@subscriber = Subscriber.find(params[:id])

respond_to do |format|
if @subscriber.update_attributes(params[:subscriber])
flash[:notice] = 'Subscriber was successfully updated.'
format.html { redirect_to(@subscriber) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @subscriber.errors, :status => :unprocessable_entity }
end
end
end

# DELETE /subscribers/1
# DELETE /subscribers/1.xml
def destroy
@subscriber = Subscriber.find(params[:id])
@subscriber.destroy

respond_to do |format|
format.html { redirect_to(subscribers_url) }
format.xml { head :ok }
end
end
end
2 changes: 2 additions & 0 deletions app/helpers/coupons_helper.rb
@@ -0,0 +1,2 @@
module CouponsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/subscribers_helper.rb
@@ -0,0 +1,2 @@
module SubscribersHelper
end
2 changes: 2 additions & 0 deletions app/models/coupon.rb
@@ -0,0 +1,2 @@
class Coupon < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions app/models/script.rb
@@ -0,0 +1,2 @@
class Script < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions app/models/site.rb
@@ -0,0 +1,2 @@
class Site < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions app/models/subscriber.rb
@@ -0,0 +1,2 @@
class Subscriber < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions app/models/transaction.rb
@@ -0,0 +1,2 @@
class Transaction < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions app/views/admin_subscribers/delete.html.erb
@@ -0,0 +1,2 @@
<h1>AdminSubscribers#delete</h1>
<p>Find me in app/views/admin_subscribers/delete.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/admin_subscribers/index.html.erb
@@ -0,0 +1,2 @@
<h1>AdminSubscribers#index</h1>
<p>Find me in app/views/admin_subscribers/index.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/admin_subscribers/new.html.erb
@@ -0,0 +1,2 @@
<h1>AdminSubscribers#new</h1>
<p>Find me in app/views/admin_subscribers/new.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/admin_subscribers/notify.html.erb
@@ -0,0 +1,2 @@
<h1>AdminSubscribers#notify</h1>
<p>Find me in app/views/admin_subscribers/notify.html.erb</p>
32 changes: 32 additions & 0 deletions app/views/coupons/edit.html.erb
@@ -0,0 +1,32 @@
<h1>Editing coupon</h1>

<% form_for(@coupon) do |f| %>
<%= f.error_messages %>

<p>
<%= f.label :name %><br />
<%= f.text_field :name %>
</p>
<p>
<%= f.label :qty %><br />
<%= f.text_field :qty %>
</p>
<p>
<%= f.label :http_link %><br />
<%= f.text_field :http_link %>
</p>
<p>
<%= f.label :unique %><br />
<%= f.check_box :unique %>
</p>
<p>
<%= f.label :site_id %><br />
<%= f.text_field :site_id %>
</p>
<p>
<%= f.submit "Update" %>
</p>
<% end %>
<%= link_to 'Show', @coupon %> |
<%= link_to 'Back', coupons_path %>
28 changes: 28 additions & 0 deletions app/views/coupons/index.html.erb
@@ -0,0 +1,28 @@
<h1>Listing coupons</h1>

<table>
<tr>
<th>Name</th>
<th>Qty</th>
<th>Http link</th>
<th>Unique</th>
<th>Site</th>
</tr>

<% for coupon in @coupons %>
<tr>
<td><%=h coupon.name %></td>
<td><%=h coupon.qty %></td>
<td><%=h coupon.http_link %></td>
<td><%=h coupon.unique %></td>
<td><%=h coupon.site_id %></td>
<td><%= link_to 'Show', coupon %></td>
<td><%= link_to 'Edit', edit_coupon_path(coupon) %></td>
<td><%= link_to 'Destroy', coupon, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>

<br />

<%= link_to 'New coupon', new_coupon_path %>
31 changes: 31 additions & 0 deletions app/views/coupons/new.html.erb
@@ -0,0 +1,31 @@
<h1>New coupon</h1>

<% form_for(@coupon) do |f| %>
<%= f.error_messages %>

<p>
<%= f.label :name %><br />
<%= f.text_field :name %>
</p>
<p>
<%= f.label :qty %><br />
<%= f.text_field :qty %>
</p>
<p>
<%= f.label :http_link %><br />
<%= f.text_field :http_link %>
</p>
<p>
<%= f.label :unique %><br />
<%= f.check_box :unique %>
</p>
<p>
<%= f.label :site_id %><br />
<%= f.text_field :site_id %>
</p>
<p>
<%= f.submit "Create" %>
</p>
<% end %>
<%= link_to 'Back', coupons_path %>
28 changes: 28 additions & 0 deletions app/views/coupons/show.html.erb
@@ -0,0 +1,28 @@
<p>
<b>Name:</b>
<%=h @coupon.name %>
</p>

<p>
<b>Qty:</b>
<%=h @coupon.qty %>
</p>

<p>
<b>Http link:</b>
<%=h @coupon.http_link %>
</p>

<p>
<b>Unique:</b>
<%=h @coupon.unique %>
</p>

<p>
<b>Site:</b>
<%=h @coupon.site_id %>
</p>


<%= link_to 'Edit', edit_coupon_path(@coupon) %> |
<%= link_to 'Back', coupons_path %>
17 changes: 17 additions & 0 deletions app/views/layouts/coupons.html.erb
@@ -0,0 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Coupons: <%= controller.action_name %></title>
<%= stylesheet_link_tag 'scaffold' %>
</head>
<body>

<p style="color: green"><%= flash[:notice] %></p>

<%= yield %>

</body>
</html>
17 changes: 17 additions & 0 deletions app/views/layouts/subscribers.html.erb
@@ -0,0 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Subscribers: <%= controller.action_name %></title>
<%= stylesheet_link_tag 'scaffold' %>
</head>
<body>

<p style="color: green"><%= flash[:notice] %></p>

<%= yield %>

</body>
</html>
20 changes: 20 additions & 0 deletions app/views/subscribers/edit.html.erb
@@ -0,0 +1,20 @@
<h1>Editing subscriber</h1>

<% form_for(@subscriber) do |f| %>
<%= f.error_messages %>

<p>
<%= f.label :callerid %><br />
<%= f.text_field :callerid %>
</p>
<p>
<%= f.label :site_id %><br />
<%= f.text_field :site_id %>
</p>
<p>
<%= f.submit "Update" %>
</p>
<% end %>
<%= link_to 'Show', @subscriber %> |
<%= link_to 'Back', subscribers_path %>

0 comments on commit 4b63893

Please sign in to comment.