gaku_archive 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/app/assets/javascripts/gaku/archive.js.coffee +4 -0
  3. data/app/assets/stylesheets/gaku/archive.css +5 -0
  4. data/app/controllers/concerns/trashable_controller.rb +32 -0
  5. data/app/controllers/gaku/admin/changes/student_address_changes_controller.rb +14 -0
  6. data/app/controllers/gaku/admin/changes/student_changes_controller.rb +13 -0
  7. data/app/controllers/gaku/admin/changes/student_contact_changes_controller.rb +13 -0
  8. data/app/controllers/gaku/admin/disposals_controller.rb +55 -0
  9. data/app/controllers/gaku/admin/students_controller.rb +22 -0
  10. data/app/controllers/gaku/class_groups_controller_injector.rb +5 -0
  11. data/app/controllers/gaku/contacts_controller_injector.rb +21 -0
  12. data/app/controllers/gaku/course_groups_controller_injector.rb +5 -0
  13. data/app/controllers/gaku/courses_controller_injector.rb +5 -0
  14. data/app/controllers/gaku/exams_controller_injector.rb +5 -0
  15. data/app/controllers/gaku/extracurricular_activities_controller_injector.rb +5 -0
  16. data/app/controllers/gaku/students_controller_injector.rb +5 -0
  17. data/app/controllers/gaku/syllabuses_controller_injector.rb +5 -0
  18. data/app/controllers/gaku/teachers_controller_injector.rb +5 -0
  19. data/app/models/concerns/trashable.rb +17 -0
  20. data/app/models/gaku/address_injector.rb +31 -0
  21. data/app/models/gaku/attachment_injector.rb +5 -0
  22. data/app/models/gaku/class_group_injector.rb +5 -0
  23. data/app/models/gaku/contact_injector.rb +34 -0
  24. data/app/models/gaku/course_group_injector.rb +5 -0
  25. data/app/models/gaku/course_injector.rb +5 -0
  26. data/app/models/gaku/exam_injector.rb +5 -0
  27. data/app/models/gaku/extracurricular_activity_injector.rb +5 -0
  28. data/app/models/gaku/guardian_injector.rb +5 -0
  29. data/app/models/gaku/student_injector.rb +16 -0
  30. data/app/models/gaku/syllabus_injector.rb +5 -0
  31. data/app/models/gaku/teacher_injector.rb +5 -0
  32. data/app/models/gaku/versioning/address_version.rb +9 -0
  33. data/app/models/gaku/versioning/contact_version.rb +7 -0
  34. data/app/models/gaku/versioning/student_version.rb +47 -0
  35. data/app/overrides/archive_menu.rb +6 -0
  36. data/app/views/gaku/addresses/_delete_link.html.slim +1 -0
  37. data/app/views/gaku/admin/changes/student_address_changes/_change.html.slim +10 -0
  38. data/app/views/gaku/admin/changes/student_address_changes/_changes.html.slim +19 -0
  39. data/app/views/gaku/admin/changes/student_address_changes/_deletion.html.slim +9 -0
  40. data/app/views/gaku/admin/changes/student_address_changes/index.html.slim +11 -0
  41. data/app/views/gaku/admin/changes/student_changes/_change.html.slim +10 -0
  42. data/app/views/gaku/admin/changes/student_changes/_changes.html.slim +18 -0
  43. data/app/views/gaku/admin/changes/student_changes/_deletion.html.slim +9 -0
  44. data/app/views/gaku/admin/changes/student_changes/index.html.slim +13 -0
  45. data/app/views/gaku/admin/changes/student_contact_changes/_change.html.slim +10 -0
  46. data/app/views/gaku/admin/changes/student_contact_changes/_changes.html.slim +19 -0
  47. data/app/views/gaku/admin/changes/student_contact_changes/_deletion.html.slim +9 -0
  48. data/app/views/gaku/admin/changes/student_contact_changes/index.html.slim +11 -0
  49. data/app/views/gaku/admin/disposals/_address.html.slim +12 -0
  50. data/app/views/gaku/admin/disposals/_addresses.html.slim +17 -0
  51. data/app/views/gaku/admin/disposals/_contact.html.slim +9 -0
  52. data/app/views/gaku/admin/disposals/_contacts.html.slim +14 -0
  53. data/app/views/gaku/admin/disposals/_course_group.html.slim +3 -0
  54. data/app/views/gaku/admin/disposals/_course_groups.html.slim +12 -0
  55. data/app/views/gaku/admin/disposals/_exam.html.slim +10 -0
  56. data/app/views/gaku/admin/disposals/_guardian.html.slim +10 -0
  57. data/app/views/gaku/admin/disposals/_student.html.slim +10 -0
  58. data/app/views/gaku/admin/disposals/_tabs.html.slim +17 -0
  59. data/app/views/gaku/admin/disposals/_teacher.html.slim +10 -0
  60. data/app/views/gaku/admin/disposals/addresses.html.slim +2 -0
  61. data/app/views/gaku/admin/disposals/attachments.html.slim +30 -0
  62. data/app/views/gaku/admin/disposals/contacts.html.slim +2 -0
  63. data/app/views/gaku/admin/disposals/course_groups.html.slim +12 -0
  64. data/app/views/gaku/admin/disposals/exams.html.slim +16 -0
  65. data/app/views/gaku/admin/disposals/guardians.html.slim +16 -0
  66. data/app/views/gaku/admin/disposals/index.html.slim +1 -0
  67. data/app/views/gaku/admin/disposals/students.html.slim +16 -0
  68. data/app/views/gaku/admin/disposals/tabs/_addresses_tabs.html.slim +19 -0
  69. data/app/views/gaku/admin/disposals/tabs/_contacts_tabs.html.slim +19 -0
  70. data/app/views/gaku/admin/disposals/teachers.html.slim +16 -0
  71. data/app/views/gaku/class_groups/recovery.js.erb +1 -0
  72. data/app/views/gaku/contacts/_delete_link.html.slim +1 -0
  73. data/app/views/gaku/course_groups/recovery.js.erb +1 -0
  74. data/app/views/gaku/courses/recovery.js.erb +1 -0
  75. data/app/views/gaku/exams/recovery.js.erb +1 -0
  76. data/app/views/gaku/extracurricular_activities/recovery.js.erb +1 -0
  77. data/app/views/gaku/shared/_delete_link.html.slim +1 -0
  78. data/app/views/gaku/shared/_delete_modal.html.slim +11 -0
  79. data/app/views/gaku/shared/menu/_archive.html.erb +1 -0
  80. data/app/views/gaku/students/recovery.js.erb +1 -0
  81. data/app/views/gaku/syllabuses/recovery.js.erb +1 -0
  82. data/app/views/gaku/teachers/recovery.js.erb +1 -0
  83. data/config/initializers/paper_trail.rb +3 -0
  84. data/config/routes.rb +67 -0
  85. data/db/migrate/20131203160531_create_versioning_tables.rb +47 -0
  86. data/db/migrate/20131203160607_add_deleted_fields.rb +53 -0
  87. data/lib/gaku/archive/engine.rb +22 -0
  88. data/lib/gaku/archive.rb +13 -0
  89. data/lib/gaku_archive.rb +1 -0
  90. metadata +191 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 51b4cf01952bb795d4668b3b827409ea8a95e25b
4
+ data.tar.gz: 93a9514a5afb1f98e355305704b0bb664356bf29
5
+ SHA512:
6
+ metadata.gz: 4577d0047827a2502e3aa162052740ec6d3703764ad0f78a0d3ce2e253fe9adbde43363d31712281dbf479f3e2cd85069edafe0085ebe241cfa0d7da40991ec1
7
+ data.tar.gz: 5d708f728c9c925d6137d314c8e85712c3339d9b51868b308a81453fe3c7945a33959f876fb3076f5e9a8b2a8e1373b974b5d26a478a898a6fc5f75da437ef5a
@@ -0,0 +1,4 @@
1
+ #= require gaku/frontend
2
+ #= require gaku/admin
3
+
4
+ #= require_tree .
@@ -0,0 +1,5 @@
1
+ /*
2
+ *= require gaku/admin
3
+ *= require gaku/frontend
4
+ *= require_self
5
+ */
@@ -0,0 +1,32 @@
1
+ module TrashableController
2
+
3
+ extend ActiveSupport::Concern
4
+ include Gaku::ClassNameDetector
5
+
6
+ included do
7
+
8
+ before_action :set_resource, only: :soft_delete
9
+ before_action :set_deleted_resource, only: :recovery
10
+
11
+ def recovery
12
+ @resource.recover
13
+ respond_with instance_variable_set("@#{class_name_underscored}", @resource)
14
+ end
15
+
16
+ def soft_delete
17
+ @resource.soft_delete
18
+ respond_with instance_variable_set("@#{class_name_underscored}", @resource), location: "/#{class_name_underscored_plural}"
19
+ end
20
+
21
+ private
22
+
23
+ def set_resource
24
+ @resource = class_name.constantize.find(params[:id])
25
+ end
26
+
27
+ def set_deleted_resource
28
+ @resource = class_name.constantize.deleted.find(params[:id])
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,14 @@
1
+ module Gaku
2
+ class Admin::Changes::StudentAddressChangesController < Admin::BaseController
3
+
4
+ #load_and_authorize_resource class: PaperTrail::Version
5
+
6
+ respond_to :html
7
+
8
+ def index
9
+ @changes = Gaku::Versioning::AddressVersion.student_addresses
10
+ @count = Gaku::Versioning::AddressVersion.student_addresses.count
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ module Gaku
2
+ class Admin::Changes::StudentChangesController < Admin::BaseController
3
+
4
+ #load_and_authorize_resource class: StudentVersion
5
+ respond_to :html, only: :index
6
+
7
+ def index
8
+ @count = Gaku::Versioning::StudentVersion.count
9
+ @changes = Kaminari.paginate_array(Gaku::Versioning::StudentVersion.all).page(params[:page])
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Gaku
2
+ class Admin::Changes::StudentContactChangesController < Admin::BaseController
3
+
4
+ #load_and_authorize_resource class: PaperTrail::Version
5
+ respond_to :html
6
+
7
+ def index
8
+ @changes = Gaku::Versioning::ContactVersion.student_contacts
9
+ @count = Gaku::Versioning::ContactVersion.student_contacts.count
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,55 @@
1
+ module Gaku
2
+ class Admin::DisposalsController < Admin::BaseController
3
+
4
+ authorize_resource class: false
5
+
6
+ def index
7
+
8
+ end
9
+
10
+ def students
11
+ @students = Disposal.students.page(params[:page])
12
+ end
13
+
14
+ def teachers
15
+ @teachers = Disposal.teachers.page(params[:page])
16
+ end
17
+
18
+ def guardians
19
+ @guardians = Disposal.guardians.page(params[:page])
20
+ end
21
+
22
+ def exams
23
+ @exams = Disposal.exams.page(params[:page])
24
+ end
25
+
26
+ def course_groups
27
+ @course_groups = Disposal.course_groups.page(params[:page])
28
+ end
29
+
30
+ def attachments
31
+ @attachments = Disposal.attachments.page(params[:page])
32
+
33
+ end
34
+
35
+ def addresses
36
+ @student_addresses = Disposal.student_addresses.page(params[:page])
37
+ @teacher_addresses = Disposal.teacher_addresses.page(params[:page])
38
+ set_student_and_teacher_count('Gaku::Address')
39
+ end
40
+
41
+ def contacts
42
+ @student_contacts = Disposal.student_contacts.page(params[:page])
43
+ @teacher_contacts = Disposal.teacher_contacts.page(params[:page])
44
+ set_student_and_teacher_count('Gaku::Contact')
45
+ end
46
+
47
+ private
48
+
49
+ def set_student_and_teacher_count(klass)
50
+ @students_count = klass.constantize.deleted.students.count
51
+ @teachers_count = klass.constantize.deleted.teachers.count
52
+ end
53
+
54
+ end
55
+ end
@@ -0,0 +1,22 @@
1
+ module Gaku
2
+ class Admin::StudentsController < Admin::BaseController
3
+ respond_to :html, only: :show
4
+
5
+ decorates_assigned :student
6
+
7
+ def show
8
+ @student = Student.includes(includes).unscoped.find(params[:id])
9
+ @notable = @student
10
+ @notable_resource = get_resource_name @notable
11
+
12
+ render 'gaku/students/show'
13
+ end
14
+
15
+ private
16
+
17
+ def includes
18
+ [[contacts: :contact_type, addresses: :country], :guardians]
19
+ end
20
+
21
+ end
22
+ end
@@ -0,0 +1,5 @@
1
+ module Gaku
2
+ ClassGroupsController.class_eval do
3
+ include TrashableController
4
+ end
5
+ end
@@ -0,0 +1,21 @@
1
+ module Gaku
2
+ ContactsController.class_eval do
3
+
4
+ def recovery
5
+ @contact = Contact.deleted.find(params[:id])
6
+ @contact.recover
7
+ respond_with @contact
8
+ end
9
+
10
+ def soft_delete
11
+ set_polymorphic_resource
12
+ @contact =Contact.find(params[:id])
13
+ @primary_contact = true if @contact.primary?
14
+ @contact.soft_delete
15
+ @polymorphic_resource.contacts.first.try(:make_primary) if @contact.primary?
16
+ @count = @polymorphic_resource.reload.contacts_count
17
+ respond_with @contact
18
+ end
19
+
20
+ end
21
+ end
@@ -0,0 +1,5 @@
1
+ module Gaku
2
+ CourseGroupsController.class_eval do
3
+ include TrashableController
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Gaku
2
+ CoursesController.class_eval do
3
+ include TrashableController
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Gaku
2
+ ExamsController.class_eval do
3
+ include TrashableController
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Gaku
2
+ ExtracurricularActivitiesController.class_eval do
3
+ include TrashableController
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Gaku
2
+ StudentsController.class_eval do
3
+ include TrashableController
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Gaku
2
+ SyllabusesController.class_eval do
3
+ include TrashableController
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Gaku
2
+ TeachersController.class_eval do
3
+ include TrashableController
4
+ end
5
+ end
@@ -0,0 +1,17 @@
1
+ module Trashable
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ default_scope -> { where(deleted: false) }
6
+ scope :deleted, -> { where(deleted: true) }
7
+
8
+ def soft_delete
9
+ update_attribute(:deleted, true)
10
+ end
11
+
12
+ def recover
13
+ update_attribute(:deleted, false)
14
+ end
15
+ end
16
+
17
+ end
@@ -0,0 +1,31 @@
1
+ Gaku::Address.class_eval do
2
+
3
+ has_paper_trail class_name: 'Gaku::Versioning::AddressVersion',
4
+ on: [:update, :destroy],
5
+ meta: {
6
+ join_model: :join_model_name,
7
+ joined_resource_id: :joined_resource_id
8
+ }
9
+
10
+ default_scope -> { where(deleted: false) }
11
+
12
+ def soft_delete
13
+ update_attributes(deleted: true, primary: false)
14
+ decrement_count
15
+ end
16
+
17
+ def recover
18
+ update_attribute(:deleted, false)
19
+ increment_count
20
+ end
21
+
22
+ def join_model_name
23
+ addressable_type
24
+ end
25
+
26
+ def joined_resource_id
27
+ addressable_id
28
+ end
29
+
30
+
31
+ end
@@ -0,0 +1,5 @@
1
+ Gaku::Attachment.class_eval do
2
+
3
+ include Trashable
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ Gaku::ClassGroup.class_eval do
2
+
3
+ include Trashable
4
+
5
+ end
@@ -0,0 +1,34 @@
1
+ Gaku::Contact.class_eval do
2
+
3
+ has_paper_trail class_name: 'Gaku::Versioning::ContactVersion',
4
+ on: [:update, :destroy],
5
+ meta: {
6
+ join_model: :join_model_name,
7
+ joined_resource_id: :joined_resource_id
8
+ }
9
+
10
+ default_scope -> { where(deleted: false) }
11
+
12
+ def soft_delete
13
+ update_attributes(deleted: true, primary: false)
14
+ decrement_count
15
+ end
16
+
17
+ def recover
18
+ update_attribute(:deleted, false)
19
+ increment_count
20
+ end
21
+
22
+ def self.deleted
23
+ where(deleted: true)
24
+ end
25
+
26
+ def join_model_name
27
+ contactable_type
28
+ end
29
+
30
+ def joined_resource_id
31
+ contactable_id
32
+ end
33
+
34
+ end
@@ -0,0 +1,5 @@
1
+ Gaku::CourseGroup.class_eval do
2
+
3
+ include Trashable
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ Gaku::Course.class_eval do
2
+
3
+ include Trashable
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ Gaku::Exam.class_eval do
2
+
3
+ include Trashable
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ Gaku::ExtracurricularActivity.class_eval do
2
+
3
+ include Trashable
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ Gaku::Guardian.class_eval do
2
+
3
+ include Trashable
4
+
5
+ end
@@ -0,0 +1,16 @@
1
+ Gaku::Student.class_eval do
2
+
3
+ include Trashable
4
+
5
+ has_paper_trail class_name: 'Gaku::Versioning::StudentVersion',
6
+ on: [:update, :destroy],
7
+ only: [
8
+ :name, :surname, :middle_name,
9
+ :foreign_id_code,
10
+ :scholarship_status_id,
11
+ :commute_method_type_id, :enrollment_status_code,
12
+ :deleted
13
+ ]
14
+
15
+
16
+ end
@@ -0,0 +1,5 @@
1
+ Gaku::Syllabus.class_eval do
2
+
3
+ include Trashable
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ Gaku::Teacher.class_eval do
2
+
3
+ include Trashable
4
+
5
+ end
@@ -0,0 +1,9 @@
1
+ module Gaku
2
+ module Versioning
3
+ class AddressVersion < PaperTrail::Version
4
+ self.table_name = :gaku_versioning_address_versions
5
+
6
+ scope :student_addresses, -> { where(item_type: 'Gaku::Address', join_model: 'Gaku::Student') }
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Gaku::Versioning
2
+ class ContactVersion < PaperTrail::Version
3
+ self.table_name = :gaku_versioning_contact_versions
4
+
5
+ scope :student_contacts, -> { where(item_type: 'Gaku::Contact', join_model: 'Gaku::Student') }
6
+ end
7
+ end
@@ -0,0 +1,47 @@
1
+ module Gaku::Versioning
2
+ class StudentVersion < PaperTrail::Version
3
+ self.table_name = :gaku_versioning_student_versions
4
+
5
+ serialize :human_changes
6
+
7
+ before_save :set_human_changes
8
+
9
+ private
10
+
11
+ def set_human_changes
12
+ @human_changes = {}
13
+ changeset.keys.each do |key|
14
+ key0 = changeset[key][0]
15
+ key1 = changeset[key][1]
16
+
17
+ case key
18
+
19
+ when 'enrollment_status_code'
20
+ enrollment_status_code_change(key0, key1)
21
+ when 'commute_method_type_id'
22
+ common_change('CommuteMethodType', key0, key1)
23
+ when 'scholarship_status_id'
24
+ common_change('ScholarshipStatus', key0, key1)
25
+ else
26
+ @human_changes[key] = [key0, key1]
27
+ end
28
+
29
+ end
30
+ self.human_changes = @human_changes
31
+ end
32
+
33
+ def enrollment_status_code_change(key0, key1)
34
+ from = Gaku::EnrollmentStatus.where(code: key0).first.to_s if key0
35
+ to = Gaku::EnrollmentStatus.where(code: key1).first.to_s if key1
36
+ @human_changes[:enrollment_status] = [from, to]
37
+ end
38
+
39
+ def common_change(klass_name, key0, key1)
40
+ klass = "Gaku::#{klass_name}".constantize
41
+ from = klass.find(key0).to_s if key0
42
+ to = klass.find(key1).to_s if key1
43
+ @human_changes[klass_name.underscore.to_sym] = [from, to]
44
+ end
45
+
46
+ end
47
+ end
@@ -0,0 +1,6 @@
1
+ Deface::Override.new(:virtual_path => "gaku/shared/menu/_admin",
2
+ :name => "archive_menu",
3
+ :insert_bottom => "[data-hook='admin_dropdown_menu']",
4
+ :partial => "gaku/shared/menu/archive",
5
+ :disabled => false
6
+ )
@@ -0,0 +1 @@
1
+ = ajax_soft_delete [:soft_delete, target].flatten
@@ -0,0 +1,10 @@
1
+ - change.changeset.keys.each do |key|
2
+ tr
3
+ td = change.id
4
+ td = link_to "#{t(:'student.singular')} #{change.joined_resource_id}", admin_student_path(change.joined_resource_id)
5
+ td = change.event
6
+ td = key
7
+ td = change.changeset[key][0]
8
+ td = change.changeset[key][1]
9
+ td = change.whodunnit
10
+ td = change.created_at
@@ -0,0 +1,19 @@
1
+ = sortable_table_for 'admin-student-address-changes-index' do
2
+ thead
3
+ tr
4
+ = th_icon 'check'
5
+ = th t(:'student.singular')
6
+ = th t(:'changes.event')
7
+ = th t(:'changes.change')
8
+ = th t(:'changes.from')
9
+ = th t(:'changes.to')
10
+ = th t(:'changes.user')
11
+ = th t(:'changes.changed_at')
12
+
13
+ tbody
14
+ - @changes.each do |change|
15
+ - if change.event == 'destroy'
16
+ = render 'deletion', change: change
17
+ - else
18
+ = render 'change', change: change
19
+
@@ -0,0 +1,9 @@
1
+ tr
2
+ td = change.id
3
+ td = link_to "#{t(:'student.singular')} #{change.joined_resource_id}", admin_student_path(change.joined_resource_id)
4
+ td = change.event
5
+ td
6
+ td
7
+ td
8
+ td = change.whodunnit
9
+ td = change.created_at
@@ -0,0 +1,11 @@
1
+ = content_for :title, t(:'changes.student_address.list')
2
+
3
+ = content_for :index_header do
4
+ .pull-left
5
+ = count_div 'changes-count' do
6
+ = print_count @count, t(:'changes.student_address.list')
7
+
8
+ = hr
9
+
10
+ #changes-index
11
+ = render 'changes'
@@ -0,0 +1,10 @@
1
+ - change.human_changes.keys.each do |key|
2
+ tr
3
+ td = change.id
4
+ td = link_to "#{t(:'student.singular')} #{change.item_id}", admin_student_path(change.item_id)
5
+ td = change.event
6
+ td = key
7
+ td = change.human_changes[key][0]
8
+ td = change.human_changes[key][1]
9
+ td = change.whodunnit
10
+ td = change.created_at
@@ -0,0 +1,18 @@
1
+ = sortable_table_for 'admin-student-changes-index' do
2
+ thead
3
+ tr
4
+ = th_icon 'check'
5
+ = th t(:'student.singular')
6
+ = th t(:'changes.event')
7
+ = th t(:'changes.change')
8
+ = th t(:'changes.from')
9
+ = th t(:'changes.to')
10
+ = th t(:'changes.user')
11
+ = th t(:'changes.changed_at')
12
+
13
+ tbody
14
+ - @changes.each do |change|
15
+ - if change.event == 'destroy'
16
+ = render 'deletion', change: change
17
+ - else
18
+ = render 'change', change: change
@@ -0,0 +1,9 @@
1
+ tr
2
+ td = change.id
3
+ td = link_to "#{t(:'student.singular')} #{change.item_id}", admin_student_path(change.item_id)
4
+ td = change.event
5
+ td
6
+ td
7
+ td
8
+ td = change.whodunnit
9
+ td = change.created_at
@@ -0,0 +1,13 @@
1
+ = content_for :title, t(:'changes.student.list')
2
+
3
+ = content_for :index_header do
4
+ .pull-left
5
+ = count_div 'changes-count' do
6
+ = print_count @count, t(:'changes.student.list')
7
+
8
+ = hr
9
+
10
+ #changes-index
11
+ = render 'changes'
12
+
13
+ = paginate @changes
@@ -0,0 +1,10 @@
1
+ - change.changeset.keys.each do |key|
2
+ tr
3
+ td = change.id
4
+ td = link_to "#{t(:'student.singular')} #{change.joined_resource_id}", admin_student_path(change.joined_resource_id)
5
+ td = change.event
6
+ td = key
7
+ td = change.changeset[key][0]
8
+ td = change.changeset[key][1]
9
+ td = change.whodunnit
10
+ td = change.created_at
@@ -0,0 +1,19 @@
1
+ = sortable_table_for 'admin-student-contact-changes-index' do
2
+ thead
3
+ tr
4
+ = th_icon 'check'
5
+ = th t(:'student.singular')
6
+ = th t(:'changes.event')
7
+ = th t(:'changes.change')
8
+ = th t(:'changes.from')
9
+ = th t(:'changes.to')
10
+ = th t(:'changes.user')
11
+ = th t(:'changes.changed_at')
12
+
13
+ tbody
14
+ - @changes.each do |change|
15
+ - if change.event == 'destroy'
16
+ = render 'deletion', change: change
17
+ - else
18
+ = render 'change', change: change
19
+
@@ -0,0 +1,9 @@
1
+ tr
2
+ td = change.id
3
+ td = link_to "#{t(:'student.singular')} #{change.joined_resource_id}", admin_student_path(change.joined_resource_id)
4
+ td = change.event
5
+ td
6
+ td
7
+ td
8
+ td = change.whodunnit
9
+ td = change.created_at