gaku_admin 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/gaku/admin/admin.coffee +6 -6
- data/app/assets/javascripts/gaku/admin/base.js.coffee +11 -2
- data/app/assets/javascripts/gaku/admin.js.coffee +6 -0
- data/app/assets/stylesheets/gaku/admin/bootstrap_and_theme.css.scss +16 -1
- data/app/assets/stylesheets/gaku/admin.css +0 -1
- data/app/controllers/concerns/admin_picture_controller.rb +28 -0
- data/app/controllers/gaku/admin/attendance_types_controller.rb +8 -8
- data/app/controllers/gaku/admin/badge_types_controller.rb +9 -16
- data/app/controllers/gaku/admin/base_controller.rb +1 -1
- data/app/controllers/gaku/admin/{schools/campuses → campuses}/addresses_controller.rb +3 -9
- data/app/controllers/gaku/admin/{schools/campuses → campuses}/contacts_controller.rb +6 -10
- data/app/controllers/gaku/admin/{schools/campuses_controller.rb → campuses_controller.rb} +7 -11
- data/app/controllers/gaku/admin/commute_method_types_controller.rb +8 -7
- data/app/controllers/gaku/admin/contact_types_controller.rb +7 -7
- data/app/controllers/gaku/admin/departments_controller.rb +7 -7
- data/app/controllers/gaku/admin/enrollment_statuses_controller.rb +9 -8
- data/app/controllers/gaku/admin/grading_method_sets/grading_method_set_items_controller.rb +1 -1
- data/app/controllers/gaku/admin/grading_method_sets_controller.rb +11 -11
- data/app/controllers/gaku/admin/grading_methods_controller.rb +10 -9
- data/app/controllers/gaku/admin/home_controller.rb +11 -0
- data/app/controllers/gaku/admin/presets_controller.rb +4 -6
- data/app/controllers/gaku/admin/roles_controller.rb +8 -7
- data/app/controllers/gaku/admin/school_years/semesters_controller.rb +0 -1
- data/app/controllers/gaku/admin/school_years_controller.rb +3 -7
- data/app/controllers/gaku/admin/schools/programs_controller.rb +11 -4
- data/app/controllers/gaku/admin/schools_controller.rb +82 -79
- data/app/controllers/gaku/admin/{achievements/simple_grade_types_controller.rb → simple_grade_types_controller.rb} +4 -3
- data/app/controllers/gaku/admin/specialties_controller.rb +2 -5
- data/app/controllers/gaku/admin/states_controller.rb +71 -71
- data/app/controllers/gaku/admin/student_review_categories_controller.rb +57 -0
- data/app/controllers/gaku/admin/templates_controller.rb +47 -50
- data/app/controllers/gaku/admin/users_controller.rb +5 -7
- data/app/controllers/gaku/states_controller.rb +2 -0
- data/app/helpers/gaku/admin_helper.rb +16 -1
- data/app/helpers/gaku/shared_helper.rb +2 -2
- data/app/overrides/admin_menu.rb +7 -6
- data/app/views/gaku/admin/attendance_types/{index.html.slim → _attendance_types.html.slim} +9 -8
- data/app/views/gaku/admin/attendance_types/index.js.erb +1 -0
- data/app/views/gaku/admin/attendance_types/index.json.rb +1 -1
- data/app/views/gaku/admin/badge_types/{index.html.slim → _badge_types.html.slim} +9 -8
- data/app/views/gaku/admin/badge_types/_form.html.slim +1 -1
- data/app/views/gaku/admin/badge_types/_modal.html.slim +1 -1
- data/app/views/gaku/admin/badge_types/create.js.erb +7 -0
- data/app/views/gaku/admin/badge_types/index.js.erb +1 -0
- data/app/views/gaku/admin/badge_types/new.js.erb +1 -1
- data/app/views/gaku/admin/badge_types/update.js.erb +3 -0
- data/app/views/gaku/admin/campuses/_campus.html.slim +4 -0
- data/app/views/gaku/admin/{schools/campuses → campuses}/_campuses.html.slim +4 -6
- data/app/views/gaku/admin/campuses/_edit_form.html.slim +3 -0
- data/app/views/gaku/admin/campuses/addresses/_address.html.slim +6 -0
- data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_address_row_fields.html.slim +1 -1
- data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_addresses.html.slim +3 -4
- data/app/views/gaku/admin/campuses/addresses/index.js.erb +1 -0
- data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/update.js.erb +1 -1
- data/app/views/gaku/admin/campuses/contacts/_contact.html.slim +3 -0
- data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/_contacts.html.slim +4 -4
- data/app/views/gaku/admin/campuses/contacts/_fields.html.slim +11 -0
- data/app/views/gaku/admin/campuses/contacts/_primary_field.html.slim +6 -0
- data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/create.js.erb +1 -1
- data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/destroy.js.erb +1 -1
- data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/edit.js.erb +1 -1
- data/app/views/gaku/admin/campuses/contacts/index.js.erb +1 -0
- data/app/views/gaku/admin/campuses/edit.html.slim +34 -0
- data/app/views/gaku/admin/campuses/edit.js.erb +1 -0
- data/app/views/gaku/admin/campuses/index.js.erb +1 -0
- data/app/views/gaku/admin/campuses/update.js.erb +2 -0
- data/app/views/gaku/admin/commute_method_types/_commute_method_types.html.slim +18 -0
- data/app/views/gaku/admin/commute_method_types/index.js.erb +1 -0
- data/app/views/gaku/admin/contact_types/_contact_types.html.slim +18 -0
- data/app/views/gaku/admin/contact_types/index.js.erb +1 -0
- data/app/views/gaku/admin/departments/_departments.html.slim +21 -0
- data/app/views/gaku/admin/departments/index.js.erb +1 -0
- data/app/views/gaku/admin/enrollment_statuses/{index.html.slim → _enrollment_statuses.html.slim} +9 -10
- data/app/views/gaku/admin/enrollment_statuses/index.js.erb +1 -0
- data/app/views/gaku/admin/grading_method_sets/_fields.html.slim +1 -1
- data/app/views/gaku/admin/grading_method_sets/{index.html.slim → _grading_method_sets.html.slim} +9 -8
- data/app/views/gaku/admin/grading_method_sets/_show.html.slim +4 -0
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_fields.html.slim +2 -2
- data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_items.html.slim +1 -1
- data/app/views/gaku/admin/grading_method_sets/index.js.erb +1 -0
- data/app/views/gaku/admin/grading_method_sets/show.js.erb +1 -0
- data/app/views/gaku/admin/grading_methods/_criteria_form_fields.html.slim +19 -0
- data/app/views/gaku/admin/grading_methods/_criteria_template.html.slim +11 -0
- data/app/views/gaku/admin/grading_methods/_fields.html.slim +1 -1
- data/app/views/gaku/admin/grading_methods/_form_fields.html.slim +3 -2
- data/app/views/gaku/admin/grading_methods/_grading_methods.html.slim +21 -0
- data/app/views/gaku/admin/grading_methods/index.js.erb +1 -0
- data/app/views/gaku/admin/home/index.html.slim +5 -0
- data/app/views/gaku/admin/presets/_address.html.slim +8 -7
- data/app/views/gaku/admin/presets/_chooser_fields.html.slim +1 -1
- data/app/views/gaku/admin/presets/_export_formats.html.slim +5 -4
- data/app/views/gaku/admin/presets/_fields.html.slim +1 -1
- data/app/views/gaku/admin/presets/_grading.html.slim +4 -3
- data/app/views/gaku/admin/presets/_locale.html.slim +6 -3
- data/app/views/gaku/admin/presets/_names_order.html.slim +1 -1
- data/app/views/gaku/admin/presets/_pagination.html.slim +10 -9
- data/app/views/gaku/admin/presets/_person.html.slim +3 -2
- data/app/views/gaku/admin/presets/{index.html.slim → _presets.html.slim} +7 -4
- data/app/views/gaku/admin/presets/_student.html.slim +1 -1
- data/app/views/gaku/admin/presets/_tabs.html.slim +2 -3
- data/app/views/gaku/admin/presets/edit.js.erb +1 -0
- data/app/views/gaku/admin/presets/index.js.erb +1 -0
- data/app/views/gaku/admin/presets/update.js.erb +1 -0
- data/app/views/gaku/admin/roles/_roles.html.slim +21 -0
- data/app/views/gaku/admin/roles/index.js.erb +1 -0
- data/app/views/gaku/admin/school_years/_edit_form.html.slim +4 -0
- data/app/views/gaku/admin/school_years/_fields.html.slim +1 -2
- data/app/views/gaku/admin/school_years/_school_years.html.slim +23 -0
- data/app/views/gaku/admin/school_years/edit.html.slim +20 -0
- data/app/views/gaku/admin/school_years/edit.js.erb +4 -2
- data/app/views/gaku/admin/school_years/index.js.erb +1 -0
- data/app/views/gaku/admin/school_years/semesters/_semesters.html.slim +1 -1
- data/app/views/gaku/admin/school_years/semesters/index.js.erb +1 -0
- data/app/views/gaku/admin/schools/_edit_form.html.slim +3 -0
- data/app/views/gaku/admin/schools/_edit_master_form.html.slim +10 -0
- data/app/views/gaku/admin/schools/_school.html.slim +4 -2
- data/app/views/gaku/admin/schools/{index.html.slim → _schools.html.slim} +10 -9
- data/app/views/gaku/admin/schools/_tabs.html.slim +1 -1
- data/app/views/gaku/admin/schools/edit.html.slim +37 -14
- data/app/views/gaku/admin/schools/edit.js.erb +1 -0
- data/app/views/gaku/admin/schools/edit_master.html.slim +36 -16
- data/app/views/gaku/admin/schools/index.js.erb +1 -0
- data/app/views/gaku/admin/schools/programs/_fields.html.slim +3 -4
- data/app/views/gaku/admin/schools/programs/_programs.html.slim +2 -2
- data/app/views/gaku/admin/schools/programs/create.js.erb +1 -0
- data/app/views/gaku/admin/schools/programs/destroy.js.erb +1 -0
- data/app/views/gaku/admin/schools/programs/index.js.erb +1 -0
- data/app/views/gaku/admin/schools/update.js.erb +1 -0
- data/app/views/gaku/admin/shared/_ajax_picture.html.slim +8 -0
- data/app/views/gaku/admin/shared/_ajax_upload_picture.html.slim +14 -0
- data/app/views/gaku/admin/shared/remove_picture.js.erb +3 -0
- data/app/views/gaku/admin/shared/set_picture.js.erb +3 -0
- data/app/views/gaku/admin/simple_grade_types/_simple_grade_types.html.slim +24 -0
- data/app/views/gaku/admin/simple_grade_types/index.js.erb +1 -0
- data/app/views/gaku/admin/specialties/{index.html.slim → _specialties.html.slim} +9 -8
- data/app/views/gaku/admin/specialties/index.js.erb +1 -0
- data/app/views/gaku/admin/states/_country_select_form.html.slim +1 -2
- data/app/views/gaku/admin/states/_form_fields.html.slim +1 -1
- data/app/views/gaku/admin/states/_states.html.slim +16 -0
- data/app/views/gaku/admin/states/index.js.erb +1 -0
- data/app/views/gaku/admin/student_review_categories/_form.html.slim +3 -0
- data/app/views/gaku/admin/student_review_categories/_form_fields.html.slim +1 -0
- data/app/views/gaku/admin/student_review_categories/_modal.html.slim +4 -0
- data/app/views/gaku/admin/student_review_categories/_student_review_categories.html.slim +18 -0
- data/app/views/gaku/admin/student_review_categories/_student_review_category.html.slim +2 -0
- data/app/views/gaku/admin/student_review_categories/_table_fields.html.slim +4 -0
- data/app/views/gaku/admin/student_review_categories/create.js.erb +7 -0
- data/app/views/gaku/admin/student_review_categories/destroy.js.erb +2 -0
- data/app/views/gaku/admin/student_review_categories/edit.js.erb +3 -0
- data/app/views/gaku/admin/student_review_categories/index.js.erb +1 -0
- data/app/views/gaku/admin/student_review_categories/new.js.erb +3 -0
- data/app/views/gaku/admin/student_review_categories/update.js.erb +3 -0
- data/app/views/gaku/admin/templates/_fields.html.slim +2 -2
- data/app/views/gaku/admin/templates/_form.html.slim +1 -1
- data/app/views/gaku/admin/templates/_modal.html.slim +5 -2
- data/app/views/gaku/admin/templates/_templates.html.slim +21 -0
- data/app/views/gaku/admin/templates/create.js.erb +7 -0
- data/app/views/gaku/admin/templates/edit.js.erb +3 -0
- data/app/views/gaku/admin/templates/index.js.erb +1 -0
- data/app/views/gaku/admin/templates/new.js.erb +3 -0
- data/app/views/gaku/admin/templates/update.js.erb +3 -0
- data/app/views/gaku/admin/users/_users.html.slim +22 -0
- data/app/views/gaku/admin/users/index.js.erb +1 -0
- data/app/views/gaku/layouts/admin/index.html.slim +0 -1
- data/app/views/gaku/shared/menu/_admin.html.erb +1 -71
- data/app/views/gaku/shared/menu/_admin_menu.html.erb +154 -0
- data/config/routes.rb +20 -10
- data/lib/gaku/admin/engine.rb +3 -5
- data/lib/gaku/admin.rb +2 -1
- data/lib/gaku/app_responder.rb +1 -1
- data/lib/gaku_admin.rb +1 -1
- data/lib/tasks/admin_user.rake +2 -1
- metadata +456 -374
- data/app/views/gaku/admin/achievements/simple_grade_types/index.html.slim +0 -23
- data/app/views/gaku/admin/commute_method_types/index.html.slim +0 -18
- data/app/views/gaku/admin/contact_types/index.html.slim +0 -18
- data/app/views/gaku/admin/departments/index.html.slim +0 -20
- data/app/views/gaku/admin/grading_method_sets/show.html.slim +0 -13
- data/app/views/gaku/admin/grading_methods/index.html.slim +0 -20
- data/app/views/gaku/admin/roles/index.html.slim +0 -20
- data/app/views/gaku/admin/school_years/index.html.slim +0 -21
- data/app/views/gaku/admin/school_years/show.html.slim +0 -15
- data/app/views/gaku/admin/schools/campuses/_campus.html.slim +0 -6
- data/app/views/gaku/admin/schools/campuses/_picture.html.slim +0 -8
- data/app/views/gaku/admin/schools/campuses/_show_table.html.slim +0 -10
- data/app/views/gaku/admin/schools/campuses/_tabs.html.slim +0 -15
- data/app/views/gaku/admin/schools/campuses/_upload_picture.html.slim +0 -7
- data/app/views/gaku/admin/schools/campuses/addresses/_address.html.slim +0 -7
- data/app/views/gaku/admin/schools/campuses/contacts/_contact.html.slim +0 -3
- data/app/views/gaku/admin/schools/campuses/contacts/_fields.html.slim +0 -12
- data/app/views/gaku/admin/schools/campuses/contacts/_primary_field.html.slim +0 -13
- data/app/views/gaku/admin/schools/campuses/edit.html.slim +0 -19
- data/app/views/gaku/admin/schools/campuses/show.html.slim +0 -13
- data/app/views/gaku/admin/schools/show.html.slim +0 -13
- data/app/views/gaku/admin/schools/show_master.html.slim +0 -14
- data/app/views/gaku/admin/states/index.html.slim +0 -15
- data/app/views/gaku/admin/templates/edit.html.slim +0 -1
- data/app/views/gaku/admin/templates/index.html.slim +0 -20
- data/app/views/gaku/admin/templates/new.html.slim +0 -1
- data/app/views/gaku/admin/users/index.html.slim +0 -21
- data/config/initializers/client_side_validations.rb +0 -9
- /data/app/views/gaku/admin/{schools/campuses → campuses}/_form.html.slim +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/_form_fields.html.slim +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_fields.html.slim +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_form.html.slim +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_form_fields.html.slim +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_modal.html.slim +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/create.js.erb +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/destroy.js.erb +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/edit.js.erb +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/new.js.erb +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/_delete_link.html.slim +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/_form.html.slim +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/_form_fields.html.slim +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/_modal.html.slim +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/make_primary.js.erb +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/new.js.erb +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/soft_delete.js.erb +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/update.js.erb +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/create.js.erb +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/destroy.js.erb +0 -0
- /data/app/views/gaku/admin/{schools/campuses → campuses}/new.js.erb +0 -0
- /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/_fields.html.slim +0 -0
- /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/_form.html.slim +0 -0
- /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/_form_fields.html.slim +0 -0
- /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/_modal.html.slim +0 -0
- /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/_simple_grade_type.html.slim +0 -0
- /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/create.js.erb +0 -0
- /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/destroy.js.erb +0 -0
- /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/edit.js.erb +0 -0
- /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/new.js.erb +0 -0
- /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/update.js.erb +0 -0
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
module Gaku
|
|
2
2
|
class Admin::GradingMethodsController < Admin::BaseController
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
respond_to :js, only: %i( new create edit update destroy )
|
|
7
|
-
respond_to :html, only: :index
|
|
4
|
+
respond_to :js, only: %i( new create edit update destroy index )
|
|
8
5
|
|
|
9
6
|
before_action :set_grading_method, only: %i( edit update destroy )
|
|
10
7
|
|
|
11
8
|
def index
|
|
12
9
|
@grading_methods = GradingMethod.all
|
|
13
|
-
|
|
10
|
+
set_count
|
|
14
11
|
respond_with @grading_methods
|
|
15
12
|
end
|
|
16
13
|
|
|
@@ -22,7 +19,7 @@ module Gaku
|
|
|
22
19
|
def create
|
|
23
20
|
@grading_method = GradingMethod.new(grading_method_params)
|
|
24
21
|
@grading_method.save
|
|
25
|
-
|
|
22
|
+
set_count
|
|
26
23
|
respond_with @grading_method
|
|
27
24
|
end
|
|
28
25
|
|
|
@@ -36,7 +33,7 @@ module Gaku
|
|
|
36
33
|
|
|
37
34
|
def destroy
|
|
38
35
|
@grading_method.destroy
|
|
39
|
-
|
|
36
|
+
set_count
|
|
40
37
|
respond_with @grading_method
|
|
41
38
|
end
|
|
42
39
|
|
|
@@ -48,12 +45,16 @@ module Gaku
|
|
|
48
45
|
|
|
49
46
|
def grading_method_params
|
|
50
47
|
params.require(:grading_method).permit(attributes).tap do |whitelisted|
|
|
51
|
-
whitelisted['
|
|
48
|
+
whitelisted['criteria'] = params[:grading_method][:criteria]
|
|
52
49
|
end
|
|
53
50
|
end
|
|
54
51
|
|
|
55
52
|
def attributes
|
|
56
|
-
%i( description
|
|
53
|
+
%i( description grading_type name curved criteria )
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def set_count
|
|
57
|
+
@count = GradingMethod.count
|
|
57
58
|
end
|
|
58
59
|
|
|
59
60
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Gaku
|
|
2
2
|
class Admin::PresetsController < Admin::BaseController
|
|
3
3
|
|
|
4
|
-
respond_to :
|
|
4
|
+
respond_to :js, only: %i( index edit update )
|
|
5
5
|
before_action :set_preset, except: :index
|
|
6
6
|
|
|
7
7
|
def index
|
|
@@ -28,7 +28,7 @@ module Gaku
|
|
|
28
28
|
|
|
29
29
|
def preset_attr
|
|
30
30
|
[
|
|
31
|
-
:name, :default, :active, :locale, :names_order,
|
|
31
|
+
:name, :default, :active, :locale, :names_order, :time_format_24,
|
|
32
32
|
pagination: pagination_attr,
|
|
33
33
|
grading: grading_attr,
|
|
34
34
|
person: person_attr,
|
|
@@ -59,12 +59,10 @@ module Gaku
|
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def chooser_fields_attr
|
|
62
|
-
%i(
|
|
63
|
-
show_name show_middle_name show_surname show_birth_date show_gender
|
|
62
|
+
%i( show_name show_middle_name show_surname show_birth_date show_gender
|
|
64
63
|
show_user show_code show_foreign_id_code show_enrollment_status
|
|
65
64
|
show_admitted show_graduated show_class_name show_specialty
|
|
66
|
-
show_primary_address show_primary_contact show_primary_email show_personal_information
|
|
67
|
-
)
|
|
65
|
+
show_primary_address show_primary_contact show_primary_email show_personal_information )
|
|
68
66
|
end
|
|
69
67
|
|
|
70
68
|
def set_preset
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
module Gaku
|
|
2
2
|
class Admin::RolesController < Admin::BaseController
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
respond_to :js, only: %i( new create edit update destroy )
|
|
7
|
-
respond_to :html, only: :index
|
|
4
|
+
respond_to :js, only: %i( new create edit update destroy index )
|
|
8
5
|
|
|
9
6
|
before_action :set_role, only: %i( edit update destroy )
|
|
10
7
|
|
|
11
8
|
def index
|
|
12
9
|
@roles = Role.all
|
|
13
|
-
|
|
10
|
+
set_count
|
|
14
11
|
respond_with @roles
|
|
15
12
|
end
|
|
16
13
|
|
|
@@ -22,7 +19,7 @@ module Gaku
|
|
|
22
19
|
def create
|
|
23
20
|
@role = Role.new(role_params)
|
|
24
21
|
@role.save
|
|
25
|
-
|
|
22
|
+
set_count
|
|
26
23
|
respond_with @role
|
|
27
24
|
end
|
|
28
25
|
|
|
@@ -36,7 +33,7 @@ module Gaku
|
|
|
36
33
|
|
|
37
34
|
def destroy
|
|
38
35
|
@role.destroy
|
|
39
|
-
|
|
36
|
+
set_count
|
|
40
37
|
respond_with @role
|
|
41
38
|
end
|
|
42
39
|
|
|
@@ -50,5 +47,9 @@ module Gaku
|
|
|
50
47
|
params.require(:role).permit(:name)
|
|
51
48
|
end
|
|
52
49
|
|
|
50
|
+
def set_count
|
|
51
|
+
@count = Role.count
|
|
52
|
+
end
|
|
53
|
+
|
|
53
54
|
end
|
|
54
55
|
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
module Gaku
|
|
2
2
|
class Admin::SchoolYearsController < Admin::BaseController
|
|
3
3
|
|
|
4
|
-
respond_to :html, only: %i(
|
|
5
|
-
respond_to :js,
|
|
4
|
+
respond_to :html, only: %i( edit )
|
|
5
|
+
respond_to :js, only: %i( index new create destroy edit update )
|
|
6
6
|
|
|
7
|
-
before_action :set_school_year, only: %i(
|
|
7
|
+
before_action :set_school_year, only: %i( edit update destroy )
|
|
8
8
|
|
|
9
9
|
def index
|
|
10
10
|
@school_years = SchoolYear.all
|
|
@@ -23,9 +23,6 @@ module Gaku
|
|
|
23
23
|
respond_with @school_year
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
def show
|
|
27
|
-
end
|
|
28
|
-
|
|
29
26
|
def edit
|
|
30
27
|
end
|
|
31
28
|
|
|
@@ -40,7 +37,6 @@ module Gaku
|
|
|
40
37
|
respond_with @school_year
|
|
41
38
|
end
|
|
42
39
|
|
|
43
|
-
|
|
44
40
|
private
|
|
45
41
|
|
|
46
42
|
def school_year_params
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
module Gaku
|
|
2
2
|
class Admin::Schools::ProgramsController < Admin::BaseController
|
|
3
|
-
|
|
4
|
-
respond_to :js, only: %i( new create destroy edit update
|
|
3
|
+
|
|
4
|
+
respond_to :js, only: %i( index new create destroy edit update
|
|
5
|
+
show_program_levels show_program_specialties show_program_syllabuses )
|
|
5
6
|
|
|
6
7
|
before_action :set_school
|
|
7
|
-
before_action :set_program, only: %i( show_program_levels show_program_specialties show_program_syllabuses
|
|
8
|
+
before_action :set_program, only: %i( show_program_levels show_program_specialties show_program_syllabuses
|
|
9
|
+
destroy edit show update )
|
|
8
10
|
before_action :load_data, only: %i( new edit )
|
|
9
11
|
|
|
12
|
+
def index
|
|
13
|
+
@programs = @school.programs
|
|
14
|
+
respond_with @programs
|
|
15
|
+
end
|
|
16
|
+
|
|
10
17
|
def new
|
|
11
18
|
@program = Program.new
|
|
12
19
|
respond_with @program
|
|
@@ -50,7 +57,7 @@ module Gaku
|
|
|
50
57
|
end
|
|
51
58
|
|
|
52
59
|
def attributes
|
|
53
|
-
#permit :id for update nested attributes
|
|
60
|
+
# permit :id for update nested attributes
|
|
54
61
|
[:id, :name, :description,
|
|
55
62
|
{ program_specialties_attributes: [:id, :specialty_id, :_destroy] },
|
|
56
63
|
{ program_levels_attributes: [:id, :level_id, :_destroy] },
|
|
@@ -1,84 +1,87 @@
|
|
|
1
1
|
module Gaku
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
2
|
+
module Admin
|
|
3
|
+
class SchoolsController < BaseController
|
|
4
|
+
include AdminPictureController
|
|
5
|
+
|
|
6
|
+
respond_to :js, only: %i( new create destroy index edit update )
|
|
7
|
+
respond_to :html, only: %i( edit_master edit update_master show )
|
|
8
|
+
|
|
9
|
+
before_action :set_school, only: %i( edit show update destroy set_picture remove_picture )
|
|
10
|
+
before_action :set_master_school, only: %i( edit_master update_master )
|
|
11
|
+
|
|
12
|
+
def edit_master
|
|
13
|
+
respond_with @school
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def destroy
|
|
17
|
+
@school.destroy
|
|
18
|
+
set_count
|
|
19
|
+
respond_with @school
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def new
|
|
23
|
+
@school = School.new
|
|
24
|
+
respond_with @school
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def create
|
|
28
|
+
@school = School.new(school_params)
|
|
29
|
+
@school.save
|
|
30
|
+
set_count
|
|
31
|
+
respond_with @school
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def edit
|
|
35
|
+
respond_with @school
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def show
|
|
39
|
+
respond_with @school
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def update
|
|
43
|
+
@school.update(school_params)
|
|
44
|
+
respond_with @school
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def update_master
|
|
48
|
+
@school.update(school_params)
|
|
49
|
+
respond_with @school, location: admin_school_details_edit_path
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def index
|
|
53
|
+
@schools = School.all
|
|
54
|
+
set_count
|
|
55
|
+
respond_with @schools
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
private
|
|
59
|
+
|
|
60
|
+
def school_params
|
|
61
|
+
params.require(:school).permit(attributes)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def attributes
|
|
65
|
+
[:name, :primary, :slogan, :description, :founded, :principal, :vice_principal, :grades, :code, :picture,
|
|
66
|
+
{ levels_attributes: level_attributes }]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def level_attributes
|
|
70
|
+
[:name, :'_destroy', :id]
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def set_school
|
|
74
|
+
@school = School.find(params[:id])
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def set_count
|
|
78
|
+
@count = School.count
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def set_master_school
|
|
82
|
+
@school = School.primary
|
|
83
|
+
end
|
|
80
84
|
end
|
|
81
85
|
|
|
82
86
|
end
|
|
83
|
-
|
|
84
87
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Gaku
|
|
2
|
-
class Admin::
|
|
3
|
-
|
|
4
|
-
respond_to :
|
|
2
|
+
class Admin::SimpleGradeTypesController < Admin::BaseController
|
|
3
|
+
|
|
4
|
+
respond_to :js, only: %i( new create update edit destroy index )
|
|
5
5
|
|
|
6
6
|
before_action :set_simple_grade_type, only: %i( edit update destroy )
|
|
7
7
|
before_action :load_data, only: %i( new edit )
|
|
@@ -66,5 +66,6 @@ module Gaku
|
|
|
66
66
|
def t_resource
|
|
67
67
|
t(:'simple_grade_type.singular')
|
|
68
68
|
end
|
|
69
|
+
|
|
69
70
|
end
|
|
70
71
|
end
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
module Gaku
|
|
2
2
|
class Admin::SpecialtiesController < Admin::BaseController
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
respond_to :js, only: %i( new create edit update destroy )
|
|
7
|
-
respond_to :html, only: :index
|
|
4
|
+
respond_to :js, only: %i( new create edit update destroy index )
|
|
8
5
|
|
|
9
6
|
before_action :set_specialty, only: %i( edit update destroy )
|
|
10
|
-
before_action :load_data,
|
|
7
|
+
before_action :load_data, only: %i( new edit )
|
|
11
8
|
|
|
12
9
|
def index
|
|
13
10
|
@specialties = Specialty.all
|
|
@@ -1,92 +1,92 @@
|
|
|
1
1
|
module Gaku
|
|
2
|
-
|
|
3
|
-
class StatesController < Admin::BaseController
|
|
4
|
-
|
|
5
|
-
#load_and_authorize_resource class: State
|
|
6
|
-
|
|
7
|
-
respond_to :js, only: %i( new create edit update destroy country_states )
|
|
8
|
-
respond_to :html, only: %i( index edit update )
|
|
9
|
-
|
|
10
|
-
before_action :set_state, only: %i( edit show update destroy )
|
|
11
|
-
before_action :set_countries
|
|
12
|
-
|
|
13
|
-
def country_states
|
|
14
|
-
if params[:state][:country_iso].empty?
|
|
15
|
-
@country = set_default_country
|
|
16
|
-
set_count @country
|
|
17
|
-
if @country
|
|
18
|
-
respond_with @country
|
|
19
|
-
else
|
|
20
|
-
render nothing: true
|
|
21
|
-
end
|
|
22
|
-
else
|
|
23
|
-
@country = Country.where(iso: params[:state][:country_iso]).first
|
|
24
|
-
@states = @country.states
|
|
25
|
-
set_count @country
|
|
26
|
-
respond_with @country
|
|
27
|
-
end
|
|
28
|
-
end
|
|
2
|
+
class Admin::StatesController < Admin::BaseController
|
|
29
3
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
respond_with @state
|
|
33
|
-
end
|
|
4
|
+
respond_to :js, only: %i( new create edit update destroy country_states index )
|
|
5
|
+
respond_to :html, only: %i( edit update )
|
|
34
6
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
respond_with @state
|
|
38
|
-
end
|
|
7
|
+
before_action :set_state, only: %i( edit show update destroy )
|
|
8
|
+
before_action :set_countries
|
|
39
9
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
10
|
+
def country_states
|
|
11
|
+
if params[:state][:country_iso].empty?
|
|
12
|
+
states_for_default_country
|
|
13
|
+
else
|
|
14
|
+
@country = Country.where(iso: params[:state][:country_iso]).first
|
|
15
|
+
@states = @country.states
|
|
16
|
+
set_count @country
|
|
17
|
+
respond_with @country
|
|
44
18
|
end
|
|
19
|
+
end
|
|
45
20
|
|
|
46
|
-
|
|
47
|
-
|
|
21
|
+
def destroy
|
|
22
|
+
@state.destroy
|
|
23
|
+
respond_with @state
|
|
24
|
+
end
|
|
48
25
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
26
|
+
def new
|
|
27
|
+
@state = State.new
|
|
28
|
+
respond_with @state
|
|
29
|
+
end
|
|
53
30
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
31
|
+
def create
|
|
32
|
+
@state = State.new(state_params)
|
|
33
|
+
@state.save
|
|
34
|
+
respond_with @state
|
|
35
|
+
end
|
|
59
36
|
|
|
60
|
-
|
|
37
|
+
def edit
|
|
38
|
+
end
|
|
61
39
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
def update
|
|
41
|
+
@state.update(state_params)
|
|
42
|
+
respond_with @state
|
|
43
|
+
end
|
|
65
44
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
45
|
+
def index
|
|
46
|
+
@country = set_default_country
|
|
47
|
+
set_count @country
|
|
48
|
+
respond_with @country
|
|
49
|
+
end
|
|
69
50
|
|
|
70
|
-
|
|
71
|
-
@state = State.find(params[:id])
|
|
72
|
-
end
|
|
51
|
+
private
|
|
73
52
|
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
def states_for_default_country
|
|
54
|
+
@country = set_default_country
|
|
55
|
+
set_count @country
|
|
56
|
+
if @country
|
|
57
|
+
respond_with @country
|
|
58
|
+
else
|
|
59
|
+
render nothing: true
|
|
76
60
|
end
|
|
61
|
+
end
|
|
77
62
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
63
|
+
def state_params
|
|
64
|
+
params.require(:state).permit(attributes)
|
|
65
|
+
end
|
|
81
66
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
67
|
+
def attributes
|
|
68
|
+
%i( name abbr name_ascii code country_iso )
|
|
69
|
+
end
|
|
85
70
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
def set_state
|
|
72
|
+
@state = State.find(params[:id])
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def set_countries
|
|
76
|
+
@countries = Country.all
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def set_count(object)
|
|
80
|
+
@count = object.states.count unless object.nil?
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def country_preset
|
|
84
|
+
Preset.address('country')
|
|
85
|
+
end
|
|
89
86
|
|
|
87
|
+
def set_default_country
|
|
88
|
+
Country.where(iso: country_preset).first
|
|
90
89
|
end
|
|
90
|
+
|
|
91
91
|
end
|
|
92
92
|
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module Gaku
|
|
2
|
+
class Admin::StudentReviewCategoriesController < Admin::BaseController
|
|
3
|
+
|
|
4
|
+
respond_to :js
|
|
5
|
+
|
|
6
|
+
before_action :set_student_review_category, only: %i( edit update destroy )
|
|
7
|
+
|
|
8
|
+
def index
|
|
9
|
+
@student_review_categories = StudentReviewCategory.all
|
|
10
|
+
set_count
|
|
11
|
+
respond_with @student_review_categories
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def new
|
|
15
|
+
@student_review_category = StudentReviewCategory.new
|
|
16
|
+
respond_with @student_review_category
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def create
|
|
20
|
+
@student_review_category = StudentReviewCategory.create(student_review_category_params)
|
|
21
|
+
set_count
|
|
22
|
+
respond_with @student_review_category
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def edit
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def update
|
|
29
|
+
@student_review_category.update(student_review_category_params)
|
|
30
|
+
respond_with @student_review_category
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def destroy
|
|
34
|
+
@student_review_category.destroy!
|
|
35
|
+
set_count
|
|
36
|
+
respond_with @student_review_category
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
def student_review_category_params
|
|
42
|
+
params.require(:student_review_category).permit(student_review_category_attrs)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def student_review_category_attrs
|
|
46
|
+
%i( name )
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def set_student_review_category
|
|
50
|
+
@student_review_category = StudentReviewCategory.find(params[:id])
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def set_count
|
|
54
|
+
@count = StudentReviewCategory.count
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|