gaku_admin 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/app/assets/fonts/gaku/admin/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/gaku/admin/glyphicons-halflings-regular.svg +228 -0
- data/app/assets/fonts/gaku/admin/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/gaku/admin/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/javascripts/gaku/admin/admin.coffee +51 -0
- data/app/assets/javascripts/gaku/admin/base.js.coffee +118 -0
- data/app/assets/javascripts/gaku/admin/slide.js.erb +14 -0
- data/app/assets/javascripts/gaku/admin.js.coffee +43 -0
- data/app/assets/stylesheets/gaku/admin/bootstrap_and_theme.css.scss +571 -0
- data/app/assets/stylesheets/gaku/admin/disposals.css.scss +14 -0
- data/app/assets/stylesheets/gaku/admin/gaku.css.scss +216 -0
- data/app/assets/stylesheets/gaku/admin.css +13 -0
- data/app/assets/templates/roster.xls +0 -0
- data/app/controllers/gaku/admin/achievements/simple_grade_types_controller.rb +70 -0
- data/app/controllers/gaku/admin/attendance_types_controller.rb +60 -0
- data/app/controllers/gaku/admin/badge_types_controller.rb +69 -0
- data/app/controllers/gaku/admin/base_controller.rb +43 -0
- data/app/controllers/gaku/admin/commute_method_types_controller.rb +54 -0
- data/app/controllers/gaku/admin/contact_types_controller.rb +55 -0
- data/app/controllers/gaku/admin/departments_controller.rb +55 -0
- data/app/controllers/gaku/admin/enrollment_statuses_controller.rb +58 -0
- data/app/controllers/gaku/admin/grading_method_sets/grading_method_set_items_controller.rb +70 -0
- data/app/controllers/gaku/admin/grading_method_sets_controller.rb +69 -0
- data/app/controllers/gaku/admin/grading_methods_controller.rb +60 -0
- data/app/controllers/gaku/admin/presets_controller.rb +75 -0
- data/app/controllers/gaku/admin/roles_controller.rb +54 -0
- data/app/controllers/gaku/admin/school_years/semesters_controller.rb +58 -0
- data/app/controllers/gaku/admin/school_years_controller.rb +63 -0
- data/app/controllers/gaku/admin/schools/campuses/addresses_controller.rb +64 -0
- data/app/controllers/gaku/admin/schools/campuses/contacts_controller.rb +77 -0
- data/app/controllers/gaku/admin/schools/campuses_controller.rb +72 -0
- data/app/controllers/gaku/admin/schools/programs_controller.rb +79 -0
- data/app/controllers/gaku/admin/schools_controller.rb +84 -0
- data/app/controllers/gaku/admin/specialties_controller.rb +63 -0
- data/app/controllers/gaku/admin/states_controller.rb +92 -0
- data/app/controllers/gaku/admin/system_tools_controller.rb +8 -0
- data/app/controllers/gaku/admin/templates_controller.rb +72 -0
- data/app/controllers/gaku/admin/users_controller.rb +82 -0
- data/app/controllers/gaku/states_controller.rb +17 -0
- data/app/helpers/gaku/admin_helper.rb +12 -0
- data/app/helpers/gaku/presets_helper.rb +10 -0
- data/app/helpers/gaku/shared_helper.rb +25 -0
- data/app/overrides/admin_menu.rb +6 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/_fields.html.slim +8 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/_form.html.slim +3 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/_form_fields.html.slim +7 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/_modal.html.slim +4 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/_simple_grade_type.html.slim +2 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/create.js.erb +7 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/destroy.js.erb +2 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/edit.js.erb +3 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/index.html.slim +23 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/new.js.erb +3 -0
- data/app/views/gaku/admin/achievements/simple_grade_types/update.js.erb +4 -0
- data/app/views/gaku/admin/attendance_types/_attendance_type.html.slim +2 -0
- data/app/views/gaku/admin/attendance_types/_fields.html.slim +9 -0
- data/app/views/gaku/admin/attendance_types/_form.html.slim +3 -0
- data/app/views/gaku/admin/attendance_types/_form_fields.html.slim +6 -0
- data/app/views/gaku/admin/attendance_types/_modal.html.slim +4 -0
- data/app/views/gaku/admin/attendance_types/create.js.erb +7 -0
- data/app/views/gaku/admin/attendance_types/destroy.js.erb +2 -0
- data/app/views/gaku/admin/attendance_types/edit.js.erb +4 -0
- data/app/views/gaku/admin/attendance_types/index.html.slim +24 -0
- data/app/views/gaku/admin/attendance_types/index.json.rb +1 -0
- data/app/views/gaku/admin/attendance_types/new.js.erb +4 -0
- data/app/views/gaku/admin/attendance_types/update.js.erb +4 -0
- data/app/views/gaku/admin/badge_types/_badge_type.html.slim +2 -0
- data/app/views/gaku/admin/badge_types/_fields.html.slim +7 -0
- data/app/views/gaku/admin/badge_types/_form.html.slim +3 -0
- data/app/views/gaku/admin/badge_types/_form_fields.html.slim +7 -0
- data/app/views/gaku/admin/badge_types/_modal.html.slim +4 -0
- data/app/views/gaku/admin/badge_types/destroy.js.erb +2 -0
- data/app/views/gaku/admin/badge_types/edit.js.erb +3 -0
- data/app/views/gaku/admin/badge_types/index.html.slim +22 -0
- data/app/views/gaku/admin/badge_types/new.js.erb +3 -0
- data/app/views/gaku/admin/commute_method_types/_commute_method_type.html.slim +2 -0
- data/app/views/gaku/admin/commute_method_types/_fields.html.slim +4 -0
- data/app/views/gaku/admin/commute_method_types/_form.html.slim +3 -0
- data/app/views/gaku/admin/commute_method_types/_modal.html.slim +4 -0
- data/app/views/gaku/admin/commute_method_types/create.js.erb +7 -0
- data/app/views/gaku/admin/commute_method_types/destroy.js.erb +2 -0
- data/app/views/gaku/admin/commute_method_types/edit.js.erb +3 -0
- data/app/views/gaku/admin/commute_method_types/index.html.slim +18 -0
- data/app/views/gaku/admin/commute_method_types/new.js.erb +3 -0
- data/app/views/gaku/admin/commute_method_types/update.js.erb +3 -0
- data/app/views/gaku/admin/contact_types/_contact_type.html.slim +2 -0
- data/app/views/gaku/admin/contact_types/_fields.html.slim +4 -0
- data/app/views/gaku/admin/contact_types/_form.html.slim +3 -0
- data/app/views/gaku/admin/contact_types/_modal.html.slim +4 -0
- data/app/views/gaku/admin/contact_types/create.js.erb +7 -0
- data/app/views/gaku/admin/contact_types/destroy.js.erb +2 -0
- data/app/views/gaku/admin/contact_types/edit.js.erb +3 -0
- data/app/views/gaku/admin/contact_types/index.html.slim +18 -0
- data/app/views/gaku/admin/contact_types/new.js.erb +3 -0
- data/app/views/gaku/admin/contact_types/update.js.erb +3 -0
- data/app/views/gaku/admin/departments/_department.html.slim +2 -0
- data/app/views/gaku/admin/departments/_form.html.slim +3 -0
- data/app/views/gaku/admin/departments/_form_fields.html.slim +1 -0
- data/app/views/gaku/admin/departments/_modal.html.slim +4 -0
- data/app/views/gaku/admin/departments/_table_fields.html.slim +5 -0
- data/app/views/gaku/admin/departments/create.js.erb +7 -0
- data/app/views/gaku/admin/departments/destroy.js.erb +2 -0
- data/app/views/gaku/admin/departments/edit.js.erb +3 -0
- data/app/views/gaku/admin/departments/index.html.slim +20 -0
- data/app/views/gaku/admin/departments/new.js.erb +3 -0
- data/app/views/gaku/admin/departments/update.js.erb +4 -0
- data/app/views/gaku/admin/enrollment_statuses/_enrollment_status.html.slim +2 -0
- data/app/views/gaku/admin/enrollment_statuses/_fields.html.slim +6 -0
- data/app/views/gaku/admin/enrollment_statuses/_form.html.slim +3 -0
- data/app/views/gaku/admin/enrollment_statuses/_form_fields.html.slim +3 -0
- data/app/views/gaku/admin/enrollment_statuses/_modal.html.slim +4 -0
- data/app/views/gaku/admin/enrollment_statuses/create.js.erb +7 -0
- data/app/views/gaku/admin/enrollment_statuses/destroy.js.erb +2 -0
- data/app/views/gaku/admin/enrollment_statuses/edit.js.erb +3 -0
- data/app/views/gaku/admin/enrollment_statuses/index.html.slim +21 -0
- data/app/views/gaku/admin/enrollment_statuses/new.js.erb +3 -0
- data/app/views/gaku/admin/enrollment_statuses/update.js.erb +4 -0
- data/app/views/gaku/admin/grading_method_sets/_fields.html.slim +9 -0
- data/app/views/gaku/admin/grading_method_sets/_form.html.slim +3 -0
- data/app/views/gaku/admin/grading_method_sets/_form_fields.html.slim +4 -0
- data/app/views/gaku/admin/grading_method_sets/_grading_method_set.html.slim +4 -0
- data/app/views/gaku/admin/grading_method_sets/_make_primary_field.html.slim +4 -0
- data/app/views/gaku/admin/grading_method_sets/_modal.html.slim +4 -0
- data/app/views/gaku/admin/grading_method_sets/create.js.erb +7 -0
- data/app/views/gaku/admin/grading_method_sets/destroy.js.erb +7 -0
- data/app/views/gaku/admin/grading_method_sets/edit.js.erb +3 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_fields.html.slim +9 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_form.html.slim +3 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_form_fields.html.slim +1 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_item.html.slim +4 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_items.html.slim +23 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_modal.html.slim +4 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/create.js.erb +7 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/destroy.js.erb +2 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/edit.js.erb +3 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/new.js.erb +3 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/update.js.erb +3 -0
- data/app/views/gaku/admin/grading_method_sets/index.html.slim +23 -0
- data/app/views/gaku/admin/grading_method_sets/make_primary.js.erb +6 -0
- data/app/views/gaku/admin/grading_method_sets/new.js.erb +3 -0
- data/app/views/gaku/admin/grading_method_sets/show.html.slim +13 -0
- data/app/views/gaku/admin/grading_method_sets/update.js.erb +3 -0
- data/app/views/gaku/admin/grading_methods/_fields.html.slim +6 -0
- data/app/views/gaku/admin/grading_methods/_form.html.slim +3 -0
- data/app/views/gaku/admin/grading_methods/_form_fields.html.slim +4 -0
- data/app/views/gaku/admin/grading_methods/_grading_method.html.slim +2 -0
- data/app/views/gaku/admin/grading_methods/_modal.html.slim +4 -0
- data/app/views/gaku/admin/grading_methods/create.js.erb +7 -0
- data/app/views/gaku/admin/grading_methods/destroy.js.erb +2 -0
- data/app/views/gaku/admin/grading_methods/edit.js.erb +3 -0
- data/app/views/gaku/admin/grading_methods/index.html.slim +20 -0
- data/app/views/gaku/admin/grading_methods/new.js.erb +3 -0
- data/app/views/gaku/admin/grading_methods/update.js.erb +3 -0
- data/app/views/gaku/admin/presets/_address.html.slim +19 -0
- data/app/views/gaku/admin/presets/_chooser_fields.html.slim +91 -0
- data/app/views/gaku/admin/presets/_export_formats.html.slim +19 -0
- data/app/views/gaku/admin/presets/_fields.html.slim +5 -0
- data/app/views/gaku/admin/presets/_grading.html.slim +14 -0
- data/app/views/gaku/admin/presets/_locale.html.slim +3 -0
- data/app/views/gaku/admin/presets/_names_order.html.slim +15 -0
- data/app/views/gaku/admin/presets/_pagination.html.slim +25 -0
- data/app/views/gaku/admin/presets/_person.html.slim +8 -0
- data/app/views/gaku/admin/presets/_preset.html.slim +2 -0
- data/app/views/gaku/admin/presets/_student.html.slim +19 -0
- data/app/views/gaku/admin/presets/_tabs.html.slim +51 -0
- data/app/views/gaku/admin/presets/edit.html.slim +1 -0
- data/app/views/gaku/admin/presets/index.html.slim +16 -0
- data/app/views/gaku/admin/roles/_fields.html.slim +5 -0
- data/app/views/gaku/admin/roles/_form.html.slim +3 -0
- data/app/views/gaku/admin/roles/_form_fields.html.slim +1 -0
- data/app/views/gaku/admin/roles/_modal.html.slim +4 -0
- data/app/views/gaku/admin/roles/_role.html.slim +2 -0
- data/app/views/gaku/admin/roles/create.js.erb +7 -0
- data/app/views/gaku/admin/roles/destroy.js.erb +2 -0
- data/app/views/gaku/admin/roles/edit.js.erb +3 -0
- data/app/views/gaku/admin/roles/index.html.slim +20 -0
- data/app/views/gaku/admin/roles/new.js.erb +3 -0
- data/app/views/gaku/admin/roles/update.js.erb +3 -0
- data/app/views/gaku/admin/school_years/_fields.html.slim +7 -0
- data/app/views/gaku/admin/school_years/_form.html.slim +3 -0
- data/app/views/gaku/admin/school_years/_form_fields.html.slim +5 -0
- data/app/views/gaku/admin/school_years/_modal.html.slim +5 -0
- data/app/views/gaku/admin/school_years/_school_year.html.slim +3 -0
- data/app/views/gaku/admin/school_years/_show_table.html.slim +10 -0
- data/app/views/gaku/admin/school_years/create.js.erb +10 -0
- data/app/views/gaku/admin/school_years/destroy.js.erb +2 -0
- data/app/views/gaku/admin/school_years/edit.js.erb +5 -0
- data/app/views/gaku/admin/school_years/index.html.slim +21 -0
- data/app/views/gaku/admin/school_years/new.js.erb +5 -0
- data/app/views/gaku/admin/school_years/semesters/_fields.html.slim +7 -0
- data/app/views/gaku/admin/school_years/semesters/_form.html.slim +3 -0
- data/app/views/gaku/admin/school_years/semesters/_form_fields.html.slim +5 -0
- data/app/views/gaku/admin/school_years/semesters/_modal.html.slim +5 -0
- data/app/views/gaku/admin/school_years/semesters/_semester.html.slim +3 -0
- data/app/views/gaku/admin/school_years/semesters/_semesters.html.slim +22 -0
- data/app/views/gaku/admin/school_years/semesters/create.js.erb +10 -0
- data/app/views/gaku/admin/school_years/semesters/destroy.js.erb +2 -0
- data/app/views/gaku/admin/school_years/semesters/edit.js.erb +6 -0
- data/app/views/gaku/admin/school_years/semesters/new.js.erb +4 -0
- data/app/views/gaku/admin/school_years/semesters/update.js.erb +8 -0
- data/app/views/gaku/admin/school_years/show.html.slim +15 -0
- data/app/views/gaku/admin/school_years/update.js.erb +8 -0
- data/app/views/gaku/admin/schools/_fields.html.slim +9 -0
- data/app/views/gaku/admin/schools/_form.html.slim +3 -0
- data/app/views/gaku/admin/schools/_form_fields.html.slim +25 -0
- data/app/views/gaku/admin/schools/_school.html.slim +6 -0
- data/app/views/gaku/admin/schools/_show_table.html.slim +35 -0
- data/app/views/gaku/admin/schools/_tabs.html.slim +15 -0
- data/app/views/gaku/admin/schools/campuses/_campus.html.slim +6 -0
- data/app/views/gaku/admin/schools/campuses/_campuses.html.slim +23 -0
- data/app/views/gaku/admin/schools/campuses/_form.html.slim +3 -0
- data/app/views/gaku/admin/schools/campuses/_form_fields.html.slim +1 -0
- data/app/views/gaku/admin/schools/campuses/_picture.html.slim +8 -0
- data/app/views/gaku/admin/schools/campuses/_show_table.html.slim +10 -0
- data/app/views/gaku/admin/schools/campuses/_tabs.html.slim +15 -0
- data/app/views/gaku/admin/schools/campuses/_upload_picture.html.slim +7 -0
- data/app/views/gaku/admin/schools/campuses/addresses/_address.html.slim +7 -0
- data/app/views/gaku/admin/schools/campuses/addresses/_address_row_fields.html.slim +4 -0
- data/app/views/gaku/admin/schools/campuses/addresses/_addresses.html.slim +24 -0
- data/app/views/gaku/admin/schools/campuses/addresses/_fields.html.slim +7 -0
- data/app/views/gaku/admin/schools/campuses/addresses/_form.html.slim +3 -0
- data/app/views/gaku/admin/schools/campuses/addresses/_form_fields.html.slim +26 -0
- data/app/views/gaku/admin/schools/campuses/addresses/_modal.html.slim +5 -0
- data/app/views/gaku/admin/schools/campuses/addresses/create.js.erb +6 -0
- data/app/views/gaku/admin/schools/campuses/addresses/destroy.js.erb +2 -0
- data/app/views/gaku/admin/schools/campuses/addresses/edit.js.erb +4 -0
- data/app/views/gaku/admin/schools/campuses/addresses/new.js.erb +4 -0
- data/app/views/gaku/admin/schools/campuses/addresses/update.js.erb +4 -0
- data/app/views/gaku/admin/schools/campuses/contacts/_contact.html.slim +3 -0
- data/app/views/gaku/admin/schools/campuses/contacts/_contacts.html.slim +22 -0
- data/app/views/gaku/admin/schools/campuses/contacts/_delete_link.html.slim +1 -0
- data/app/views/gaku/admin/schools/campuses/contacts/_fields.html.slim +12 -0
- data/app/views/gaku/admin/schools/campuses/contacts/_form.html.slim +3 -0
- data/app/views/gaku/admin/schools/campuses/contacts/_form_fields.html.slim +14 -0
- data/app/views/gaku/admin/schools/campuses/contacts/_modal.html.slim +5 -0
- data/app/views/gaku/admin/schools/campuses/contacts/_primary_field.html.slim +13 -0
- data/app/views/gaku/admin/schools/campuses/contacts/create.js.erb +20 -0
- data/app/views/gaku/admin/schools/campuses/contacts/destroy.js.erb +8 -0
- data/app/views/gaku/admin/schools/campuses/contacts/edit.js.erb +4 -0
- data/app/views/gaku/admin/schools/campuses/contacts/make_primary.js.erb +6 -0
- data/app/views/gaku/admin/schools/campuses/contacts/new.js.erb +3 -0
- data/app/views/gaku/admin/schools/campuses/contacts/soft_delete.js.erb +8 -0
- data/app/views/gaku/admin/schools/campuses/contacts/update.js.erb +14 -0
- data/app/views/gaku/admin/schools/campuses/create.js.erb +9 -0
- data/app/views/gaku/admin/schools/campuses/destroy.js.erb +2 -0
- data/app/views/gaku/admin/schools/campuses/edit.html.slim +19 -0
- data/app/views/gaku/admin/schools/campuses/new.js.erb +3 -0
- data/app/views/gaku/admin/schools/campuses/show.html.slim +13 -0
- data/app/views/gaku/admin/schools/create.js.erb +7 -0
- data/app/views/gaku/admin/schools/destroy.js.erb +1 -0
- data/app/views/gaku/admin/schools/edit.html.slim +19 -0
- data/app/views/gaku/admin/schools/edit_master.html.slim +22 -0
- data/app/views/gaku/admin/schools/index.html.slim +25 -0
- data/app/views/gaku/admin/schools/new.js.erb +3 -0
- data/app/views/gaku/admin/schools/programs/_fields.html.slim +10 -0
- data/app/views/gaku/admin/schools/programs/_form.html.slim +14 -0
- data/app/views/gaku/admin/schools/programs/_form_fields.html.slim +6 -0
- data/app/views/gaku/admin/schools/programs/_modal.html.slim +3 -0
- data/app/views/gaku/admin/schools/programs/_program.html.slim +2 -0
- data/app/views/gaku/admin/schools/programs/_programs.html.slim +23 -0
- data/app/views/gaku/admin/schools/programs/create.js.erb +7 -0
- data/app/views/gaku/admin/schools/programs/destroy.js.erb +2 -0
- data/app/views/gaku/admin/schools/programs/edit.js.erb +3 -0
- data/app/views/gaku/admin/schools/programs/new.js.erb +3 -0
- data/app/views/gaku/admin/schools/programs/program_levels/_form_fields.html.slim +6 -0
- data/app/views/gaku/admin/schools/programs/program_levels/_modal.html.slim +11 -0
- data/app/views/gaku/admin/schools/programs/program_specialties/_form_fields.html.slim +7 -0
- data/app/views/gaku/admin/schools/programs/program_specialties/_modal.html.slim +10 -0
- data/app/views/gaku/admin/schools/programs/program_syllabuses/_form_fields.html.slim +5 -0
- data/app/views/gaku/admin/schools/programs/program_syllabuses/_modal.html.slim +10 -0
- data/app/views/gaku/admin/schools/programs/show_program_levels.js.erb +3 -0
- data/app/views/gaku/admin/schools/programs/show_program_specialties.js.erb +3 -0
- data/app/views/gaku/admin/schools/programs/show_program_syllabuses.js.erb +3 -0
- data/app/views/gaku/admin/schools/programs/update.js.erb +3 -0
- data/app/views/gaku/admin/schools/show.html.slim +13 -0
- data/app/views/gaku/admin/schools/show_master.html.slim +14 -0
- data/app/views/gaku/admin/shared/_picture.html.slim +6 -0
- data/app/views/gaku/admin/shared/_upload_picture.html.slim +7 -0
- data/app/views/gaku/admin/specialties/_fields.html.slim +7 -0
- data/app/views/gaku/admin/specialties/_form.html.slim +3 -0
- data/app/views/gaku/admin/specialties/_form_fields.html.slim +4 -0
- data/app/views/gaku/admin/specialties/_modal.html.slim +4 -0
- data/app/views/gaku/admin/specialties/_specialty.html.slim +2 -0
- data/app/views/gaku/admin/specialties/create.js.erb +7 -0
- data/app/views/gaku/admin/specialties/destroy.js.erb +2 -0
- data/app/views/gaku/admin/specialties/edit.js.erb +3 -0
- data/app/views/gaku/admin/specialties/index.html.slim +21 -0
- data/app/views/gaku/admin/specialties/new.js.erb +3 -0
- data/app/views/gaku/admin/specialties/update.js.erb +3 -0
- data/app/views/gaku/admin/states/_country_select_form.html.slim +4 -0
- data/app/views/gaku/admin/states/_country_table.html.slim +11 -0
- data/app/views/gaku/admin/states/_fields.html.slim +8 -0
- data/app/views/gaku/admin/states/_form.html.slim +4 -0
- data/app/views/gaku/admin/states/_form_fields.html.slim +14 -0
- data/app/views/gaku/admin/states/_modal.html.slim +4 -0
- data/app/views/gaku/admin/states/_state.html.slim +2 -0
- data/app/views/gaku/admin/states/country_states.js.erb +2 -0
- data/app/views/gaku/admin/states/create.js.erb +7 -0
- data/app/views/gaku/admin/states/destroy.js.erb +2 -0
- data/app/views/gaku/admin/states/edit.js.erb +3 -0
- data/app/views/gaku/admin/states/index.html.slim +15 -0
- data/app/views/gaku/admin/states/new.js.erb +3 -0
- data/app/views/gaku/admin/states/update.js.erb +3 -0
- data/app/views/gaku/admin/system_tools/index.html.slim +1 -0
- data/app/views/gaku/admin/templates/_error_msg.html.slim +8 -0
- data/app/views/gaku/admin/templates/_fields.html.slim +8 -0
- data/app/views/gaku/admin/templates/_form.html.slim +3 -0
- data/app/views/gaku/admin/templates/_form_fields.html.slim +4 -0
- data/app/views/gaku/admin/templates/_modal.html.slim +4 -0
- data/app/views/gaku/admin/templates/_template.html.slim +2 -0
- data/app/views/gaku/admin/templates/destroy.js.erb +2 -0
- data/app/views/gaku/admin/templates/edit.html.slim +1 -0
- data/app/views/gaku/admin/templates/index.html.slim +20 -0
- data/app/views/gaku/admin/templates/new.html.slim +1 -0
- data/app/views/gaku/admin/users/_fields.html.slim +5 -0
- data/app/views/gaku/admin/users/_form.html.slim +3 -0
- data/app/views/gaku/admin/users/_form_fields.html.slim +14 -0
- data/app/views/gaku/admin/users/_modal.html.slim +4 -0
- data/app/views/gaku/admin/users/_user.html.slim +2 -0
- data/app/views/gaku/admin/users/create.js.erb +7 -0
- data/app/views/gaku/admin/users/destroy.js.erb +2 -0
- data/app/views/gaku/admin/users/edit.js.erb +3 -0
- data/app/views/gaku/admin/users/index.html.slim +21 -0
- data/app/views/gaku/admin/users/new.js.erb +3 -0
- data/app/views/gaku/admin/users/update.js.erb +4 -0
- data/app/views/gaku/layouts/admin/edit.html.slim +10 -0
- data/app/views/gaku/layouts/admin/gaku.html.slim +27 -0
- data/app/views/gaku/layouts/admin/index.html.slim +12 -0
- data/app/views/gaku/layouts/admin/show.html.slim +10 -0
- data/app/views/gaku/shared/_delete_link.html.slim +1 -0
- data/app/views/gaku/shared/_delete_modal.html.slim +11 -0
- data/app/views/gaku/shared/_errors.html.slim +6 -0
- data/app/views/gaku/shared/_flash.html.slim +4 -0
- data/app/views/gaku/shared/_language_bar.html.slim +8 -0
- data/app/views/gaku/shared/_login_widget.html.slim +15 -0
- data/app/views/gaku/shared/_manage_buttons.html.slim +4 -0
- data/app/views/gaku/shared/_modal_config.html.slim +37 -0
- data/app/views/gaku/shared/_multi_errors.html.slim +6 -0
- data/app/views/gaku/shared/_picture.html.slim +8 -0
- data/app/views/gaku/shared/_upload_picture.html.slim +7 -0
- data/app/views/gaku/shared/error.js.erb +2 -0
- data/app/views/gaku/shared/menu/_admin.html.erb +71 -0
- data/app/views/gaku/shared/multi_error.js.erb +2 -0
- data/app/views/gaku/shared/notice.js.erb +2 -0
- data/app/views/gaku/states/_no_states_select.html.slim +1 -0
- data/app/views/gaku/states/_states_select.html.slim +1 -0
- data/app/views/gaku/states/index.js.erb +5 -0
- data/config/initializers/client_side_validations.rb +9 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/routes.rb +67 -0
- data/lib/gaku/admin/engine.rb +30 -0
- data/lib/gaku/admin.rb +31 -0
- data/lib/gaku/app_responder.rb +6 -0
- data/lib/gaku_admin.rb +1 -0
- data/lib/tasks/admin_user.rake +104 -0
- data/lib/tasks/core.rake +65 -0
- data/lib/tasks/reset.rake +37 -0
- metadata +684 -0
@@ -0,0 +1,70 @@
|
|
1
|
+
module Gaku
|
2
|
+
class Admin::GradingMethodSets::GradingMethodSetItemsController < Admin::BaseController
|
3
|
+
|
4
|
+
respond_to :js, only: %i( new create edit update destroy )
|
5
|
+
|
6
|
+
before_action :set_grading_method_set_item, only: %i( edit update destroy )
|
7
|
+
before_action :set_grading_methods, only: %i( new edit )
|
8
|
+
before_action :set_grading_method_set
|
9
|
+
|
10
|
+
def new
|
11
|
+
@grading_method_set_item = GradingMethodSetItem.new
|
12
|
+
respond_with @grading_method_set_item
|
13
|
+
end
|
14
|
+
|
15
|
+
def sort
|
16
|
+
params[:'grading-method-set-item'].each_with_index do |id, index|
|
17
|
+
@grading_method_set.update_items_positions(id, index)
|
18
|
+
end
|
19
|
+
render nothing: true
|
20
|
+
end
|
21
|
+
|
22
|
+
def create
|
23
|
+
@grading_method_set_item = @grading_method_set.items.build(grading_method_set_item_params)
|
24
|
+
@grading_method_set_item.save
|
25
|
+
set_count
|
26
|
+
respond_with @grading_method_set_item
|
27
|
+
end
|
28
|
+
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
def update
|
33
|
+
@grading_method_set_item.update(grading_method_set_item_params)
|
34
|
+
respond_with @grading_method_set_item
|
35
|
+
end
|
36
|
+
|
37
|
+
def destroy
|
38
|
+
@grading_method_set_item.destroy
|
39
|
+
set_count
|
40
|
+
respond_with @grading_method_set_item
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def set_grading_method_set_item
|
46
|
+
@grading_method_set_item = GradingMethodSetItem.find(params[:id])
|
47
|
+
end
|
48
|
+
|
49
|
+
def set_grading_method_set
|
50
|
+
@grading_method_set = GradingMethodSet.find(params[:grading_method_set_id])
|
51
|
+
end
|
52
|
+
|
53
|
+
def set_grading_methods
|
54
|
+
@grading_methods = GradingMethod.all.map { |s| [s.name, s.id] }
|
55
|
+
end
|
56
|
+
|
57
|
+
def set_count
|
58
|
+
@count = @grading_method_set.items.count
|
59
|
+
end
|
60
|
+
|
61
|
+
def grading_method_set_item_params
|
62
|
+
params.require(:grading_method_set_item).permit(attributes)
|
63
|
+
end
|
64
|
+
|
65
|
+
def attributes
|
66
|
+
%i(position grading_method_id grading_method_set_id)
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
module Gaku
|
2
|
+
class Admin::GradingMethodSetsController < Admin::BaseController
|
3
|
+
|
4
|
+
#load_and_authorize_resource class: GradingMethodSet
|
5
|
+
|
6
|
+
respond_to :js, only: %i( new create edit update destroy make_primary )
|
7
|
+
respond_to :html, only: %i( index show )
|
8
|
+
|
9
|
+
before_action :set_grading_method_set, only: %i( edit update show destroy make_primary )
|
10
|
+
|
11
|
+
def index
|
12
|
+
@grading_method_sets = GradingMethodSet.all
|
13
|
+
@count = GradingMethodSet.count
|
14
|
+
respond_with @grading_method_sets
|
15
|
+
end
|
16
|
+
|
17
|
+
def new
|
18
|
+
@grading_method_set = GradingMethodSet.new
|
19
|
+
respond_with @grading_method_set
|
20
|
+
end
|
21
|
+
|
22
|
+
def create
|
23
|
+
@grading_method_set = GradingMethodSet.new(grading_method_set_params)
|
24
|
+
@grading_method_set.save
|
25
|
+
@count = GradingMethodSet.count
|
26
|
+
respond_with @grading_method_set
|
27
|
+
end
|
28
|
+
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
def show
|
33
|
+
end
|
34
|
+
|
35
|
+
def update
|
36
|
+
@grading_method_set.update(grading_method_set_params)
|
37
|
+
respond_with @grading_method_set
|
38
|
+
end
|
39
|
+
|
40
|
+
def destroy
|
41
|
+
if @grading_method_set.primary?
|
42
|
+
GradingMethodSet.first.try(:make_primary)
|
43
|
+
end
|
44
|
+
@grading_method_set.destroy
|
45
|
+
@count = GradingMethodSet.count
|
46
|
+
respond_with @grading_method_set
|
47
|
+
end
|
48
|
+
|
49
|
+
def make_primary
|
50
|
+
@grading_method_set.make_primary
|
51
|
+
respond_with @grading_method_set
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def set_grading_method_set
|
57
|
+
@grading_method_set = GradingMethodSet.find(params[:id])
|
58
|
+
end
|
59
|
+
|
60
|
+
def grading_method_set_params
|
61
|
+
params.require(:grading_method_set).permit(attributes)
|
62
|
+
end
|
63
|
+
|
64
|
+
def attributes
|
65
|
+
%i(display_deviation display_rank name primary rank_order)
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Gaku
|
2
|
+
class Admin::GradingMethodsController < Admin::BaseController
|
3
|
+
|
4
|
+
#load_and_authorize_resource class: GradingMethod
|
5
|
+
|
6
|
+
respond_to :js, only: %i( new create edit update destroy )
|
7
|
+
respond_to :html, only: :index
|
8
|
+
|
9
|
+
before_action :set_grading_method, only: %i( edit update destroy )
|
10
|
+
|
11
|
+
def index
|
12
|
+
@grading_methods = GradingMethod.all
|
13
|
+
@count = GradingMethod.count
|
14
|
+
respond_with @grading_methods
|
15
|
+
end
|
16
|
+
|
17
|
+
def new
|
18
|
+
@grading_method = GradingMethod.new
|
19
|
+
respond_with @grading_method
|
20
|
+
end
|
21
|
+
|
22
|
+
def create
|
23
|
+
@grading_method = GradingMethod.new(grading_method_params)
|
24
|
+
@grading_method.save
|
25
|
+
@count = GradingMethod.count
|
26
|
+
respond_with @grading_method
|
27
|
+
end
|
28
|
+
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
def update
|
33
|
+
@grading_method.update(grading_method_params)
|
34
|
+
respond_with @grading_method
|
35
|
+
end
|
36
|
+
|
37
|
+
def destroy
|
38
|
+
@grading_method.destroy
|
39
|
+
@count = GradingMethod.count
|
40
|
+
respond_with @grading_method
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def set_grading_method
|
46
|
+
@grading_method = GradingMethod.find(params[:id])
|
47
|
+
end
|
48
|
+
|
49
|
+
def grading_method_params
|
50
|
+
params.require(:grading_method).permit(attributes).tap do |whitelisted|
|
51
|
+
whitelisted['arguments'] = params[:grading_method][:arguments]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def attributes
|
56
|
+
%i( description method name curved arguments )
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
module Gaku
|
2
|
+
class Admin::PresetsController < Admin::BaseController
|
3
|
+
|
4
|
+
respond_to :html, only: %i( index edit update )
|
5
|
+
before_action :set_preset, except: :index
|
6
|
+
|
7
|
+
def index
|
8
|
+
@presets = Preset.all
|
9
|
+
@count = Preset.count
|
10
|
+
respond_with @presets
|
11
|
+
end
|
12
|
+
|
13
|
+
def edit
|
14
|
+
@per_page_values = [10, 25, 50, 100]
|
15
|
+
@countries = Country.all
|
16
|
+
end
|
17
|
+
|
18
|
+
def update
|
19
|
+
@preset.update(preset_params)
|
20
|
+
respond_with @preset, location: [:edit, :admin, @preset]
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def preset_params
|
26
|
+
params.require(:preset).permit(preset_attr)
|
27
|
+
end
|
28
|
+
|
29
|
+
def preset_attr
|
30
|
+
[
|
31
|
+
:name, :default, :active, :locale, :names_order,
|
32
|
+
pagination: pagination_attr,
|
33
|
+
grading: grading_attr,
|
34
|
+
person: person_attr,
|
35
|
+
address: address_attr,
|
36
|
+
export_formats: export_formats_attr,
|
37
|
+
chooser_fields: chooser_fields_attr
|
38
|
+
]
|
39
|
+
end
|
40
|
+
|
41
|
+
def pagination_attr
|
42
|
+
%i( default students teachers changes )
|
43
|
+
end
|
44
|
+
|
45
|
+
def grading_attr
|
46
|
+
%i( method scheme )
|
47
|
+
end
|
48
|
+
|
49
|
+
def person_attr
|
50
|
+
%i( gender )
|
51
|
+
end
|
52
|
+
|
53
|
+
def address_attr
|
54
|
+
%i( country state city )
|
55
|
+
end
|
56
|
+
|
57
|
+
def export_formats_attr
|
58
|
+
%i( documents printables spreadsheets )
|
59
|
+
end
|
60
|
+
|
61
|
+
def chooser_fields_attr
|
62
|
+
%i(
|
63
|
+
show_name show_middle_name show_surname show_birth_date show_gender
|
64
|
+
show_user show_code show_foreign_id_code show_enrollment_status
|
65
|
+
show_admitted show_graduated show_class_name show_specialty
|
66
|
+
show_primary_address show_primary_contact show_primary_email show_personal_information
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
70
|
+
def set_preset
|
71
|
+
@preset = Preset.find(params[:id])
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Gaku
|
2
|
+
class Admin::RolesController < Admin::BaseController
|
3
|
+
|
4
|
+
#load_and_authorize_resource class: Role
|
5
|
+
|
6
|
+
respond_to :js, only: %i( new create edit update destroy )
|
7
|
+
respond_to :html, only: :index
|
8
|
+
|
9
|
+
before_action :set_role, only: %i( edit update destroy )
|
10
|
+
|
11
|
+
def index
|
12
|
+
@roles = Role.all
|
13
|
+
@count = Role.count
|
14
|
+
respond_with @roles
|
15
|
+
end
|
16
|
+
|
17
|
+
def new
|
18
|
+
@role = Role.new
|
19
|
+
respond_with @role
|
20
|
+
end
|
21
|
+
|
22
|
+
def create
|
23
|
+
@role = Role.new(role_params)
|
24
|
+
@role.save
|
25
|
+
@count = Role.count
|
26
|
+
respond_with @role
|
27
|
+
end
|
28
|
+
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
def update
|
33
|
+
@role.update(role_params)
|
34
|
+
respond_with @role
|
35
|
+
end
|
36
|
+
|
37
|
+
def destroy
|
38
|
+
@role.destroy
|
39
|
+
@count = Role.count
|
40
|
+
respond_with @role
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def set_role
|
46
|
+
@role = Role.find(params[:id])
|
47
|
+
end
|
48
|
+
|
49
|
+
def role_params
|
50
|
+
params.require(:role).permit(:name)
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module Gaku
|
2
|
+
class Admin::SchoolYears::SemestersController < Admin::BaseController
|
3
|
+
|
4
|
+
respond_to :js, only: %i( new create edit update destroy )
|
5
|
+
|
6
|
+
before_action :set_school_year
|
7
|
+
before_action :set_semester, only: %i( edit update destroy )
|
8
|
+
|
9
|
+
|
10
|
+
def new
|
11
|
+
@semester = Semester.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def create
|
15
|
+
@semester = @school_year.semesters.build(semester_params)
|
16
|
+
@semester.save
|
17
|
+
set_count
|
18
|
+
respond_with @semester
|
19
|
+
end
|
20
|
+
|
21
|
+
def edit
|
22
|
+
end
|
23
|
+
|
24
|
+
def update
|
25
|
+
@semester.update(semester_params)
|
26
|
+
respond_with @semester
|
27
|
+
end
|
28
|
+
|
29
|
+
def destroy
|
30
|
+
@semester.destroy
|
31
|
+
set_count
|
32
|
+
respond_with @semester
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def semester_params
|
38
|
+
params.require(:semester).permit(attributes)
|
39
|
+
end
|
40
|
+
|
41
|
+
def set_semester
|
42
|
+
@semester = Semester.find(params[:id])
|
43
|
+
end
|
44
|
+
|
45
|
+
def set_school_year
|
46
|
+
@school_year = SchoolYear.find(params[:school_year_id])
|
47
|
+
end
|
48
|
+
|
49
|
+
def set_count
|
50
|
+
@count = @school_year.semesters.count
|
51
|
+
end
|
52
|
+
|
53
|
+
def attributes
|
54
|
+
%i( starting ending )
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Gaku
|
2
|
+
class Admin::SchoolYearsController < Admin::BaseController
|
3
|
+
|
4
|
+
respond_to :html, only: %i( index show )
|
5
|
+
respond_to :js, only: %i( new create destroy edit update )
|
6
|
+
|
7
|
+
before_action :set_school_year, only: %i( show edit update destroy )
|
8
|
+
|
9
|
+
def index
|
10
|
+
@school_years = SchoolYear.all
|
11
|
+
set_count
|
12
|
+
respond_with @school_years
|
13
|
+
end
|
14
|
+
|
15
|
+
def new
|
16
|
+
@school_year = SchoolYear.new
|
17
|
+
end
|
18
|
+
|
19
|
+
def create
|
20
|
+
@school_year = SchoolYear.new(school_year_params)
|
21
|
+
@school_year.save
|
22
|
+
set_count
|
23
|
+
respond_with @school_year
|
24
|
+
end
|
25
|
+
|
26
|
+
def show
|
27
|
+
end
|
28
|
+
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
def update
|
33
|
+
@school_year.update(school_year_params)
|
34
|
+
respond_with @school_year
|
35
|
+
end
|
36
|
+
|
37
|
+
def destroy
|
38
|
+
@school_year.destroy
|
39
|
+
set_count
|
40
|
+
respond_with @school_year
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def school_year_params
|
47
|
+
params.require(:school_year).permit(attributes)
|
48
|
+
end
|
49
|
+
|
50
|
+
def set_school_year
|
51
|
+
@school_year = SchoolYear.find(params[:id])
|
52
|
+
end
|
53
|
+
|
54
|
+
def set_count
|
55
|
+
@count = SchoolYear.count
|
56
|
+
end
|
57
|
+
|
58
|
+
def attributes
|
59
|
+
%i( starting ending )
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module Gaku
|
2
|
+
class Admin::Schools::Campuses::AddressesController < Admin::BaseController
|
3
|
+
|
4
|
+
respond_to :js, only: %i( new create destroy edit update )
|
5
|
+
|
6
|
+
before_action :set_address, only: %i( edit update destroy )
|
7
|
+
before_action :set_school
|
8
|
+
before_action :set_campus
|
9
|
+
before_action :set_countries, only: %i( new edit )
|
10
|
+
|
11
|
+
def destroy
|
12
|
+
@campus.address.destroy
|
13
|
+
respond_with @campus.address
|
14
|
+
end
|
15
|
+
|
16
|
+
def new
|
17
|
+
@address = Address.new
|
18
|
+
respond_with @address
|
19
|
+
end
|
20
|
+
|
21
|
+
def create
|
22
|
+
@address = @campus.build_address(address_params)
|
23
|
+
@address.save
|
24
|
+
respond_with @address
|
25
|
+
end
|
26
|
+
|
27
|
+
def edit
|
28
|
+
respond_with @address
|
29
|
+
end
|
30
|
+
|
31
|
+
def update
|
32
|
+
@address.update(address_params)
|
33
|
+
respond_with @address, location: [:edit, :admin, @school, @campus]
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def address_params
|
39
|
+
params.require(:address).permit(attributes)
|
40
|
+
end
|
41
|
+
|
42
|
+
def attributes
|
43
|
+
%i( title address1 address2 city zipcode state state_id country country_id deleted primary past )
|
44
|
+
end
|
45
|
+
|
46
|
+
def set_school
|
47
|
+
@school = School.find(params[:school_id])
|
48
|
+
end
|
49
|
+
|
50
|
+
def set_campus
|
51
|
+
@campus = Campus.find(params[:campus_id])
|
52
|
+
end
|
53
|
+
|
54
|
+
def set_address
|
55
|
+
@address = Address.find(params[:id])
|
56
|
+
end
|
57
|
+
|
58
|
+
def set_countries
|
59
|
+
@countries = Country.all
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module Gaku
|
2
|
+
class Admin::Schools::Campuses::ContactsController < Admin::BaseController
|
3
|
+
|
4
|
+
respond_to :js
|
5
|
+
|
6
|
+
before_action :set_contact_types, only: %i( new edit )
|
7
|
+
before_action :set_contact, only: %i( edit update destroy make_primary )
|
8
|
+
before_action :set_school
|
9
|
+
before_action :set_campus
|
10
|
+
|
11
|
+
def new
|
12
|
+
@contact = Contact.new
|
13
|
+
respond_with @contact
|
14
|
+
end
|
15
|
+
|
16
|
+
def create
|
17
|
+
@contact = @campus.contacts.new(contact_params)
|
18
|
+
@contact.save
|
19
|
+
set_count
|
20
|
+
respond_with @contact
|
21
|
+
end
|
22
|
+
|
23
|
+
def edit
|
24
|
+
respond_with @contact
|
25
|
+
end
|
26
|
+
|
27
|
+
def update
|
28
|
+
@contact.update(contact_params)
|
29
|
+
respond_with @contact, location: [:edit, :admin, @school, @campus]
|
30
|
+
end
|
31
|
+
|
32
|
+
def destroy
|
33
|
+
if @contact.destroy
|
34
|
+
@campus.contacts.first.try(:make_primary) if @contact.primary?
|
35
|
+
end
|
36
|
+
set_count
|
37
|
+
respond_with @contact
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
def make_primary
|
42
|
+
@contact.make_primary
|
43
|
+
respond_with @contact
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def set_contact
|
49
|
+
@contact = Contact.find(params[:id])
|
50
|
+
end
|
51
|
+
|
52
|
+
def set_school
|
53
|
+
@school = School.find(params[:school_id])
|
54
|
+
end
|
55
|
+
|
56
|
+
def set_campus
|
57
|
+
@campus = Campus.find(params[:campus_id])
|
58
|
+
end
|
59
|
+
|
60
|
+
def contact_params
|
61
|
+
params.require(:contact).permit(attributes)
|
62
|
+
end
|
63
|
+
|
64
|
+
def attributes
|
65
|
+
%i( data details contact_type_id primary emergency )
|
66
|
+
end
|
67
|
+
|
68
|
+
def set_contact_types
|
69
|
+
@contact_types = ContactType.all
|
70
|
+
end
|
71
|
+
|
72
|
+
def set_count
|
73
|
+
@count = @campus.reload.contacts_count
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module Gaku
|
2
|
+
class Admin::Schools::CampusesController < Admin::BaseController
|
3
|
+
|
4
|
+
respond_to :js, only: %i( new create destroy )
|
5
|
+
respond_to :html, only: %i( edit update show )
|
6
|
+
|
7
|
+
before_action :set_campus, only: %i( edit show update destroy )
|
8
|
+
before_action :set_school
|
9
|
+
|
10
|
+
|
11
|
+
def destroy
|
12
|
+
@campus.destroy
|
13
|
+
set_count
|
14
|
+
respond_with @campus
|
15
|
+
end
|
16
|
+
|
17
|
+
def new
|
18
|
+
@campus = Campus.new
|
19
|
+
respond_with @campus
|
20
|
+
end
|
21
|
+
|
22
|
+
def create
|
23
|
+
@campus = Campus.new(campus_params)
|
24
|
+
@campus.save
|
25
|
+
@school.campuses << @campus
|
26
|
+
set_count
|
27
|
+
respond_with @campus
|
28
|
+
end
|
29
|
+
|
30
|
+
def edit
|
31
|
+
respond_with @campus
|
32
|
+
end
|
33
|
+
|
34
|
+
def show
|
35
|
+
respond_with @campus
|
36
|
+
end
|
37
|
+
|
38
|
+
def update
|
39
|
+
@campus.update(campus_params)
|
40
|
+
respond_with @campus, location: [:edit, :admin, @school, @campus]
|
41
|
+
end
|
42
|
+
|
43
|
+
def index
|
44
|
+
@campuses = Campus.all
|
45
|
+
set_count
|
46
|
+
respond_with @campus
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def campus_params
|
52
|
+
params.require(:campus).permit(attributes)
|
53
|
+
end
|
54
|
+
|
55
|
+
def attributes
|
56
|
+
%i( name school_id master picture )
|
57
|
+
end
|
58
|
+
|
59
|
+
def set_school
|
60
|
+
@school = School.find(params[:school_id])
|
61
|
+
end
|
62
|
+
|
63
|
+
def set_campus
|
64
|
+
@campus = Campus.find(params[:id])
|
65
|
+
end
|
66
|
+
|
67
|
+
def set_count
|
68
|
+
@count = @school.campuses.count
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|