gaku 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +6 -1
- data/.travis.yml +17 -7
- data/Gemfile +1 -1
- data/README.md +44 -3
- data/Rakefile +8 -12
- data/VERSION +1 -1
- data/admin/.rspec +2 -0
- data/admin/.ruby-gemset +1 -0
- data/admin/.ruby-version +1 -0
- data/admin/Gemfile +7 -0
- data/admin/Guardfile +40 -0
- data/admin/Rakefile +31 -0
- data/admin/app/assets/fonts/gaku/admin/glyphicons-halflings-regular.eot +0 -0
- data/admin/app/assets/fonts/gaku/admin/glyphicons-halflings-regular.svg +228 -0
- data/admin/app/assets/fonts/gaku/admin/glyphicons-halflings-regular.ttf +0 -0
- data/admin/app/assets/fonts/gaku/admin/glyphicons-halflings-regular.woff +0 -0
- data/admin/app/assets/javascripts/gaku/admin.js.coffee +43 -0
- data/admin/app/assets/javascripts/gaku/admin/admin.coffee +51 -0
- data/admin/app/assets/javascripts/gaku/admin/base.js.coffee +118 -0
- data/admin/app/assets/javascripts/gaku/admin/slide.js.erb +14 -0
- data/admin/app/assets/stylesheets/gaku/admin.css +13 -0
- data/admin/app/assets/stylesheets/gaku/admin/bootstrap_and_theme.css.scss +571 -0
- data/{core → admin}/app/assets/stylesheets/gaku/admin/disposals.css.scss +0 -0
- data/admin/app/assets/stylesheets/gaku/admin/gaku.css.scss +216 -0
- data/{core → admin}/app/assets/templates/roster.xls +0 -0
- data/admin/app/controllers/gaku/admin/achievements/simple_grade_types_controller.rb +70 -0
- data/{core → admin}/app/controllers/gaku/admin/attendance_types_controller.rb +0 -0
- data/admin/app/controllers/gaku/admin/badge_types_controller.rb +69 -0
- data/admin/app/controllers/gaku/admin/base_controller.rb +43 -0
- data/{core → admin}/app/controllers/gaku/admin/commute_method_types_controller.rb +0 -0
- data/{core → admin}/app/controllers/gaku/admin/contact_types_controller.rb +0 -0
- data/admin/app/controllers/gaku/admin/departments_controller.rb +55 -0
- data/{core → admin}/app/controllers/gaku/admin/enrollment_statuses_controller.rb +0 -0
- data/{core → admin}/app/controllers/gaku/admin/grading_method_sets/grading_method_set_items_controller.rb +0 -0
- data/{core → admin}/app/controllers/gaku/admin/grading_method_sets_controller.rb +0 -0
- data/admin/app/controllers/gaku/admin/grading_methods_controller.rb +60 -0
- data/admin/app/controllers/gaku/admin/presets_controller.rb +75 -0
- data/{core → admin}/app/controllers/gaku/admin/roles_controller.rb +0 -0
- data/admin/app/controllers/gaku/admin/school_years/semesters_controller.rb +58 -0
- data/admin/app/controllers/gaku/admin/school_years_controller.rb +63 -0
- data/admin/app/controllers/gaku/admin/schools/campuses/addresses_controller.rb +64 -0
- data/admin/app/controllers/gaku/admin/schools/campuses/contacts_controller.rb +77 -0
- data/admin/app/controllers/gaku/admin/schools/campuses_controller.rb +72 -0
- data/admin/app/controllers/gaku/admin/schools/programs_controller.rb +79 -0
- data/admin/app/controllers/gaku/admin/schools_controller.rb +84 -0
- data/admin/app/controllers/gaku/admin/specialties_controller.rb +63 -0
- data/admin/app/controllers/gaku/admin/states_controller.rb +92 -0
- data/{core → admin}/app/controllers/gaku/admin/system_tools_controller.rb +0 -0
- data/admin/app/controllers/gaku/admin/templates_controller.rb +72 -0
- data/admin/app/controllers/gaku/admin/users_controller.rb +82 -0
- data/admin/app/controllers/gaku/states_controller.rb +17 -0
- data/admin/app/helpers/gaku/admin_helper.rb +12 -0
- data/admin/app/helpers/gaku/presets_helper.rb +10 -0
- data/admin/app/helpers/gaku/shared_helper.rb +25 -0
- data/admin/app/overrides/admin_menu.rb +6 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/_fields.html.slim +8 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/_form_fields.html.slim +7 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/_modal.html.slim +4 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/_simple_grade_type.html.slim +2 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/destroy.js.erb +2 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/edit.js.erb +3 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/index.html.slim +23 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/new.js.erb +3 -0
- data/admin/app/views/gaku/admin/achievements/simple_grade_types/update.js.erb +4 -0
- data/{core → admin}/app/views/gaku/admin/attendance_types/_attendance_type.html.slim +0 -0
- data/{core → admin}/app/views/gaku/admin/attendance_types/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/attendance_types/_form.html.slim +3 -0
- data/{core → admin}/app/views/gaku/admin/attendance_types/_form_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/attendance_types/_modal.html.slim +4 -0
- data/admin/app/views/gaku/admin/attendance_types/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/attendance_types/destroy.js.erb +2 -0
- data/{core → admin}/app/views/gaku/admin/attendance_types/edit.js.erb +0 -0
- data/admin/app/views/gaku/admin/attendance_types/index.html.slim +24 -0
- data/{core → admin}/app/views/gaku/admin/attendance_types/index.json.rb +0 -0
- data/admin/app/views/gaku/admin/attendance_types/new.js.erb +4 -0
- data/{core → admin}/app/views/gaku/admin/attendance_types/update.js.erb +0 -0
- data/admin/app/views/gaku/admin/badge_types/_badge_type.html.slim +2 -0
- data/admin/app/views/gaku/admin/badge_types/_fields.html.slim +7 -0
- data/admin/app/views/gaku/admin/badge_types/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/badge_types/_form_fields.html.slim +7 -0
- data/admin/app/views/gaku/admin/badge_types/_modal.html.slim +4 -0
- data/admin/app/views/gaku/admin/badge_types/destroy.js.erb +2 -0
- data/admin/app/views/gaku/admin/badge_types/edit.js.erb +3 -0
- data/admin/app/views/gaku/admin/badge_types/index.html.slim +22 -0
- data/admin/app/views/gaku/admin/badge_types/new.js.erb +3 -0
- data/{core → admin}/app/views/gaku/admin/commute_method_types/_commute_method_type.html.slim +0 -0
- data/{core → admin}/app/views/gaku/admin/commute_method_types/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/commute_method_types/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/commute_method_types/_modal.html.slim +4 -0
- data/admin/app/views/gaku/admin/commute_method_types/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/commute_method_types/destroy.js.erb +2 -0
- data/{core → admin}/app/views/gaku/admin/commute_method_types/edit.js.erb +0 -0
- data/admin/app/views/gaku/admin/commute_method_types/index.html.slim +18 -0
- data/{core → admin}/app/views/gaku/admin/commute_method_types/new.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/commute_method_types/update.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/contact_types/_contact_type.html.slim +0 -0
- data/{core → admin}/app/views/gaku/admin/contact_types/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/contact_types/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/contact_types/_modal.html.slim +4 -0
- data/admin/app/views/gaku/admin/contact_types/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/contact_types/destroy.js.erb +2 -0
- data/{core → admin}/app/views/gaku/admin/contact_types/edit.js.erb +0 -0
- data/admin/app/views/gaku/admin/contact_types/index.html.slim +18 -0
- data/{core → admin}/app/views/gaku/admin/contact_types/new.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/contact_types/update.js.erb +0 -0
- data/admin/app/views/gaku/admin/departments/_department.html.slim +2 -0
- data/admin/app/views/gaku/admin/departments/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/departments/_form_fields.html.slim +1 -0
- data/admin/app/views/gaku/admin/departments/_modal.html.slim +4 -0
- data/admin/app/views/gaku/admin/departments/_table_fields.html.slim +5 -0
- data/admin/app/views/gaku/admin/departments/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/departments/destroy.js.erb +2 -0
- data/admin/app/views/gaku/admin/departments/edit.js.erb +3 -0
- data/admin/app/views/gaku/admin/departments/index.html.slim +20 -0
- data/admin/app/views/gaku/admin/departments/new.js.erb +3 -0
- data/admin/app/views/gaku/admin/departments/update.js.erb +4 -0
- data/{core → admin}/app/views/gaku/admin/enrollment_statuses/_enrollment_status.html.slim +0 -0
- data/{core → admin}/app/views/gaku/admin/enrollment_statuses/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/enrollment_statuses/_form.html.slim +3 -0
- data/{core → admin}/app/views/gaku/admin/enrollment_statuses/_form_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/enrollment_statuses/_modal.html.slim +4 -0
- data/admin/app/views/gaku/admin/enrollment_statuses/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/enrollment_statuses/destroy.js.erb +2 -0
- data/{core → admin}/app/views/gaku/admin/enrollment_statuses/edit.js.erb +0 -0
- data/admin/app/views/gaku/admin/enrollment_statuses/index.html.slim +21 -0
- data/{core → admin}/app/views/gaku/admin/enrollment_statuses/new.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/enrollment_statuses/update.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/grading_method_sets/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/grading_method_sets/_form.html.slim +3 -0
- data/{core → admin}/app/views/gaku/admin/grading_method_sets/_form_fields.html.slim +0 -0
- data/{core → admin}/app/views/gaku/admin/grading_method_sets/_grading_method_set.html.slim +0 -0
- data/admin/app/views/gaku/admin/grading_method_sets/_make_primary_field.html.slim +4 -0
- data/admin/app/views/gaku/admin/grading_method_sets/_modal.html.slim +4 -0
- data/admin/app/views/gaku/admin/grading_method_sets/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/grading_method_sets/destroy.js.erb +7 -0
- data/admin/app/views/gaku/admin/grading_method_sets/edit.js.erb +3 -0
- data/{core → admin}/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_form.html.slim +3 -0
- data/{core → admin}/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_form_fields.html.slim +0 -0
- data/{core → admin}/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_item.html.slim +0 -0
- data/admin/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_items.html.slim +23 -0
- data/admin/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_modal.html.slim +4 -0
- data/admin/app/views/gaku/admin/grading_method_sets/grading_method_set_items/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/grading_method_sets/grading_method_set_items/destroy.js.erb +2 -0
- data/{core → admin}/app/views/gaku/admin/grading_method_sets/grading_method_set_items/edit.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/grading_method_sets/grading_method_set_items/new.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/grading_method_sets/grading_method_set_items/update.js.erb +0 -0
- data/admin/app/views/gaku/admin/grading_method_sets/index.html.slim +23 -0
- data/{core → admin}/app/views/gaku/admin/grading_method_sets/make_primary.js.erb +0 -0
- data/admin/app/views/gaku/admin/grading_method_sets/new.js.erb +3 -0
- data/admin/app/views/gaku/admin/grading_method_sets/show.html.slim +13 -0
- data/admin/app/views/gaku/admin/grading_method_sets/update.js.erb +3 -0
- data/{core → admin}/app/views/gaku/admin/grading_methods/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/grading_methods/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/grading_methods/_form_fields.html.slim +4 -0
- data/{core → admin}/app/views/gaku/admin/grading_methods/_grading_method.html.slim +0 -0
- data/admin/app/views/gaku/admin/grading_methods/_modal.html.slim +4 -0
- data/admin/app/views/gaku/admin/grading_methods/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/grading_methods/destroy.js.erb +2 -0
- data/{core → admin}/app/views/gaku/admin/grading_methods/edit.js.erb +0 -0
- data/admin/app/views/gaku/admin/grading_methods/index.html.slim +20 -0
- data/{core → admin}/app/views/gaku/admin/grading_methods/new.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/grading_methods/update.js.erb +0 -0
- data/admin/app/views/gaku/admin/presets/_address.html.slim +19 -0
- data/admin/app/views/gaku/admin/presets/_chooser_fields.html.slim +91 -0
- data/admin/app/views/gaku/admin/presets/_export_formats.html.slim +19 -0
- data/admin/app/views/gaku/admin/presets/_fields.html.slim +5 -0
- data/admin/app/views/gaku/admin/presets/_grading.html.slim +14 -0
- data/admin/app/views/gaku/admin/presets/_locale.html.slim +3 -0
- data/admin/app/views/gaku/admin/presets/_names_order.html.slim +15 -0
- data/admin/app/views/gaku/admin/presets/_pagination.html.slim +25 -0
- data/admin/app/views/gaku/admin/presets/_person.html.slim +8 -0
- data/admin/app/views/gaku/admin/presets/_preset.html.slim +2 -0
- data/admin/app/views/gaku/admin/presets/_student.html.slim +19 -0
- data/admin/app/views/gaku/admin/presets/_tabs.html.slim +51 -0
- data/{core/app/views/gaku/admin/disposals/index.html.slim → admin/app/views/gaku/admin/presets/edit.html.slim} +0 -0
- data/admin/app/views/gaku/admin/presets/index.html.slim +16 -0
- data/{core → admin}/app/views/gaku/admin/roles/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/roles/_form.html.slim +3 -0
- data/{core → admin}/app/views/gaku/admin/roles/_form_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/roles/_modal.html.slim +4 -0
- data/{core → admin}/app/views/gaku/admin/roles/_role.html.slim +0 -0
- data/admin/app/views/gaku/admin/roles/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/roles/destroy.js.erb +2 -0
- data/admin/app/views/gaku/admin/roles/edit.js.erb +3 -0
- data/admin/app/views/gaku/admin/roles/index.html.slim +20 -0
- data/{core → admin}/app/views/gaku/admin/roles/new.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/roles/update.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/school_years/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/school_years/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/school_years/_form_fields.html.slim +5 -0
- data/admin/app/views/gaku/admin/school_years/_modal.html.slim +5 -0
- data/{core → admin}/app/views/gaku/admin/school_years/_school_year.html.slim +0 -0
- data/{core → admin}/app/views/gaku/admin/school_years/_show_table.html.slim +0 -0
- data/admin/app/views/gaku/admin/school_years/create.js.erb +10 -0
- data/admin/app/views/gaku/admin/school_years/destroy.js.erb +2 -0
- data/admin/app/views/gaku/admin/school_years/edit.js.erb +5 -0
- data/admin/app/views/gaku/admin/school_years/index.html.slim +21 -0
- data/admin/app/views/gaku/admin/school_years/new.js.erb +5 -0
- data/{core → admin}/app/views/gaku/admin/school_years/semesters/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/school_years/semesters/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/school_years/semesters/_form_fields.html.slim +5 -0
- data/admin/app/views/gaku/admin/school_years/semesters/_modal.html.slim +5 -0
- data/{core → admin}/app/views/gaku/admin/school_years/semesters/_semester.html.slim +0 -0
- data/admin/app/views/gaku/admin/school_years/semesters/_semesters.html.slim +22 -0
- data/admin/app/views/gaku/admin/school_years/semesters/create.js.erb +10 -0
- data/admin/app/views/gaku/admin/school_years/semesters/destroy.js.erb +2 -0
- data/admin/app/views/gaku/admin/school_years/semesters/edit.js.erb +6 -0
- data/admin/app/views/gaku/admin/school_years/semesters/new.js.erb +4 -0
- data/admin/app/views/gaku/admin/school_years/semesters/update.js.erb +8 -0
- data/admin/app/views/gaku/admin/school_years/show.html.slim +15 -0
- data/admin/app/views/gaku/admin/school_years/update.js.erb +8 -0
- data/{core → admin}/app/views/gaku/admin/schools/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/schools/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/schools/_form_fields.html.slim +25 -0
- data/admin/app/views/gaku/admin/schools/_school.html.slim +6 -0
- data/admin/app/views/gaku/admin/schools/_show_table.html.slim +35 -0
- data/admin/app/views/gaku/admin/schools/_tabs.html.slim +15 -0
- data/admin/app/views/gaku/admin/schools/campuses/_campus.html.slim +6 -0
- data/admin/app/views/gaku/admin/schools/campuses/_campuses.html.slim +23 -0
- data/admin/app/views/gaku/admin/schools/campuses/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/schools/campuses/_form_fields.html.slim +1 -0
- data/admin/app/views/gaku/admin/schools/campuses/_picture.html.slim +8 -0
- data/admin/app/views/gaku/admin/schools/campuses/_show_table.html.slim +10 -0
- data/admin/app/views/gaku/admin/schools/campuses/_tabs.html.slim +15 -0
- data/admin/app/views/gaku/admin/schools/campuses/_upload_picture.html.slim +7 -0
- data/admin/app/views/gaku/admin/schools/campuses/addresses/_address.html.slim +7 -0
- data/admin/app/views/gaku/admin/schools/campuses/addresses/_address_row_fields.html.slim +4 -0
- data/admin/app/views/gaku/admin/schools/campuses/addresses/_addresses.html.slim +24 -0
- data/{core/app/views/gaku/shared/fields/_address_fields.html.slim → admin/app/views/gaku/admin/schools/campuses/addresses/_fields.html.slim} +0 -0
- data/admin/app/views/gaku/admin/schools/campuses/addresses/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/schools/campuses/addresses/_form_fields.html.slim +26 -0
- data/admin/app/views/gaku/admin/schools/campuses/addresses/_modal.html.slim +5 -0
- data/admin/app/views/gaku/admin/schools/campuses/addresses/create.js.erb +6 -0
- data/{core → admin}/app/views/gaku/admin/schools/campuses/addresses/destroy.js.erb +0 -0
- data/admin/app/views/gaku/admin/schools/campuses/addresses/edit.js.erb +4 -0
- data/admin/app/views/gaku/admin/schools/campuses/addresses/new.js.erb +4 -0
- data/admin/app/views/gaku/admin/schools/campuses/addresses/update.js.erb +4 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/_contact.html.slim +3 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/_contacts.html.slim +22 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/_delete_link.html.slim +1 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/_fields.html.slim +12 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/_form_fields.html.slim +14 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/_modal.html.slim +5 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/_primary_field.html.slim +13 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/create.js.erb +20 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/destroy.js.erb +8 -0
- data/{core/app/views/gaku → admin/app/views/gaku/admin/schools/campuses}/contacts/edit.js.erb +0 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/make_primary.js.erb +6 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/new.js.erb +3 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/soft_delete.js.erb +8 -0
- data/admin/app/views/gaku/admin/schools/campuses/contacts/update.js.erb +14 -0
- data/admin/app/views/gaku/admin/schools/campuses/create.js.erb +9 -0
- data/admin/app/views/gaku/admin/schools/campuses/destroy.js.erb +2 -0
- data/admin/app/views/gaku/admin/schools/campuses/edit.html.slim +19 -0
- data/admin/app/views/gaku/admin/schools/campuses/new.js.erb +3 -0
- data/admin/app/views/gaku/admin/schools/campuses/show.html.slim +13 -0
- data/admin/app/views/gaku/admin/schools/create.js.erb +7 -0
- data/{core/app/views/gaku/attachments/recover_attachment.js.erb → admin/app/views/gaku/admin/schools/destroy.js.erb} +0 -0
- data/admin/app/views/gaku/admin/schools/edit.html.slim +19 -0
- data/admin/app/views/gaku/admin/schools/edit_master.html.slim +22 -0
- data/admin/app/views/gaku/admin/schools/index.html.slim +25 -0
- data/admin/app/views/gaku/admin/schools/new.js.erb +3 -0
- data/admin/app/views/gaku/admin/schools/programs/_fields.html.slim +10 -0
- data/admin/app/views/gaku/admin/schools/programs/_form.html.slim +14 -0
- data/admin/app/views/gaku/admin/schools/programs/_form_fields.html.slim +6 -0
- data/admin/app/views/gaku/admin/schools/programs/_modal.html.slim +3 -0
- data/{core → admin}/app/views/gaku/admin/schools/programs/_program.html.slim +0 -0
- data/admin/app/views/gaku/admin/schools/programs/_programs.html.slim +23 -0
- data/admin/app/views/gaku/admin/schools/programs/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/schools/programs/destroy.js.erb +2 -0
- data/admin/app/views/gaku/admin/schools/programs/edit.js.erb +3 -0
- data/admin/app/views/gaku/admin/schools/programs/new.js.erb +3 -0
- data/admin/app/views/gaku/admin/schools/programs/program_levels/_form_fields.html.slim +6 -0
- data/admin/app/views/gaku/admin/schools/programs/program_levels/_modal.html.slim +11 -0
- data/admin/app/views/gaku/admin/schools/programs/program_specialties/_form_fields.html.slim +7 -0
- data/admin/app/views/gaku/admin/schools/programs/program_specialties/_modal.html.slim +10 -0
- data/admin/app/views/gaku/admin/schools/programs/program_syllabuses/_form_fields.html.slim +5 -0
- data/admin/app/views/gaku/admin/schools/programs/program_syllabuses/_modal.html.slim +10 -0
- data/admin/app/views/gaku/admin/schools/programs/show_program_levels.js.erb +3 -0
- data/admin/app/views/gaku/admin/schools/programs/show_program_specialties.js.erb +3 -0
- data/admin/app/views/gaku/admin/schools/programs/show_program_syllabuses.js.erb +3 -0
- data/admin/app/views/gaku/admin/schools/programs/update.js.erb +3 -0
- data/admin/app/views/gaku/admin/schools/show.html.slim +13 -0
- data/admin/app/views/gaku/admin/schools/show_master.html.slim +14 -0
- data/admin/app/views/gaku/admin/shared/_picture.html.slim +6 -0
- data/admin/app/views/gaku/admin/shared/_upload_picture.html.slim +7 -0
- data/admin/app/views/gaku/admin/specialties/_fields.html.slim +7 -0
- data/admin/app/views/gaku/admin/specialties/_form.html.slim +3 -0
- data/admin/app/views/gaku/admin/specialties/_form_fields.html.slim +4 -0
- data/admin/app/views/gaku/admin/specialties/_modal.html.slim +4 -0
- data/{core → admin}/app/views/gaku/admin/specialties/_specialty.html.slim +0 -0
- data/admin/app/views/gaku/admin/specialties/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/specialties/destroy.js.erb +2 -0
- data/{core → admin}/app/views/gaku/admin/specialties/edit.js.erb +0 -0
- data/admin/app/views/gaku/admin/specialties/index.html.slim +21 -0
- data/{core → admin}/app/views/gaku/admin/specialties/new.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/specialties/update.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/states/_country_select_form.html.slim +0 -0
- data/{core → admin}/app/views/gaku/admin/states/_country_table.html.slim +0 -0
- data/{core → admin}/app/views/gaku/admin/states/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/states/_form.html.slim +4 -0
- data/admin/app/views/gaku/admin/states/_form_fields.html.slim +14 -0
- data/admin/app/views/gaku/admin/states/_modal.html.slim +4 -0
- data/{core → admin}/app/views/gaku/admin/states/_state.html.slim +0 -0
- data/admin/app/views/gaku/admin/states/country_states.js.erb +2 -0
- data/admin/app/views/gaku/admin/states/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/states/destroy.js.erb +2 -0
- data/admin/app/views/gaku/admin/states/edit.js.erb +3 -0
- data/admin/app/views/gaku/admin/states/index.html.slim +15 -0
- data/admin/app/views/gaku/admin/states/new.js.erb +3 -0
- data/admin/app/views/gaku/admin/states/update.js.erb +3 -0
- data/{core → admin}/app/views/gaku/admin/system_tools/index.html.slim +0 -0
- data/admin/app/views/gaku/admin/templates/_error_msg.html.slim +8 -0
- data/admin/app/views/gaku/admin/templates/_fields.html.slim +8 -0
- data/admin/app/views/gaku/admin/templates/_form.html.slim +3 -0
- data/{core → admin}/app/views/gaku/admin/templates/_form_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/templates/_modal.html.slim +4 -0
- data/{core → admin}/app/views/gaku/admin/templates/_template.html.slim +0 -0
- data/admin/app/views/gaku/admin/templates/destroy.js.erb +2 -0
- data/admin/app/views/gaku/admin/templates/edit.html.slim +1 -0
- data/admin/app/views/gaku/admin/templates/index.html.slim +20 -0
- data/admin/app/views/gaku/admin/templates/new.html.slim +1 -0
- data/{core → admin}/app/views/gaku/admin/users/_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/users/_form.html.slim +3 -0
- data/{core → admin}/app/views/gaku/admin/users/_form_fields.html.slim +0 -0
- data/admin/app/views/gaku/admin/users/_modal.html.slim +4 -0
- data/{core → admin}/app/views/gaku/admin/users/_user.html.slim +0 -0
- data/admin/app/views/gaku/admin/users/create.js.erb +7 -0
- data/admin/app/views/gaku/admin/users/destroy.js.erb +2 -0
- data/{core → admin}/app/views/gaku/admin/users/edit.js.erb +0 -0
- data/admin/app/views/gaku/admin/users/index.html.slim +21 -0
- data/{core → admin}/app/views/gaku/admin/users/new.js.erb +0 -0
- data/{core → admin}/app/views/gaku/admin/users/update.js.erb +0 -0
- data/admin/app/views/gaku/layouts/admin/edit.html.slim +10 -0
- data/admin/app/views/gaku/layouts/admin/gaku.html.slim +27 -0
- data/admin/app/views/gaku/layouts/admin/index.html.slim +12 -0
- data/admin/app/views/gaku/layouts/admin/show.html.slim +10 -0
- data/admin/app/views/gaku/shared/_delete_link.html.slim +1 -0
- data/admin/app/views/gaku/shared/_delete_modal.html.slim +11 -0
- data/admin/app/views/gaku/shared/_errors.html.slim +6 -0
- data/admin/app/views/gaku/shared/_flash.html.slim +4 -0
- data/{core → admin}/app/views/gaku/shared/_language_bar.html.slim +0 -0
- data/admin/app/views/gaku/shared/_login_widget.html.slim +15 -0
- data/{core → admin}/app/views/gaku/shared/_manage_buttons.html.slim +0 -0
- data/admin/app/views/gaku/shared/_modal_config.html.slim +37 -0
- data/admin/app/views/gaku/shared/_multi_errors.html.slim +6 -0
- data/admin/app/views/gaku/shared/_picture.html.slim +8 -0
- data/admin/app/views/gaku/shared/_upload_picture.html.slim +7 -0
- data/{core → admin}/app/views/gaku/shared/error.js.erb +0 -0
- data/admin/app/views/gaku/shared/menu/_admin.html.erb +71 -0
- data/{core → admin}/app/views/gaku/shared/multi_error.js.erb +0 -0
- data/{core → admin}/app/views/gaku/shared/notice.js.erb +0 -0
- data/{core → admin}/app/views/gaku/states/_no_states_select.html.slim +0 -0
- data/{core → admin}/app/views/gaku/states/_states_select.html.slim +0 -0
- data/{core → admin}/app/views/gaku/states/index.js.erb +0 -0
- data/{core → admin}/config/initializers/client_side_validations.rb +0 -0
- data/{core → admin}/config/initializers/wrap_parameters.rb +0 -0
- data/admin/config/routes.rb +67 -0
- data/admin/gaku_admin.gemspec +49 -0
- data/admin/lib/gaku/admin.rb +31 -0
- data/admin/lib/gaku/admin/engine.rb +30 -0
- data/{core → admin}/lib/gaku/app_responder.rb +0 -0
- data/admin/lib/gaku_admin.rb +1 -0
- data/admin/lib/tasks/admin_user.rake +104 -0
- data/admin/lib/tasks/core.rake +65 -0
- data/admin/lib/tasks/reset.rake +37 -0
- data/admin/spec/controllers/gaku/admin/achievements/simple_grade_types_controller_spec.rb +168 -0
- data/admin/spec/controllers/gaku/admin/badge_types_controller_spec.rb +139 -0
- data/admin/spec/controllers/gaku/admin/departments_controller_spec.rb +154 -0
- data/admin/spec/controllers/gaku/admin/grading/grading_method_set_items_controller_spec.rb +165 -0
- data/admin/spec/controllers/gaku/admin/grading/grading_method_sets_controller_spec.rb +183 -0
- data/admin/spec/controllers/gaku/admin/grading/grading_methods_controller_spec.rb +154 -0
- data/admin/spec/controllers/gaku/admin/presets_controller_spec.rb +68 -0
- data/admin/spec/controllers/gaku/admin/roles_controller_spec.rb +154 -0
- data/admin/spec/controllers/gaku/admin/school_years/school_years_controller_spec.rb +158 -0
- data/admin/spec/controllers/gaku/admin/school_years/semesters_controller_spec.rb +134 -0
- data/admin/spec/controllers/gaku/admin/schools/campuses/addresses_controller_spec.rb +121 -0
- data/admin/spec/controllers/gaku/admin/schools/campuses/campuses_controller_spec.rb +142 -0
- data/admin/spec/controllers/gaku/admin/schools/schools_controller_spec.rb +204 -0
- data/admin/spec/controllers/gaku/admin/specialties_controller_spec.rb +164 -0
- data/admin/spec/controllers/gaku/admin/templates_controller_spec.rb +156 -0
- data/admin/spec/controllers/gaku/admin/types_and_methods/attendance_types_controller_spec.rb +176 -0
- data/admin/spec/controllers/gaku/admin/types_and_methods/commute_method_types_controller_spec.rb +154 -0
- data/admin/spec/controllers/gaku/admin/types_and_methods/contact_types_controller_spec.rb +154 -0
- data/admin/spec/controllers/gaku/admin/types_and_methods/enrollment_statuses_controller_spec.rb +153 -0
- data/admin/spec/controllers/gaku/admin/users_controller_spec.rb +154 -0
- data/admin/spec/features/achievements/simple_grade_types_spec.rb +85 -0
- data/admin/spec/features/badge_types/badge_types_spec.rb +72 -0
- data/admin/spec/features/departments_spec.rb +76 -0
- data/admin/spec/features/grading/grading_method_set_items_spec.rb +86 -0
- data/admin/spec/features/grading/grading_method_sets_spec.rb +119 -0
- data/admin/spec/features/grading/grading_methods_spec.rb +101 -0
- data/admin/spec/features/presets/address_preset_spec.rb +36 -0
- data/admin/spec/features/presets/chooser_fields_preset_spec.rb +40 -0
- data/admin/spec/features/presets/export_formats_spec.rb +30 -0
- data/admin/spec/features/presets/grading_preset_spec.rb +31 -0
- data/admin/spec/features/presets/locale_preset_spec.rb +28 -0
- data/admin/spec/features/presets/names_order_preset_spec.rb +29 -0
- data/admin/spec/features/presets/pagination_preset_spec.rb +36 -0
- data/admin/spec/features/presets/person_preset_spec.rb +27 -0
- data/admin/spec/features/roles_spec.rb +83 -0
- data/admin/spec/features/school_years/school_years_spec.rb +117 -0
- data/admin/spec/features/school_years/semesters_spec.rb +142 -0
- data/admin/spec/features/schools/campuses/addresses_spec.rb +111 -0
- data/admin/spec/features/schools/campuses/campuses_spec.rb +65 -0
- data/admin/spec/features/schools/campuses/contacts_spec.rb +57 -0
- data/admin/spec/features/schools/campuses/picture_spec.rb +30 -0
- data/admin/spec/features/schools/picture_spec.rb +22 -0
- data/admin/spec/features/schools/programs_spec.rb +119 -0
- data/admin/spec/features/schools/school_details_spec.rb +26 -0
- data/admin/spec/features/schools/school_levels_spec.rb +80 -0
- data/admin/spec/features/schools/schools_spec.rb +78 -0
- data/admin/spec/features/specialties_spec.rb +83 -0
- data/{core/spec/requests/admin → admin/spec/features}/system_tools/backup_spec.rb +0 -0
- data/admin/spec/features/templates_spec.rb +113 -0
- data/admin/spec/features/types_and_methods/attendance_types_spec.rb +78 -0
- data/admin/spec/features/types_and_methods/commute_method_types_spec.rb +73 -0
- data/admin/spec/features/types_and_methods/contact_types_spec.rb +73 -0
- data/admin/spec/features/types_and_methods/enrollment_statuses_spec.rb +74 -0
- data/admin/spec/features/types_and_methods/states_spec.rb +109 -0
- data/admin/spec/features/users_spec.rb +88 -0
- data/admin/spec/routing/admin/school_years/school_years_routing_spec.rb +69 -0
- data/admin/spec/routing/admin/school_years/semesters_routing_spec.rb +58 -0
- data/admin/spec/routing/admin/schools/admin_school_routes_spec.rb +79 -0
- data/admin/spec/routing/admin/schools/campuses/admin_schools_campus_routes_spec.rb +65 -0
- data/admin/spec/routing/admin/schools/campuses/admin_schools_campuses_address_routes_spec.rb +61 -0
- data/admin/spec/routing/admin/schools/campuses/contacts_routing_spec.rb +61 -0
- data/admin/spec/routing/admin/simple_grade_types_routing_spec.rb +52 -0
- data/admin/spec/routing/admin/templates_routing_spec.rb +61 -0
- data/admin/spec/spec_helper.rb +5 -0
- data/admin/spec/spec_helper_controllers.rb +5 -0
- data/admin/spec/spec_helper_routing.rb +4 -0
- data/admin/spec/support/120x120.jpg +0 -0
- data/{core/spec/support → admin/spec/support/controllers/matchers}/have_attributes_matcher.rb +0 -0
- data/{core/spec/support → admin/spec/support/controllers}/shared_examples/allow.rb +0 -0
- data/{core/spec/support → admin/spec/support/controllers}/shared_examples/deny.rb +0 -0
- data/admin/spec/support/features/shared_examples/addresses_spec.rb +171 -0
- data/admin/spec/support/features/shared_examples/avatarable_spec.rb +21 -0
- data/admin/spec/support/features/shared_examples/contacts_spec.rb +123 -0
- data/admin/spec/support/sample_roster.ods +0 -0
- data/all_dependencies.rb +23 -0
- data/archive/.rspec +2 -0
- data/archive/.ruby-gemset +1 -0
- data/archive/.ruby-version +1 -0
- data/archive/Gemfile +8 -0
- data/archive/Rakefile +31 -0
- data/archive/app/assets/javascripts/gaku/archive.js.coffee +4 -0
- data/archive/app/assets/stylesheets/gaku/archive.css +5 -0
- data/archive/app/controllers/concerns/trashable_controller.rb +32 -0
- data/{core → archive}/app/controllers/gaku/admin/changes/student_address_changes_controller.rb +0 -0
- data/{core → archive}/app/controllers/gaku/admin/changes/student_changes_controller.rb +0 -0
- data/{core → archive}/app/controllers/gaku/admin/changes/student_contact_changes_controller.rb +0 -0
- data/{core → archive}/app/controllers/gaku/admin/disposals_controller.rb +0 -0
- data/archive/app/controllers/gaku/admin/students_controller.rb +22 -0
- data/archive/app/controllers/gaku/class_groups_controller_injector.rb +5 -0
- data/archive/app/controllers/gaku/contacts_controller_injector.rb +21 -0
- data/archive/app/controllers/gaku/course_groups_controller_injector.rb +5 -0
- data/archive/app/controllers/gaku/courses_controller_injector.rb +5 -0
- data/archive/app/controllers/gaku/exams_controller_injector.rb +5 -0
- data/archive/app/controllers/gaku/extracurricular_activities_controller_injector.rb +5 -0
- data/archive/app/controllers/gaku/students_controller_injector.rb +5 -0
- data/archive/app/controllers/gaku/syllabuses_controller_injector.rb +5 -0
- data/archive/app/controllers/gaku/teachers_controller_injector.rb +5 -0
- data/{core → archive}/app/models/concerns/trashable.rb +0 -0
- data/archive/app/models/gaku/address_injector.rb +31 -0
- data/archive/app/models/gaku/attachment_injector.rb +5 -0
- data/archive/app/models/gaku/class_group_injector.rb +5 -0
- data/archive/app/models/gaku/contact_injector.rb +34 -0
- data/archive/app/models/gaku/course_group_injector.rb +5 -0
- data/archive/app/models/gaku/course_injector.rb +5 -0
- data/archive/app/models/gaku/exam_injector.rb +5 -0
- data/archive/app/models/gaku/extracurricular_activity_injector.rb +5 -0
- data/archive/app/models/gaku/guardian_injector.rb +5 -0
- data/archive/app/models/gaku/student_injector.rb +16 -0
- data/archive/app/models/gaku/syllabus_injector.rb +5 -0
- data/archive/app/models/gaku/teacher_injector.rb +5 -0
- data/{core → archive}/app/models/gaku/versioning/address_version.rb +0 -0
- data/{core → archive}/app/models/gaku/versioning/contact_version.rb +0 -0
- data/archive/app/models/gaku/versioning/student_version.rb +47 -0
- data/archive/app/overrides/archive_menu.rb +6 -0
- data/archive/app/views/gaku/addresses/_delete_link.html.slim +1 -0
- data/archive/app/views/gaku/admin/changes/student_address_changes/_change.html.slim +10 -0
- data/{core → archive}/app/views/gaku/admin/changes/student_address_changes/_changes.html.slim +0 -0
- data/archive/app/views/gaku/admin/changes/student_address_changes/_deletion.html.slim +9 -0
- data/{core → archive}/app/views/gaku/admin/changes/student_address_changes/index.html.slim +0 -0
- data/archive/app/views/gaku/admin/changes/student_changes/_change.html.slim +10 -0
- data/{core → archive}/app/views/gaku/admin/changes/student_changes/_changes.html.slim +0 -0
- data/archive/app/views/gaku/admin/changes/student_changes/_deletion.html.slim +9 -0
- data/{core → archive}/app/views/gaku/admin/changes/student_changes/index.html.slim +0 -0
- data/archive/app/views/gaku/admin/changes/student_contact_changes/_change.html.slim +10 -0
- data/{core → archive}/app/views/gaku/admin/changes/student_contact_changes/_changes.html.slim +0 -0
- data/archive/app/views/gaku/admin/changes/student_contact_changes/_deletion.html.slim +9 -0
- data/{core → archive}/app/views/gaku/admin/changes/student_contact_changes/index.html.slim +0 -0
- data/archive/app/views/gaku/admin/disposals/_address.html.slim +12 -0
- data/{core → archive}/app/views/gaku/admin/disposals/_addresses.html.slim +0 -0
- data/archive/app/views/gaku/admin/disposals/_contact.html.slim +9 -0
- data/{core → archive}/app/views/gaku/admin/disposals/_contacts.html.slim +0 -0
- data/{core → archive}/app/views/gaku/admin/disposals/_course_group.html.slim +0 -0
- data/archive/app/views/gaku/admin/disposals/_course_groups.html.slim +12 -0
- data/archive/app/views/gaku/admin/disposals/_exam.html.slim +10 -0
- data/{core → archive}/app/views/gaku/admin/disposals/_guardian.html.slim +0 -0
- data/archive/app/views/gaku/admin/disposals/_student.html.slim +10 -0
- data/{core → archive}/app/views/gaku/admin/disposals/_tabs.html.slim +0 -0
- data/archive/app/views/gaku/admin/disposals/_teacher.html.slim +10 -0
- data/{core → archive}/app/views/gaku/admin/disposals/addresses.html.slim +0 -0
- data/archive/app/views/gaku/admin/disposals/attachments.html.slim +30 -0
- data/{core → archive}/app/views/gaku/admin/disposals/contacts.html.slim +0 -0
- data/{core → archive}/app/views/gaku/admin/disposals/course_groups.html.slim +0 -0
- data/{core → archive}/app/views/gaku/admin/disposals/exams.html.slim +0 -0
- data/{core → archive}/app/views/gaku/admin/disposals/guardians.html.slim +0 -0
- data/archive/app/views/gaku/admin/disposals/index.html.slim +1 -0
- data/{core → archive}/app/views/gaku/admin/disposals/students.html.slim +0 -0
- data/{core → archive}/app/views/gaku/admin/disposals/tabs/_addresses_tabs.html.slim +0 -0
- data/{core → archive}/app/views/gaku/admin/disposals/tabs/_contacts_tabs.html.slim +0 -0
- data/{core → archive}/app/views/gaku/admin/disposals/teachers.html.slim +0 -0
- data/{core/app/views/gaku/exams → archive/app/views/gaku/class_groups}/recovery.js.erb +0 -0
- data/archive/app/views/gaku/contacts/_delete_link.html.slim +1 -0
- data/{core/app/views/gaku/addresses → archive/app/views/gaku/course_groups}/recovery.js.erb +0 -0
- data/{core/app/views/gaku/students/guardians → archive/app/views/gaku/courses}/recovery.js.erb +0 -0
- data/{core/app/views/gaku/students → archive/app/views/gaku/exams}/recovery.js.erb +0 -0
- data/{core/app/views/gaku/teachers → archive/app/views/gaku/extracurricular_activities}/recovery.js.erb +0 -0
- data/archive/app/views/gaku/shared/_delete_link.html.slim +1 -0
- data/archive/app/views/gaku/shared/_delete_modal.html.slim +11 -0
- data/archive/app/views/gaku/shared/menu/_archive.html.erb +1 -0
- data/archive/app/views/gaku/students/recovery.js.erb +1 -0
- data/{core/app/views/gaku/contacts → archive/app/views/gaku/syllabuses}/recovery.js.erb +0 -0
- data/archive/app/views/gaku/teachers/recovery.js.erb +1 -0
- data/{core → archive}/config/initializers/paper_trail.rb +0 -0
- data/archive/config/routes.rb +67 -0
- data/archive/db/migrate/20131203160531_create_versioning_tables.rb +47 -0
- data/archive/db/migrate/20131203160607_add_deleted_fields.rb +53 -0
- data/archive/gaku_archive.gemspec +28 -0
- data/archive/lib/gaku/archive.rb +13 -0
- data/archive/lib/gaku/archive/engine.rb +22 -0
- data/archive/lib/gaku_archive.rb +1 -0
- data/archive/spec/controllers/gaku/addresses_controller_spec.rb +144 -0
- data/archive/spec/controllers/gaku/admin/disposals_controller_spec.rb +177 -0
- data/archive/spec/controllers/gaku/class_groups_controller_spec.rb +86 -0
- data/archive/spec/controllers/gaku/contacts_controller_spec.rb +133 -0
- data/archive/spec/controllers/gaku/course_groups_controller_spec.rb +86 -0
- data/archive/spec/controllers/gaku/courses_controller_spec.rb +86 -0
- data/archive/spec/controllers/gaku/exams_controller_spec.rb +86 -0
- data/archive/spec/controllers/gaku/extracurricular_activities_controller_spec.rb +85 -0
- data/archive/spec/controllers/gaku/students_controller_spec.rb +72 -0
- data/archive/spec/controllers/gaku/syllabuses_controller_spec.rb +86 -0
- data/archive/spec/controllers/gaku/teachers_controller_spec.rb +86 -0
- data/{core/spec/requests → archive/spec/features}/admin/changes_and_deletions/student_addresses_spec.rb +0 -0
- data/{core/spec/requests → archive/spec/features}/admin/changes_and_deletions/student_contacts_spec.rb +0 -0
- data/archive/spec/features/admin/changes_and_deletions/students_spec.rb +45 -0
- data/archive/spec/features/admin/disposals/student_disposals_spec.rb +51 -0
- data/archive/spec/features/admin/disposals/teacher_disposals_spec.rb +51 -0
- data/archive/spec/features/students/addresses_spec.rb +29 -0
- data/archive/spec/features/students/contacts_spec.rb +36 -0
- data/archive/spec/features/students/guardians/addresses_spec.rb +32 -0
- data/archive/spec/features/students/guardians/contacts_spec.rb +31 -0
- data/archive/spec/features/students/guardians/guardians_spec.rb +33 -0
- data/archive/spec/features/students/students_spec.rb +36 -0
- data/{core → archive}/spec/integration/student_address_versioning_spec.rb +0 -0
- data/{core → archive}/spec/integration/student_contact_vesioning_spec.rb +0 -0
- data/archive/spec/integration/student_versioning_spec.rb +91 -0
- data/archive/spec/models/address_spec.rb +64 -0
- data/archive/spec/models/attachment_spec.rb +9 -0
- data/archive/spec/models/class_group_spec.rb +9 -0
- data/archive/spec/models/contact_spec.rb +9 -0
- data/archive/spec/models/course_group_spec.rb +9 -0
- data/archive/spec/models/course_spec.rb +9 -0
- data/archive/spec/models/exam_spec.rb +11 -0
- data/archive/spec/models/extracurricular_activity_spec.rb +9 -0
- data/archive/spec/models/guardian_spec.rb +9 -0
- data/archive/spec/models/student_spec.rb +13 -0
- data/archive/spec/models/syllabus_spec.rb +9 -0
- data/archive/spec/models/teacher_spec.rb +9 -0
- data/archive/spec/routing/student_routes_spec.rb +26 -0
- data/archive/spec/routing/students/guardians_routes_spec.rb +37 -0
- data/archive/spec/spec_helper.rb +5 -0
- data/archive/spec/spec_helper_base.rb +20 -0
- data/archive/spec/spec_helper_controllers.rb +4 -0
- data/archive/spec/spec_helper_models.rb +38 -0
- data/archive/spec/spec_helper_routing.rb +4 -0
- data/archive/spec/support/controllers.rb +3 -0
- data/archive/spec/support/controllers/matchers/have_attributes_matcher.rb +8 -0
- data/archive/spec/support/controllers/shared_examples/allow.rb +10 -0
- data/archive/spec/support/controllers/shared_examples/deny.rb +27 -0
- data/archive/spec/support/features.rb +5 -0
- data/archive/spec/support/features/shared_examples/addresses_spec.rb +22 -0
- data/archive/spec/support/features/shared_examples/contacts_spec.rb +26 -0
- data/{core/spec/support → archive/spec/support/models}/shared_examples/thrashable.rb +0 -0
- data/core/Gemfile +2 -1
- data/core/Guardfile +6 -0
- data/core/app/assets/images/{pictures/thumb/missing.png → missing_original.png} +0 -0
- data/core/app/assets/images/missing_thumb.png +0 -0
- data/core/app/controllers/gaku/core_controller.rb +64 -0
- data/core/app/decorators/gaku/course_decorator.rb +15 -0
- data/core/app/decorators/gaku/person_decorator.rb +1 -1
- data/core/app/decorators/gaku/student_decorator.rb +24 -7
- data/core/app/models/concerns/pagination.rb +8 -0
- data/core/app/models/concerns/person.rb +11 -0
- data/core/app/models/concerns/picture.rb +1 -1
- data/core/app/models/gaku/address.rb +4 -22
- data/core/app/models/gaku/attachment.rb +0 -2
- data/core/app/models/gaku/badge.rb +10 -0
- data/core/app/models/gaku/badge_type.rb +15 -0
- data/core/app/models/gaku/class_group.rb +1 -1
- data/core/app/models/gaku/class_group_enrollment.rb +2 -2
- data/core/app/models/gaku/contact.rb +8 -23
- data/core/app/models/gaku/contact_type.rb +1 -1
- data/core/app/models/gaku/country.rb +1 -0
- data/core/app/models/gaku/course_enrollment.rb +6 -0
- data/core/app/models/gaku/course_group.rb +0 -2
- data/core/app/models/gaku/department.rb +17 -0
- data/core/app/models/gaku/enrollment_status.rb +1 -1
- data/core/app/models/gaku/exam.rb +3 -1
- data/core/app/models/gaku/exam_portion.rb +1 -1
- data/core/app/models/gaku/external_school_record.rb +22 -7
- data/core/app/models/gaku/extracurricular_activity.rb +1 -1
- data/core/app/models/gaku/grading_method.rb +2 -1
- data/core/app/models/gaku/guardian.rb +1 -1
- data/core/app/models/gaku/level.rb +1 -0
- data/core/app/models/gaku/preset.rb +35 -62
- data/core/app/models/gaku/program.rb +1 -0
- data/core/app/models/gaku/school.rb +6 -1
- data/core/app/models/gaku/semester.rb +3 -0
- data/core/app/models/gaku/simple_grade.rb +7 -3
- data/core/app/models/gaku/simple_grade_type.rb +14 -0
- data/core/app/models/gaku/specialty.rb +3 -1
- data/core/app/models/gaku/student.rb +56 -15
- data/core/app/models/gaku/student_specialty.rb +0 -1
- data/core/app/models/gaku/syllabus.rb +2 -0
- data/core/app/models/gaku/teacher.rb +1 -1
- data/core/app/models/gaku/template.rb +5 -7
- data/core/app/models/gaku/user.rb +10 -2
- data/core/app/views/gaku/admin/grading_methods/_arguments_form_fields.html.slim +19 -0
- data/core/app/views/gaku/admin/grading_methods/_arguments_template.html.slim +11 -0
- data/core/app/views/gaku/shared/menu/_global.html.erb +2 -26
- data/core/config/initializers/devise.rb +3 -0
- data/core/config/initializers/{kaminari_config.rb → kaminari.rb} +0 -0
- data/core/config/initializers/translation_missing.rb +1 -1
- data/core/config/routes.rb +1 -289
- data/core/db/default/gaku/attendance_types.rb +2 -2
- data/core/db/default/gaku/commute_method_types.rb +1 -1
- data/core/db/default/gaku/departments.rb +14 -0
- data/core/db/default/gaku/presets.rb +33 -0
- data/core/db/default/gaku/scholarship_statuses.rb +2 -2
- data/core/db/migrate/20120202111850_presets.rb +30 -0
- data/core/db/migrate/20131014065028_translations.rb +77 -0
- data/core/db/migrate/20131025073352_gaku_core.rb +628 -0
- data/core/db/migrate/20140130182100_change_fields_external_school_record.rb +7 -0
- data/core/db/migrate/20140131113337_create_student_configs.rb +21 -0
- data/core/db/migrate/20140207093618_drop_student_configs.rb +5 -0
- data/core/gaku_core.gemspec +14 -49
- data/core/lib/gaku/core.rb +3 -21
- data/core/lib/gaku/core/engine.rb +8 -24
- data/core/lib/gaku/migrations.rb +30 -0
- data/core/lib/gaku/streamer/sse.rb +22 -0
- data/core/lib/gaku/testing/auth_helpers.rb +2 -2
- data/core/lib/gaku/testing/coverage.rb +20 -0
- data/core/{spec/support → lib/gaku/testing}/deferred_garbage_collection.rb +0 -0
- data/core/lib/gaku/testing/factories/attachment_factory.rb +3 -2
- data/core/lib/gaku/testing/factories/badge_factory.rb +12 -0
- data/core/lib/gaku/testing/factories/badge_type_factory.rb +12 -0
- data/core/lib/gaku/testing/factories/campus_factory.rb +5 -1
- data/core/lib/gaku/testing/factories/class_group_course_enrollment_factory.rb +8 -0
- data/core/lib/gaku/testing/factories/class_group_factory.rb +2 -7
- data/core/lib/gaku/testing/factories/contact_type_factory.rb +1 -1
- data/core/lib/gaku/testing/factories/country_factory.rb +2 -2
- data/core/lib/gaku/testing/factories/course_enrollment_factory.rb +4 -0
- data/core/lib/gaku/testing/factories/course_factory.rb +4 -0
- data/core/lib/gaku/testing/factories/course_group_factory.rb +4 -0
- data/core/lib/gaku/testing/factories/department_factory.rb +11 -0
- data/core/lib/gaku/testing/factories/exam_factory.rb +10 -2
- data/core/lib/gaku/testing/factories/exam_portion_factory.rb +5 -1
- data/core/lib/gaku/testing/factories/external_school_record_factory.rb +14 -0
- data/core/lib/gaku/testing/factories/extracurricular_activity_factory.rb +4 -0
- data/core/lib/gaku/testing/factories/guardian_factory.rb +4 -1
- data/core/lib/gaku/testing/factories/level_factory.rb +1 -1
- data/core/lib/gaku/testing/factories/preset_factory.rb +17 -0
- data/core/lib/gaku/testing/factories/program_factory.rb +1 -1
- data/core/lib/gaku/testing/factories/school_factory.rb +5 -1
- data/core/lib/gaku/testing/factories/school_year_factory.rb +5 -0
- data/core/lib/gaku/testing/factories/semester_factory.rb +5 -0
- data/core/lib/gaku/testing/factories/simple_grade_factory.rb +7 -3
- data/core/lib/gaku/testing/factories/simple_grade_type_factory.rb +13 -0
- data/core/lib/gaku/testing/factories/student_specialty_factory.rb +4 -0
- data/core/lib/gaku/testing/factories/template_factory.rb +7 -0
- data/core/lib/gaku/testing/factories/traits.rb +8 -0
- data/core/lib/generators/gaku/dummy/templates/rails/database.yml +2 -0
- data/core/lib/generators/gaku/install/install_generator.rb +31 -30
- data/core/lib/generators/gaku/install/templates/app/assets/javascripts/gaku/admin/all.js +10 -0
- data/core/lib/generators/gaku/install/templates/app/assets/javascripts/gaku/archive/all.js +10 -0
- data/core/lib/generators/gaku/install/templates/app/assets/javascripts/gaku/frontend/all.js +10 -0
- data/core/lib/generators/gaku/install/templates/app/assets/stylesheets/gaku/admin/all.css +9 -0
- data/core/lib/generators/gaku/install/templates/app/assets/stylesheets/gaku/archive/all.css +9 -0
- data/core/lib/generators/gaku/install/templates/app/assets/stylesheets/gaku/frontend/all.css +9 -0
- data/core/spec/models/address_spec.rb +1 -37
- data/core/spec/models/assignment_score_spec.rb +1 -1
- data/core/spec/models/assignment_spec.rb +1 -1
- data/core/spec/models/attachment_spec.rb +1 -5
- data/core/spec/models/attendance_spec.rb +1 -1
- data/core/spec/models/attendance_type_spec.rb +1 -1
- data/core/spec/models/badge_spec.rb +15 -0
- data/core/spec/models/badge_type_spec.rb +20 -0
- data/core/spec/models/campus_spec.rb +7 -7
- data/core/spec/models/class_group_course_enrollment_spec.rb +1 -1
- data/core/spec/models/class_group_enrollment_spec.rb +4 -4
- data/core/spec/models/class_group_spec.rb +1 -1
- data/core/spec/models/commute_method_type_spec.rb +1 -1
- data/core/spec/models/contact_spec.rb +1 -6
- data/core/spec/models/contact_type_spec.rb +2 -1
- data/core/spec/models/country_spec.rb +2 -1
- data/core/spec/models/course_enrollment_spec.rb +1 -1
- data/core/spec/models/course_group_enrollment_spec.rb +1 -1
- data/core/spec/models/course_group_spec.rb +1 -5
- data/core/spec/models/course_spec.rb +1 -5
- data/core/spec/models/department_spec.rb +22 -0
- data/core/spec/models/enrollment_status_spec.rb +2 -1
- data/core/spec/models/exam_portion_score_spec.rb +1 -1
- data/core/spec/models/exam_portion_spec.rb +1 -1
- data/core/spec/models/exam_schedule_spec.rb +1 -1
- data/core/spec/models/exam_score_spec.rb +1 -1
- data/core/spec/models/exam_spec.rb +21 -2
- data/core/spec/models/exam_syllabus_spec.rb +1 -1
- data/core/spec/models/external_school_record_spec.rb +18 -3
- data/core/spec/models/extracurricular_activity_enrollment_spec.rb +1 -1
- data/core/spec/models/extracurricular_activity_spec.rb +2 -1
- data/core/spec/models/factories_spec.rb +1 -1
- data/core/spec/models/faculty_spec.rb +1 -1
- data/core/spec/models/grading_method_set_item_spec.rb +1 -1
- data/core/spec/models/grading_method_set_spec.rb +1 -1
- data/core/spec/models/grading_method_spec.rb +4 -1
- data/core/spec/models/guardian_spec.rb +1 -2
- data/core/spec/models/lesson_plan_spec.rb +1 -1
- data/core/spec/models/lesson_spec.rb +1 -1
- data/core/spec/models/level_spec.rb +2 -1
- data/core/spec/models/note_spec.rb +1 -1
- data/core/spec/models/preset_spec.rb +1 -1
- data/core/spec/models/program_level_spec.rb +1 -1
- data/core/spec/models/program_spec.rb +2 -1
- data/core/spec/models/program_specialty_spec.rb +1 -1
- data/core/spec/models/program_syllabus_spec.rb +1 -2
- data/core/spec/models/role_spec.rb +1 -1
- data/core/spec/models/scholarship_status_spec.rb +1 -1
- data/core/spec/models/school_role_spec.rb +1 -1
- data/core/spec/models/school_spec.rb +3 -2
- data/core/spec/models/school_year_spec.rb +1 -1
- data/core/spec/models/semester_class_group_spec.rb +1 -1
- data/core/spec/models/semester_course_spec.rb +1 -1
- data/core/spec/models/semester_spec.rb +1 -1
- data/core/spec/models/simple_grade_spec.rb +4 -3
- data/core/spec/models/simple_grade_type_spec.rb +19 -0
- data/core/spec/models/specialty_spec.rb +4 -1
- data/core/spec/models/state_spec.rb +1 -1
- data/core/spec/models/student_guardian_spec.rb +1 -1
- data/core/spec/models/student_spec.rb +105 -7
- data/core/spec/models/student_speciality_spec.rb +4 -3
- data/core/spec/models/syllabus_spec.rb +3 -1
- data/core/spec/models/teacher_spec.rb +1 -2
- data/core/spec/models/template_spec.rb +1 -1
- data/core/spec/models/user_role_spec.rb +1 -1
- data/core/spec/models/user_spec.rb +1 -1
- data/core/spec/spec_helper_base.rb +20 -0
- data/core/spec/spec_helper_models.rb +38 -0
- data/core/spec/support/{accept_nested_attributes_for_matcher.rb → models/matchers/accept_nested_attributes_for_matcher.rb} +0 -0
- data/core/spec/support/{shared_examples → models/shared_examples}/addressable.rb +0 -0
- data/core/spec/support/{shared_examples → models/shared_examples}/avatarable.rb +0 -0
- data/core/spec/support/{shared_examples → models/shared_examples}/contactable.rb +0 -0
- data/core/spec/support/{shared_examples → models/shared_examples}/notable.rb +0 -0
- data/core/spec/support/{shared_examples → models/shared_examples}/person.rb +0 -0
- data/core_dependencies.rb +12 -0
- data/{core → frontend}/.gitignore +0 -0
- data/frontend/.rspec +2 -0
- data/frontend/.ruby-gemset +1 -0
- data/frontend/.ruby-version +1 -0
- data/frontend/Gemfile +7 -0
- data/frontend/Guardfile +40 -0
- data/frontend/Rakefile +31 -0
- data/frontend/app/assets/fonts/gaku/frontend/glyphicons-halflings-regular.eot +0 -0
- data/frontend/app/assets/fonts/gaku/frontend/glyphicons-halflings-regular.svg +228 -0
- data/frontend/app/assets/fonts/gaku/frontend/glyphicons-halflings-regular.ttf +0 -0
- data/frontend/app/assets/fonts/gaku/frontend/glyphicons-halflings-regular.woff +0 -0
- data/frontend/app/assets/javascripts/gaku/frontend.js.coffee +42 -0
- data/frontend/app/assets/javascripts/gaku/frontend/base.js.coffee +147 -0
- data/frontend/app/assets/javascripts/gaku/frontend/class_groups.js.coffee +19 -0
- data/frontend/app/assets/javascripts/gaku/frontend/courses.js.coffee +23 -0
- data/{core/app/assets/javascripts/gaku → frontend/app/assets/javascripts/gaku/frontend}/exams.js.coffee +0 -0
- data/frontend/app/assets/javascripts/gaku/frontend/extracurricular_activities.js.coffee +12 -0
- data/frontend/app/assets/javascripts/gaku/frontend/slide.js.erb +14 -0
- data/frontend/app/assets/javascripts/gaku/frontend/students.js.coffee +38 -0
- data/frontend/app/assets/javascripts/gaku/frontend/syllabuses.js.coffee +23 -0
- data/{core/app/assets/javascripts/gaku → frontend/app/assets/javascripts/gaku/frontend}/teachers.js.coffee +0 -0
- data/frontend/app/assets/stylesheets/gaku/bootstrap_and_theme.css.scss +573 -0
- data/frontend/app/assets/stylesheets/gaku/frontend.css +14 -0
- data/{core/app/assets/stylesheets/gaku → frontend/app/assets/stylesheets/gaku/frontend}/class_groups.css.scss +0 -0
- data/{core/app/assets/stylesheets/gaku → frontend/app/assets/stylesheets/gaku/frontend}/course_groups.css.scss +0 -0
- data/{core/app/assets/stylesheets/gaku → frontend/app/assets/stylesheets/gaku/frontend}/courses.css.scss +0 -0
- data/{core/app/assets/stylesheets/gaku → frontend/app/assets/stylesheets/gaku/frontend}/exams.css.scss +0 -0
- data/frontend/app/assets/stylesheets/gaku/frontend/gaku.css.scss +216 -0
- data/{core/app/assets/stylesheets/gaku → frontend/app/assets/stylesheets/gaku/frontend}/students.css.scss +0 -0
- data/frontend/app/assets/templates/roster.xls +0 -0
- data/{core → frontend}/app/controllers/concerns/enrollments_controller.rb +0 -0
- data/frontend/app/controllers/concerns/polymorphic_resource_concern.rb +48 -0
- data/frontend/app/controllers/concerns/student_chooser_controller.rb +41 -0
- data/frontend/app/controllers/gaku/addresses_controller.rb +94 -0
- data/frontend/app/controllers/gaku/attachments_controller.rb +90 -0
- data/frontend/app/controllers/gaku/attendances_controller.rb +28 -0
- data/{core → frontend}/app/controllers/gaku/class_group_enrollments_controller.rb +0 -0
- data/frontend/app/controllers/gaku/class_groups/courses_controller.rb +50 -0
- data/frontend/app/controllers/gaku/class_groups/semester_class_groups_controller.rb +63 -0
- data/frontend/app/controllers/gaku/class_groups/students_controller.rb +37 -0
- data/frontend/app/controllers/gaku/class_groups_controller.rb +120 -0
- data/frontend/app/controllers/gaku/contacts_controller.rb +79 -0
- data/{core → frontend}/app/controllers/gaku/course_enrollments_controller.rb +0 -0
- data/frontend/app/controllers/gaku/course_groups/course_group_enrollments_controller.rb +54 -0
- data/frontend/app/controllers/gaku/course_groups_controller.rb +91 -0
- data/{core → frontend}/app/controllers/gaku/courses/enrollments_controller.rb +0 -0
- data/frontend/app/controllers/gaku/courses/exams_controller.rb +28 -0
- data/frontend/app/controllers/gaku/courses/semester_courses_controller.rb +64 -0
- data/frontend/app/controllers/gaku/courses_controller.rb +95 -0
- data/frontend/app/controllers/gaku/devise/passwords_controller.rb +4 -0
- data/frontend/app/controllers/gaku/devise/registrations_controller.rb +60 -0
- data/frontend/app/controllers/gaku/devise/sessions_controller.rb +13 -0
- data/frontend/app/controllers/gaku/exam_portion_scores_controller.rb +26 -0
- data/frontend/app/controllers/gaku/exams/exam_portions/attachments_controller.rb +46 -0
- data/frontend/app/controllers/gaku/exams/exam_portions_controller.rb +76 -0
- data/frontend/app/controllers/gaku/exams_controller.rb +153 -0
- data/frontend/app/controllers/gaku/extracurricular_activities/students_controller.rb +21 -0
- data/frontend/app/controllers/gaku/extracurricular_activities_controller.rb +68 -0
- data/frontend/app/controllers/gaku/extracurricular_activity_enrollments_controller.rb +16 -0
- data/frontend/app/controllers/gaku/gaku_controller.rb +23 -0
- data/frontend/app/controllers/gaku/home_controller.rb +11 -0
- data/frontend/app/controllers/gaku/notes_controller.rb +81 -0
- data/frontend/app/controllers/gaku/realtime_controller.rb +29 -0
- data/frontend/app/controllers/gaku/search_controller.rb +16 -0
- data/{core → frontend}/app/controllers/gaku/states_controller.rb +0 -0
- data/frontend/app/controllers/gaku/students/badges_controller.rb +65 -0
- data/frontend/app/controllers/gaku/students/class_group_enrollments_controller.rb +45 -0
- data/frontend/app/controllers/gaku/students/course_enrollments_controller.rb +51 -0
- data/frontend/app/controllers/gaku/students/external_school_records_controller.rb +70 -0
- data/frontend/app/controllers/gaku/students/guardians_controller.rb +70 -0
- data/frontend/app/controllers/gaku/students/simple_grades_controller.rb +69 -0
- data/frontend/app/controllers/gaku/students/student_specialties_controller.rb +68 -0
- data/frontend/app/controllers/gaku/students_controller.rb +198 -0
- data/{core → frontend}/app/controllers/gaku/syllabuses/assignments_controller.rb +0 -0
- data/frontend/app/controllers/gaku/syllabuses/exam_syllabuses_controller.rb +38 -0
- data/frontend/app/controllers/gaku/syllabuses/exams_controller.rb +68 -0
- data/frontend/app/controllers/gaku/syllabuses_controller.rb +77 -0
- data/frontend/app/controllers/gaku/teachers_controller.rb +76 -0
- data/frontend/app/helpers/gaku/autocomplete_helper.rb +31 -0
- data/frontend/app/helpers/gaku/exam_helper.rb +13 -0
- data/frontend/app/helpers/gaku/frontend_helper.rb +42 -0
- data/frontend/app/helpers/gaku/person_helper.rb +79 -0
- data/frontend/app/helpers/gaku/shared_helper.rb +29 -0
- data/frontend/app/helpers/gaku/student_chooser_helper.rb +11 -0
- data/frontend/app/helpers/gaku/students_helper.rb +31 -0
- data/frontend/app/overrides/frontend_menu.rb +6 -0
- data/frontend/app/views/gaku/addresses/_address.html.slim +5 -0
- data/frontend/app/views/gaku/addresses/_addresses.html.slim +25 -0
- data/frontend/app/views/gaku/addresses/_delete_link.html.slim +1 -0
- data/frontend/app/views/gaku/addresses/_fields.html.slim +14 -0
- data/frontend/app/views/gaku/addresses/_form.html.slim +3 -0
- data/frontend/app/views/gaku/addresses/_form_fields.html.slim +26 -0
- data/frontend/app/views/gaku/addresses/_modal.html.slim +4 -0
- data/frontend/app/views/gaku/addresses/_primary_field.html.slim +12 -0
- data/frontend/app/views/gaku/addresses/create.js.erb +12 -0
- data/frontend/app/views/gaku/addresses/destroy.js.erb +8 -0
- data/{core → frontend}/app/views/gaku/addresses/edit.js.erb +0 -0
- data/{core → frontend}/app/views/gaku/addresses/make_primary.js.erb +0 -0
- data/{core → frontend}/app/views/gaku/addresses/new.js.erb +0 -0
- data/{core/app/views/gaku/attachments/destroy.js.erb → frontend/app/views/gaku/addresses/recovery.js.erb} +0 -0
- data/frontend/app/views/gaku/addresses/soft_delete.js.erb +8 -0
- data/{core → frontend}/app/views/gaku/addresses/update.js.erb +0 -0
- data/frontend/app/views/gaku/attachments/destroy.js.erb +1 -0
- data/frontend/app/views/gaku/attachments/edit.js.erb +3 -0
- data/{core → frontend}/app/views/gaku/attachments/new.js.erb +0 -0
- data/frontend/app/views/gaku/attachments/recovery.js.erb +1 -0
- data/frontend/app/views/gaku/attachments/soft_delete.js.erb +3 -0
- data/frontend/app/views/gaku/class_groups/_class_group.html.slim +4 -0
- data/frontend/app/views/gaku/class_groups/_class_groups.html.slim +11 -0
- data/frontend/app/views/gaku/class_groups/_class_groups_with_semester.html.slim +12 -0
- data/{core/app/views/gaku/shared/fields/_class_group_fields.html.slim → frontend/app/views/gaku/class_groups/_fields.html.slim} +0 -0
- data/frontend/app/views/gaku/class_groups/_form.html.slim +3 -0
- data/frontend/app/views/gaku/class_groups/_form_fields.html.slim +7 -0
- data/frontend/app/views/gaku/class_groups/_student_chooser_form.html.slim +4 -0
- data/frontend/app/views/gaku/class_groups/_tabs.html.slim +41 -0
- data/frontend/app/views/gaku/class_groups/advanced_search.js.erb +30 -0
- data/{core → frontend}/app/views/gaku/class_groups/courses/_course.html.slim +0 -0
- data/frontend/app/views/gaku/class_groups/courses/_courses.html.slim +14 -0
- data/frontend/app/views/gaku/class_groups/courses/_form.html.slim +5 -0
- data/frontend/app/views/gaku/class_groups/courses/create.js.erb +7 -0
- data/frontend/app/views/gaku/class_groups/courses/destroy.js.erb +2 -0
- data/{core → frontend}/app/views/gaku/class_groups/courses/new.js.erb +0 -0
- data/frontend/app/views/gaku/class_groups/create.js.erb +6 -0
- data/frontend/app/views/gaku/class_groups/destroy.js.erb +1 -0
- data/frontend/app/views/gaku/class_groups/edit.html.slim +16 -0
- data/frontend/app/views/gaku/class_groups/index.html.slim +25 -0
- data/frontend/app/views/gaku/class_groups/new.js.erb +3 -0
- data/frontend/app/views/gaku/class_groups/search/_form.html.slim +18 -0
- data/frontend/app/views/gaku/class_groups/search/_semester_form.html.slim +23 -0
- data/frontend/app/views/gaku/class_groups/semester_advanced_search.js.erb +30 -0
- data/{core → frontend}/app/views/gaku/class_groups/semester_class_groups/_fields.html.slim +0 -0
- data/frontend/app/views/gaku/class_groups/semester_class_groups/_form.html.slim +4 -0
- data/frontend/app/views/gaku/class_groups/semester_class_groups/_form_fields.html.slim +3 -0
- data/{core → frontend}/app/views/gaku/class_groups/semester_class_groups/_modal.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/class_groups/semester_class_groups/_semester.html.slim +0 -0
- data/frontend/app/views/gaku/class_groups/semester_class_groups/_semester_modal.html.slim +4 -0
- data/frontend/app/views/gaku/class_groups/semester_class_groups/_semesters.html.slim +13 -0
- data/frontend/app/views/gaku/class_groups/semester_class_groups/create.js.erb +8 -0
- data/frontend/app/views/gaku/class_groups/semester_class_groups/destroy.js.erb +2 -0
- data/frontend/app/views/gaku/class_groups/semester_class_groups/edit.js.erb +3 -0
- data/frontend/app/views/gaku/class_groups/semester_class_groups/new.js.erb +3 -0
- data/frontend/app/views/gaku/class_groups/semester_class_groups/update.js.erb +3 -0
- data/frontend/app/views/gaku/class_groups/student_chooser.js.erb +9 -0
- data/{core → frontend}/app/views/gaku/class_groups/students/_student.html.slim +0 -0
- data/frontend/app/views/gaku/class_groups/students/_students.html.slim +14 -0
- data/frontend/app/views/gaku/class_groups/students/destroy.js.erb +2 -0
- data/frontend/app/views/gaku/class_groups/students/enroll_students.js.erb +16 -0
- data/frontend/app/views/gaku/class_groups/students/new.js.erb +3 -0
- data/frontend/app/views/gaku/class_groups/students/without_semester.js.erb +2 -0
- data/frontend/app/views/gaku/class_groups/with_semester.html.slim +26 -0
- data/frontend/app/views/gaku/class_groups/with_semester.js.erb +2 -0
- data/frontend/app/views/gaku/class_groups/without_semester.html.slim +26 -0
- data/frontend/app/views/gaku/class_groups/without_semester.js.erb +2 -0
- data/{core → frontend}/app/views/gaku/contacts/_contact.html.slim +0 -0
- data/frontend/app/views/gaku/contacts/_contacts.html.slim +22 -0
- data/frontend/app/views/gaku/contacts/_delete_link.html.slim +1 -0
- data/frontend/app/views/gaku/contacts/_fields.html.slim +14 -0
- data/frontend/app/views/gaku/contacts/_form.html.slim +4 -0
- data/frontend/app/views/gaku/contacts/_form_fields.html.slim +14 -0
- data/frontend/app/views/gaku/contacts/_modal.html.slim +4 -0
- data/frontend/app/views/gaku/contacts/_primary_field.html.slim +13 -0
- data/frontend/app/views/gaku/contacts/create.js.erb +21 -0
- data/frontend/app/views/gaku/contacts/destroy.js.erb +9 -0
- data/frontend/app/views/gaku/contacts/edit.js.erb +4 -0
- data/{core → frontend}/app/views/gaku/contacts/make_primary.js.erb +0 -0
- data/{core → frontend}/app/views/gaku/contacts/new.js.erb +0 -0
- data/frontend/app/views/gaku/contacts/recovery.js.erb +1 -0
- data/frontend/app/views/gaku/contacts/soft_delete.js.erb +8 -0
- data/{core → frontend}/app/views/gaku/contacts/update.js.erb +0 -0
- data/frontend/app/views/gaku/course_groups/_course_group.html.slim +4 -0
- data/frontend/app/views/gaku/course_groups/_course_groups.html.slim +7 -0
- data/{core → frontend}/app/views/gaku/course_groups/_fields.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/course_groups/_form.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/course_groups/_form_fields.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/course_groups/course_group_enrollments/_course.html.slim +0 -0
- data/frontend/app/views/gaku/course_groups/course_group_enrollments/_courses.html.slim +21 -0
- data/frontend/app/views/gaku/course_groups/course_group_enrollments/_form.html.slim +4 -0
- data/frontend/app/views/gaku/course_groups/course_group_enrollments/create.js.erb +7 -0
- data/frontend/app/views/gaku/course_groups/course_group_enrollments/destroy.js.erb +2 -0
- data/{core → frontend}/app/views/gaku/course_groups/course_group_enrollments/new.js.erb +0 -0
- data/frontend/app/views/gaku/course_groups/create.js.erb +6 -0
- data/frontend/app/views/gaku/course_groups/destroy.js.erb +1 -0
- data/frontend/app/views/gaku/course_groups/edit.html.slim +21 -0
- data/frontend/app/views/gaku/course_groups/index.html.slim +14 -0
- data/frontend/app/views/gaku/course_groups/new.js.erb +3 -0
- data/frontend/app/views/gaku/courses/_course.html.slim +7 -0
- data/frontend/app/views/gaku/courses/_courses.html.slim +24 -0
- data/frontend/app/views/gaku/courses/_form.html.slim +3 -0
- data/frontend/app/views/gaku/courses/_form_fields.html.slim +5 -0
- data/frontend/app/views/gaku/courses/_student_chooser_form.html.slim +4 -0
- data/frontend/app/views/gaku/courses/_tabs.html.slim +26 -0
- data/frontend/app/views/gaku/courses/create.js.erb +6 -0
- data/frontend/app/views/gaku/courses/destroy.js.erb +1 -0
- data/frontend/app/views/gaku/courses/edit.html.slim +16 -0
- data/{core → frontend}/app/views/gaku/courses/enrollments/_enrolled.html.slim +0 -0
- data/frontend/app/views/gaku/courses/enrollments/_enrollments.html.slim +27 -0
- data/frontend/app/views/gaku/courses/enrollments/_errors_modal.html.slim +11 -0
- data/frontend/app/views/gaku/courses/enrollments/class_groups/_form.html.slim +3 -0
- data/frontend/app/views/gaku/courses/enrollments/class_groups/enroll.js.erb +16 -0
- data/{core → frontend}/app/views/gaku/courses/enrollments/class_groups/new.js.erb +0 -0
- data/frontend/app/views/gaku/courses/enrollments/error.js.erb +2 -0
- data/frontend/app/views/gaku/courses/enrollments/students/enroll_students.js.erb +11 -0
- data/{core → frontend}/app/views/gaku/courses/exams/_exam.html.slim +0 -0
- data/frontend/app/views/gaku/courses/exams/_exam_portion_head.html.slim +5 -0
- data/frontend/app/views/gaku/courses/exams/_exams.html.slim +14 -0
- data/frontend/app/views/gaku/courses/exams/_grading_table_head.html.slim +9 -0
- data/frontend/app/views/gaku/courses/exams/_grading_table_student_field.html.slim +11 -0
- data/frontend/app/views/gaku/courses/exams/grading.html.slim +7 -0
- data/frontend/app/views/gaku/courses/index.html.slim +14 -0
- data/frontend/app/views/gaku/courses/new.js.erb +3 -0
- data/{core → frontend}/app/views/gaku/courses/semester_courses/_fields.html.slim +0 -0
- data/frontend/app/views/gaku/courses/semester_courses/_form.html.slim +4 -0
- data/frontend/app/views/gaku/courses/semester_courses/_form_fields.html.slim +3 -0
- data/frontend/app/views/gaku/courses/semester_courses/_modal.html.slim +4 -0
- data/{core → frontend}/app/views/gaku/courses/semester_courses/_semester_course.html.slim +0 -0
- data/frontend/app/views/gaku/courses/semester_courses/_semester_courses.html.slim +16 -0
- data/frontend/app/views/gaku/courses/semester_courses/create.js.erb +6 -0
- data/frontend/app/views/gaku/courses/semester_courses/destroy.js.erb +3 -0
- data/frontend/app/views/gaku/courses/semester_courses/edit.js.erb +3 -0
- data/frontend/app/views/gaku/courses/semester_courses/new.js.erb +3 -0
- data/frontend/app/views/gaku/courses/semester_courses/update.js.erb +3 -0
- data/frontend/app/views/gaku/courses/student_chooser.js.erb +7 -0
- data/{core → frontend}/app/views/gaku/devise/confirmations/new.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/devise/mailer/confirmation_instructions.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/devise/mailer/reset_password_instructions.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/devise/mailer/unlock_instructions.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/devise/passwords/edit.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/devise/passwords/new.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/devise/registrations/edit.html.slim +0 -0
- data/frontend/app/views/gaku/devise/registrations/new.html.slim +27 -0
- data/frontend/app/views/gaku/devise/registrations/set_up_admin_account.html.slim +26 -0
- data/frontend/app/views/gaku/devise/sessions/new.html.slim +24 -0
- data/{core → frontend}/app/views/gaku/devise/shared/_links.html.erb +0 -0
- data/{core → frontend}/app/views/gaku/devise/unlocks/new.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/exam_divisions/_form.html.erb +0 -0
- data/{core → frontend}/app/views/gaku/exam_divisions/edit.html.erb +0 -0
- data/{core → frontend}/app/views/gaku/exam_divisions/index.html.erb +0 -0
- data/{core → frontend}/app/views/gaku/exam_divisions/new.html.erb +0 -0
- data/{core → frontend}/app/views/gaku/exam_divisions/show.html.erb +0 -0
- data/frontend/app/views/gaku/exams/_exam.html.slim +2 -0
- data/frontend/app/views/gaku/exams/_form.html.slim +16 -0
- data/frontend/app/views/gaku/exams/_form_fields.html.slim +17 -0
- data/frontend/app/views/gaku/exams/_table_fields.html.slim +8 -0
- data/frontend/app/views/gaku/exams/_tabs.html.slim +15 -0
- data/frontend/app/views/gaku/exams/_weight_check_widget.html.slim +20 -0
- data/frontend/app/views/gaku/exams/create.js.erb +6 -0
- data/frontend/app/views/gaku/exams/destroy.js.erb +1 -0
- data/frontend/app/views/gaku/exams/edit.html.slim +16 -0
- data/frontend/app/views/gaku/exams/exam_portions/_custom_exam_portion_error.html.slim +4 -0
- data/frontend/app/views/gaku/exams/exam_portions/_exam_portion.html.slim +2 -0
- data/frontend/app/views/gaku/exams/exam_portions/_exam_portion_weight_td.html.slim +3 -0
- data/frontend/app/views/gaku/exams/exam_portions/_exam_portions.html.slim +27 -0
- data/frontend/app/views/gaku/exams/exam_portions/_form.html.slim +3 -0
- data/frontend/app/views/gaku/exams/exam_portions/_table_fields.slim +8 -0
- data/frontend/app/views/gaku/exams/exam_portions/_tabs.html.slim +11 -0
- data/{core → frontend}/app/views/gaku/exams/exam_portions/attachments/_attachment.html.slim +0 -0
- data/frontend/app/views/gaku/exams/exam_portions/attachments/_attachments.html.slim +20 -0
- data/frontend/app/views/gaku/exams/exam_portions/attachments/_form.html.slim +3 -0
- data/{core → frontend}/app/views/gaku/exams/exam_portions/attachments/_form_fields.html.slim +0 -0
- data/frontend/app/views/gaku/exams/exam_portions/attachments/_modal.html.slim +4 -0
- data/{core → frontend}/app/views/gaku/exams/exam_portions/attachments/create.js.erb +0 -0
- data/frontend/app/views/gaku/exams/exam_portions/attachments/new.js.erb +3 -0
- data/frontend/app/views/gaku/exams/exam_portions/create.js.erb +49 -0
- data/frontend/app/views/gaku/exams/exam_portions/destroy.js.erb +8 -0
- data/frontend/app/views/gaku/exams/exam_portions/edit.html.slim +16 -0
- data/frontend/app/views/gaku/exams/exam_portions/new.js.erb +3 -0
- data/frontend/app/views/gaku/exams/exam_portions/show.html.slim +30 -0
- data/{core → frontend}/app/views/gaku/exams/export.xls.rb +0 -0
- data/frontend/app/views/gaku/exams/index.html.slim +24 -0
- data/frontend/app/views/gaku/exams/new.js.erb +3 -0
- data/frontend/app/views/gaku/exams/show.html.slim +28 -0
- data/frontend/app/views/gaku/extracurricular_activities/_extracurricular_activities.html.slim +7 -0
- data/frontend/app/views/gaku/extracurricular_activities/_extracurricular_activity.html.slim +4 -0
- data/{core → frontend}/app/views/gaku/extracurricular_activities/_fields.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/extracurricular_activities/_form.html.slim +0 -0
- data/frontend/app/views/gaku/extracurricular_activities/_form_fields.html.slim +3 -0
- data/frontend/app/views/gaku/extracurricular_activities/_student_chooser_form.html.slim +4 -0
- data/frontend/app/views/gaku/extracurricular_activities/_tabs.html.slim +15 -0
- data/frontend/app/views/gaku/extracurricular_activities/create.js.erb +6 -0
- data/frontend/app/views/gaku/extracurricular_activities/destroy.js.erb +2 -0
- data/frontend/app/views/gaku/extracurricular_activities/edit.html.slim +16 -0
- data/frontend/app/views/gaku/extracurricular_activities/index.html.slim +15 -0
- data/frontend/app/views/gaku/extracurricular_activities/new.js.erb +3 -0
- data/frontend/app/views/gaku/extracurricular_activities/student_chooser.js.erb +9 -0
- data/{core → frontend}/app/views/gaku/extracurricular_activities/students/_student.html.slim +0 -0
- data/frontend/app/views/gaku/extracurricular_activities/students/_students.html.slim +16 -0
- data/frontend/app/views/gaku/extracurricular_activities/students/destroy.js.erb +3 -0
- data/frontend/app/views/gaku/extracurricular_activities/students/enroll_students.js.erb +11 -0
- data/frontend/app/views/gaku/home/_user_info.html.slim +7 -0
- data/frontend/app/views/gaku/home/_user_menu.html.slim +4 -0
- data/frontend/app/views/gaku/home/index.html.slim +10 -0
- data/frontend/app/views/gaku/layouts/edit.html.slim +10 -0
- data/frontend/app/views/gaku/layouts/gaku.html.slim +22 -0
- data/frontend/app/views/gaku/layouts/home.html.slim +1 -0
- data/frontend/app/views/gaku/layouts/index.html.slim +12 -0
- data/frontend/app/views/gaku/layouts/show.html.slim +10 -0
- data/frontend/app/views/gaku/notes/_buttons.html.slim +8 -0
- data/{core → frontend}/app/views/gaku/notes/_fields.html.slim +0 -0
- data/frontend/app/views/gaku/notes/_form.html.slim +6 -0
- data/frontend/app/views/gaku/notes/_form_fields.html.slim +6 -0
- data/frontend/app/views/gaku/notes/_modal.html.slim +4 -0
- data/{core → frontend}/app/views/gaku/notes/_note.html.slim +0 -0
- data/frontend/app/views/gaku/notes/_notes.html.slim +21 -0
- data/frontend/app/views/gaku/notes/_show_modal.html.slim +4 -0
- data/{core → frontend}/app/views/gaku/notes/create.js.erb +0 -0
- data/{core → frontend}/app/views/gaku/notes/destroy.js.erb +0 -0
- data/{core → frontend}/app/views/gaku/notes/edit.js.erb +0 -0
- data/{core → frontend}/app/views/gaku/notes/new.js.erb +0 -0
- data/frontend/app/views/gaku/notes/show.js.erb +2 -0
- data/{core → frontend}/app/views/gaku/notes/update.js.erb +0 -0
- data/frontend/app/views/gaku/shared/_delete_link.html.slim +1 -0
- data/frontend/app/views/gaku/shared/_delete_modal.html.slim +11 -0
- data/frontend/app/views/gaku/shared/_errors.html.slim +6 -0
- data/{core → frontend}/app/views/gaku/shared/_external_school_record.html.slim +0 -0
- data/frontend/app/views/gaku/shared/_flash.html.slim +4 -0
- data/frontend/app/views/gaku/shared/_language_bar.html.slim +8 -0
- data/frontend/app/views/gaku/shared/_login_widget.html.slim +15 -0
- data/frontend/app/views/gaku/shared/_manage_buttons.html.slim +4 -0
- data/frontend/app/views/gaku/shared/_menubar.html.slim +7 -0
- data/frontend/app/views/gaku/shared/_modal_config.html.slim +37 -0
- data/frontend/app/views/gaku/shared/_multi_errors.html.slim +6 -0
- data/frontend/app/views/gaku/shared/_picture.html.slim +8 -0
- data/frontend/app/views/gaku/shared/_upload_picture.html.slim +7 -0
- data/frontend/app/views/gaku/shared/error.js.erb +2 -0
- data/frontend/app/views/gaku/shared/fields/_address_and_contact_show_table.html.slim +6 -0
- data/frontend/app/views/gaku/shared/fields/_attachment_fields.html.slim +10 -0
- data/{core → frontend}/app/views/gaku/shared/fields/_course_fields.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/shared/fields/_course_show_fields.html.slim +0 -0
- data/frontend/app/views/gaku/shared/fields/_exam_portion_fields.html.slim +7 -0
- data/{core → frontend}/app/views/gaku/shared/fields/_person_edit_table.html.slim +0 -0
- data/frontend/app/views/gaku/shared/fields/_person_show_table.html.slim +15 -0
- data/{core → frontend}/app/views/gaku/shared/fields/_semester_fields.html.slim +0 -0
- data/frontend/app/views/gaku/shared/form_fields/_exam_portion_form_fields.html.slim +14 -0
- data/frontend/app/views/gaku/shared/form_fields/_person_form_fields.html.slim +17 -0
- data/frontend/app/views/gaku/shared/menu/_frontend.html.erb +22 -0
- data/frontend/app/views/gaku/shared/multi_error.js.erb +2 -0
- data/frontend/app/views/gaku/shared/notice.js.erb +2 -0
- data/{core → frontend}/app/views/gaku/shared/overrides/students/_import_link.html.slim +0 -0
- data/{core → frontend}/app/views/gaku/shared/overrides/syllabuses/_import_link.html.slim +0 -0
- data/frontend/app/views/gaku/shared/student/_show.html.slim +12 -0
- data/frontend/app/views/gaku/shared/student_chooser/_chooser.html.slim +7 -0
- data/frontend/app/views/gaku/shared/student_chooser/_chooser_widget.html.slim +10 -0
- data/frontend/app/views/gaku/shared/student_chooser/_modal.html.slim +3 -0
- data/frontend/app/views/gaku/states/_no_states_select.html.slim +1 -0
- data/frontend/app/views/gaku/states/_states_select.html.slim +1 -0
- data/frontend/app/views/gaku/states/index.js.erb +5 -0
- data/frontend/app/views/gaku/students/_academic.html.slim +18 -0
- data/frontend/app/views/gaku/students/_chooser_widget.html.slim +14 -0
- data/frontend/app/views/gaku/students/_form.html.slim +3 -0
- data/frontend/app/views/gaku/students/_form_fields.html.slim +25 -0
- data/frontend/app/views/gaku/students/_personal.html.slim +3 -0
- data/frontend/app/views/gaku/students/_student.html.slim +5 -0
- data/frontend/app/views/gaku/students/_student_chooser_form.html.slim +16 -0
- data/frontend/app/views/gaku/students/_student_unit.html.slim +5 -0
- data/frontend/app/views/gaku/students/_students.html.slim +62 -0
- data/frontend/app/views/gaku/students/_table_fields.html.slim +63 -0
- data/frontend/app/views/gaku/students/_tabs.html.slim +48 -0
- data/frontend/app/views/gaku/students/_tabs_academic.html.slim +40 -0
- data/frontend/app/views/gaku/students/_tabs_personal.html.slim +27 -0
- data/frontend/app/views/gaku/students/advanced_search.js.erb +66 -0
- data/frontend/app/views/gaku/students/badges/_badge.html.slim +2 -0
- data/frontend/app/views/gaku/students/badges/_badge_type.html.slim +5 -0
- data/frontend/app/views/gaku/students/badges/_badges.html.slim +2 -0
- data/frontend/app/views/gaku/students/badges/_badges_tab.html.slim +8 -0
- data/frontend/app/views/gaku/students/badges/_edit.html.slim +8 -0
- data/frontend/app/views/gaku/students/badges/_fields.html.slim +8 -0
- data/frontend/app/views/gaku/students/badges/_form.html.slim +3 -0
- data/frontend/app/views/gaku/students/badges/_form_fields.html.slim +1 -0
- data/frontend/app/views/gaku/students/badges/_index.html.slim +20 -0
- data/frontend/app/views/gaku/students/badges/_index_modal.html.slim +4 -0
- data/frontend/app/views/gaku/students/badges/create.js.erb +14 -0
- data/frontend/app/views/gaku/students/badges/destroy.js.erb +6 -0
- data/frontend/app/views/gaku/students/badges/edit.js.erb +2 -0
- data/frontend/app/views/gaku/students/badges/index.js.erb +3 -0
- data/frontend/app/views/gaku/students/badges/new.js.erb +3 -0
- data/frontend/app/views/gaku/students/badges/update.js.erb +5 -0
- data/frontend/app/views/gaku/students/chosen.js.erb +12 -0
- data/frontend/app/views/gaku/students/class_group_enrollments/_new_modal.html.slim +28 -0
- data/frontend/app/views/gaku/students/class_group_enrollments/create.js.erb +11 -0
- data/frontend/app/views/gaku/students/class_group_enrollments/new.js.erb +2 -0
- data/frontend/app/views/gaku/students/course_enrollments/_course_enrollment.html.slim +4 -0
- data/frontend/app/views/gaku/students/course_enrollments/_course_enrollments.html.slim +17 -0
- data/frontend/app/views/gaku/students/course_enrollments/_errors_modal.html.slim +11 -0
- data/frontend/app/views/gaku/students/course_enrollments/_form.html.slim +4 -0
- data/frontend/app/views/gaku/students/course_enrollments/create.js.erb +9 -0
- data/frontend/app/views/gaku/students/course_enrollments/destroy.js.erb +3 -0
- data/frontend/app/views/gaku/students/course_enrollments/error.js.erb +2 -0
- data/frontend/app/views/gaku/students/course_enrollments/new.js.erb +3 -0
- data/frontend/app/views/gaku/students/create.js.erb +8 -0
- data/frontend/app/views/gaku/students/destroy.js.erb +2 -0
- data/frontend/app/views/gaku/students/edit.html.slim +37 -0
- data/frontend/app/views/gaku/students/external_school_records/_external_school_record.html.slim +2 -0
- data/frontend/app/views/gaku/students/external_school_records/_external_school_records.html.slim +24 -0
- data/frontend/app/views/gaku/students/external_school_records/_fields.html.slim +11 -0
- data/frontend/app/views/gaku/students/external_school_records/_form.html.slim +3 -0
- data/frontend/app/views/gaku/students/external_school_records/_form_fields.html.slim +17 -0
- data/frontend/app/views/gaku/students/external_school_records/_modal.html.slim +4 -0
- data/frontend/app/views/gaku/students/external_school_records/create.js.erb +8 -0
- data/frontend/app/views/gaku/students/external_school_records/destroy.js.erb +3 -0
- data/frontend/app/views/gaku/students/external_school_records/edit.js.erb +4 -0
- data/frontend/app/views/gaku/students/external_school_records/new.js.erb +4 -0
- data/frontend/app/views/gaku/students/external_school_records/update.js.erb +3 -0
- data/frontend/app/views/gaku/students/guardians/_delete_modal.html.slim +12 -0
- data/frontend/app/views/gaku/students/guardians/_form.html.slim +3 -0
- data/frontend/app/views/gaku/students/guardians/_form_fields.html.slim +4 -0
- data/frontend/app/views/gaku/students/guardians/_guardian.html.slim +12 -0
- data/frontend/app/views/gaku/students/guardians/_guardians.html.slim +24 -0
- data/frontend/app/views/gaku/students/guardians/_picture.html.slim +8 -0
- data/frontend/app/views/gaku/students/guardians/_tabs.html.slim +14 -0
- data/frontend/app/views/gaku/students/guardians/_upload_picture.html.slim +7 -0
- data/frontend/app/views/gaku/students/guardians/create.js.erb +7 -0
- data/frontend/app/views/gaku/students/guardians/destroy.js.erb +1 -0
- data/frontend/app/views/gaku/students/guardians/edit.html.slim +21 -0
- data/frontend/app/views/gaku/students/guardians/new.js.erb +3 -0
- data/frontend/app/views/gaku/students/guardians/recovery.js.erb +1 -0
- data/frontend/app/views/gaku/students/guardians/show.html.slim +17 -0
- data/frontend/app/views/gaku/students/importer/index.html.slim +26 -0
- data/frontend/app/views/gaku/students/index.html.slim +22 -0
- data/frontend/app/views/gaku/students/index.js.erb +2 -0
- data/frontend/app/views/gaku/students/new.html.slim +3 -0
- data/frontend/app/views/gaku/students/new.js.erb +3 -0
- data/frontend/app/views/gaku/students/search/_academic.html.slim +22 -0
- data/frontend/app/views/gaku/students/search/_address.html.slim +34 -0
- data/frontend/app/views/gaku/students/search/_advanced_form.html.slim +36 -0
- data/frontend/app/views/gaku/students/search/_extended.slim +108 -0
- data/frontend/app/views/gaku/students/search/_form.html.slim +8 -0
- data/frontend/app/views/gaku/students/search/_student.html.slim +36 -0
- data/frontend/app/views/gaku/students/show.html.slim +24 -0
- data/frontend/app/views/gaku/students/simple_grades/_edit.html.slim +8 -0
- data/frontend/app/views/gaku/students/simple_grades/_fields.html.slim +8 -0
- data/frontend/app/views/gaku/students/simple_grades/_form.html.slim +3 -0
- data/frontend/app/views/gaku/students/simple_grades/_form_fields.html.slim +3 -0
- data/frontend/app/views/gaku/students/simple_grades/_index.html.slim +21 -0
- data/frontend/app/views/gaku/students/simple_grades/_index_modal.html.slim +4 -0
- data/frontend/app/views/gaku/students/simple_grades/_simple_grade.html.slim +2 -0
- data/frontend/app/views/gaku/students/simple_grades/_simple_grades.html.slim +2 -0
- data/frontend/app/views/gaku/students/simple_grades/create.js.erb +10 -0
- data/frontend/app/views/gaku/students/simple_grades/destroy.js.erb +4 -0
- data/frontend/app/views/gaku/students/simple_grades/edit.js.erb +4 -0
- data/frontend/app/views/gaku/students/simple_grades/index.js.erb +5 -0
- data/frontend/app/views/gaku/students/simple_grades/new.js.erb +6 -0
- data/frontend/app/views/gaku/students/simple_grades/update.js.erb +4 -0
- data/frontend/app/views/gaku/students/student_specialties/_edit.html.slim +8 -0
- data/frontend/app/views/gaku/students/student_specialties/_fields.html.slim +5 -0
- data/frontend/app/views/gaku/students/student_specialties/_form.html.slim +3 -0
- data/frontend/app/views/gaku/students/student_specialties/_form_fields.html.slim +2 -0
- data/frontend/app/views/gaku/students/student_specialties/_index.html.slim +18 -0
- data/frontend/app/views/gaku/students/student_specialties/_index_modal.html.slim +4 -0
- data/frontend/app/views/gaku/students/student_specialties/_student_specialties.html.slim +2 -0
- data/frontend/app/views/gaku/students/student_specialties/_student_specialty.html.slim +2 -0
- data/frontend/app/views/gaku/students/student_specialties/create.js.erb +10 -0
- data/frontend/app/views/gaku/students/student_specialties/destroy.js.erb +4 -0
- data/frontend/app/views/gaku/students/student_specialties/edit.js.erb +2 -0
- data/frontend/app/views/gaku/students/student_specialties/index.js.erb +5 -0
- data/frontend/app/views/gaku/students/student_specialties/new.js.erb +3 -0
- data/frontend/app/views/gaku/students/student_specialties/update.js.erb +4 -0
- data/frontend/app/views/gaku/syllabuses/_all_exams.html.slim +14 -0
- data/frontend/app/views/gaku/syllabuses/_fields.html.slim +7 -0
- data/{core → frontend}/app/views/gaku/syllabuses/_form.html.slim +0 -0
- data/frontend/app/views/gaku/syllabuses/_form_fields.html.slim +12 -0
- data/frontend/app/views/gaku/syllabuses/_syllabus.html.slim +2 -0
- data/frontend/app/views/gaku/syllabuses/_syllabuses.html.slim +12 -0
- data/frontend/app/views/gaku/syllabuses/_tabs.html.slim +16 -0
- data/frontend/app/views/gaku/syllabuses/create.js.erb +7 -0
- data/frontend/app/views/gaku/syllabuses/destroy.js.erb +1 -0
- data/frontend/app/views/gaku/syllabuses/edit.html.slim +16 -0
- data/frontend/app/views/gaku/syllabuses/exam_syllabuses/create.js.erb +12 -0
- data/frontend/app/views/gaku/syllabuses/exam_syllabuses/destroy.js.erb +5 -0
- data/frontend/app/views/gaku/syllabuses/exams/_exam.html.slim +3 -0
- data/frontend/app/views/gaku/syllabuses/exams/_exams.html.slim +13 -0
- data/frontend/app/views/gaku/syllabuses/exams/_fields.html.slim +10 -0
- data/frontend/app/views/gaku/syllabuses/exams/_form.html.slim +17 -0
- data/frontend/app/views/gaku/syllabuses/exams/_form_fields.html.slim +10 -0
- data/frontend/app/views/gaku/syllabuses/exams/_modal.html.slim +4 -0
- data/frontend/app/views/gaku/syllabuses/exams/_select_form.html.slim +6 -0
- data/frontend/app/views/gaku/syllabuses/exams/create.js.erb +9 -0
- data/frontend/app/views/gaku/syllabuses/exams/destroy.js.erb +3 -0
- data/frontend/app/views/gaku/syllabuses/exams/edit.js.erb +3 -0
- data/frontend/app/views/gaku/syllabuses/exams/new.js.erb +3 -0
- data/frontend/app/views/gaku/syllabuses/exams/update.js.erb +4 -0
- data/frontend/app/views/gaku/syllabuses/importer/index.html.slim +14 -0
- data/frontend/app/views/gaku/syllabuses/index.html.slim +14 -0
- data/{core → frontend}/app/views/gaku/syllabuses/new.js.erb +0 -0
- data/frontend/app/views/gaku/teachers/_fields.html.slim +5 -0
- data/frontend/app/views/gaku/teachers/_form.html.slim +3 -0
- data/{core → frontend}/app/views/gaku/teachers/_form_fields.html.slim +0 -0
- data/frontend/app/views/gaku/teachers/_tabs.html.slim +20 -0
- data/frontend/app/views/gaku/teachers/_teacher.html.slim +5 -0
- data/frontend/app/views/gaku/teachers/_teachers.html.slim +11 -0
- data/frontend/app/views/gaku/teachers/create.js.erb +8 -0
- data/frontend/app/views/gaku/teachers/destroy.js.erb +1 -0
- data/frontend/app/views/gaku/teachers/edit.html.slim +19 -0
- data/frontend/app/views/gaku/teachers/index.html.slim +16 -0
- data/frontend/app/views/gaku/teachers/new.js.erb +3 -0
- data/frontend/app/views/gaku/teachers/show.html.slim +13 -0
- data/{core → frontend}/app/views/kaminari/_first_page.html.erb +0 -0
- data/{core → frontend}/app/views/kaminari/_gap.html.erb +0 -0
- data/{core → frontend}/app/views/kaminari/_last_page.html.erb +0 -0
- data/{core → frontend}/app/views/kaminari/_next_page.html.erb +0 -0
- data/{core → frontend}/app/views/kaminari/_page.html.erb +0 -0
- data/frontend/app/views/kaminari/_paginator.html.erb +27 -0
- data/{core → frontend}/app/views/kaminari/_prev_page.html.erb +0 -0
- data/frontend/config/initializers/client_side_validations.rb +9 -0
- data/frontend/config/initializers/wrap_parameters.rb +14 -0
- data/frontend/config/routes.rb +137 -0
- data/frontend/coverage/.last_run.json +5 -0
- data/frontend/coverage/.resultset.json +179 -0
- data/frontend/gaku_frontend.gemspec +50 -0
- data/frontend/lib/gaku/app_responder.rb +6 -0
- data/frontend/lib/gaku/class_name_detector.rb +23 -0
- data/frontend/lib/gaku/frontend.rb +33 -0
- data/frontend/lib/gaku/frontend/engine.rb +30 -0
- data/frontend/lib/gaku_frontend.rb +1 -0
- data/frontend/lib/tasks/admin_user.rake +104 -0
- data/frontend/lib/tasks/core.rake +65 -0
- data/frontend/lib/tasks/reset.rake +37 -0
- data/frontend/spec/controllers/gaku/addresses_controller_spec.rb +136 -0
- data/frontend/spec/controllers/gaku/class_group_enrollments_controller_spec.rb +62 -0
- data/frontend/spec/controllers/gaku/class_groups/class_groups_controller_spec.rb +151 -0
- data/frontend/spec/controllers/gaku/class_groups/courses_controller_spec.rb +90 -0
- data/frontend/spec/controllers/gaku/class_groups/semesters_controller_spec.rb +90 -0
- data/frontend/spec/controllers/gaku/contacts_controller_spec.rb +135 -0
- data/frontend/spec/controllers/gaku/course_groups/course_group_enrollments_controller.rb +90 -0
- data/frontend/spec/controllers/gaku/course_groups/course_groups_controller_spec.rb +143 -0
- data/frontend/spec/controllers/gaku/courses/courses_controller_spec.rb +143 -0
- data/frontend/spec/controllers/gaku/exams/exam_portions_controller_spec.rb +137 -0
- data/frontend/spec/controllers/gaku/exams/exams_controller_spec.rb +154 -0
- data/frontend/spec/controllers/gaku/extracurricular_activities_controller_spec.rb +143 -0
- data/frontend/spec/controllers/gaku/notes_controller_spec.rb +143 -0
- data/frontend/spec/controllers/gaku/students/badges_controller_spec.rb +126 -0
- data/frontend/spec/controllers/gaku/students/course_enrollments_controller_spec.rb +121 -0
- data/frontend/spec/controllers/gaku/students/external_school_records_controller_spec.rb +138 -0
- data/frontend/spec/controllers/gaku/students/guardians_controller_spec.rb +115 -0
- data/frontend/spec/controllers/gaku/students/simple_grades_controller_spec.rb +147 -0
- data/frontend/spec/controllers/gaku/students/student_specialties_controller_spec.rb +126 -0
- data/frontend/spec/controllers/gaku/students/students_controller_spec.rb +338 -0
- data/frontend/spec/controllers/gaku/syllabuses_controller_spec.rb +151 -0
- data/frontend/spec/controllers/gaku/teachers_controller_spec.rb +152 -0
- data/{core → frontend}/spec/coverage/.last_run.json +0 -0
- data/{core → frontend}/spec/coverage/.resultset.json +0 -0
- data/{core/spec/requests → frontend/spec/features}/change_language_spec.rb +0 -0
- data/frontend/spec/features/class_groups/class_groups_spec.rb +96 -0
- data/frontend/spec/features/class_groups/courses_spec.rb +39 -0
- data/frontend/spec/features/class_groups/notes_spec.rb +32 -0
- data/frontend/spec/features/class_groups/semester_class_groups_spec.rb +96 -0
- data/frontend/spec/features/class_groups/students_spec.rb +90 -0
- data/frontend/spec/features/course_groups/course_groups_spec.rb +76 -0
- data/frontend/spec/features/course_groups/courses_spec.rb +37 -0
- data/frontend/spec/features/courses/courses_spec.rb +108 -0
- data/frontend/spec/features/courses/enrollments/class_groups_spec.rb +81 -0
- data/frontend/spec/features/courses/enrollments/students_spec.rb +75 -0
- data/frontend/spec/features/courses/exams_spec.rb +36 -0
- data/frontend/spec/features/courses/notes_spec.rb +32 -0
- data/frontend/spec/features/courses/semester_courses_spec.rb +108 -0
- data/frontend/spec/features/exams/exam_portions/attachments_spec.rb +101 -0
- data/frontend/spec/features/exams/exam_portions/exam_portions_spec.rb +81 -0
- data/frontend/spec/features/exams/exams_spec.rb +101 -0
- data/frontend/spec/features/exams/notes_spec.rb +32 -0
- data/frontend/spec/features/extracurricular_activities/extracurricular_activities_spec.rb +67 -0
- data/frontend/spec/features/extracurricular_activities/students_spec.rb +164 -0
- data/frontend/spec/features/sign_in_spec.rb +78 -0
- data/{core/spec/requests → frontend/spec/features}/sign_out_spec.rb +0 -0
- data/frontend/spec/features/sign_up_spec.rb +71 -0
- data/frontend/spec/features/students/addresses_spec.rb +60 -0
- data/frontend/spec/features/students/badges_spec.rb +95 -0
- data/frontend/spec/features/students/class_group_enrollments_spec.rb +47 -0
- data/{core/spec/requests → frontend/spec/features}/students/commute_methods_spec.rb +0 -0
- data/frontend/spec/features/students/contacts_spec.rb +60 -0
- data/frontend/spec/features/students/course_enrollments_spec.rb +39 -0
- data/{core/spec/requests → frontend/spec/features}/students/enrollment_status_spec.rb +0 -0
- data/frontend/spec/features/students/external_school_records_spec.rb +71 -0
- data/frontend/spec/features/students/guardians/addresses_spec.rb +65 -0
- data/frontend/spec/features/students/guardians/contacts_spec.rb +58 -0
- data/frontend/spec/features/students/guardians/guardians_spec.rb +76 -0
- data/frontend/spec/features/students/guardians/picture_spec.rb +24 -0
- data/frontend/spec/features/students/notes_spec.rb +35 -0
- data/frontend/spec/features/students/picture_spec.rb +23 -0
- data/frontend/spec/features/students/preset_spec.rb +477 -0
- data/{core/spec/requests → frontend/spec/features}/students/scholarship_status_spec.rb +0 -0
- data/frontend/spec/features/students/simple_grades_spec.rb +89 -0
- data/frontend/spec/features/students/student_specialties_spec.rb +82 -0
- data/frontend/spec/features/students/students_spec.rb +228 -0
- data/frontend/spec/features/syllabuses/exams_spec.rb +161 -0
- data/frontend/spec/features/syllabuses/notes_spec.rb +32 -0
- data/frontend/spec/features/syllabuses/syllabuses_spec.rb +72 -0
- data/frontend/spec/features/teachers/addresses_spec.rb +60 -0
- data/{core/spec/requests → frontend/spec/features}/teachers/contacts_spec.rb +0 -0
- data/{core/spec/requests → frontend/spec/features}/teachers/notes_spec.rb +0 -0
- data/frontend/spec/features/teachers/picture_spec.rb +22 -0
- data/frontend/spec/features/teachers/teachers_spec.rb +82 -0
- data/frontend/spec/routing/class_groups/courses_routing_spec.rb +40 -0
- data/frontend/spec/routing/class_groups/students_routing_spec.rb +40 -0
- data/frontend/spec/routing/student_routes_spec.rb +50 -0
- data/frontend/spec/routing/students/badges_routes_spec.rb +62 -0
- data/frontend/spec/routing/students/course_enrollments_routes_spec.rb +36 -0
- data/frontend/spec/routing/students/guardians_routes_spec.rb +55 -0
- data/frontend/spec/routing/students/simple_grades_routes_spec.rb +63 -0
- data/frontend/spec/routing/students/student_specialties_routes_spec.rb +63 -0
- data/frontend/spec/spec_helper.rb +5 -0
- data/frontend/spec/spec_helper_controllers.rb +4 -0
- data/frontend/spec/spec_helper_routing.rb +4 -0
- data/frontend/spec/support/120x120.jpg +0 -0
- data/frontend/spec/support/controllers/matchers/have_attributes_matcher.rb +8 -0
- data/frontend/spec/support/controllers/shared_examples/allow.rb +10 -0
- data/frontend/spec/support/controllers/shared_examples/deny.rb +27 -0
- data/frontend/spec/support/features/shared_examples/addresses_spec.rb +171 -0
- data/frontend/spec/support/features/shared_examples/avatarable_spec.rb +21 -0
- data/frontend/spec/support/features/shared_examples/contacts_spec.rb +123 -0
- data/frontend/spec/support/features/shared_examples/course_enrollable_spec.rb +69 -0
- data/frontend/spec/support/features/shared_examples/notes_spec.rb +82 -0
- data/frontend/spec/support/models/matchers/accept_nested_attributes_for_matcher.rb +39 -0
- data/frontend/spec/support/models/shared_examples/addressable.rb +3 -0
- data/frontend/spec/support/models/shared_examples/avatarable.rb +3 -0
- data/frontend/spec/support/models/shared_examples/contactable.rb +3 -0
- data/frontend/spec/support/models/shared_examples/notable.rb +3 -0
- data/frontend/spec/support/models/shared_examples/person.rb +4 -0
- data/frontend/spec/support/models/shared_examples/thrashable.rb +6 -0
- data/gaku.gemspec +5 -2
- data/lib/gaku.rb +3 -0
- data/sample/.rspec +2 -0
- data/sample/.ruby-gemset +1 -0
- data/sample/.ruby-version +1 -0
- data/sample/db/sample/gaku/01-syllabuses.rb +130 -0
- data/sample/db/sample/gaku/02-courses.rb +13 -0
- data/sample/db/sample/gaku/badge_types.rb +12 -0
- data/sample/db/sample/gaku/changes/student_changes.rb +2 -4
- data/sample/db/sample/gaku/class_groups.rb +10 -0
- data/sample/db/sample/gaku/disposals/address_and_contact_disposals.rb +20 -20
- data/sample/db/sample/gaku/teachers.rb +3 -11
- data/sample/gaku_sample.gemspec +2 -2
- data/sample/lib/shared_sample_data.rb +29 -6
- data/testing/Gemfile +6 -0
- data/testing/gaku_testing.gemspec +22 -0
- data/testing/lib/gaku/testing.rb +10 -0
- data/testing/lib/gaku/testing/engine.rb +10 -0
- data/testing/lib/gaku/testing/env.rb +19 -0
- data/testing/lib/gaku/testing/feature_helpers.rb +159 -0
- data/testing/lib/gaku/testing/flash_helpers.rb +35 -0
- data/testing/lib/gaku/testing/spec_helpers/spec_helper.rb +47 -0
- data/testing/lib/gaku/testing/spec_helpers/spec_helper_base.rb +17 -0
- data/testing/lib/gaku/testing/spec_helpers/spec_helper_controllers.rb +45 -0
- data/testing/lib/gaku/testing/spec_helpers/spec_helper_models.rb +38 -0
- data/testing/lib/gaku/testing/spec_helpers/spec_helper_routing.rb +6 -0
- data/testing/lib/gaku_testing.rb +1 -0
- metadata +1322 -1044
- data/core/app/assets/images/bootstrap/glyphicons-halflings-white.png +0 -0
- data/core/app/assets/images/bootstrap/glyphicons-halflings.png +0 -0
- data/core/app/assets/images/dataTables/back_disabled.png +0 -0
- data/core/app/assets/images/dataTables/back_enabled.png +0 -0
- data/core/app/assets/images/dataTables/back_enabled_hover.png +0 -0
- data/core/app/assets/images/dataTables/forward_disabled.png +0 -0
- data/core/app/assets/images/dataTables/forward_enabled.png +0 -0
- data/core/app/assets/images/dataTables/forward_enabled_hover.png +0 -0
- data/core/app/assets/images/dataTables/sort_asc.png +0 -0
- data/core/app/assets/images/dataTables/sort_asc_disabled.png +0 -0
- data/core/app/assets/images/dataTables/sort_both.png +0 -0
- data/core/app/assets/images/dataTables/sort_desc.png +0 -0
- data/core/app/assets/images/dataTables/sort_desc_disabled.png +0 -0
- data/core/app/assets/images/tbs-img/glyphicons-halflings-white.png +0 -0
- data/core/app/assets/images/tbs-img/glyphicons-halflings.png +0 -0
- data/core/app/assets/javascripts/gaku/admin.coffee +0 -30
- data/core/app/assets/javascripts/gaku/backbone/collections/attendance_types.js.coffee +0 -2
- data/core/app/assets/javascripts/gaku/backbone/collections/courses.js.coffee +0 -2
- data/core/app/assets/javascripts/gaku/backbone/collections/exams.js.coffee +0 -2
- data/core/app/assets/javascripts/gaku/backbone/models/attendance.js.coffee +0 -1
- data/core/app/assets/javascripts/gaku/backbone/models/attendance_type.coffee +0 -1
- data/core/app/assets/javascripts/gaku/backbone/models/calculation.js.coffee +0 -43
- data/core/app/assets/javascripts/gaku/backbone/models/completed.js.coffee +0 -1
- data/core/app/assets/javascripts/gaku/backbone/models/course.js.coffee +0 -2
- data/core/app/assets/javascripts/gaku/backbone/models/exam.js.coffee +0 -1
- data/core/app/assets/javascripts/gaku/backbone/models/exam_attendance.js.coffee +0 -4
- data/core/app/assets/javascripts/gaku/backbone/models/exam_portion_score.js.coffee +0 -18
- data/core/app/assets/javascripts/gaku/backbone/routers/.gitkeep +0 -0
- data/core/app/assets/javascripts/gaku/backbone/routers/exams_router.js.coffee +0 -22
- data/core/app/assets/javascripts/gaku/backbone/templates/.gitkeep +0 -0
- data/core/app/assets/javascripts/gaku/backbone/templates/attendance_chooser.jst.eco +0 -19
- data/core/app/assets/javascripts/gaku/backbone/templates/tables/attendance_show.jst.eco +0 -3
- data/core/app/assets/javascripts/gaku/backbone/templates/tables/exam_calculations.jst.eco +0 -39
- data/core/app/assets/javascripts/gaku/backbone/templates/tables/exam_completion.jst.eco +0 -1
- data/core/app/assets/javascripts/gaku/backbone/templates/tables/exam_score.jst.eco +0 -53
- data/core/app/assets/javascripts/gaku/backbone/templates/tables/exam_table.jst.eco +0 -32
- data/core/app/assets/javascripts/gaku/backbone/templates/tables/exam_user.jst.eco +0 -18
- data/core/app/assets/javascripts/gaku/backbone/views/exam_attendance.js.coffee +0 -51
- data/core/app/assets/javascripts/gaku/backbone/views/exam_attendance_show.js.coffee +0 -6
- data/core/app/assets/javascripts/gaku/backbone/views/exam_calculations.js.coffee +0 -15
- data/core/app/assets/javascripts/gaku/backbone/views/exam_completion.js.coffee +0 -7
- data/core/app/assets/javascripts/gaku/backbone/views/exam_portion_score.js.coffee +0 -8
- data/core/app/assets/javascripts/gaku/backbone/views/exam_score_view.js.coffee +0 -7
- data/core/app/assets/javascripts/gaku/backbone/views/exam_table_view.js.coffee +0 -227
- data/core/app/assets/javascripts/gaku/backbone/views/exam_user_view.js.coffee +0 -8
- data/core/app/assets/javascripts/gaku/class_groups.js.coffee +0 -11
- data/core/app/assets/javascripts/gaku/courses.js.coffee +0 -12
- data/core/app/assets/javascripts/gaku/extracurricular_activities.js.coffee +0 -12
- data/core/app/assets/javascripts/gaku/gaku.js.coffee +0 -174
- data/core/app/assets/javascripts/gaku/gaku_core.js +0 -35
- data/core/app/assets/javascripts/gaku/slide.js.erb +0 -14
- data/core/app/assets/javascripts/gaku/students.js.coffee +0 -36
- data/core/app/assets/javascripts/gaku/syllabuses.js.coffee +0 -26
- data/core/app/assets/stylesheets/gaku/gaku.css.scss +0 -172
- data/core/app/assets/stylesheets/gaku/gaku_core.css +0 -10
- data/core/app/assets/stylesheets/gaku/gaku_import.scss +0 -2
- data/core/app/controllers/concerns/polymorphic_resource_concern.rb +0 -47
- data/core/app/controllers/concerns/student_chooser_controller.rb +0 -52
- data/core/app/controllers/gaku/addresses_controller.rb +0 -105
- data/core/app/controllers/gaku/admin/achievements_controller.rb +0 -64
- data/core/app/controllers/gaku/admin/base_controller.rb +0 -40
- data/core/app/controllers/gaku/admin/grading_methods_controller.rb +0 -58
- data/core/app/controllers/gaku/admin/presets_controller.rb +0 -40
- data/core/app/controllers/gaku/admin/school_years/semesters_controller.rb +0 -31
- data/core/app/controllers/gaku/admin/school_years_controller.rb +0 -30
- data/core/app/controllers/gaku/admin/schools/campuses/addresses_controller.rb +0 -53
- data/core/app/controllers/gaku/admin/schools/campuses_controller.rb +0 -46
- data/core/app/controllers/gaku/admin/schools/programs_controller.rb +0 -48
- data/core/app/controllers/gaku/admin/schools_controller.rb +0 -59
- data/core/app/controllers/gaku/admin/specialties_controller.rb +0 -58
- data/core/app/controllers/gaku/admin/states_controller.rb +0 -49
- data/core/app/controllers/gaku/admin/templates_controller.rb +0 -49
- data/core/app/controllers/gaku/admin/users_controller.rb +0 -82
- data/core/app/controllers/gaku/attachments_controller.rb +0 -88
- data/core/app/controllers/gaku/attendances_controller.rb +0 -29
- data/core/app/controllers/gaku/class_groups/courses_controller.rb +0 -44
- data/core/app/controllers/gaku/class_groups/semester_class_groups_controller.rb +0 -38
- data/core/app/controllers/gaku/class_groups/students_controller.rb +0 -43
- data/core/app/controllers/gaku/class_groups_controller.rb +0 -59
- data/core/app/controllers/gaku/contacts_controller.rb +0 -103
- data/core/app/controllers/gaku/course_groups/course_group_enrollments_controller.rb +0 -50
- data/core/app/controllers/gaku/course_groups_controller.rb +0 -81
- data/core/app/controllers/gaku/courses/semester_courses_controller.rb +0 -37
- data/core/app/controllers/gaku/courses_controller.rb +0 -73
- data/core/app/controllers/gaku/devise/passwords_controller.rb +0 -4
- data/core/app/controllers/gaku/devise/registrations_controller.rb +0 -60
- data/core/app/controllers/gaku/devise/sessions_controller.rb +0 -4
- data/core/app/controllers/gaku/exam_portion_scores_controller.rb +0 -18
- data/core/app/controllers/gaku/exams/exam_portions/attachments_controller.rb +0 -53
- data/core/app/controllers/gaku/exams/exam_portions_controller.rb +0 -55
- data/core/app/controllers/gaku/exams_controller.rb +0 -140
- data/core/app/controllers/gaku/extracurricular_activities/students_controller.rb +0 -55
- data/core/app/controllers/gaku/extracurricular_activities_controller.rb +0 -48
- data/core/app/controllers/gaku/extracurricular_activity_enrollments_controller.rb +0 -10
- data/core/app/controllers/gaku/gaku_controller.rb +0 -93
- data/core/app/controllers/gaku/home_controller.rb +0 -10
- data/core/app/controllers/gaku/notes_controller.rb +0 -81
- data/core/app/controllers/gaku/schedules_controller.rb +0 -11
- data/core/app/controllers/gaku/students/class_group_enrollments_controller.rb +0 -59
- data/core/app/controllers/gaku/students/course_enrollments_controller.rb +0 -43
- data/core/app/controllers/gaku/students/guardians_controller.rb +0 -85
- data/core/app/controllers/gaku/students/simple_grades_controller.rb +0 -59
- data/core/app/controllers/gaku/students/student_achievements_controller.rb +0 -49
- data/core/app/controllers/gaku/students/student_specialties_controller.rb +0 -60
- data/core/app/controllers/gaku/students_controller.rb +0 -189
- data/core/app/controllers/gaku/syllabuses/exam_syllabuses_controller.rb +0 -38
- data/core/app/controllers/gaku/syllabuses/exams_controller.rb +0 -53
- data/core/app/controllers/gaku/syllabuses_controller.rb +0 -73
- data/core/app/controllers/gaku/teachers_controller.rb +0 -113
- data/core/app/helpers/gaku/autocomplete_helper.rb +0 -31
- data/core/app/helpers/gaku/count_helper.rb +0 -13
- data/core/app/helpers/gaku/flash_helper.rb +0 -16
- data/core/app/helpers/gaku/gaku_helper.rb +0 -138
- data/core/app/helpers/gaku/icon_helper.rb +0 -26
- data/core/app/helpers/gaku/person_helper.rb +0 -55
- data/core/app/helpers/gaku/presets_helper.rb +0 -41
- data/core/app/helpers/gaku/sort_helper.rb +0 -17
- data/core/app/helpers/gaku/student_chooser_helper.rb +0 -12
- data/core/app/helpers/gaku/students_helper.rb +0 -42
- data/core/app/helpers/gaku/translations_helper.rb +0 -181
- data/core/app/models/gaku/achievement.rb +0 -17
- data/core/app/models/gaku/student_achievement.rb +0 -10
- data/core/app/models/gaku/versioning/student_version.rb +0 -49
- data/core/app/views/gaku/addresses/_address.html.slim +0 -5
- data/core/app/views/gaku/addresses/_addresses.html.slim +0 -27
- data/core/app/views/gaku/addresses/_fields.html.slim +0 -14
- data/core/app/views/gaku/addresses/_form.html.slim +0 -3
- data/core/app/views/gaku/addresses/_form_fields.html.slim +0 -26
- data/core/app/views/gaku/addresses/_modal.html.slim +0 -6
- data/core/app/views/gaku/addresses/_primary_field.html.slim +0 -13
- data/core/app/views/gaku/addresses/create.js.erb +0 -12
- data/core/app/views/gaku/addresses/destroy.js.erb +0 -8
- data/core/app/views/gaku/addresses/soft_delete.js.erb +0 -8
- data/core/app/views/gaku/admin/achievements/_achievement.html.slim +0 -2
- data/core/app/views/gaku/admin/achievements/_fields.html.slim +0 -7
- data/core/app/views/gaku/admin/achievements/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/achievements/_form_fields.html.slim +0 -4
- data/core/app/views/gaku/admin/achievements/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/achievements/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/achievements/edit.js.erb +0 -3
- data/core/app/views/gaku/admin/achievements/index.html.slim +0 -22
- data/core/app/views/gaku/admin/achievements/new.js.erb +0 -3
- data/core/app/views/gaku/admin/attendance_types/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/attendance_types/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/attendance_types/create.js.erb +0 -7
- data/core/app/views/gaku/admin/attendance_types/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/attendance_types/index.html.slim +0 -24
- data/core/app/views/gaku/admin/attendance_types/new.js.erb +0 -4
- data/core/app/views/gaku/admin/changes/student_address_changes/_change.html.slim +0 -10
- data/core/app/views/gaku/admin/changes/student_address_changes/_deletion.html.slim +0 -9
- data/core/app/views/gaku/admin/changes/student_changes/_change.html.slim +0 -10
- data/core/app/views/gaku/admin/changes/student_changes/_deletion.html.slim +0 -9
- data/core/app/views/gaku/admin/changes/student_contact_changes/_change.html.slim +0 -10
- data/core/app/views/gaku/admin/changes/student_contact_changes/_deletion.html.slim +0 -9
- data/core/app/views/gaku/admin/commute_method_types/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/commute_method_types/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/commute_method_types/create.js.erb +0 -7
- data/core/app/views/gaku/admin/commute_method_types/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/commute_method_types/index.html.slim +0 -18
- data/core/app/views/gaku/admin/contact_types/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/contact_types/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/contact_types/create.js.erb +0 -7
- data/core/app/views/gaku/admin/contact_types/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/contact_types/index.html.slim +0 -18
- data/core/app/views/gaku/admin/disposals/_address.html.slim +0 -12
- data/core/app/views/gaku/admin/disposals/_contact.html.slim +0 -9
- data/core/app/views/gaku/admin/disposals/_course_groups.html.slim +0 -12
- data/core/app/views/gaku/admin/disposals/_exam.html.slim +0 -10
- data/core/app/views/gaku/admin/disposals/_student.html.slim +0 -10
- data/core/app/views/gaku/admin/disposals/_teacher.html.slim +0 -10
- data/core/app/views/gaku/admin/disposals/attachments.html.slim +0 -30
- data/core/app/views/gaku/admin/enrollment_statuses/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/enrollment_statuses/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/enrollment_statuses/create.js.erb +0 -7
- data/core/app/views/gaku/admin/enrollment_statuses/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/enrollment_statuses/index.html.slim +0 -21
- data/core/app/views/gaku/admin/grading_method_sets/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/grading_method_sets/_make_primary_field.html.slim +0 -4
- data/core/app/views/gaku/admin/grading_method_sets/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/grading_method_sets/create.js.erb +0 -7
- data/core/app/views/gaku/admin/grading_method_sets/destroy.js.erb +0 -7
- data/core/app/views/gaku/admin/grading_method_sets/edit.js.erb +0 -3
- data/core/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_items.html.slim +0 -23
- data/core/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/grading_method_sets/grading_method_set_items/create.js.erb +0 -7
- data/core/app/views/gaku/admin/grading_method_sets/grading_method_set_items/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/grading_method_sets/index.html.slim +0 -23
- data/core/app/views/gaku/admin/grading_method_sets/new.js.erb +0 -3
- data/core/app/views/gaku/admin/grading_method_sets/show.html.slim +0 -13
- data/core/app/views/gaku/admin/grading_method_sets/update.js.erb +0 -3
- data/core/app/views/gaku/admin/grading_methods/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/grading_methods/_form_fields.html.slim +0 -3
- data/core/app/views/gaku/admin/grading_methods/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/grading_methods/create.js.erb +0 -7
- data/core/app/views/gaku/admin/grading_methods/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/grading_methods/index.html.slim +0 -20
- data/core/app/views/gaku/admin/presets/defaults.html.slim +0 -50
- data/core/app/views/gaku/admin/presets/grading.html.slim +0 -12
- data/core/app/views/gaku/admin/presets/locale.html.slim +0 -10
- data/core/app/views/gaku/admin/presets/names.html.slim +0 -20
- data/core/app/views/gaku/admin/presets/output_formats.html.slim +0 -19
- data/core/app/views/gaku/admin/presets/pagination.html.slim +0 -19
- data/core/app/views/gaku/admin/presets/students.html.slim +0 -21
- data/core/app/views/gaku/admin/roles/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/roles/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/roles/create.js.erb +0 -7
- data/core/app/views/gaku/admin/roles/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/roles/edit.js.erb +0 -3
- data/core/app/views/gaku/admin/roles/index.html.slim +0 -20
- data/core/app/views/gaku/admin/school_years/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/school_years/_form_fields.html.slim +0 -5
- data/core/app/views/gaku/admin/school_years/_modal.html.slim +0 -7
- data/core/app/views/gaku/admin/school_years/create.js.erb +0 -10
- data/core/app/views/gaku/admin/school_years/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/school_years/edit.js.erb +0 -5
- data/core/app/views/gaku/admin/school_years/index.html.slim +0 -21
- data/core/app/views/gaku/admin/school_years/new.js.erb +0 -5
- data/core/app/views/gaku/admin/school_years/semesters/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/school_years/semesters/_form_fields.html.slim +0 -5
- data/core/app/views/gaku/admin/school_years/semesters/_modal.html.slim +0 -7
- data/core/app/views/gaku/admin/school_years/semesters/_semesters.html.slim +0 -22
- data/core/app/views/gaku/admin/school_years/semesters/create.js.erb +0 -10
- data/core/app/views/gaku/admin/school_years/semesters/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/school_years/semesters/edit.js.erb +0 -6
- data/core/app/views/gaku/admin/school_years/semesters/new.js.erb +0 -5
- data/core/app/views/gaku/admin/school_years/semesters/update.js.erb +0 -8
- data/core/app/views/gaku/admin/school_years/show.html.slim +0 -15
- data/core/app/views/gaku/admin/school_years/update.js.erb +0 -8
- data/core/app/views/gaku/admin/schools/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/schools/_form_fields.html.slim +0 -25
- data/core/app/views/gaku/admin/schools/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/schools/_school.html.slim +0 -2
- data/core/app/views/gaku/admin/schools/_school_unit.html.slim +0 -6
- data/core/app/views/gaku/admin/schools/_show_table.html.slim +0 -35
- data/core/app/views/gaku/admin/schools/campuses/_campus.html.slim +0 -7
- data/core/app/views/gaku/admin/schools/campuses/_campus_unit.html.slim +0 -6
- data/core/app/views/gaku/admin/schools/campuses/_campuses.html.slim +0 -20
- data/core/app/views/gaku/admin/schools/campuses/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/schools/campuses/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/schools/campuses/_picture.html.slim +0 -10
- data/core/app/views/gaku/admin/schools/campuses/_show_table.html.slim +0 -10
- data/core/app/views/gaku/admin/schools/campuses/_upload_picture.html.slim +0 -7
- data/core/app/views/gaku/admin/schools/campuses/addresses/_address.html.slim +0 -6
- data/core/app/views/gaku/admin/schools/campuses/addresses/_address_row_fields.html.slim +0 -4
- data/core/app/views/gaku/admin/schools/campuses/addresses/_addresses.html.slim +0 -24
- data/core/app/views/gaku/admin/schools/campuses/addresses/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/schools/campuses/addresses/_modal.html.slim +0 -7
- data/core/app/views/gaku/admin/schools/campuses/addresses/create.js.erb +0 -6
- data/core/app/views/gaku/admin/schools/campuses/addresses/edit.js.erb +0 -4
- data/core/app/views/gaku/admin/schools/campuses/addresses/new.js.erb +0 -4
- data/core/app/views/gaku/admin/schools/campuses/addresses/update.js.erb +0 -4
- data/core/app/views/gaku/admin/schools/campuses/create.js.erb +0 -7
- data/core/app/views/gaku/admin/schools/campuses/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/schools/campuses/edit.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/campuses/new.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/campuses/show.html.slim +0 -21
- data/core/app/views/gaku/admin/schools/campuses/update.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/create.js.erb +0 -7
- data/core/app/views/gaku/admin/schools/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/schools/edit.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/edit_master.html.slim +0 -17
- data/core/app/views/gaku/admin/schools/index.html.slim +0 -29
- data/core/app/views/gaku/admin/schools/new.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/programs/_fields.html.slim +0 -9
- data/core/app/views/gaku/admin/schools/programs/_form.html.slim +0 -20
- data/core/app/views/gaku/admin/schools/programs/_form_fields.html.slim +0 -6
- data/core/app/views/gaku/admin/schools/programs/_modal.html.slim +0 -5
- data/core/app/views/gaku/admin/schools/programs/_programs.html.slim +0 -25
- data/core/app/views/gaku/admin/schools/programs/create.js.erb +0 -7
- data/core/app/views/gaku/admin/schools/programs/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/schools/programs/edit.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/programs/new.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/programs/program_levels/_form_fields.html.slim +0 -8
- data/core/app/views/gaku/admin/schools/programs/program_levels/_modal.html.slim +0 -10
- data/core/app/views/gaku/admin/schools/programs/program_specialties/_form_fields.html.slim +0 -7
- data/core/app/views/gaku/admin/schools/programs/program_specialties/_modal.html.slim +0 -10
- data/core/app/views/gaku/admin/schools/programs/program_syllabuses/_form_fields.html.slim +0 -6
- data/core/app/views/gaku/admin/schools/programs/program_syllabuses/_modal.html.slim +0 -10
- data/core/app/views/gaku/admin/schools/programs/show_program_levels.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/programs/show_program_specialties.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/programs/show_program_syllabuses.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/programs/update.js.erb +0 -3
- data/core/app/views/gaku/admin/schools/show.html.slim +0 -26
- data/core/app/views/gaku/admin/schools/update.js.erb +0 -7
- data/core/app/views/gaku/admin/shared/_picture.html.slim +0 -10
- data/core/app/views/gaku/admin/shared/_upload_picture.html.slim +0 -7
- data/core/app/views/gaku/admin/specialties/_fields.html.slim +0 -6
- data/core/app/views/gaku/admin/specialties/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/specialties/_form_fields.html.slim +0 -3
- data/core/app/views/gaku/admin/specialties/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/specialties/create.js.erb +0 -7
- data/core/app/views/gaku/admin/specialties/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/specialties/index.html.slim +0 -20
- data/core/app/views/gaku/admin/states/_form.html.slim +0 -4
- data/core/app/views/gaku/admin/states/_form_fields.html.slim +0 -14
- data/core/app/views/gaku/admin/states/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/states/country_states.js.erb +0 -1
- data/core/app/views/gaku/admin/states/create.js.erb +0 -7
- data/core/app/views/gaku/admin/states/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/states/edit.js.erb +0 -3
- data/core/app/views/gaku/admin/states/index.html.slim +0 -15
- data/core/app/views/gaku/admin/states/new.js.erb +0 -3
- data/core/app/views/gaku/admin/states/update.js.erb +0 -3
- data/core/app/views/gaku/admin/templates/_fields.html.slim +0 -8
- data/core/app/views/gaku/admin/templates/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/templates/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/templates/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/templates/edit.js.erb +0 -4
- data/core/app/views/gaku/admin/templates/index.html.slim +0 -20
- data/core/app/views/gaku/admin/templates/new.js.erb +0 -3
- data/core/app/views/gaku/admin/users/_form.html.slim +0 -3
- data/core/app/views/gaku/admin/users/_modal.html.slim +0 -6
- data/core/app/views/gaku/admin/users/create.js.erb +0 -7
- data/core/app/views/gaku/admin/users/destroy.js.erb +0 -2
- data/core/app/views/gaku/admin/users/index.html.slim +0 -21
- data/core/app/views/gaku/attachments/edit.js.erb +0 -3
- data/core/app/views/gaku/attachments/soft_delete.js.erb +0 -3
- data/core/app/views/gaku/class_groups/_class_group.html.slim +0 -7
- data/core/app/views/gaku/class_groups/_class_group_modal.html.slim +0 -7
- data/core/app/views/gaku/class_groups/_class_group_unit.html.slim +0 -5
- data/core/app/views/gaku/class_groups/_class_groups.html.slim +0 -25
- data/core/app/views/gaku/class_groups/_form.html.slim +0 -8
- data/core/app/views/gaku/class_groups/_form_fields.html.slim +0 -6
- data/core/app/views/gaku/class_groups/_tabs.html.slim +0 -32
- data/core/app/views/gaku/class_groups/courses/_courses.html.slim +0 -19
- data/core/app/views/gaku/class_groups/courses/_form.html.slim +0 -5
- data/core/app/views/gaku/class_groups/courses/create.js.erb +0 -8
- data/core/app/views/gaku/class_groups/courses/destroy.js.erb +0 -3
- data/core/app/views/gaku/class_groups/create.js.erb +0 -6
- data/core/app/views/gaku/class_groups/destroy.js.erb +0 -6
- data/core/app/views/gaku/class_groups/edit.js.erb +0 -3
- data/core/app/views/gaku/class_groups/index.html.slim +0 -14
- data/core/app/views/gaku/class_groups/new.js.erb +0 -3
- data/core/app/views/gaku/class_groups/semester_class_groups/_form.html.slim +0 -4
- data/core/app/views/gaku/class_groups/semester_class_groups/_form_fields.html.slim +0 -3
- data/core/app/views/gaku/class_groups/semester_class_groups/_semester_modal.html.slim +0 -6
- data/core/app/views/gaku/class_groups/semester_class_groups/_semesters.html.slim +0 -19
- data/core/app/views/gaku/class_groups/semester_class_groups/create.js.erb +0 -6
- data/core/app/views/gaku/class_groups/semester_class_groups/destroy.js.erb +0 -3
- data/core/app/views/gaku/class_groups/semester_class_groups/edit.js.erb +0 -3
- data/core/app/views/gaku/class_groups/semester_class_groups/new.js.erb +0 -3
- data/core/app/views/gaku/class_groups/semester_class_groups/update.js.erb +0 -3
- data/core/app/views/gaku/class_groups/show.html.slim +0 -25
- data/core/app/views/gaku/class_groups/student_chooser.js.erb +0 -2
- data/core/app/views/gaku/class_groups/students/_students.html.slim +0 -19
- data/core/app/views/gaku/class_groups/students/destroy.js.erb +0 -3
- data/core/app/views/gaku/class_groups/students/enroll_students.js.erb +0 -17
- data/core/app/views/gaku/class_groups/students/new.js.erb +0 -3
- data/core/app/views/gaku/class_groups/update.js.erb +0 -8
- data/core/app/views/gaku/contacts/_contacts.html.slim +0 -24
- data/core/app/views/gaku/contacts/_fields.html.slim +0 -13
- data/core/app/views/gaku/contacts/_form.html.slim +0 -4
- data/core/app/views/gaku/contacts/_form_fields.html.slim +0 -14
- data/core/app/views/gaku/contacts/_modal.html.slim +0 -6
- data/core/app/views/gaku/contacts/_primary_field.html.slim +0 -13
- data/core/app/views/gaku/contacts/create.js.erb +0 -21
- data/core/app/views/gaku/contacts/destroy.js.erb +0 -9
- data/core/app/views/gaku/contacts/soft_delete.js.erb +0 -8
- data/core/app/views/gaku/course_groups/_course_group.html.slim +0 -3
- data/core/app/views/gaku/course_groups/_course_group_unit.html.slim +0 -4
- data/core/app/views/gaku/course_groups/_course_groups.html.slim +0 -7
- data/core/app/views/gaku/course_groups/_delete_confirm.html.slim +0 -11
- data/core/app/views/gaku/course_groups/_modal.html.slim +0 -6
- data/core/app/views/gaku/course_groups/course_group_enrollments/_courses.html.slim +0 -23
- data/core/app/views/gaku/course_groups/course_group_enrollments/_form.html.slim +0 -4
- data/core/app/views/gaku/course_groups/course_group_enrollments/create.js.erb +0 -7
- data/core/app/views/gaku/course_groups/course_group_enrollments/destroy.js.erb +0 -2
- data/core/app/views/gaku/course_groups/create.js.erb +0 -10
- data/core/app/views/gaku/course_groups/destroy.js.erb +0 -2
- data/core/app/views/gaku/course_groups/edit.js.erb +0 -3
- data/core/app/views/gaku/course_groups/index.html.slim +0 -15
- data/core/app/views/gaku/course_groups/index.js.erb +0 -1
- data/core/app/views/gaku/course_groups/new.js.erb +0 -3
- data/core/app/views/gaku/course_groups/recovery.js.erb +0 -2
- data/core/app/views/gaku/course_groups/show.html.slim +0 -30
- data/core/app/views/gaku/course_groups/update.js.erb +0 -7
- data/core/app/views/gaku/courses/_course.html.slim +0 -2
- data/core/app/views/gaku/courses/_course_unit.html.slim +0 -5
- data/core/app/views/gaku/courses/_courses.html.slim +0 -27
- data/core/app/views/gaku/courses/_form.html.slim +0 -7
- data/core/app/views/gaku/courses/_form_fields.html.slim +0 -4
- data/core/app/views/gaku/courses/_modal.html.slim +0 -6
- data/core/app/views/gaku/courses/_tabs.html.slim +0 -25
- data/core/app/views/gaku/courses/assignments/_assignments.html.slim +0 -2
- data/core/app/views/gaku/courses/create.js.erb +0 -7
- data/core/app/views/gaku/courses/destroy.js.erb +0 -7
- data/core/app/views/gaku/courses/edit.js.erb +0 -4
- data/core/app/views/gaku/courses/enrollments/_enrollments.html.slim +0 -29
- data/core/app/views/gaku/courses/enrollments/_errors_modal.html.slim +0 -11
- data/core/app/views/gaku/courses/enrollments/class_groups/_form.html.slim +0 -3
- data/core/app/views/gaku/courses/enrollments/class_groups/enroll.js.erb +0 -16
- data/core/app/views/gaku/courses/enrollments/error.js.erb +0 -2
- data/core/app/views/gaku/courses/enrollments/students/enroll_students.js.erb +0 -11
- data/core/app/views/gaku/courses/exams/_exams.html.slim +0 -14
- data/core/app/views/gaku/courses/index.html.slim +0 -14
- data/core/app/views/gaku/courses/new.js.erb +0 -3
- data/core/app/views/gaku/courses/semester_courses/_form.html.slim +0 -4
- data/core/app/views/gaku/courses/semester_courses/_form_fields.html.slim +0 -3
- data/core/app/views/gaku/courses/semester_courses/_modal.html.slim +0 -6
- data/core/app/views/gaku/courses/semester_courses/_semester_courses.html.slim +0 -18
- data/core/app/views/gaku/courses/semester_courses/create.js.erb +0 -6
- data/core/app/views/gaku/courses/semester_courses/destroy.js.erb +0 -3
- data/core/app/views/gaku/courses/semester_courses/edit.js.erb +0 -3
- data/core/app/views/gaku/courses/semester_courses/new.js.erb +0 -3
- data/core/app/views/gaku/courses/semester_courses/update.js.erb +0 -3
- data/core/app/views/gaku/courses/show.html.slim +0 -32
- data/core/app/views/gaku/courses/student_chooser.js.erb +0 -2
- data/core/app/views/gaku/courses/update.js.erb +0 -16
- data/core/app/views/gaku/devise/registrations/new.html.slim +0 -29
- data/core/app/views/gaku/devise/registrations/set_up_admin_account.html.slim +0 -27
- data/core/app/views/gaku/devise/sessions/new.html.slim +0 -27
- data/core/app/views/gaku/exams/_exam.html.slim +0 -2
- data/core/app/views/gaku/exams/_fields.html.slim +0 -8
- data/core/app/views/gaku/exams/_form.html.slim +0 -19
- data/core/app/views/gaku/exams/_form_fields.html.slim +0 -13
- data/core/app/views/gaku/exams/_modal.html.slim +0 -6
- data/core/app/views/gaku/exams/_show_table.html.slim +0 -15
- data/core/app/views/gaku/exams/_weight_check_widget.html.slim +0 -20
- data/core/app/views/gaku/exams/create.js.erb +0 -6
- data/core/app/views/gaku/exams/destroy.js.erb +0 -2
- data/core/app/views/gaku/exams/edit.js +0 -3
- data/core/app/views/gaku/exams/exam_portions/_custom_exam_portion_error.html.slim +0 -4
- data/core/app/views/gaku/exams/exam_portions/_exam_portion.html.slim +0 -3
- data/core/app/views/gaku/exams/exam_portions/_exam_portion_unit.html.slim +0 -3
- data/core/app/views/gaku/exams/exam_portions/_exam_portion_weight_td.html.slim +0 -3
- data/core/app/views/gaku/exams/exam_portions/_exam_portions.html.slim +0 -14
- data/core/app/views/gaku/exams/exam_portions/_form.html.slim +0 -3
- data/core/app/views/gaku/exams/exam_portions/_modal.html.slim +0 -8
- data/core/app/views/gaku/exams/exam_portions/_show_table.html.slim +0 -12
- data/core/app/views/gaku/exams/exam_portions/attachments/_attachments.html.slim +0 -23
- data/core/app/views/gaku/exams/exam_portions/attachments/_form.html.slim +0 -6
- data/core/app/views/gaku/exams/exam_portions/attachments/_modal.html.slim +0 -6
- data/core/app/views/gaku/exams/exam_portions/attachments/create.js.erb~HEAD +0 -0
- data/core/app/views/gaku/exams/exam_portions/attachments/create.js.erb~HEAD_0 +0 -0
- data/core/app/views/gaku/exams/exam_portions/attachments/create.js.erb~kagetsuki_master +0 -0
- data/core/app/views/gaku/exams/exam_portions/attachments/create.js.erb~kagetsuki_master_0 +0 -0
- data/core/app/views/gaku/exams/exam_portions/attachments/new.js.erb +0 -3
- data/core/app/views/gaku/exams/exam_portions/create.js.erb +0 -48
- data/core/app/views/gaku/exams/exam_portions/destroy.js.erb +0 -8
- data/core/app/views/gaku/exams/exam_portions/edit.js.erb +0 -3
- data/core/app/views/gaku/exams/exam_portions/new.js.erb +0 -3
- data/core/app/views/gaku/exams/exam_portions/show.html.slim +0 -8
- data/core/app/views/gaku/exams/exam_portions/update.js.erb +0 -27
- data/core/app/views/gaku/exams/grading.html.slim +0 -34
- data/core/app/views/gaku/exams/index.html.slim +0 -21
- data/core/app/views/gaku/exams/new.js.erb +0 -3
- data/core/app/views/gaku/exams/show.html.slim +0 -33
- data/core/app/views/gaku/exams/update.js.erb +0 -5
- data/core/app/views/gaku/extracurricular_activities/_extracurricular_activities.html.slim +0 -9
- data/core/app/views/gaku/extracurricular_activities/_extracurricular_activity.html.slim +0 -6
- data/core/app/views/gaku/extracurricular_activities/_form_fields.html.slim +0 -3
- data/core/app/views/gaku/extracurricular_activities/_modal.html.slim +0 -7
- data/core/app/views/gaku/extracurricular_activities/_tabs.html.slim +0 -14
- data/core/app/views/gaku/extracurricular_activities/create.js.erb +0 -6
- data/core/app/views/gaku/extracurricular_activities/destroy.js.erb +0 -2
- data/core/app/views/gaku/extracurricular_activities/edit.js.erb +0 -3
- data/core/app/views/gaku/extracurricular_activities/index.html.slim +0 -14
- data/core/app/views/gaku/extracurricular_activities/index.js.erb +0 -2
- data/core/app/views/gaku/extracurricular_activities/new.js.erb +0 -3
- data/core/app/views/gaku/extracurricular_activities/show.html.slim +0 -20
- data/core/app/views/gaku/extracurricular_activities/student_chooser.js.erb +0 -2
- data/core/app/views/gaku/extracurricular_activities/students/_students.html.slim +0 -19
- data/core/app/views/gaku/extracurricular_activities/students/destroy.js.erb +0 -3
- data/core/app/views/gaku/extracurricular_activities/students/enroll_students.js.erb +0 -11
- data/core/app/views/gaku/extracurricular_activities/update.js.erb +0 -6
- data/core/app/views/gaku/home/_user_info.html.slim +0 -7
- data/core/app/views/gaku/home/_user_menu.html.slim +0 -2
- data/core/app/views/gaku/home/index.html.slim +0 -13
- data/core/app/views/gaku/layouts/admin/index.html.slim +0 -15
- data/core/app/views/gaku/layouts/edit.html.slim +0 -9
- data/core/app/views/gaku/layouts/gaku.html.slim +0 -23
- data/core/app/views/gaku/layouts/index.html.slim +0 -14
- data/core/app/views/gaku/layouts/show.html.slim +0 -10
- data/core/app/views/gaku/notes/_buttons.html.slim +0 -5
- data/core/app/views/gaku/notes/_form.html.slim +0 -6
- data/core/app/views/gaku/notes/_form_fields.html.slim +0 -6
- data/core/app/views/gaku/notes/_modal.html.slim +0 -6
- data/core/app/views/gaku/notes/_notes.html.slim +0 -19
- data/core/app/views/gaku/notes/_show_modal.html.slim +0 -4
- data/core/app/views/gaku/notes/show.js.erb +0 -3
- data/core/app/views/gaku/shared/_delete_modal.html.slim +0 -7
- data/core/app/views/gaku/shared/_delete_modal_remote.html.slim +0 -7
- data/core/app/views/gaku/shared/_errors.html.slim +0 -6
- data/core/app/views/gaku/shared/_flash.html.slim +0 -4
- data/core/app/views/gaku/shared/_login_widget.html.slim +0 -27
- data/core/app/views/gaku/shared/_menubar.html.slim +0 -8
- data/core/app/views/gaku/shared/_modal_config.html.slim +0 -37
- data/core/app/views/gaku/shared/_multi_errors.html.slim +0 -6
- data/core/app/views/gaku/shared/_picture.html.slim +0 -12
- data/core/app/views/gaku/shared/_upload_picture.html.slim +0 -7
- data/core/app/views/gaku/shared/fields/_attachment_fields.html.slim +0 -10
- data/core/app/views/gaku/shared/fields/_exam_portion_fields.html.slim +0 -8
- data/core/app/views/gaku/shared/fields/_person_fields.html.slim +0 -4
- data/core/app/views/gaku/shared/fields/_person_show_table.html.slim +0 -3
- data/core/app/views/gaku/shared/fields/_student_fields.html.slim +0 -22
- data/core/app/views/gaku/shared/fields/_syllabus_fields.html.slim +0 -5
- data/core/app/views/gaku/shared/form_fields/_exam_portion_form_fields.html.slim +0 -15
- data/core/app/views/gaku/shared/form_fields/_person_form_fields.html.slim +0 -16
- data/core/app/views/gaku/shared/menu/_admin.html.erb +0 -104
- data/core/app/views/gaku/shared/student/_academic.html.slim +0 -18
- data/core/app/views/gaku/shared/student/_edit.html.slim +0 -20
- data/core/app/views/gaku/shared/student/_personal.html.slim +0 -6
- data/core/app/views/gaku/shared/student/_show.html.slim +0 -14
- data/core/app/views/gaku/shared/student/_show_table.html.slim +0 -51
- data/core/app/views/gaku/shared/student/_tabs.html.slim +0 -36
- data/core/app/views/gaku/shared/student_chooser/_chooser.html.slim +0 -36
- data/core/app/views/gaku/shared/student_chooser/_class_group.html.slim +0 -5
- data/core/app/views/gaku/shared/student_chooser/_course.html.slim +0 -5
- data/core/app/views/gaku/shared/student_chooser/_extracurricular_activity.html.slim +0 -5
- data/core/app/views/gaku/shared/student_chooser/_modal.html.slim +0 -4
- data/core/app/views/gaku/shared/student_chooser/_student.html.slim +0 -18
- data/core/app/views/gaku/students/_delete_modal.html.slim +0 -5
- data/core/app/views/gaku/students/_form.html.slim +0 -3
- data/core/app/views/gaku/students/_form_fields.html.slim +0 -19
- data/core/app/views/gaku/students/_modal.html.slim +0 -6
- data/core/app/views/gaku/students/_student.html.slim +0 -6
- data/core/app/views/gaku/students/_student_unit.html.slim +0 -5
- data/core/app/views/gaku/students/_students.html.slim +0 -17
- data/core/app/views/gaku/students/class_group_enrollments/_new_modal.html.slim +0 -28
- data/core/app/views/gaku/students/class_group_enrollments/create.js.erb +0 -11
- data/core/app/views/gaku/students/class_group_enrollments/new.js.erb +0 -2
- data/core/app/views/gaku/students/commute_methods/_commute_method.html.slim +0 -6
- data/core/app/views/gaku/students/commute_methods/_modal.html.slim +0 -6
- data/core/app/views/gaku/students/commute_methods/create.js.erb +0 -3
- data/core/app/views/gaku/students/commute_methods/edit.js.erb +0 -5
- data/core/app/views/gaku/students/commute_methods/new.js.erb +0 -4
- data/core/app/views/gaku/students/commute_methods/update.js.erb +0 -3
- data/core/app/views/gaku/students/course_enrollments/_course_enrollment.html.slim +0 -5
- data/core/app/views/gaku/students/course_enrollments/_course_enrollment_unit.html.slim +0 -3
- data/core/app/views/gaku/students/course_enrollments/_course_enrollments.html.slim +0 -21
- data/core/app/views/gaku/students/course_enrollments/_errors_modal.html.slim +0 -11
- data/core/app/views/gaku/students/course_enrollments/_form.html.slim +0 -5
- data/core/app/views/gaku/students/course_enrollments/create.js.erb +0 -10
- data/core/app/views/gaku/students/course_enrollments/destroy.js.erb +0 -3
- data/core/app/views/gaku/students/course_enrollments/error.js.erb +0 -2
- data/core/app/views/gaku/students/course_enrollments/new.js.erb +0 -3
- data/core/app/views/gaku/students/create.js.erb +0 -8
- data/core/app/views/gaku/students/destroy.js.erb +0 -2
- data/core/app/views/gaku/students/edit.html.slim +0 -9
- data/core/app/views/gaku/students/edit.js.erb +0 -3
- data/core/app/views/gaku/students/guardians/_edit_table.html.slim +0 -9
- data/core/app/views/gaku/students/guardians/_form.html.slim +0 -3
- data/core/app/views/gaku/students/guardians/_form_fields.html.slim +0 -4
- data/core/app/views/gaku/students/guardians/_guardian.html.slim +0 -2
- data/core/app/views/gaku/students/guardians/_guardian_unit.html.slim +0 -12
- data/core/app/views/gaku/students/guardians/_guardians.html.slim +0 -26
- data/core/app/views/gaku/students/guardians/_modal.html.slim +0 -7
- data/core/app/views/gaku/students/guardians/_picture.html.slim +0 -12
- data/core/app/views/gaku/students/guardians/_show_table.html.slim +0 -13
- data/core/app/views/gaku/students/guardians/_tabs.html.slim +0 -15
- data/core/app/views/gaku/students/guardians/_upload_picture.html.slim +0 -7
- data/core/app/views/gaku/students/guardians/create.js.erb +0 -7
- data/core/app/views/gaku/students/guardians/destroy.js.erb +0 -4
- data/core/app/views/gaku/students/guardians/edit.html.slim +0 -7
- data/core/app/views/gaku/students/guardians/edit.js.erb +0 -3
- data/core/app/views/gaku/students/guardians/new.js.erb +0 -3
- data/core/app/views/gaku/students/guardians/show.html.slim +0 -14
- data/core/app/views/gaku/students/guardians/update.js.erb +0 -4
- data/core/app/views/gaku/students/index.html.slim +0 -16
- data/core/app/views/gaku/students/index.js.erb +0 -13
- data/core/app/views/gaku/students/index.pdf.thinreports +0 -17
- data/core/app/views/gaku/students/new.js.erb +0 -3
- data/core/app/views/gaku/students/search/_address.html.slim +0 -36
- data/core/app/views/gaku/students/search/_extended.slim +0 -134
- data/core/app/views/gaku/students/search/_form.html.slim +0 -25
- data/core/app/views/gaku/students/search/_student.html.slim +0 -24
- data/core/app/views/gaku/students/show.html.slim +0 -1
- data/core/app/views/gaku/students/show.pdf.thinreports +0 -8
- data/core/app/views/gaku/students/simple_grades/_edit.html.slim +0 -8
- data/core/app/views/gaku/students/simple_grades/_fields.html.slim +0 -6
- data/core/app/views/gaku/students/simple_grades/_form.html.slim +0 -6
- data/core/app/views/gaku/students/simple_grades/_form_fields.html.slim +0 -3
- data/core/app/views/gaku/students/simple_grades/_index.html.slim +0 -19
- data/core/app/views/gaku/students/simple_grades/_index_modal.html.slim +0 -4
- data/core/app/views/gaku/students/simple_grades/_simple_grade.html.slim +0 -3
- data/core/app/views/gaku/students/simple_grades/_simple_grades.html.slim +0 -2
- data/core/app/views/gaku/students/simple_grades/create.js.erb +0 -10
- data/core/app/views/gaku/students/simple_grades/destroy.js.erb +0 -4
- data/core/app/views/gaku/students/simple_grades/edit.js.erb +0 -2
- data/core/app/views/gaku/students/simple_grades/index.js.erb +0 -5
- data/core/app/views/gaku/students/simple_grades/new.js.erb +0 -3
- data/core/app/views/gaku/students/simple_grades/update.js.erb +0 -4
- data/core/app/views/gaku/students/student_achievements/_achievements_tab.html.slim +0 -12
- data/core/app/views/gaku/students/student_achievements/_edit.html.slim +0 -8
- data/core/app/views/gaku/students/student_achievements/_fields.html.slim +0 -8
- data/core/app/views/gaku/students/student_achievements/_form.html.slim +0 -6
- data/core/app/views/gaku/students/student_achievements/_form_fields.html.slim +0 -1
- data/core/app/views/gaku/students/student_achievements/_index.html.slim +0 -20
- data/core/app/views/gaku/students/student_achievements/_index_modal.html.slim +0 -4
- data/core/app/views/gaku/students/student_achievements/_student_achievement.html.slim +0 -3
- data/core/app/views/gaku/students/student_achievements/_student_achievements.html.slim +0 -2
- data/core/app/views/gaku/students/student_achievements/create.js.erb +0 -10
- data/core/app/views/gaku/students/student_achievements/destroy.js.erb +0 -4
- data/core/app/views/gaku/students/student_achievements/edit.js.erb +0 -2
- data/core/app/views/gaku/students/student_achievements/index.js.erb +0 -3
- data/core/app/views/gaku/students/student_achievements/new.js.erb +0 -3
- data/core/app/views/gaku/students/student_achievements/update.js.erb +0 -5
- data/core/app/views/gaku/students/student_specialties/_edit.html.slim +0 -8
- data/core/app/views/gaku/students/student_specialties/_fields.html.slim +0 -5
- data/core/app/views/gaku/students/student_specialties/_form.html.slim +0 -6
- data/core/app/views/gaku/students/student_specialties/_form_fields.html.slim +0 -2
- data/core/app/views/gaku/students/student_specialties/_index.html.slim +0 -18
- data/core/app/views/gaku/students/student_specialties/_index_modal.html.slim +0 -4
- data/core/app/views/gaku/students/student_specialties/_specialties_list.html.slim +0 -0
- data/core/app/views/gaku/students/student_specialties/_student_specialties.html.slim +0 -2
- data/core/app/views/gaku/students/student_specialties/_student_specialty.html.slim +0 -3
- data/core/app/views/gaku/students/student_specialties/create.js.erb +0 -11
- data/core/app/views/gaku/students/student_specialties/destroy.js.erb +0 -5
- data/core/app/views/gaku/students/student_specialties/edit.js.erb +0 -2
- data/core/app/views/gaku/students/student_specialties/index.js.erb +0 -5
- data/core/app/views/gaku/students/student_specialties/new.js.erb +0 -3
- data/core/app/views/gaku/students/student_specialties/update.js.erb +0 -4
- data/core/app/views/gaku/students/update.js.erb +0 -3
- data/core/app/views/gaku/syllabuses/_form_fields.html.slim +0 -10
- data/core/app/views/gaku/syllabuses/_modal.html.slim +0 -7
- data/core/app/views/gaku/syllabuses/_syllabus.html.slim +0 -2
- data/core/app/views/gaku/syllabuses/_syllabus_fields.html.slim +0 -4
- data/core/app/views/gaku/syllabuses/_syllabuses.html.slim +0 -11
- data/core/app/views/gaku/syllabuses/assignments/_assignment.html.slim +0 -9
- data/core/app/views/gaku/syllabuses/assignments/_assignments.html.slim +0 -19
- data/core/app/views/gaku/syllabuses/assignments/_form.html.slim +0 -17
- data/core/app/views/gaku/syllabuses/assignments/create.js.erb +0 -7
- data/core/app/views/gaku/syllabuses/create.js.erb +0 -7
- data/core/app/views/gaku/syllabuses/destroy.js.erb +0 -2
- data/core/app/views/gaku/syllabuses/edit.html.slim +0 -59
- data/core/app/views/gaku/syllabuses/edit.js.erb +0 -3
- data/core/app/views/gaku/syllabuses/exam_syllabuses/create.js.erb +0 -11
- data/core/app/views/gaku/syllabuses/exam_syllabuses/destroy.js.erb +0 -6
- data/core/app/views/gaku/syllabuses/exams/_exam.html.slim +0 -4
- data/core/app/views/gaku/syllabuses/exams/_exams.html.slim +0 -16
- data/core/app/views/gaku/syllabuses/exams/_fields.html.slim +0 -9
- data/core/app/views/gaku/syllabuses/exams/_form.html.slim +0 -15
- data/core/app/views/gaku/syllabuses/exams/_form_fields.html.slim +0 -10
- data/core/app/views/gaku/syllabuses/exams/_modal.html.slim +0 -6
- data/core/app/views/gaku/syllabuses/exams/_select_form.html.slim +0 -6
- data/core/app/views/gaku/syllabuses/exams/create.js.erb +0 -10
- data/core/app/views/gaku/syllabuses/exams/destroy.js.erb +0 -2
- data/core/app/views/gaku/syllabuses/exams/edit.js.erb +0 -3
- data/core/app/views/gaku/syllabuses/exams/new.js.erb +0 -3
- data/core/app/views/gaku/syllabuses/exams/update.js.erb +0 -4
- data/core/app/views/gaku/syllabuses/index.html.slim +0 -14
- data/core/app/views/gaku/syllabuses/update.js.erb +0 -4
- data/core/app/views/gaku/teachers/_delete_modal.html.slim +0 -5
- data/core/app/views/gaku/teachers/_edit_table.html.slim +0 -5
- data/core/app/views/gaku/teachers/_fields.html.slim +0 -1
- data/core/app/views/gaku/teachers/_form.html.slim +0 -3
- data/core/app/views/gaku/teachers/_modal.html.slim +0 -6
- data/core/app/views/gaku/teachers/_show_table.html.slim +0 -7
- data/core/app/views/gaku/teachers/_tabs.html.slim +0 -21
- data/core/app/views/gaku/teachers/_teacher.html.slim +0 -6
- data/core/app/views/gaku/teachers/_teacher_unit.html.slim +0 -4
- data/core/app/views/gaku/teachers/_teachers.html.slim +0 -11
- data/core/app/views/gaku/teachers/create.js.erb +0 -8
- data/core/app/views/gaku/teachers/destroy.js.erb +0 -2
- data/core/app/views/gaku/teachers/edit.html.slim +0 -23
- data/core/app/views/gaku/teachers/edit.js.erb +0 -3
- data/core/app/views/gaku/teachers/index.html.slim +0 -16
- data/core/app/views/gaku/teachers/index.js.erb +0 -2
- data/core/app/views/gaku/teachers/new.js.erb +0 -3
- data/core/app/views/gaku/teachers/show.html.slim +0 -14
- data/core/app/views/gaku/teachers/update.js.erb +0 -4
- data/core/app/views/kaminari/_paginator.html.erb +0 -25
- data/core/config/initializers/mime_types.rb +0 -1
- data/core/config/initializers/ruby_template_handler.rb +0 -1
- data/core/db/migrate/20120202111850_translated_tables.rb +0 -52
- data/core/db/migrate/20131014065028_gaku_core.rb +0 -685
- data/core/lib/gaku/core/version.rb +0 -5
- data/core/lib/gaku/testing/env.rb +0 -10
- data/core/lib/gaku/testing/factories/achievement_factory.rb +0 -12
- data/core/lib/gaku/testing/factories/student_achievement_factory.rb +0 -8
- data/core/lib/gaku/testing/flash_helpers.rb +0 -35
- data/core/lib/gaku/testing/request_helpers.rb +0 -212
- data/core/lib/generators/gaku/install/templates/app/assets/javascripts/gaku/all.js +0 -14
- data/core/lib/generators/gaku/install/templates/app/assets/stylesheets/gaku/all.css +0 -12
- data/core/log/.gitkeep +0 -0
- data/core/script/rails +0 -9
- data/core/spec/controllers/gaku/addresses_controller_spec.rb +0 -262
- data/core/spec/controllers/gaku/admin/achievements_controller_spec.rb +0 -139
- data/core/spec/controllers/gaku/admin/disposals_controller_spec.rb +0 -177
- data/core/spec/controllers/gaku/admin/grading/grading_method_set_items_controller_spec.rb +0 -165
- data/core/spec/controllers/gaku/admin/grading/grading_method_sets_controller_spec.rb +0 -183
- data/core/spec/controllers/gaku/admin/grading/grading_methods_controller_spec.rb +0 -154
- data/core/spec/controllers/gaku/admin/presets_controller_spec.rb +0 -44
- data/core/spec/controllers/gaku/admin/roles_controller_spec.rb +0 -154
- data/core/spec/controllers/gaku/admin/schools/campuses/campuses_controller_spec.rb +0 -94
- data/core/spec/controllers/gaku/admin/schools/schools_controller_spec.rb +0 -129
- data/core/spec/controllers/gaku/admin/specialties_controller_spec.rb +0 -154
- data/core/spec/controllers/gaku/admin/templates_controller_spec.rb +0 -118
- data/core/spec/controllers/gaku/admin/types_and_methods/attendance_types_controller_spec.rb +0 -176
- data/core/spec/controllers/gaku/admin/types_and_methods/commute_method_types_controller_spec.rb +0 -154
- data/core/spec/controllers/gaku/admin/types_and_methods/contact_types_controller_spec.rb +0 -154
- data/core/spec/controllers/gaku/admin/types_and_methods/enrollment_statuses_controller_spec.rb +0 -153
- data/core/spec/controllers/gaku/admin/users_controller_spec.rb +0 -154
- data/core/spec/controllers/gaku/class_group_enrollments_controller_spec.rb +0 -62
- data/core/spec/controllers/gaku/class_groups/class_groups_controller_spec.rb +0 -129
- data/core/spec/controllers/gaku/contacts_controller_spec.rb +0 -250
- data/core/spec/controllers/gaku/course_groups/course_groups_controller_spec.rb +0 -75
- data/core/spec/controllers/gaku/courses/courses_controller_spec.rb +0 -79
- data/core/spec/controllers/gaku/exams/exams_controller_spec.rb +0 -156
- data/core/spec/controllers/gaku/notes_controller_spec.rb +0 -143
- data/core/spec/controllers/gaku/students/guardians_controller_spec.rb +0 -62
- data/core/spec/controllers/gaku/students/students_controller_spec.rb +0 -243
- data/core/spec/controllers/gaku/syllabuses_controller_spec.rb +0 -140
- data/core/spec/controllers/gaku/teachers_controller_spec.rb +0 -190
- data/core/spec/integration/student_versioning_spec.rb +0 -93
- data/core/spec/models/achievement_spec.rb +0 -21
- data/core/spec/models/student_achievement_spec.rb +0 -15
- data/core/spec/requests/admin/achievements/achievements_spec.rb +0 -73
- data/core/spec/requests/admin/changes_and_deletions/students_spec.rb +0 -47
- data/core/spec/requests/admin/disposals/student_disposals_spec.rb +0 -50
- data/core/spec/requests/admin/disposals/teacher_disposals_spec.rb +0 -50
- data/core/spec/requests/admin/grading/grading_method_set_items_spec.rb +0 -86
- data/core/spec/requests/admin/grading/grading_method_sets_spec.rb +0 -118
- data/core/spec/requests/admin/grading/grading_methods_spec.rb +0 -74
- data/core/spec/requests/admin/presets/defaults_preset_spec.rb +0 -21
- data/core/spec/requests/admin/presets/grading_preset_spec.rb +0 -22
- data/core/spec/requests/admin/presets/locale_preset_spec.rb +0 -22
- data/core/spec/requests/admin/presets/names_preset_spec.rb +0 -21
- data/core/spec/requests/admin/presets/output_formats_spec.rb +0 -30
- data/core/spec/requests/admin/presets/pagination_preset_spec.rb +0 -23
- data/core/spec/requests/admin/presets/student_preset_spec.rb +0 -28
- data/core/spec/requests/admin/roles_spec.rb +0 -86
- data/core/spec/requests/admin/school_years/school_years_spec.rb +0 -125
- data/core/spec/requests/admin/school_years/semesters_spec.rb +0 -167
- data/core/spec/requests/admin/schools/campuses/addresses_spec.rb +0 -116
- data/core/spec/requests/admin/schools/campuses/campuses_spec.rb +0 -90
- data/core/spec/requests/admin/schools/campuses/contacts_spec.rb +0 -49
- data/core/spec/requests/admin/schools/campuses/picture_spec.rb +0 -19
- data/core/spec/requests/admin/schools/picture_spec.rb +0 -21
- data/core/spec/requests/admin/schools/programs_spec.rb +0 -125
- data/core/spec/requests/admin/schools/school_details_spec.rb +0 -22
- data/core/spec/requests/admin/schools/school_levels_spec.rb +0 -82
- data/core/spec/requests/admin/schools/schools_spec.rb +0 -138
- data/core/spec/requests/admin/specialties_spec.rb +0 -73
- data/core/spec/requests/admin/templates_spec.rb +0 -97
- data/core/spec/requests/admin/types_and_methods/attendance_types_spec.rb +0 -80
- data/core/spec/requests/admin/types_and_methods/commute_method_types_spec.rb +0 -75
- data/core/spec/requests/admin/types_and_methods/contact_types_spec.rb +0 -74
- data/core/spec/requests/admin/types_and_methods/enrollment_statuses_spec.rb +0 -75
- data/core/spec/requests/admin/types_and_methods/states_spec.rb +0 -110
- data/core/spec/requests/admin/users_spec.rb +0 -91
- data/core/spec/requests/class_groups/class_groups_spec.rb +0 -171
- data/core/spec/requests/class_groups/courses_spec.rb +0 -40
- data/core/spec/requests/class_groups/notes_spec.rb +0 -30
- data/core/spec/requests/class_groups/semester_class_groups_spec.rb +0 -111
- data/core/spec/requests/class_groups/students_spec.rb +0 -92
- data/core/spec/requests/course_groups/course_groups_spec.rb +0 -122
- data/core/spec/requests/course_groups/courses_spec.rb +0 -38
- data/core/spec/requests/courses/courses_spec.rb +0 -167
- data/core/spec/requests/courses/enrollments/class_groups_spec.rb +0 -86
- data/core/spec/requests/courses/enrollments/students_spec.rb +0 -63
- data/core/spec/requests/courses/exams_spec.rb +0 -36
- data/core/spec/requests/courses/notes_spec.rb +0 -30
- data/core/spec/requests/courses/semester_courses_spec.rb +0 -119
- data/core/spec/requests/exams/exam_portions/attachments_spec.rb +0 -147
- data/core/spec/requests/exams/exam_portions/exam_portions_spec.rb +0 -113
- data/core/spec/requests/exams/exams_spec.rb +0 -141
- data/core/spec/requests/exams/notes_spec.rb +0 -30
- data/core/spec/requests/extracurricular_activities/extracurricular_activities_spec.rb +0 -87
- data/core/spec/requests/extracurricular_activities/students_spec.rb +0 -120
- data/core/spec/requests/sign_in_spec.rb +0 -78
- data/core/spec/requests/sign_up_spec.rb +0 -75
- data/core/spec/requests/students/achievements_spec.rb +0 -82
- data/core/spec/requests/students/addresses_spec.rb +0 -61
- data/core/spec/requests/students/class_group_enrollments_spec.rb +0 -47
- data/core/spec/requests/students/contacts_spec.rb +0 -60
- data/core/spec/requests/students/course_enrollments_spec.rb +0 -39
- data/core/spec/requests/students/guardians/addresses_spec.rb +0 -65
- data/core/spec/requests/students/guardians/contacts_spec.rb +0 -59
- data/core/spec/requests/students/guardians/guardians_spec.rb +0 -89
- data/core/spec/requests/students/guardians/picture_spec.rb +0 -23
- data/core/spec/requests/students/notes_spec.rb +0 -33
- data/core/spec/requests/students/picture_spec.rb +0 -21
- data/core/spec/requests/students/simple_grades_spec.rb +0 -85
- data/core/spec/requests/students/specialties_spec.rb +0 -91
- data/core/spec/requests/students/students_spec.rb +0 -127
- data/core/spec/requests/syllabuses/exams_spec.rb +0 -168
- data/core/spec/requests/syllabuses/notes_spec.rb +0 -30
- data/core/spec/requests/syllabuses/syllabuses_spec.rb +0 -104
- data/core/spec/requests/teachers/addresses_spec.rb +0 -60
- data/core/spec/requests/teachers/picture_spec.rb +0 -21
- data/core/spec/requests/teachers/teachers_spec.rb +0 -114
- data/core/spec/routing/student_routes_spec.rb +0 -73
- data/core/spec/spec_helper.rb +0 -86
- data/core/spec/support/requests/avatarable_spec.rb +0 -16
- data/core/spec/support/requests/course_enrollable_spec.rb +0 -72
- data/core/spec/support/requests/shared_addresses_spec.rb +0 -175
- data/core/spec/support/requests/shared_contacts_spec.rb +0 -121
- data/core/spec/support/requests/shared_notes_spec.rb +0 -83
- data/core/vendor/assets/javascripts/backbone.js +0 -1431
- data/core/vendor/assets/javascripts/tablefix.js.coffee +0 -109
- data/gaku_dependencies.rb +0 -16
- data/sample/db/sample/gaku/achievements.rb +0 -12
- data/sample/db/sample/gaku/courses.rb +0 -9
- data/sample/db/sample/gaku/syllabuses.rb +0 -130
@@ -1,83 +0,0 @@
|
|
1
|
-
shared_examples_for 'new note' do
|
2
|
-
|
3
|
-
context 'new' do
|
4
|
-
|
5
|
-
before do
|
6
|
-
click new_link
|
7
|
-
wait_until_visible submit
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'adds and shows', js: true do
|
11
|
-
expect do
|
12
|
-
expect do
|
13
|
-
fill_in 'note_title', with: 'The note title'
|
14
|
-
fill_in 'note_content', with: 'The note content'
|
15
|
-
click submit
|
16
|
-
flash_created?
|
17
|
-
end.to change(Gaku::Note, :count).by(1)
|
18
|
-
end.to change(@resource.notes, :count).by(1)
|
19
|
-
|
20
|
-
has_content? 'The note title'
|
21
|
-
has_content? 'The note content'
|
22
|
-
count? 'Notes list(1)'
|
23
|
-
if page.has_css?(tab_link)
|
24
|
-
within(tab_link) { has_content? 'Notes(1)' }
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'has validations', js: true do
|
29
|
-
has_validations?
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
shared_examples_for 'edit note' do
|
36
|
-
|
37
|
-
let(:note) { @resource.notes.first }
|
38
|
-
|
39
|
-
before do
|
40
|
-
within(table) { click js_edit_link }
|
41
|
-
wait_until_visible modal
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'edits', js:true do
|
45
|
-
old_note = note.title
|
46
|
-
fill_in 'note_title', with: 'Edited note title'
|
47
|
-
fill_in 'note_content', with: 'Edited note content'
|
48
|
-
click submit
|
49
|
-
|
50
|
-
flash_updated?
|
51
|
-
has_content? 'Edited note title'
|
52
|
-
has_content? 'Edited note content'
|
53
|
-
has_no_content? old_note
|
54
|
-
expect(@resource.notes.first.reload.title).to eq 'Edited note title'
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'errors without required fields', js:true do
|
58
|
-
fill_in 'note_title', with: ''
|
59
|
-
has_validations?
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
shared_examples_for 'delete note' do
|
64
|
-
|
65
|
-
it 'deletes', js: true do
|
66
|
-
note_field = @resource.notes.first.title
|
67
|
-
|
68
|
-
count? 'Notes list(1)'
|
69
|
-
has_content? note_field
|
70
|
-
|
71
|
-
expect do
|
72
|
-
ensure_delete_is_working
|
73
|
-
flash_destroyed?
|
74
|
-
end.to change(@resource.notes, :count).by(-1)
|
75
|
-
|
76
|
-
within(count_div) { has_no_content? 'Notes list(1)' }
|
77
|
-
if page.has_css?(tab_link)
|
78
|
-
within(tab_link) { has_no_content? 'Notes(1)' }
|
79
|
-
end
|
80
|
-
has_no_content? note_field
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
@@ -1,1431 +0,0 @@
|
|
1
|
-
// Backbone.js 0.9.2
|
2
|
-
|
3
|
-
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
4
|
-
// Backbone may be freely distributed under the MIT license.
|
5
|
-
// For all details and documentation:
|
6
|
-
// http://backbonejs.org
|
7
|
-
|
8
|
-
(function(){
|
9
|
-
|
10
|
-
// Initial Setup
|
11
|
-
// -------------
|
12
|
-
|
13
|
-
// Save a reference to the global object (`window` in the browser, `global`
|
14
|
-
// on the server).
|
15
|
-
var root = this;
|
16
|
-
|
17
|
-
// Save the previous value of the `Backbone` variable, so that it can be
|
18
|
-
// restored later on, if `noConflict` is used.
|
19
|
-
var previousBackbone = root.Backbone;
|
20
|
-
|
21
|
-
// Create a local reference to slice/splice.
|
22
|
-
var slice = Array.prototype.slice;
|
23
|
-
var splice = Array.prototype.splice;
|
24
|
-
|
25
|
-
// The top-level namespace. All public Backbone classes and modules will
|
26
|
-
// be attached to this. Exported for both CommonJS and the browser.
|
27
|
-
var Backbone;
|
28
|
-
if (typeof exports !== 'undefined') {
|
29
|
-
Backbone = exports;
|
30
|
-
} else {
|
31
|
-
Backbone = root.Backbone = {};
|
32
|
-
}
|
33
|
-
|
34
|
-
// Current version of the library. Keep in sync with `package.json`.
|
35
|
-
Backbone.VERSION = '0.9.2';
|
36
|
-
|
37
|
-
// Require Underscore, if we're on the server, and it's not already present.
|
38
|
-
var _ = root._;
|
39
|
-
if (!_ && (typeof require !== 'undefined')) _ = require('underscore');
|
40
|
-
|
41
|
-
// For Backbone's purposes, jQuery, Zepto, or Ender owns the `$` variable.
|
42
|
-
var $ = root.jQuery || root.Zepto || root.ender;
|
43
|
-
|
44
|
-
// Set the JavaScript library that will be used for DOM manipulation and
|
45
|
-
// Ajax calls (a.k.a. the `$` variable). By default Backbone will use: jQuery,
|
46
|
-
// Zepto, or Ender; but the `setDomLibrary()` method lets you inject an
|
47
|
-
// alternate JavaScript library (or a mock library for testing your views
|
48
|
-
// outside of a browser).
|
49
|
-
Backbone.setDomLibrary = function(lib) {
|
50
|
-
$ = lib;
|
51
|
-
};
|
52
|
-
|
53
|
-
// Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
|
54
|
-
// to its previous owner. Returns a reference to this Backbone object.
|
55
|
-
Backbone.noConflict = function() {
|
56
|
-
root.Backbone = previousBackbone;
|
57
|
-
return this;
|
58
|
-
};
|
59
|
-
|
60
|
-
// Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
|
61
|
-
// will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and
|
62
|
-
// set a `X-Http-Method-Override` header.
|
63
|
-
Backbone.emulateHTTP = false;
|
64
|
-
|
65
|
-
// Turn on `emulateJSON` to support legacy servers that can't deal with direct
|
66
|
-
// `application/json` requests ... will encode the body as
|
67
|
-
// `application/x-www-form-urlencoded` instead and will send the model in a
|
68
|
-
// form param named `model`.
|
69
|
-
Backbone.emulateJSON = false;
|
70
|
-
|
71
|
-
// Backbone.Events
|
72
|
-
// -----------------
|
73
|
-
|
74
|
-
// Regular expression used to split event strings
|
75
|
-
var eventSplitter = /\s+/;
|
76
|
-
|
77
|
-
// A module that can be mixed in to *any object* in order to provide it with
|
78
|
-
// custom events. You may bind with `on` or remove with `off` callback functions
|
79
|
-
// to an event; trigger`-ing an event fires all callbacks in succession.
|
80
|
-
//
|
81
|
-
// var object = {};
|
82
|
-
// _.extend(object, Backbone.Events);
|
83
|
-
// object.on('expand', function(){ alert('expanded'); });
|
84
|
-
// object.trigger('expand');
|
85
|
-
//
|
86
|
-
var Events = Backbone.Events = {
|
87
|
-
|
88
|
-
// Bind one or more space separated events, `events`, to a `callback`
|
89
|
-
// function. Passing `"all"` will bind the callback to all events fired.
|
90
|
-
on: function(events, callback, context) {
|
91
|
-
|
92
|
-
var calls, event, node, tail, list;
|
93
|
-
if (!callback) return this;
|
94
|
-
events = events.split(eventSplitter);
|
95
|
-
calls = this._callbacks || (this._callbacks = {});
|
96
|
-
|
97
|
-
// Create an immutable callback list, allowing traversal during
|
98
|
-
// modification. The tail is an empty object that will always be used
|
99
|
-
// as the next node.
|
100
|
-
while (event = events.shift()) {
|
101
|
-
list = calls[event];
|
102
|
-
node = list ? list.tail : {};
|
103
|
-
node.next = tail = {};
|
104
|
-
node.context = context;
|
105
|
-
node.callback = callback;
|
106
|
-
calls[event] = {tail: tail, next: list ? list.next : node};
|
107
|
-
}
|
108
|
-
|
109
|
-
return this;
|
110
|
-
},
|
111
|
-
|
112
|
-
// Remove one or many callbacks. If `context` is null, removes all callbacks
|
113
|
-
// with that function. If `callback` is null, removes all callbacks for the
|
114
|
-
// event. If `events` is null, removes all bound callbacks for all events.
|
115
|
-
off: function(events, callback, context) {
|
116
|
-
var event, calls, node, tail, cb, ctx;
|
117
|
-
|
118
|
-
// No events, or removing *all* events.
|
119
|
-
if (!(calls = this._callbacks)) return;
|
120
|
-
if (!(events || callback || context)) {
|
121
|
-
delete this._callbacks;
|
122
|
-
return this;
|
123
|
-
}
|
124
|
-
|
125
|
-
// Loop through the listed events and contexts, splicing them out of the
|
126
|
-
// linked list of callbacks if appropriate.
|
127
|
-
events = events ? events.split(eventSplitter) : _.keys(calls);
|
128
|
-
while (event = events.shift()) {
|
129
|
-
node = calls[event];
|
130
|
-
delete calls[event];
|
131
|
-
if (!node || !(callback || context)) continue;
|
132
|
-
// Create a new list, omitting the indicated callbacks.
|
133
|
-
tail = node.tail;
|
134
|
-
while ((node = node.next) !== tail) {
|
135
|
-
cb = node.callback;
|
136
|
-
ctx = node.context;
|
137
|
-
if ((callback && cb !== callback) || (context && ctx !== context)) {
|
138
|
-
this.on(event, cb, ctx);
|
139
|
-
}
|
140
|
-
}
|
141
|
-
}
|
142
|
-
|
143
|
-
return this;
|
144
|
-
},
|
145
|
-
|
146
|
-
// Trigger one or many events, firing all bound callbacks. Callbacks are
|
147
|
-
// passed the same arguments as `trigger` is, apart from the event name
|
148
|
-
// (unless you're listening on `"all"`, which will cause your callback to
|
149
|
-
// receive the true name of the event as the first argument).
|
150
|
-
trigger: function(events) {
|
151
|
-
var event, node, calls, tail, args, all, rest;
|
152
|
-
if (!(calls = this._callbacks)) return this;
|
153
|
-
all = calls.all;
|
154
|
-
events = events.split(eventSplitter);
|
155
|
-
rest = slice.call(arguments, 1);
|
156
|
-
|
157
|
-
// For each event, walk through the linked list of callbacks twice,
|
158
|
-
// first to trigger the event, then to trigger any `"all"` callbacks.
|
159
|
-
while (event = events.shift()) {
|
160
|
-
if (node = calls[event]) {
|
161
|
-
tail = node.tail;
|
162
|
-
while ((node = node.next) !== tail) {
|
163
|
-
node.callback.apply(node.context || this, rest);
|
164
|
-
}
|
165
|
-
}
|
166
|
-
if (node = all) {
|
167
|
-
tail = node.tail;
|
168
|
-
args = [event].concat(rest);
|
169
|
-
while ((node = node.next) !== tail) {
|
170
|
-
node.callback.apply(node.context || this, args);
|
171
|
-
}
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
return this;
|
176
|
-
}
|
177
|
-
|
178
|
-
};
|
179
|
-
|
180
|
-
// Aliases for backwards compatibility.
|
181
|
-
Events.bind = Events.on;
|
182
|
-
Events.unbind = Events.off;
|
183
|
-
|
184
|
-
// Backbone.Model
|
185
|
-
// --------------
|
186
|
-
|
187
|
-
// Create a new model, with defined attributes. A client id (`cid`)
|
188
|
-
// is automatically generated and assigned for you.
|
189
|
-
var Model = Backbone.Model = function(attributes, options) {
|
190
|
-
var defaults;
|
191
|
-
attributes || (attributes = {});
|
192
|
-
if (options && options.parse) attributes = this.parse(attributes);
|
193
|
-
if (defaults = getValue(this, 'defaults')) {
|
194
|
-
attributes = _.extend({}, defaults, attributes);
|
195
|
-
}
|
196
|
-
if (options && options.collection) this.collection = options.collection;
|
197
|
-
this.attributes = {};
|
198
|
-
this._escapedAttributes = {};
|
199
|
-
this.cid = _.uniqueId('c');
|
200
|
-
this.changed = {};
|
201
|
-
this._silent = {};
|
202
|
-
this._pending = {};
|
203
|
-
this.set(attributes, {silent: true});
|
204
|
-
// Reset change tracking.
|
205
|
-
this.changed = {};
|
206
|
-
this._silent = {};
|
207
|
-
this._pending = {};
|
208
|
-
this._previousAttributes = _.clone(this.attributes);
|
209
|
-
this.initialize.apply(this, arguments);
|
210
|
-
};
|
211
|
-
|
212
|
-
// Attach all inheritable methods to the Model prototype.
|
213
|
-
_.extend(Model.prototype, Events, {
|
214
|
-
|
215
|
-
// A hash of attributes whose current and previous value differ.
|
216
|
-
changed: null,
|
217
|
-
|
218
|
-
// A hash of attributes that have silently changed since the last time
|
219
|
-
// `change` was called. Will become pending attributes on the next call.
|
220
|
-
_silent: null,
|
221
|
-
|
222
|
-
// A hash of attributes that have changed since the last `'change'` event
|
223
|
-
// began.
|
224
|
-
_pending: null,
|
225
|
-
|
226
|
-
// The default name for the JSON `id` attribute is `"id"`. MongoDB and
|
227
|
-
// CouchDB users may want to set this to `"_id"`.
|
228
|
-
idAttribute: 'id',
|
229
|
-
|
230
|
-
// Initialize is an empty function by default. Override it with your own
|
231
|
-
// initialization logic.
|
232
|
-
initialize: function(){},
|
233
|
-
|
234
|
-
// Return a copy of the model's `attributes` object.
|
235
|
-
toJSON: function(options) {
|
236
|
-
return _.clone(this.attributes);
|
237
|
-
},
|
238
|
-
|
239
|
-
// Get the value of an attribute.
|
240
|
-
get: function(attr) {
|
241
|
-
return this.attributes[attr];
|
242
|
-
},
|
243
|
-
|
244
|
-
// Get the HTML-escaped value of an attribute.
|
245
|
-
escape: function(attr) {
|
246
|
-
var html;
|
247
|
-
if (html = this._escapedAttributes[attr]) return html;
|
248
|
-
var val = this.get(attr);
|
249
|
-
return this._escapedAttributes[attr] = _.escape(val == null ? '' : '' + val);
|
250
|
-
},
|
251
|
-
|
252
|
-
// Returns `true` if the attribute contains a value that is not null
|
253
|
-
// or undefined.
|
254
|
-
has: function(attr) {
|
255
|
-
return this.get(attr) != null;
|
256
|
-
},
|
257
|
-
|
258
|
-
// Set a hash of model attributes on the object, firing `"change"` unless
|
259
|
-
// you choose to silence it.
|
260
|
-
set: function(key, value, options) {
|
261
|
-
var attrs, attr, val;
|
262
|
-
|
263
|
-
// Handle both
|
264
|
-
if (_.isObject(key) || key == null) {
|
265
|
-
attrs = key;
|
266
|
-
options = value;
|
267
|
-
} else {
|
268
|
-
attrs = {};
|
269
|
-
attrs[key] = value;
|
270
|
-
}
|
271
|
-
|
272
|
-
// Extract attributes and options.
|
273
|
-
options || (options = {});
|
274
|
-
if (!attrs) return this;
|
275
|
-
if (attrs instanceof Model) attrs = attrs.attributes;
|
276
|
-
if (options.unset) for (attr in attrs) attrs[attr] = void 0;
|
277
|
-
|
278
|
-
// Run validation.
|
279
|
-
if (!this._validate(attrs, options)) return false;
|
280
|
-
|
281
|
-
// Check for changes of `id`.
|
282
|
-
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
|
283
|
-
|
284
|
-
var changes = options.changes = {};
|
285
|
-
var now = this.attributes;
|
286
|
-
var escaped = this._escapedAttributes;
|
287
|
-
var prev = this._previousAttributes || {};
|
288
|
-
|
289
|
-
// For each `set` attribute...
|
290
|
-
for (attr in attrs) {
|
291
|
-
val = attrs[attr];
|
292
|
-
|
293
|
-
// If the new and current value differ, record the change.
|
294
|
-
if (!_.isEqual(now[attr], val) || (options.unset && _.has(now, attr))) {
|
295
|
-
delete escaped[attr];
|
296
|
-
(options.silent ? this._silent : changes)[attr] = true;
|
297
|
-
}
|
298
|
-
|
299
|
-
// Update or delete the current value.
|
300
|
-
options.unset ? delete now[attr] : now[attr] = val;
|
301
|
-
|
302
|
-
// If the new and previous value differ, record the change. If not,
|
303
|
-
// then remove changes for this attribute.
|
304
|
-
if (!_.isEqual(prev[attr], val) || (_.has(now, attr) != _.has(prev, attr))) {
|
305
|
-
this.changed[attr] = val;
|
306
|
-
if (!options.silent) this._pending[attr] = true;
|
307
|
-
} else {
|
308
|
-
delete this.changed[attr];
|
309
|
-
delete this._pending[attr];
|
310
|
-
}
|
311
|
-
}
|
312
|
-
|
313
|
-
// Fire the `"change"` events.
|
314
|
-
if (!options.silent) this.change(options);
|
315
|
-
return this;
|
316
|
-
},
|
317
|
-
|
318
|
-
// Remove an attribute from the model, firing `"change"` unless you choose
|
319
|
-
// to silence it. `unset` is a noop if the attribute doesn't exist.
|
320
|
-
unset: function(attr, options) {
|
321
|
-
(options || (options = {})).unset = true;
|
322
|
-
return this.set(attr, null, options);
|
323
|
-
},
|
324
|
-
|
325
|
-
// Clear all attributes on the model, firing `"change"` unless you choose
|
326
|
-
// to silence it.
|
327
|
-
clear: function(options) {
|
328
|
-
(options || (options = {})).unset = true;
|
329
|
-
return this.set(_.clone(this.attributes), options);
|
330
|
-
},
|
331
|
-
|
332
|
-
// Fetch the model from the server. If the server's representation of the
|
333
|
-
// model differs from its current attributes, they will be overriden,
|
334
|
-
// triggering a `"change"` event.
|
335
|
-
fetch: function(options) {
|
336
|
-
options = options ? _.clone(options) : {};
|
337
|
-
var model = this;
|
338
|
-
var success = options.success;
|
339
|
-
options.success = function(resp, status, xhr) {
|
340
|
-
if (!model.set(model.parse(resp, xhr), options)) return false;
|
341
|
-
if (success) success(model, resp);
|
342
|
-
};
|
343
|
-
options.error = Backbone.wrapError(options.error, model, options);
|
344
|
-
return (this.sync || Backbone.sync).call(this, 'read', this, options);
|
345
|
-
},
|
346
|
-
|
347
|
-
// Set a hash of model attributes, and sync the model to the server.
|
348
|
-
// If the server returns an attributes hash that differs, the model's
|
349
|
-
// state will be `set` again.
|
350
|
-
save: function(key, value, options) {
|
351
|
-
var attrs, current;
|
352
|
-
|
353
|
-
// Handle both `("key", value)` and `({key: value})` -style calls.
|
354
|
-
if (_.isObject(key) || key == null) {
|
355
|
-
attrs = key;
|
356
|
-
options = value;
|
357
|
-
} else {
|
358
|
-
attrs = {};
|
359
|
-
attrs[key] = value;
|
360
|
-
}
|
361
|
-
options = options ? _.clone(options) : {};
|
362
|
-
|
363
|
-
// If we're "wait"-ing to set changed attributes, validate early.
|
364
|
-
if (options.wait) {
|
365
|
-
if (!this._validate(attrs, options)) return false;
|
366
|
-
current = _.clone(this.attributes);
|
367
|
-
}
|
368
|
-
|
369
|
-
// Regular saves `set` attributes before persisting to the server.
|
370
|
-
var silentOptions = _.extend({}, options, {silent: true});
|
371
|
-
if (attrs && !this.set(attrs, options.wait ? silentOptions : options)) {
|
372
|
-
return false;
|
373
|
-
}
|
374
|
-
|
375
|
-
// After a successful server-side save, the client is (optionally)
|
376
|
-
// updated with the server-side state.
|
377
|
-
var model = this;
|
378
|
-
var success = options.success;
|
379
|
-
options.success = function(resp, status, xhr) {
|
380
|
-
var serverAttrs = model.parse(resp, xhr);
|
381
|
-
if (options.wait) {
|
382
|
-
delete options.wait;
|
383
|
-
serverAttrs = _.extend(attrs || {}, serverAttrs);
|
384
|
-
}
|
385
|
-
if (!model.set(serverAttrs, options)) return false;
|
386
|
-
if (success) {
|
387
|
-
success(model, resp);
|
388
|
-
} else {
|
389
|
-
model.trigger('sync', model, resp, options);
|
390
|
-
}
|
391
|
-
};
|
392
|
-
|
393
|
-
// Finish configuring and sending the Ajax request.
|
394
|
-
options.error = Backbone.wrapError(options.error, model, options);
|
395
|
-
var method = this.isNew() ? 'create' : 'update';
|
396
|
-
var xhr = (this.sync || Backbone.sync).call(this, method, this, options);
|
397
|
-
if (options.wait) this.set(current, silentOptions);
|
398
|
-
return xhr;
|
399
|
-
},
|
400
|
-
|
401
|
-
// Destroy this model on the server if it was already persisted.
|
402
|
-
// Optimistically removes the model from its collection, if it has one.
|
403
|
-
// If `wait: true` is passed, waits for the server to respond before removal.
|
404
|
-
destroy: function(options) {
|
405
|
-
options = options ? _.clone(options) : {};
|
406
|
-
var model = this;
|
407
|
-
var success = options.success;
|
408
|
-
|
409
|
-
var triggerDestroy = function() {
|
410
|
-
model.trigger('destroy', model, model.collection, options);
|
411
|
-
};
|
412
|
-
|
413
|
-
if (this.isNew()) {
|
414
|
-
triggerDestroy();
|
415
|
-
return false;
|
416
|
-
}
|
417
|
-
|
418
|
-
options.success = function(resp) {
|
419
|
-
if (options.wait) triggerDestroy();
|
420
|
-
if (success) {
|
421
|
-
success(model, resp);
|
422
|
-
} else {
|
423
|
-
model.trigger('sync', model, resp, options);
|
424
|
-
}
|
425
|
-
};
|
426
|
-
|
427
|
-
options.error = Backbone.wrapError(options.error, model, options);
|
428
|
-
var xhr = (this.sync || Backbone.sync).call(this, 'delete', this, options);
|
429
|
-
if (!options.wait) triggerDestroy();
|
430
|
-
return xhr;
|
431
|
-
},
|
432
|
-
|
433
|
-
// Default URL for the model's representation on the server -- if you're
|
434
|
-
// using Backbone's restful methods, override this to change the endpoint
|
435
|
-
// that will be called.
|
436
|
-
url: function() {
|
437
|
-
var base = getValue(this, 'urlRoot') || getValue(this.collection, 'url') || urlError();
|
438
|
-
if (this.isNew()) return base;
|
439
|
-
return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + encodeURIComponent(this.id);
|
440
|
-
},
|
441
|
-
|
442
|
-
// **parse** converts a response into the hash of attributes to be `set` on
|
443
|
-
// the model. The default implementation is just to pass the response along.
|
444
|
-
parse: function(resp, xhr) {
|
445
|
-
return resp;
|
446
|
-
},
|
447
|
-
|
448
|
-
// Create a new model with identical attributes to this one.
|
449
|
-
clone: function() {
|
450
|
-
return new this.constructor(this.attributes);
|
451
|
-
},
|
452
|
-
|
453
|
-
// A model is new if it has never been saved to the server, and lacks an id.
|
454
|
-
isNew: function() {
|
455
|
-
return this.id == null;
|
456
|
-
},
|
457
|
-
|
458
|
-
// Call this method to manually fire a `"change"` event for this model and
|
459
|
-
// a `"change:attribute"` event for each changed attribute.
|
460
|
-
// Calling this will cause all objects observing the model to update.
|
461
|
-
change: function(options) {
|
462
|
-
options || (options = {});
|
463
|
-
var changing = this._changing;
|
464
|
-
this._changing = true;
|
465
|
-
|
466
|
-
// Silent changes become pending changes.
|
467
|
-
for (var attr in this._silent) this._pending[attr] = true;
|
468
|
-
|
469
|
-
// Silent changes are triggered.
|
470
|
-
var changes = _.extend({}, options.changes, this._silent);
|
471
|
-
this._silent = {};
|
472
|
-
for (var attr in changes) {
|
473
|
-
this.trigger('change:' + attr, this, this.get(attr), options);
|
474
|
-
}
|
475
|
-
if (changing) return this;
|
476
|
-
|
477
|
-
// Continue firing `"change"` events while there are pending changes.
|
478
|
-
while (!_.isEmpty(this._pending)) {
|
479
|
-
this._pending = {};
|
480
|
-
this.trigger('change', this, options);
|
481
|
-
// Pending and silent changes still remain.
|
482
|
-
for (var attr in this.changed) {
|
483
|
-
if (this._pending[attr] || this._silent[attr]) continue;
|
484
|
-
delete this.changed[attr];
|
485
|
-
}
|
486
|
-
this._previousAttributes = _.clone(this.attributes);
|
487
|
-
}
|
488
|
-
|
489
|
-
this._changing = false;
|
490
|
-
return this;
|
491
|
-
},
|
492
|
-
|
493
|
-
// Determine if the model has changed since the last `"change"` event.
|
494
|
-
// If you specify an attribute name, determine if that attribute has changed.
|
495
|
-
hasChanged: function(attr) {
|
496
|
-
if (!arguments.length) return !_.isEmpty(this.changed);
|
497
|
-
return _.has(this.changed, attr);
|
498
|
-
},
|
499
|
-
|
500
|
-
// Return an object containing all the attributes that have changed, or
|
501
|
-
// false if there are no changed attributes. Useful for determining what
|
502
|
-
// parts of a view need to be updated and/or what attributes need to be
|
503
|
-
// persisted to the server. Unset attributes will be set to undefined.
|
504
|
-
// You can also pass an attributes object to diff against the model,
|
505
|
-
// determining if there *would be* a change.
|
506
|
-
changedAttributes: function(diff) {
|
507
|
-
if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
|
508
|
-
var val, changed = false, old = this._previousAttributes;
|
509
|
-
for (var attr in diff) {
|
510
|
-
if (_.isEqual(old[attr], (val = diff[attr]))) continue;
|
511
|
-
(changed || (changed = {}))[attr] = val;
|
512
|
-
}
|
513
|
-
return changed;
|
514
|
-
},
|
515
|
-
|
516
|
-
// Get the previous value of an attribute, recorded at the time the last
|
517
|
-
// `"change"` event was fired.
|
518
|
-
previous: function(attr) {
|
519
|
-
if (!arguments.length || !this._previousAttributes) return null;
|
520
|
-
return this._previousAttributes[attr];
|
521
|
-
},
|
522
|
-
|
523
|
-
// Get all of the attributes of the model at the time of the previous
|
524
|
-
// `"change"` event.
|
525
|
-
previousAttributes: function() {
|
526
|
-
return _.clone(this._previousAttributes);
|
527
|
-
},
|
528
|
-
|
529
|
-
// Check if the model is currently in a valid state. It's only possible to
|
530
|
-
// get into an *invalid* state if you're using silent changes.
|
531
|
-
isValid: function() {
|
532
|
-
return !this.validate(this.attributes);
|
533
|
-
},
|
534
|
-
|
535
|
-
// Run validation against the next complete set of model attributes,
|
536
|
-
// returning `true` if all is well. If a specific `error` callback has
|
537
|
-
// been passed, call that instead of firing the general `"error"` event.
|
538
|
-
_validate: function(attrs, options) {
|
539
|
-
if (options.silent || !this.validate) return true;
|
540
|
-
attrs = _.extend({}, this.attributes, attrs);
|
541
|
-
var error = this.validate(attrs, options);
|
542
|
-
if (!error) return true;
|
543
|
-
if (options && options.error) {
|
544
|
-
options.error(this, error, options);
|
545
|
-
} else {
|
546
|
-
this.trigger('error', this, error, options);
|
547
|
-
}
|
548
|
-
return false;
|
549
|
-
}
|
550
|
-
|
551
|
-
});
|
552
|
-
|
553
|
-
// Backbone.Collection
|
554
|
-
// -------------------
|
555
|
-
|
556
|
-
// Provides a standard collection class for our sets of models, ordered
|
557
|
-
// or unordered. If a `comparator` is specified, the Collection will maintain
|
558
|
-
// its models in sort order, as they're added and removed.
|
559
|
-
var Collection = Backbone.Collection = function(models, options) {
|
560
|
-
options || (options = {});
|
561
|
-
if (options.model) this.model = options.model;
|
562
|
-
if (options.comparator) this.comparator = options.comparator;
|
563
|
-
this._reset();
|
564
|
-
this.initialize.apply(this, arguments);
|
565
|
-
if (models) this.reset(models, {silent: true, parse: options.parse});
|
566
|
-
};
|
567
|
-
|
568
|
-
// Define the Collection's inheritable methods.
|
569
|
-
_.extend(Collection.prototype, Events, {
|
570
|
-
|
571
|
-
// The default model for a collection is just a **Backbone.Model**.
|
572
|
-
// This should be overridden in most cases.
|
573
|
-
model: Model,
|
574
|
-
|
575
|
-
// Initialize is an empty function by default. Override it with your own
|
576
|
-
// initialization logic.
|
577
|
-
initialize: function(){},
|
578
|
-
|
579
|
-
// The JSON representation of a Collection is an array of the
|
580
|
-
// models' attributes.
|
581
|
-
toJSON: function(options) {
|
582
|
-
return this.map(function(model){ return model.toJSON(options); });
|
583
|
-
},
|
584
|
-
|
585
|
-
// Add a model, or list of models to the set. Pass **silent** to avoid
|
586
|
-
// firing the `add` event for every new model.
|
587
|
-
add: function(models, options) {
|
588
|
-
var i, index, length, model, cid, id, cids = {}, ids = {}, dups = [];
|
589
|
-
options || (options = {});
|
590
|
-
models = _.isArray(models) ? models.slice() : [models];
|
591
|
-
|
592
|
-
// Begin by turning bare objects into model references, and preventing
|
593
|
-
// invalid models or duplicate models from being added.
|
594
|
-
for (i = 0, length = models.length; i < length; i++) {
|
595
|
-
if (!(model = models[i] = this._prepareModel(models[i], options))) {
|
596
|
-
throw new Error("Can't add an invalid model to a collection");
|
597
|
-
}
|
598
|
-
cid = model.cid;
|
599
|
-
id = model.id;
|
600
|
-
if (cids[cid] || this._byCid[cid] || ((id != null) && (ids[id] || this._byId[id]))) {
|
601
|
-
dups.push(i);
|
602
|
-
continue;
|
603
|
-
}
|
604
|
-
cids[cid] = ids[id] = model;
|
605
|
-
}
|
606
|
-
|
607
|
-
// Remove duplicates.
|
608
|
-
i = dups.length;
|
609
|
-
while (i--) {
|
610
|
-
models.splice(dups[i], 1);
|
611
|
-
}
|
612
|
-
|
613
|
-
// Listen to added models' events, and index models for lookup by
|
614
|
-
// `id` and by `cid`.
|
615
|
-
for (i = 0, length = models.length; i < length; i++) {
|
616
|
-
(model = models[i]).on('all', this._onModelEvent, this);
|
617
|
-
this._byCid[model.cid] = model;
|
618
|
-
if (model.id != null) this._byId[model.id] = model;
|
619
|
-
}
|
620
|
-
|
621
|
-
// Insert models into the collection, re-sorting if needed, and triggering
|
622
|
-
// `add` events unless silenced.
|
623
|
-
this.length += length;
|
624
|
-
index = options.at != null ? options.at : this.models.length;
|
625
|
-
splice.apply(this.models, [index, 0].concat(models));
|
626
|
-
if (this.comparator) this.sort({silent: true});
|
627
|
-
if (options.silent) return this;
|
628
|
-
for (i = 0, length = this.models.length; i < length; i++) {
|
629
|
-
if (!cids[(model = this.models[i]).cid]) continue;
|
630
|
-
options.index = i;
|
631
|
-
model.trigger('add', model, this, options);
|
632
|
-
}
|
633
|
-
return this;
|
634
|
-
},
|
635
|
-
|
636
|
-
// Remove a model, or a list of models from the set. Pass silent to avoid
|
637
|
-
// firing the `remove` event for every model removed.
|
638
|
-
remove: function(models, options) {
|
639
|
-
var i, l, index, model;
|
640
|
-
options || (options = {});
|
641
|
-
models = _.isArray(models) ? models.slice() : [models];
|
642
|
-
for (i = 0, l = models.length; i < l; i++) {
|
643
|
-
model = this.getByCid(models[i]) || this.get(models[i]);
|
644
|
-
if (!model) continue;
|
645
|
-
delete this._byId[model.id];
|
646
|
-
delete this._byCid[model.cid];
|
647
|
-
index = this.indexOf(model);
|
648
|
-
this.models.splice(index, 1);
|
649
|
-
this.length--;
|
650
|
-
if (!options.silent) {
|
651
|
-
options.index = index;
|
652
|
-
model.trigger('remove', model, this, options);
|
653
|
-
}
|
654
|
-
this._removeReference(model);
|
655
|
-
}
|
656
|
-
return this;
|
657
|
-
},
|
658
|
-
|
659
|
-
// Add a model to the end of the collection.
|
660
|
-
push: function(model, options) {
|
661
|
-
model = this._prepareModel(model, options);
|
662
|
-
this.add(model, options);
|
663
|
-
return model;
|
664
|
-
},
|
665
|
-
|
666
|
-
// Remove a model from the end of the collection.
|
667
|
-
pop: function(options) {
|
668
|
-
var model = this.at(this.length - 1);
|
669
|
-
this.remove(model, options);
|
670
|
-
return model;
|
671
|
-
},
|
672
|
-
|
673
|
-
// Add a model to the beginning of the collection.
|
674
|
-
unshift: function(model, options) {
|
675
|
-
model = this._prepareModel(model, options);
|
676
|
-
this.add(model, _.extend({at: 0}, options));
|
677
|
-
return model;
|
678
|
-
},
|
679
|
-
|
680
|
-
// Remove a model from the beginning of the collection.
|
681
|
-
shift: function(options) {
|
682
|
-
var model = this.at(0);
|
683
|
-
this.remove(model, options);
|
684
|
-
return model;
|
685
|
-
},
|
686
|
-
|
687
|
-
// Get a model from the set by id.
|
688
|
-
get: function(id) {
|
689
|
-
if (id == null) return void 0;
|
690
|
-
return this._byId[id.id != null ? id.id : id];
|
691
|
-
},
|
692
|
-
|
693
|
-
// Get a model from the set by client id.
|
694
|
-
getByCid: function(cid) {
|
695
|
-
return cid && this._byCid[cid.cid || cid];
|
696
|
-
},
|
697
|
-
|
698
|
-
// Get the model at the given index.
|
699
|
-
at: function(index) {
|
700
|
-
return this.models[index];
|
701
|
-
},
|
702
|
-
|
703
|
-
// Return models with matching attributes. Useful for simple cases of `filter`.
|
704
|
-
where: function(attrs) {
|
705
|
-
if (_.isEmpty(attrs)) return [];
|
706
|
-
return this.filter(function(model) {
|
707
|
-
for (var key in attrs) {
|
708
|
-
if (attrs[key] !== model.get(key)) return false;
|
709
|
-
}
|
710
|
-
return true;
|
711
|
-
});
|
712
|
-
},
|
713
|
-
|
714
|
-
// Force the collection to re-sort itself. You don't need to call this under
|
715
|
-
// normal circumstances, as the set will maintain sort order as each item
|
716
|
-
// is added.
|
717
|
-
sort: function(options) {
|
718
|
-
options || (options = {});
|
719
|
-
if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
|
720
|
-
var boundComparator = _.bind(this.comparator, this);
|
721
|
-
if (this.comparator.length == 1) {
|
722
|
-
this.models = this.sortBy(boundComparator);
|
723
|
-
} else {
|
724
|
-
this.models.sort(boundComparator);
|
725
|
-
}
|
726
|
-
if (!options.silent) this.trigger('reset', this, options);
|
727
|
-
return this;
|
728
|
-
},
|
729
|
-
|
730
|
-
// Pluck an attribute from each model in the collection.
|
731
|
-
pluck: function(attr) {
|
732
|
-
return _.map(this.models, function(model){ return model.get(attr); });
|
733
|
-
},
|
734
|
-
|
735
|
-
// When you have more items than you want to add or remove individually,
|
736
|
-
// you can reset the entire set with a new list of models, without firing
|
737
|
-
// any `add` or `remove` events. Fires `reset` when finished.
|
738
|
-
reset: function(models, options) {
|
739
|
-
models || (models = []);
|
740
|
-
options || (options = {});
|
741
|
-
for (var i = 0, l = this.models.length; i < l; i++) {
|
742
|
-
this._removeReference(this.models[i]);
|
743
|
-
}
|
744
|
-
this._reset();
|
745
|
-
this.add(models, _.extend({silent: true}, options));
|
746
|
-
if (!options.silent) this.trigger('reset', this, options);
|
747
|
-
return this;
|
748
|
-
},
|
749
|
-
|
750
|
-
// Fetch the default set of models for this collection, resetting the
|
751
|
-
// collection when they arrive. If `add: true` is passed, appends the
|
752
|
-
// models to the collection instead of resetting.
|
753
|
-
fetch: function(options) {
|
754
|
-
options = options ? _.clone(options) : {};
|
755
|
-
if (options.parse === undefined) options.parse = true;
|
756
|
-
var collection = this;
|
757
|
-
var success = options.success;
|
758
|
-
options.success = function(resp, status, xhr) {
|
759
|
-
collection[options.add ? 'add' : 'reset'](collection.parse(resp, xhr), options);
|
760
|
-
if (success) success(collection, resp);
|
761
|
-
};
|
762
|
-
options.error = Backbone.wrapError(options.error, collection, options);
|
763
|
-
return (this.sync || Backbone.sync).call(this, 'read', this, options);
|
764
|
-
},
|
765
|
-
|
766
|
-
// Create a new instance of a model in this collection. Add the model to the
|
767
|
-
// collection immediately, unless `wait: true` is passed, in which case we
|
768
|
-
// wait for the server to agree.
|
769
|
-
create: function(model, options) {
|
770
|
-
var coll = this;
|
771
|
-
options = options ? _.clone(options) : {};
|
772
|
-
model = this._prepareModel(model, options);
|
773
|
-
if (!model) return false;
|
774
|
-
if (!options.wait) coll.add(model, options);
|
775
|
-
var success = options.success;
|
776
|
-
options.success = function(nextModel, resp, xhr) {
|
777
|
-
if (options.wait) coll.add(nextModel, options);
|
778
|
-
if (success) {
|
779
|
-
success(nextModel, resp);
|
780
|
-
} else {
|
781
|
-
nextModel.trigger('sync', model, resp, options);
|
782
|
-
}
|
783
|
-
};
|
784
|
-
model.save(null, options);
|
785
|
-
return model;
|
786
|
-
},
|
787
|
-
|
788
|
-
// **parse** converts a response into a list of models to be added to the
|
789
|
-
// collection. The default implementation is just to pass it through.
|
790
|
-
parse: function(resp, xhr) {
|
791
|
-
return resp;
|
792
|
-
},
|
793
|
-
|
794
|
-
// Proxy to _'s chain. Can't be proxied the same way the rest of the
|
795
|
-
// underscore methods are proxied because it relies on the underscore
|
796
|
-
// constructor.
|
797
|
-
chain: function () {
|
798
|
-
return _(this.models).chain();
|
799
|
-
},
|
800
|
-
|
801
|
-
// Reset all internal state. Called when the collection is reset.
|
802
|
-
_reset: function(options) {
|
803
|
-
this.length = 0;
|
804
|
-
this.models = [];
|
805
|
-
this._byId = {};
|
806
|
-
this._byCid = {};
|
807
|
-
},
|
808
|
-
|
809
|
-
// Prepare a model or hash of attributes to be added to this collection.
|
810
|
-
_prepareModel: function(model, options) {
|
811
|
-
options || (options = {});
|
812
|
-
if (!(model instanceof Model)) {
|
813
|
-
var attrs = model;
|
814
|
-
options.collection = this;
|
815
|
-
model = new this.model(attrs, options);
|
816
|
-
if (!model._validate(model.attributes, options)) model = false;
|
817
|
-
} else if (!model.collection) {
|
818
|
-
model.collection = this;
|
819
|
-
}
|
820
|
-
return model;
|
821
|
-
},
|
822
|
-
|
823
|
-
// Internal method to remove a model's ties to a collection.
|
824
|
-
_removeReference: function(model) {
|
825
|
-
if (this == model.collection) {
|
826
|
-
delete model.collection;
|
827
|
-
}
|
828
|
-
model.off('all', this._onModelEvent, this);
|
829
|
-
},
|
830
|
-
|
831
|
-
// Internal method called every time a model in the set fires an event.
|
832
|
-
// Sets need to update their indexes when models change ids. All other
|
833
|
-
// events simply proxy through. "add" and "remove" events that originate
|
834
|
-
// in other collections are ignored.
|
835
|
-
_onModelEvent: function(event, model, collection, options) {
|
836
|
-
if ((event == 'add' || event == 'remove') && collection != this) return;
|
837
|
-
if (event == 'destroy') {
|
838
|
-
this.remove(model, options);
|
839
|
-
}
|
840
|
-
if (model && event === 'change:' + model.idAttribute) {
|
841
|
-
delete this._byId[model.previous(model.idAttribute)];
|
842
|
-
this._byId[model.id] = model;
|
843
|
-
}
|
844
|
-
this.trigger.apply(this, arguments);
|
845
|
-
}
|
846
|
-
|
847
|
-
});
|
848
|
-
|
849
|
-
// Underscore methods that we want to implement on the Collection.
|
850
|
-
var methods = ['forEach', 'each', 'map', 'reduce', 'reduceRight', 'find',
|
851
|
-
'detect', 'filter', 'select', 'reject', 'every', 'all', 'some', 'any',
|
852
|
-
'include', 'contains', 'invoke', 'max', 'min', 'sortBy', 'sortedIndex',
|
853
|
-
'toArray', 'size', 'first', 'initial', 'rest', 'last', 'without', 'indexOf',
|
854
|
-
'shuffle', 'lastIndexOf', 'isEmpty', 'groupBy'];
|
855
|
-
|
856
|
-
// Mix in each Underscore method as a proxy to `Collection#models`.
|
857
|
-
_.each(methods, function(method) {
|
858
|
-
Collection.prototype[method] = function() {
|
859
|
-
return _[method].apply(_, [this.models].concat(_.toArray(arguments)));
|
860
|
-
};
|
861
|
-
});
|
862
|
-
|
863
|
-
// Backbone.Router
|
864
|
-
// -------------------
|
865
|
-
|
866
|
-
// Routers map faux-URLs to actions, and fire events when routes are
|
867
|
-
// matched. Creating a new one sets its `routes` hash, if not set statically.
|
868
|
-
var Router = Backbone.Router = function(options) {
|
869
|
-
options || (options = {});
|
870
|
-
if (options.routes) this.routes = options.routes;
|
871
|
-
this._bindRoutes();
|
872
|
-
this.initialize.apply(this, arguments);
|
873
|
-
};
|
874
|
-
|
875
|
-
// Cached regular expressions for matching named param parts and splatted
|
876
|
-
// parts of route strings.
|
877
|
-
var namedParam = /:\w+/g;
|
878
|
-
var splatParam = /\*\w+/g;
|
879
|
-
var escapeRegExp = /[-[\]{}()+?.,\\^$|#\s]/g;
|
880
|
-
|
881
|
-
// Set up all inheritable **Backbone.Router** properties and methods.
|
882
|
-
_.extend(Router.prototype, Events, {
|
883
|
-
|
884
|
-
// Initialize is an empty function by default. Override it with your own
|
885
|
-
// initialization logic.
|
886
|
-
initialize: function(){},
|
887
|
-
|
888
|
-
// Manually bind a single named route to a callback. For example:
|
889
|
-
//
|
890
|
-
// this.route('search/:query/p:num', 'search', function(query, num) {
|
891
|
-
// ...
|
892
|
-
// });
|
893
|
-
//
|
894
|
-
route: function(route, name, callback) {
|
895
|
-
Backbone.history || (Backbone.history = new History);
|
896
|
-
if (!_.isRegExp(route)) route = this._routeToRegExp(route);
|
897
|
-
if (!callback) callback = this[name];
|
898
|
-
Backbone.history.route(route, _.bind(function(fragment) {
|
899
|
-
var args = this._extractParameters(route, fragment);
|
900
|
-
callback && callback.apply(this, args);
|
901
|
-
this.trigger.apply(this, ['route:' + name].concat(args));
|
902
|
-
Backbone.history.trigger('route', this, name, args);
|
903
|
-
}, this));
|
904
|
-
return this;
|
905
|
-
},
|
906
|
-
|
907
|
-
// Simple proxy to `Backbone.history` to save a fragment into the history.
|
908
|
-
navigate: function(fragment, options) {
|
909
|
-
Backbone.history.navigate(fragment, options);
|
910
|
-
},
|
911
|
-
|
912
|
-
// Bind all defined routes to `Backbone.history`. We have to reverse the
|
913
|
-
// order of the routes here to support behavior where the most general
|
914
|
-
// routes can be defined at the bottom of the route map.
|
915
|
-
_bindRoutes: function() {
|
916
|
-
if (!this.routes) return;
|
917
|
-
var routes = [];
|
918
|
-
for (var route in this.routes) {
|
919
|
-
routes.unshift([route, this.routes[route]]);
|
920
|
-
}
|
921
|
-
for (var i = 0, l = routes.length; i < l; i++) {
|
922
|
-
this.route(routes[i][0], routes[i][1], this[routes[i][1]]);
|
923
|
-
}
|
924
|
-
},
|
925
|
-
|
926
|
-
// Convert a route string into a regular expression, suitable for matching
|
927
|
-
// against the current location hash.
|
928
|
-
_routeToRegExp: function(route) {
|
929
|
-
route = route.replace(escapeRegExp, '\\$&')
|
930
|
-
.replace(namedParam, '([^\/]+)')
|
931
|
-
.replace(splatParam, '(.*?)');
|
932
|
-
return new RegExp('^' + route + '$');
|
933
|
-
},
|
934
|
-
|
935
|
-
// Given a route, and a URL fragment that it matches, return the array of
|
936
|
-
// extracted parameters.
|
937
|
-
_extractParameters: function(route, fragment) {
|
938
|
-
return route.exec(fragment).slice(1);
|
939
|
-
}
|
940
|
-
|
941
|
-
});
|
942
|
-
|
943
|
-
// Backbone.History
|
944
|
-
// ----------------
|
945
|
-
|
946
|
-
// Handles cross-browser history management, based on URL fragments. If the
|
947
|
-
// browser does not support `onhashchange`, falls back to polling.
|
948
|
-
var History = Backbone.History = function() {
|
949
|
-
this.handlers = [];
|
950
|
-
_.bindAll(this, 'checkUrl');
|
951
|
-
};
|
952
|
-
|
953
|
-
// Cached regex for cleaning leading hashes and slashes .
|
954
|
-
var routeStripper = /^[#\/]/;
|
955
|
-
|
956
|
-
// Cached regex for detecting MSIE.
|
957
|
-
var isExplorer = /msie [\w.]+/;
|
958
|
-
|
959
|
-
// Has the history handling already been started?
|
960
|
-
History.started = false;
|
961
|
-
|
962
|
-
// Set up all inheritable **Backbone.History** properties and methods.
|
963
|
-
_.extend(History.prototype, Events, {
|
964
|
-
|
965
|
-
// The default interval to poll for hash changes, if necessary, is
|
966
|
-
// twenty times a second.
|
967
|
-
interval: 50,
|
968
|
-
|
969
|
-
// Gets the true hash value. Cannot use location.hash directly due to bug
|
970
|
-
// in Firefox where location.hash will always be decoded.
|
971
|
-
getHash: function(windowOverride) {
|
972
|
-
var loc = windowOverride ? windowOverride.location : window.location;
|
973
|
-
var match = loc.href.match(/#(.*)$/);
|
974
|
-
return match ? match[1] : '';
|
975
|
-
},
|
976
|
-
|
977
|
-
// Get the cross-browser normalized URL fragment, either from the URL,
|
978
|
-
// the hash, or the override.
|
979
|
-
getFragment: function(fragment, forcePushState) {
|
980
|
-
if (fragment == null) {
|
981
|
-
if (this._hasPushState || forcePushState) {
|
982
|
-
fragment = window.location.pathname;
|
983
|
-
var search = window.location.search;
|
984
|
-
if (search) fragment += search;
|
985
|
-
} else {
|
986
|
-
fragment = this.getHash();
|
987
|
-
}
|
988
|
-
}
|
989
|
-
if (!fragment.indexOf(this.options.root)) fragment = fragment.substr(this.options.root.length);
|
990
|
-
return fragment.replace(routeStripper, '');
|
991
|
-
},
|
992
|
-
|
993
|
-
// Start the hash change handling, returning `true` if the current URL matches
|
994
|
-
// an existing route, and `false` otherwise.
|
995
|
-
start: function(options) {
|
996
|
-
if (History.started) throw new Error("Backbone.history has already been started");
|
997
|
-
History.started = true;
|
998
|
-
|
999
|
-
// Figure out the initial configuration. Do we need an iframe?
|
1000
|
-
// Is pushState desired ... is it available?
|
1001
|
-
this.options = _.extend({}, {root: '/'}, this.options, options);
|
1002
|
-
this._wantsHashChange = this.options.hashChange !== false;
|
1003
|
-
this._wantsPushState = !!this.options.pushState;
|
1004
|
-
this._hasPushState = !!(this.options.pushState && window.history && window.history.pushState);
|
1005
|
-
var fragment = this.getFragment();
|
1006
|
-
var docMode = document.documentMode;
|
1007
|
-
var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
|
1008
|
-
|
1009
|
-
if (oldIE) {
|
1010
|
-
this.iframe = $('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
|
1011
|
-
this.navigate(fragment);
|
1012
|
-
}
|
1013
|
-
|
1014
|
-
// Depending on whether we're using pushState or hashes, and whether
|
1015
|
-
// 'onhashchange' is supported, determine how we check the URL state.
|
1016
|
-
if (this._hasPushState) {
|
1017
|
-
$(window).bind('popstate', this.checkUrl);
|
1018
|
-
} else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
|
1019
|
-
$(window).bind('hashchange', this.checkUrl);
|
1020
|
-
} else if (this._wantsHashChange) {
|
1021
|
-
this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
|
1022
|
-
}
|
1023
|
-
|
1024
|
-
// Determine if we need to change the base url, for a pushState link
|
1025
|
-
// opened by a non-pushState browser.
|
1026
|
-
this.fragment = fragment;
|
1027
|
-
var loc = window.location;
|
1028
|
-
var atRoot = loc.pathname == this.options.root;
|
1029
|
-
|
1030
|
-
// If we've started off with a route from a `pushState`-enabled browser,
|
1031
|
-
// but we're currently in a browser that doesn't support it...
|
1032
|
-
if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
|
1033
|
-
this.fragment = this.getFragment(null, true);
|
1034
|
-
window.location.replace(this.options.root + '#' + this.fragment);
|
1035
|
-
// Return immediately as browser will do redirect to new url
|
1036
|
-
return true;
|
1037
|
-
|
1038
|
-
// Or if we've started out with a hash-based route, but we're currently
|
1039
|
-
// in a browser where it could be `pushState`-based instead...
|
1040
|
-
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
|
1041
|
-
this.fragment = this.getHash().replace(routeStripper, '');
|
1042
|
-
window.history.replaceState({}, document.title, loc.protocol + '//' + loc.host + this.options.root + this.fragment);
|
1043
|
-
}
|
1044
|
-
|
1045
|
-
if (!this.options.silent) {
|
1046
|
-
return this.loadUrl();
|
1047
|
-
}
|
1048
|
-
},
|
1049
|
-
|
1050
|
-
// Disable Backbone.history, perhaps temporarily. Not useful in a real app,
|
1051
|
-
// but possibly useful for unit testing Routers.
|
1052
|
-
stop: function() {
|
1053
|
-
$(window).unbind('popstate', this.checkUrl).unbind('hashchange', this.checkUrl);
|
1054
|
-
clearInterval(this._checkUrlInterval);
|
1055
|
-
History.started = false;
|
1056
|
-
},
|
1057
|
-
|
1058
|
-
// Add a route to be tested when the fragment changes. Routes added later
|
1059
|
-
// may override previous routes.
|
1060
|
-
route: function(route, callback) {
|
1061
|
-
this.handlers.unshift({route: route, callback: callback});
|
1062
|
-
},
|
1063
|
-
|
1064
|
-
// Checks the current URL to see if it has changed, and if it has,
|
1065
|
-
// calls `loadUrl`, normalizing across the hidden iframe.
|
1066
|
-
checkUrl: function(e) {
|
1067
|
-
var current = this.getFragment();
|
1068
|
-
if (current == this.fragment && this.iframe) current = this.getFragment(this.getHash(this.iframe));
|
1069
|
-
if (current == this.fragment) return false;
|
1070
|
-
if (this.iframe) this.navigate(current);
|
1071
|
-
this.loadUrl() || this.loadUrl(this.getHash());
|
1072
|
-
},
|
1073
|
-
|
1074
|
-
// Attempt to load the current URL fragment. If a route succeeds with a
|
1075
|
-
// match, returns `true`. If no defined routes matches the fragment,
|
1076
|
-
// returns `false`.
|
1077
|
-
loadUrl: function(fragmentOverride) {
|
1078
|
-
var fragment = this.fragment = this.getFragment(fragmentOverride);
|
1079
|
-
var matched = _.any(this.handlers, function(handler) {
|
1080
|
-
if (handler.route.test(fragment)) {
|
1081
|
-
handler.callback(fragment);
|
1082
|
-
return true;
|
1083
|
-
}
|
1084
|
-
});
|
1085
|
-
return matched;
|
1086
|
-
},
|
1087
|
-
|
1088
|
-
// Save a fragment into the hash history, or replace the URL state if the
|
1089
|
-
// 'replace' option is passed. You are responsible for properly URL-encoding
|
1090
|
-
// the fragment in advance.
|
1091
|
-
//
|
1092
|
-
// The options object can contain `trigger: true` if you wish to have the
|
1093
|
-
// route callback be fired (not usually desirable), or `replace: true`, if
|
1094
|
-
// you wish to modify the current URL without adding an entry to the history.
|
1095
|
-
navigate: function(fragment, options) {
|
1096
|
-
if (!History.started) return false;
|
1097
|
-
if (!options || options === true) options = {trigger: options};
|
1098
|
-
var frag = (fragment || '').replace(routeStripper, '');
|
1099
|
-
if (this.fragment == frag) return;
|
1100
|
-
|
1101
|
-
// If pushState is available, we use it to set the fragment as a real URL.
|
1102
|
-
if (this._hasPushState) {
|
1103
|
-
if (frag.indexOf(this.options.root) != 0) frag = this.options.root + frag;
|
1104
|
-
this.fragment = frag;
|
1105
|
-
window.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, frag);
|
1106
|
-
|
1107
|
-
// If hash changes haven't been explicitly disabled, update the hash
|
1108
|
-
// fragment to store history.
|
1109
|
-
} else if (this._wantsHashChange) {
|
1110
|
-
this.fragment = frag;
|
1111
|
-
this._updateHash(window.location, frag, options.replace);
|
1112
|
-
if (this.iframe && (frag != this.getFragment(this.getHash(this.iframe)))) {
|
1113
|
-
// Opening and closing the iframe tricks IE7 and earlier to push a history entry on hash-tag change.
|
1114
|
-
// When replace is true, we don't want this.
|
1115
|
-
if(!options.replace) this.iframe.document.open().close();
|
1116
|
-
this._updateHash(this.iframe.location, frag, options.replace);
|
1117
|
-
}
|
1118
|
-
|
1119
|
-
// If you've told us that you explicitly don't want fallback hashchange-
|
1120
|
-
// based history, then `navigate` becomes a page refresh.
|
1121
|
-
} else {
|
1122
|
-
window.location.assign(this.options.root + fragment);
|
1123
|
-
}
|
1124
|
-
if (options.trigger) this.loadUrl(fragment);
|
1125
|
-
},
|
1126
|
-
|
1127
|
-
// Update the hash location, either replacing the current entry, or adding
|
1128
|
-
// a new one to the browser history.
|
1129
|
-
_updateHash: function(location, fragment, replace) {
|
1130
|
-
if (replace) {
|
1131
|
-
location.replace(location.toString().replace(/(javascript:|#).*$/, '') + '#' + fragment);
|
1132
|
-
} else {
|
1133
|
-
location.hash = fragment;
|
1134
|
-
}
|
1135
|
-
}
|
1136
|
-
});
|
1137
|
-
|
1138
|
-
// Backbone.View
|
1139
|
-
// -------------
|
1140
|
-
|
1141
|
-
// Creating a Backbone.View creates its initial element outside of the DOM,
|
1142
|
-
// if an existing element is not provided...
|
1143
|
-
var View = Backbone.View = function(options) {
|
1144
|
-
this.cid = _.uniqueId('view');
|
1145
|
-
this._configure(options || {});
|
1146
|
-
this._ensureElement();
|
1147
|
-
this.initialize.apply(this, arguments);
|
1148
|
-
this.delegateEvents();
|
1149
|
-
};
|
1150
|
-
|
1151
|
-
// Cached regex to split keys for `delegate`.
|
1152
|
-
var delegateEventSplitter = /^(\S+)\s*(.*)$/;
|
1153
|
-
|
1154
|
-
// List of view options to be merged as properties.
|
1155
|
-
var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName'];
|
1156
|
-
|
1157
|
-
// Set up all inheritable **Backbone.View** properties and methods.
|
1158
|
-
_.extend(View.prototype, Events, {
|
1159
|
-
|
1160
|
-
// The default `tagName` of a View's element is `"div"`.
|
1161
|
-
tagName: 'div',
|
1162
|
-
|
1163
|
-
// jQuery delegate for element lookup, scoped to DOM elements within the
|
1164
|
-
// current view. This should be prefered to global lookups where possible.
|
1165
|
-
$: function(selector) {
|
1166
|
-
return this.$el.find(selector);
|
1167
|
-
},
|
1168
|
-
|
1169
|
-
// Initialize is an empty function by default. Override it with your own
|
1170
|
-
// initialization logic.
|
1171
|
-
initialize: function(){},
|
1172
|
-
|
1173
|
-
// **render** is the core function that your view should override, in order
|
1174
|
-
// to populate its element (`this.el`), with the appropriate HTML. The
|
1175
|
-
// convention is for **render** to always return `this`.
|
1176
|
-
render: function() {
|
1177
|
-
return this;
|
1178
|
-
},
|
1179
|
-
|
1180
|
-
// Remove this view from the DOM. Note that the view isn't present in the
|
1181
|
-
// DOM by default, so calling this method may be a no-op.
|
1182
|
-
remove: function() {
|
1183
|
-
this.$el.remove();
|
1184
|
-
return this;
|
1185
|
-
},
|
1186
|
-
|
1187
|
-
// For small amounts of DOM Elements, where a full-blown template isn't
|
1188
|
-
// needed, use **make** to manufacture elements, one at a time.
|
1189
|
-
//
|
1190
|
-
// var el = this.make('li', {'class': 'row'}, this.model.escape('title'));
|
1191
|
-
//
|
1192
|
-
make: function(tagName, attributes, content) {
|
1193
|
-
var el = document.createElement(tagName);
|
1194
|
-
if (attributes) $(el).attr(attributes);
|
1195
|
-
if (content != null) $(el).html(content);
|
1196
|
-
return el;
|
1197
|
-
},
|
1198
|
-
|
1199
|
-
// Change the view's element (`this.el` property), including event
|
1200
|
-
// re-delegation.
|
1201
|
-
setElement: function(element, delegate) {
|
1202
|
-
if (this.$el) this.undelegateEvents();
|
1203
|
-
this.$el = (element instanceof $) ? element : $(element);
|
1204
|
-
this.el = this.$el[0];
|
1205
|
-
if (delegate !== false) this.delegateEvents();
|
1206
|
-
return this;
|
1207
|
-
},
|
1208
|
-
|
1209
|
-
// Set callbacks, where `this.events` is a hash of
|
1210
|
-
//
|
1211
|
-
// *{"event selector": "callback"}*
|
1212
|
-
//
|
1213
|
-
// {
|
1214
|
-
// 'mousedown .title': 'edit',
|
1215
|
-
// 'click .button': 'save'
|
1216
|
-
// 'click .open': function(e) { ... }
|
1217
|
-
// }
|
1218
|
-
//
|
1219
|
-
// pairs. Callbacks will be bound to the view, with `this` set properly.
|
1220
|
-
// Uses event delegation for efficiency.
|
1221
|
-
// Omitting the selector binds the event to `this.el`.
|
1222
|
-
// This only works for delegate-able events: not `focus`, `blur`, and
|
1223
|
-
// not `change`, `submit`, and `reset` in Internet Explorer.
|
1224
|
-
delegateEvents: function(events) {
|
1225
|
-
if (!(events || (events = getValue(this, 'events')))) return;
|
1226
|
-
this.undelegateEvents();
|
1227
|
-
for (var key in events) {
|
1228
|
-
var method = events[key];
|
1229
|
-
if (!_.isFunction(method)) method = this[events[key]];
|
1230
|
-
if (!method) throw new Error('Method "' + events[key] + '" does not exist');
|
1231
|
-
var match = key.match(delegateEventSplitter);
|
1232
|
-
var eventName = match[1], selector = match[2];
|
1233
|
-
method = _.bind(method, this);
|
1234
|
-
eventName += '.delegateEvents' + this.cid;
|
1235
|
-
if (selector === '') {
|
1236
|
-
this.$el.bind(eventName, method);
|
1237
|
-
} else {
|
1238
|
-
this.$el.delegate(selector, eventName, method);
|
1239
|
-
}
|
1240
|
-
}
|
1241
|
-
},
|
1242
|
-
|
1243
|
-
// Clears all callbacks previously bound to the view with `delegateEvents`.
|
1244
|
-
// You usually don't need to use this, but may wish to if you have multiple
|
1245
|
-
// Backbone views attached to the same DOM element.
|
1246
|
-
undelegateEvents: function() {
|
1247
|
-
this.$el.unbind('.delegateEvents' + this.cid);
|
1248
|
-
},
|
1249
|
-
|
1250
|
-
// Performs the initial configuration of a View with a set of options.
|
1251
|
-
// Keys with special meaning *(model, collection, id, className)*, are
|
1252
|
-
// attached directly to the view.
|
1253
|
-
_configure: function(options) {
|
1254
|
-
if (this.options) options = _.extend({}, this.options, options);
|
1255
|
-
for (var i = 0, l = viewOptions.length; i < l; i++) {
|
1256
|
-
var attr = viewOptions[i];
|
1257
|
-
if (options[attr]) this[attr] = options[attr];
|
1258
|
-
}
|
1259
|
-
this.options = options;
|
1260
|
-
},
|
1261
|
-
|
1262
|
-
// Ensure that the View has a DOM element to render into.
|
1263
|
-
// If `this.el` is a string, pass it through `$()`, take the first
|
1264
|
-
// matching element, and re-assign it to `el`. Otherwise, create
|
1265
|
-
// an element from the `id`, `className` and `tagName` properties.
|
1266
|
-
_ensureElement: function() {
|
1267
|
-
if (!this.el) {
|
1268
|
-
var attrs = getValue(this, 'attributes') || {};
|
1269
|
-
if (this.id) attrs.id = this.id;
|
1270
|
-
if (this.className) attrs['class'] = this.className;
|
1271
|
-
this.setElement(this.make(this.tagName, attrs), false);
|
1272
|
-
} else {
|
1273
|
-
this.setElement(this.el, false);
|
1274
|
-
}
|
1275
|
-
}
|
1276
|
-
|
1277
|
-
});
|
1278
|
-
|
1279
|
-
// The self-propagating extend function that Backbone classes use.
|
1280
|
-
var extend = function (protoProps, classProps) {
|
1281
|
-
var child = inherits(this, protoProps, classProps);
|
1282
|
-
child.extend = this.extend;
|
1283
|
-
return child;
|
1284
|
-
};
|
1285
|
-
|
1286
|
-
// Set up inheritance for the model, collection, and view.
|
1287
|
-
Model.extend = Collection.extend = Router.extend = View.extend = extend;
|
1288
|
-
|
1289
|
-
// Backbone.sync
|
1290
|
-
// -------------
|
1291
|
-
|
1292
|
-
// Map from CRUD to HTTP for our default `Backbone.sync` implementation.
|
1293
|
-
var methodMap = {
|
1294
|
-
'create': 'POST',
|
1295
|
-
'update': 'PUT',
|
1296
|
-
'delete': 'DELETE',
|
1297
|
-
'read': 'GET'
|
1298
|
-
};
|
1299
|
-
|
1300
|
-
// Override this function to change the manner in which Backbone persists
|
1301
|
-
// models to the server. You will be passed the type of request, and the
|
1302
|
-
// model in question. By default, makes a RESTful Ajax request
|
1303
|
-
// to the model's `url()`. Some possible customizations could be:
|
1304
|
-
//
|
1305
|
-
// * Use `setTimeout` to batch rapid-fire updates into a single request.
|
1306
|
-
// * Send up the models as XML instead of JSON.
|
1307
|
-
// * Persist models via WebSockets instead of Ajax.
|
1308
|
-
//
|
1309
|
-
// Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
|
1310
|
-
// as `POST`, with a `_method` parameter containing the true HTTP method,
|
1311
|
-
// as well as all requests with the body as `application/x-www-form-urlencoded`
|
1312
|
-
// instead of `application/json` with the model in a param named `model`.
|
1313
|
-
// Useful when interfacing with server-side languages like **PHP** that make
|
1314
|
-
// it difficult to read the body of `PUT` requests.
|
1315
|
-
Backbone.sync = function(method, model, options) {
|
1316
|
-
var type = methodMap[method];
|
1317
|
-
|
1318
|
-
// Default options, unless specified.
|
1319
|
-
options || (options = {});
|
1320
|
-
|
1321
|
-
// Default JSON-request options.
|
1322
|
-
var params = {type: type, dataType: 'json'};
|
1323
|
-
|
1324
|
-
// Ensure that we have a URL.
|
1325
|
-
if (!options.url) {
|
1326
|
-
params.url = getValue(model, 'url') || urlError();
|
1327
|
-
}
|
1328
|
-
|
1329
|
-
// Ensure that we have the appropriate request data.
|
1330
|
-
if (!options.data && model && (method == 'create' || method == 'update')) {
|
1331
|
-
params.contentType = 'application/json';
|
1332
|
-
params.data = JSON.stringify(model.toJSON());
|
1333
|
-
}
|
1334
|
-
|
1335
|
-
// For older servers, emulate JSON by encoding the request into an HTML-form.
|
1336
|
-
if (Backbone.emulateJSON) {
|
1337
|
-
params.contentType = 'application/x-www-form-urlencoded';
|
1338
|
-
params.data = params.data ? {model: params.data} : {};
|
1339
|
-
}
|
1340
|
-
|
1341
|
-
// For older servers, emulate HTTP by mimicking the HTTP method with `_method`
|
1342
|
-
// And an `X-HTTP-Method-Override` header.
|
1343
|
-
if (Backbone.emulateHTTP) {
|
1344
|
-
if (type === 'PUT' || type === 'DELETE') {
|
1345
|
-
if (Backbone.emulateJSON) params.data._method = type;
|
1346
|
-
params.type = 'POST';
|
1347
|
-
params.beforeSend = function(xhr) {
|
1348
|
-
xhr.setRequestHeader('X-HTTP-Method-Override', type);
|
1349
|
-
};
|
1350
|
-
}
|
1351
|
-
}
|
1352
|
-
|
1353
|
-
// Don't process data on a non-GET request.
|
1354
|
-
if (params.type !== 'GET' && !Backbone.emulateJSON) {
|
1355
|
-
params.processData = false;
|
1356
|
-
}
|
1357
|
-
|
1358
|
-
// Make the request, allowing the user to override any Ajax options.
|
1359
|
-
return $.ajax(_.extend(params, options));
|
1360
|
-
};
|
1361
|
-
|
1362
|
-
// Wrap an optional error callback with a fallback error event.
|
1363
|
-
Backbone.wrapError = function(onError, originalModel, options) {
|
1364
|
-
return function(model, resp) {
|
1365
|
-
resp = model === originalModel ? resp : model;
|
1366
|
-
if (onError) {
|
1367
|
-
onError(originalModel, resp, options);
|
1368
|
-
} else {
|
1369
|
-
originalModel.trigger('error', originalModel, resp, options);
|
1370
|
-
}
|
1371
|
-
};
|
1372
|
-
};
|
1373
|
-
|
1374
|
-
// Helpers
|
1375
|
-
// -------
|
1376
|
-
|
1377
|
-
// Shared empty constructor function to aid in prototype-chain creation.
|
1378
|
-
var ctor = function(){};
|
1379
|
-
|
1380
|
-
// Helper function to correctly set up the prototype chain, for subclasses.
|
1381
|
-
// Similar to `goog.inherits`, but uses a hash of prototype properties and
|
1382
|
-
// class properties to be extended.
|
1383
|
-
var inherits = function(parent, protoProps, staticProps) {
|
1384
|
-
var child;
|
1385
|
-
|
1386
|
-
// The constructor function for the new subclass is either defined by you
|
1387
|
-
// (the "constructor" property in your `extend` definition), or defaulted
|
1388
|
-
// by us to simply call the parent's constructor.
|
1389
|
-
if (protoProps && protoProps.hasOwnProperty('constructor')) {
|
1390
|
-
child = protoProps.constructor;
|
1391
|
-
} else {
|
1392
|
-
child = function(){ parent.apply(this, arguments); };
|
1393
|
-
}
|
1394
|
-
|
1395
|
-
// Inherit class (static) properties from parent.
|
1396
|
-
_.extend(child, parent);
|
1397
|
-
|
1398
|
-
// Set the prototype chain to inherit from `parent`, without calling
|
1399
|
-
// `parent`'s constructor function.
|
1400
|
-
ctor.prototype = parent.prototype;
|
1401
|
-
child.prototype = new ctor();
|
1402
|
-
|
1403
|
-
// Add prototype properties (instance properties) to the subclass,
|
1404
|
-
// if supplied.
|
1405
|
-
if (protoProps) _.extend(child.prototype, protoProps);
|
1406
|
-
|
1407
|
-
// Add static properties to the constructor function, if supplied.
|
1408
|
-
if (staticProps) _.extend(child, staticProps);
|
1409
|
-
|
1410
|
-
// Correctly set child's `prototype.constructor`.
|
1411
|
-
child.prototype.constructor = child;
|
1412
|
-
|
1413
|
-
// Set a convenience property in case the parent's prototype is needed later.
|
1414
|
-
child.__super__ = parent.prototype;
|
1415
|
-
|
1416
|
-
return child;
|
1417
|
-
};
|
1418
|
-
|
1419
|
-
// Helper function to get a value from a Backbone object as a property
|
1420
|
-
// or as a function.
|
1421
|
-
var getValue = function(object, prop) {
|
1422
|
-
if (!(object && object[prop])) return null;
|
1423
|
-
return _.isFunction(object[prop]) ? object[prop]() : object[prop];
|
1424
|
-
};
|
1425
|
-
|
1426
|
-
// Throw an error when a URL is needed, and none is supplied.
|
1427
|
-
var urlError = function() {
|
1428
|
-
throw new Error('A "url" property or function must be specified');
|
1429
|
-
};
|
1430
|
-
|
1431
|
-
}).call(this);
|