Commit 72eae761
Changed files (4)
app
controllers
views
admin
shared
subscriptions
config
app/controllers/admin/subscriptions_controller.rb
@@ -0,0 +1,9 @@
+module Admin
+ class SubscriptionsController < AdminController
+ def index
+ members = Gibbon::API.lists.members({ id: '6ea750df21', status: 'subscribed', opts: { start: 0, limit: 100}})
+ @subscriptions = members["data"]
+ @total = members["total"]
+ end
+ end
+end
app/views/admin/subscriptions/index.html.erb
@@ -0,0 +1,24 @@
+<div class="row-fluid">
+ <div class="span12">
+ <%= render :partial => 'admin/shared/admin_nav' %>
+ <h1>Subscriptions <small>(<%= @total %>)</small></h1>
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th></th>
+ <th>Email</th>
+ <th>Timestamp</th>
+ </tr>
+ </thead>
+ <tbody>
+ <% @subscriptions.each_with_index do |subscription, index| %>
+ <tr>
+ <td><%= index+1 %></td>
+ <td><%= subscription["email"] %></td>
+ <td><%= subscription["timestamp_signup"] %></td>
+ </tr>
+ </tbody>
+ <% end %>
+ </table>
+ </div>
+</div>
config/routes.rb
@@ -65,5 +65,6 @@ Cake::Application.routes.draw do
resources :users, only: [:index]
resources :jobs, only: [:index, :show]
resources :activities, only: [:index]
+ resources :subscriptions, only: [:index]
end
end