Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
298ef73
commit 4b63893
Showing
233 changed files
with
14,638 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module CouponsHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module SubscribersHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Coupon < ActiveRecord::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Script < ActiveRecord::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Site < ActiveRecord::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Subscriber < ActiveRecord::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Transaction < ActiveRecord::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1>AdminSubscribers#delete</h1> | ||
<p>Find me in app/views/admin_subscribers/delete.html.erb</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1>AdminSubscribers#index</h1> | ||
<p>Find me in app/views/admin_subscribers/index.html.erb</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1>AdminSubscribers#new</h1> | ||
<p>Find me in app/views/admin_subscribers/new.html.erb</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1>AdminSubscribers#notify</h1> | ||
<p>Find me in app/views/admin_subscribers/notify.html.erb</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %> |
Oops, something went wrong.