pin back hamlrails
This commit is contained in:
parent
f44783efdd
commit
37c7550a08
|
|
@ -0,0 +1,26 @@
|
||||||
|
ActiveAdmin.register_page "Monthly Roll Forward", as: "JamClass Monthly Roll Forward" do
|
||||||
|
menu :parent => 'JamClass'
|
||||||
|
|
||||||
|
content :title => "JamClass Monthly Roll Forwards" do
|
||||||
|
para do
|
||||||
|
table_for JamClassReport.roll_forward_bookings do
|
||||||
|
|
||||||
|
column "Student" do |r|
|
||||||
|
r.student.admin_name
|
||||||
|
end
|
||||||
|
column "Teacher" do |r|
|
||||||
|
r.teacher.admin_name
|
||||||
|
end
|
||||||
|
column "Booking Active?" do |r|
|
||||||
|
r.active ? 'Y' : 'N'
|
||||||
|
end
|
||||||
|
column "Booking Status" do |r|
|
||||||
|
link_to r.status, admin_lesson_booking_path(r.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -41,6 +41,37 @@ ActiveAdmin.register JamRuby::LessonBooking, :as => 'LessonBookings' do
|
||||||
end
|
end
|
||||||
|
|
||||||
show do
|
show do
|
||||||
|
attributes_table do
|
||||||
|
row "User Link" do |lesson_booking|
|
||||||
|
span do
|
||||||
|
link_to "Web URL", "#{Rails.application.config.external_root_url}/client#/jamclass/lesson-booking/#{lesson_booking.id}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
row "Type" do |lesson_booking|
|
||||||
|
lesson_booking.display_type
|
||||||
|
end
|
||||||
|
row "Status" do |lesson_booking|
|
||||||
|
lesson_booking.status
|
||||||
|
end
|
||||||
|
row "Teacher" do |lesson_booking|
|
||||||
|
teacher = lesson_booking.teacher
|
||||||
|
span do
|
||||||
|
link_to "#{teacher.name} (#{teacher.email})", "#{Rails.application.config.external_root_url}/client#/profile/teacher/#{teacher.id}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
row "Student" do |lesson_booking|
|
||||||
|
student = lesson_booking.student
|
||||||
|
span do
|
||||||
|
link_to "#{student.name} (#{student.email})", "#{Rails.application.config.external_root_url}/client#/profile/#{student.id}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
row "Created At" do |lesson_booking|
|
||||||
|
lesson_booking.created_at
|
||||||
|
end
|
||||||
|
row "Booked Price" do |lesson_booking|
|
||||||
|
lesson_booking.booked_price
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,5 +100,9 @@ module JamRuby
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.roll_forward_bookings
|
||||||
|
LessonBooking.where('remaining_roll_forward_amount_in_cents > 0')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -77,7 +77,7 @@ gem 'carrierwave', '0.11.2' #, '0.9.0'
|
||||||
gem 'carrierwave_direct'
|
gem 'carrierwave_direct'
|
||||||
gem 'fog'
|
gem 'fog'
|
||||||
#gem 'jquery-payment-rails', github: 'sethcall/jquery-payment-rails'
|
#gem 'jquery-payment-rails', github: 'sethcall/jquery-payment-rails'
|
||||||
gem 'haml-rails'
|
gem 'haml-rails', '0.9.0'
|
||||||
gem 'unf' #optional fog dependency
|
gem 'unf' #optional fog dependency
|
||||||
gem 'devise', '3.3.0' #3.4.0 causes uninitialized constant ActionController::Metal (NameError)
|
gem 'devise', '3.3.0' #3.4.0 causes uninitialized constant ActionController::Metal (NameError)
|
||||||
gem 'postgres-copy'
|
gem 'postgres-copy'
|
||||||
|
|
|
||||||
|
|
@ -63,4 +63,25 @@ def amazon_gift_cards
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def sample_amazon_gift_cards
|
||||||
|
CSV.open("test-posa-cards-amazon-test-drive-paid-4.csv", "wb") do |csv|
|
||||||
|
for i in 1..20
|
||||||
|
csv << [generate(), 'amazon-test-drive-paid-4', true, true]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
CSV.open("test-posa-cards-amazon-test-drive-free-4.csv", "wb") do |csv|
|
||||||
|
for i in 1..20
|
||||||
|
csv << [generate(), 'amazon-test-drive-free-4',true, false]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
CSV.open("test-posa-cards-amazon-test-drive-free-2.csv", "wb") do |csv|
|
||||||
|
for i in 1..20
|
||||||
|
csv << [generate(), 'amazon-test-drive-free-2',true, false]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue