Skip to content

Commit

Permalink
added link to Spreedly on list of subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Bass committed Nov 13, 2008
1 parent fa17e6f commit 77041f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/subscriber.rb
Expand Up @@ -17,6 +17,11 @@ def spreedly_url
end
end

def spreedly_account_url
mode = Radiant::Config['spreedly.mode'] == "Testing" ? "test" : "production"
"https://spreedly.com/#{mode}/subscribers/#{id}"
end

def spreedly_configured?
# TODO this is yucky
!Radiant::Config['spreedly.api_token'].blank? &&
Expand Down
4 changes: 4 additions & 0 deletions app/views/admin/subscriber/index.html.erb
Expand Up @@ -7,6 +7,7 @@
<thead>
<tr>
<th class="subscriber">Subscriber</th>
<th class="spreedly">Spreedly</th>
<th class="status">Status</th>
<th class="remove">Modify</th>
</tr>
Expand All @@ -18,6 +19,9 @@
<td class="subscriber">
<%= link_to s.email, subscriber_edit_url(:id => s.id) %>
</td>
<td class="spreedly">
<%= link_to "View", s.spreedly_account_url %>
</td>
<td class="<%= s.active? ? "" : "status" %>">
<%= s.status %>
</td>
Expand Down

0 comments on commit 77041f7

Please sign in to comment.