Skip to content

Commit

Permalink
updating to work with the latest radiant 0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shayarnett committed Apr 2, 2009
1 parent b4e3c2f commit d9dc4df
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Adds support for paid subscriptions through Spreedly.
From the target Radiant project:

git clone git://github.com/pelargir/radiant-spreedly-extension.git vendor/extensions/spreedly

After installing the plugin run the migrations:

rake radiant:extensions:spreedly:migrate

Start your project, login as an admin, and visit the Extensions page. The Spreedly
extension should be listed there. You should also see two new tabs near the top
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/subscriber_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class Admin::SubscriberController < Admin::AbstractModelController
class Admin::SubscriberController < Admin::ResourceController
model_class Subscriber
end
10 changes: 8 additions & 2 deletions app/models/spreedly_tags.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
module SpreedlyTags
include Radiant::Taggable
include ActionController::UrlWriter
default_url_options[:host] = "localhost:3000"

include ActionView::Helpers::TagHelper
include ActionView::Helpers::AssetTagHelper
include ActionView::Helpers::UrlHelper
include ActionController::UrlWriter

def self.included(klass)
super
def klass.default_url_options
{:host => "localhost:3000"}
end
end

tag "flash" do |tag|
tag.expand
Expand Down
2 changes: 1 addition & 1 deletion app/models/subscription_plan.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class SubscriptionPlan < ActiveResource::Base
def self.refresh
token = Radiant::Config['spreedly.api_token']
mode = Radiant::Config['spreedly.mode'].downcase
mode = (Radiant::Config['spreedly.mode'] || 'test').downcase
self.site = "https://#{token}:X@spreedly.com/api/v3/#{mode}"
end
refresh
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/spreedly/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% form_tag do -%>
API Token: <%= text_field_tag :api_token, Radiant::Config['spreedly.api_token'],:size => 50 %><br/>
Login Name: <%= text_field_tag :login_name, Radiant::Config['spreedly.login_name'], :size => 20 %><br/>
Plan: <%= select_tag :plan_id, options_for_select(SubscriptionPlan.to_dropdown, Radiant::Config['spreedly.plan_id'].to_i) %><br/>
Plan: <%= select_tag :plan_id, options_for_select(SubscriptionPlan.to_dropdown, Radiant::Config['spreedly.plan_id'].to_i) unless Radiant::Config['spreedly.mode'].nil? %><br/>
Mode: <%= select_tag :mode, options_for_select(%w(Test Production), Radiant::Config['spreedly.mode']) %><br/>
<%= submit_tag "Save" %> or <%= link_to "cancel", spreedly_index_url %>
<% end -%>

0 comments on commit d9dc4df

Please sign in to comment.