gaku_admin 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,71 +1,68 @@
|
|
1
1
|
module Gaku
|
2
|
-
|
3
|
-
class TemplatesController < Admin::BaseController
|
2
|
+
class Admin::TemplatesController < Admin::BaseController
|
4
3
|
|
5
|
-
|
4
|
+
responders :collection
|
6
5
|
|
7
|
-
|
8
|
-
|
6
|
+
respond_to :js, only: %i( new create edit update destroy index )
|
7
|
+
respond_to :html, only: :download
|
9
8
|
|
10
|
-
|
9
|
+
before_action :set_template, only: %i( download edit update destroy )
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
def create
|
17
|
-
@template = Template.new(template_params)
|
18
|
-
if @template.save
|
19
|
-
set_count
|
20
|
-
respond_with @template, location: admin_templates_path
|
21
|
-
else
|
22
|
-
render :new
|
23
|
-
end
|
24
|
-
end
|
11
|
+
def new
|
12
|
+
@template = Template.new
|
13
|
+
end
|
25
14
|
|
26
|
-
|
15
|
+
def create
|
16
|
+
@template = Template.new(template_params)
|
17
|
+
if @template.save
|
18
|
+
set_count
|
27
19
|
respond_with @template
|
20
|
+
else
|
21
|
+
render :new
|
28
22
|
end
|
23
|
+
end
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
25
|
+
def edit
|
26
|
+
respond_with @template
|
27
|
+
end
|
34
28
|
|
35
|
-
|
36
|
-
|
37
|
-
|
29
|
+
def update
|
30
|
+
@template.update(template_params)
|
31
|
+
respond_with @template
|
32
|
+
end
|
38
33
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
respond_with @templates
|
43
|
-
end
|
34
|
+
def download
|
35
|
+
send_file @template.file.path
|
36
|
+
end
|
44
37
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
38
|
+
def index
|
39
|
+
@templates = Template.all
|
40
|
+
set_count
|
41
|
+
respond_with @templates
|
42
|
+
end
|
50
43
|
|
51
|
-
|
44
|
+
def destroy
|
45
|
+
@template.destroy
|
46
|
+
set_count
|
47
|
+
respond_with @template
|
48
|
+
end
|
52
49
|
|
53
|
-
|
54
|
-
@count = Template.count
|
55
|
-
end
|
50
|
+
private
|
56
51
|
|
57
|
-
|
58
|
-
|
59
|
-
|
52
|
+
def set_count
|
53
|
+
@count = Template.count
|
54
|
+
end
|
60
55
|
|
61
|
-
|
62
|
-
|
63
|
-
|
56
|
+
def set_template
|
57
|
+
@template = Template.find(params[:id])
|
58
|
+
end
|
64
59
|
|
65
|
-
|
66
|
-
|
67
|
-
|
60
|
+
def template_params
|
61
|
+
params.require(:template).permit(attributes)
|
62
|
+
end
|
68
63
|
|
64
|
+
def attributes
|
65
|
+
%i( name context locked file )
|
69
66
|
end
|
70
67
|
|
71
68
|
end
|
@@ -1,10 +1,7 @@
|
|
1
1
|
module Gaku
|
2
2
|
class Admin::UsersController < 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_user, only: %i( edit update destroy )
|
10
7
|
before_action :set_roles
|
@@ -21,8 +18,9 @@ module Gaku
|
|
21
18
|
end
|
22
19
|
|
23
20
|
def create
|
24
|
-
|
25
|
-
|
21
|
+
user_creator = UserCreator.new(user_params)
|
22
|
+
user_creator.save
|
23
|
+
@user = user_creator.get_user
|
26
24
|
save_user_roles
|
27
25
|
@count = User.count
|
28
26
|
respond_with @user
|
@@ -55,7 +53,7 @@ module Gaku
|
|
55
53
|
end
|
56
54
|
|
57
55
|
def attributes
|
58
|
-
[:login, :username, :email, :password, :password_confirmation, :remember_me, :locale, { role_ids: [] }
|
56
|
+
[:login, :username, :email, :password, :password_confirmation, :remember_me, :locale, { role_ids: [] }]
|
59
57
|
end
|
60
58
|
|
61
59
|
def set_roles
|
@@ -8,5 +8,20 @@ module Gaku
|
|
8
8
|
content_tag :h4, text
|
9
9
|
end
|
10
10
|
|
11
|
+
def grading_methods_with_i18n
|
12
|
+
Hash[*Gaku::GradingMethod::Types.map do |k|
|
13
|
+
[I18n.t("grading_method.#{k}"), k.to_s]
|
14
|
+
end.flatten]
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
def badge_count(count, text, css_class)
|
19
|
+
if count != 0
|
20
|
+
"#{text}<span class='badge pull-right #{css_class}'>#{count}</span>".html_safe
|
21
|
+
else
|
22
|
+
"#{text}<span class='badge pull-right #{css_class}'></span>".html_safe
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
11
26
|
end
|
12
|
-
end
|
27
|
+
end
|
data/app/overrides/admin_menu.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
Deface::Override.new(
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
Deface::Override.new(
|
2
|
+
virtual_path: 'gaku/shared/menu/_global',
|
3
|
+
name: 'admin_menu',
|
4
|
+
insert_bottom: "[data-hook='menu']",
|
5
|
+
partial: 'gaku/shared/menu/admin',
|
6
|
+
disabled: false
|
7
|
+
)
|
@@ -1,12 +1,13 @@
|
|
1
|
-
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
.row
|
2
|
+
.col-md-12
|
3
|
+
#new-admin-attendance-type.d-none
|
4
|
+
.pull-left
|
5
|
+
= count_div 'admin-attendance-types-count' do
|
6
|
+
= print_count @count, t(:'attendance_type.list')
|
7
|
+
.pull-right
|
8
|
+
= ajax_link_to_new t(:'attendance_type.add'), [:new, :admin, :attendance_type], id: 'new-admin-attendance-type-link'
|
7
9
|
|
8
|
-
|
9
|
-
#new-admin-attendance-type.d-none
|
10
|
+
hr
|
10
11
|
|
11
12
|
#admin-attendance-types
|
12
13
|
= table_for 'admin-attendance-types-index' do
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#ajax-load').html('<%=j render "attendance_types" %>')
|
@@ -1 +1 @@
|
|
1
|
-
@attendance_types.to_json(root: false)
|
1
|
+
@attendance_types.to_json(root: false)
|
@@ -1,12 +1,13 @@
|
|
1
|
-
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
.row
|
2
|
+
.col-md-12
|
3
|
+
#new-admin-badge-type.d-none
|
4
|
+
.pull-left
|
5
|
+
= count_div 'admin-badge-types-count' do
|
6
|
+
= print_count @count, t(:'badge_type.list')
|
7
|
+
.pull-right
|
8
|
+
= ajax_link_to_new t(:'badge_type.add'), [:new, :admin, :badge_type], id: 'new-admin-badge-type-link'
|
7
9
|
|
8
|
-
|
9
|
-
#new-admin-badge-type.d-none
|
10
|
+
hr
|
10
11
|
|
11
12
|
#admin-badge-types
|
12
13
|
= table_for 'admin-badge-types-index' do
|
@@ -1,4 +1,4 @@
|
|
1
1
|
= modal_for 'edit-badge-type-modal' do
|
2
|
-
=
|
2
|
+
= modal_form_for [:admin, @badge_type], resource: 'admin-badge-type' do |f|
|
3
3
|
= render 'form_fields', f: f
|
4
4
|
= buttons_for @badge_type, resource: 'admin-badge-type'
|
@@ -0,0 +1,7 @@
|
|
1
|
+
$('#admin-badge-types-index tbody').append('<%= j render("badge_type", {badge_type: @badge_type}) %>');
|
2
|
+
|
3
|
+
$('#new-admin-badge-type').slide();
|
4
|
+
$('#new-admin-badge-type-link').show();
|
5
|
+
|
6
|
+
showNotice("<%= render_flash %>");
|
7
|
+
$('.admin-badge-types-count').html("<%= print_count(@count, t(:'badge_type.list')) %>");
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#ajax-load').html('<%=j render "badge_types" %>')
|
@@ -6,7 +6,7 @@
|
|
6
6
|
= count_div 'admin-school-campuses-count' do
|
7
7
|
= print_count @school.campuses.count, t(:'campus.list')
|
8
8
|
.pull-right
|
9
|
-
= ajax_link_to_new t(:'campus.add'), [:new, :admin, @school, :campus], id: 'new-admin-school-campus-link'
|
9
|
+
= ajax_link_to_new t(:'campus.add'), [:new, :admin, @school, :campus], id: 'new-admin-school-campus-link'
|
10
10
|
= hr
|
11
11
|
|
12
12
|
= index_body do
|
@@ -15,9 +15,7 @@
|
|
15
15
|
tr
|
16
16
|
= th_icon 'home'
|
17
17
|
= th t(:'campus.name')
|
18
|
-
|
19
|
-
|
20
|
-
- else
|
21
|
-
= th_actions 1
|
18
|
+
= th_actions 1
|
19
|
+
|
22
20
|
tbody
|
23
|
-
= render partial: 'gaku/admin/
|
21
|
+
= render partial: 'gaku/admin/campuses/campus', collection: @school.campuses, as: 'campus'
|
@@ -5,8 +5,7 @@
|
|
5
5
|
= count_div '' do
|
6
6
|
= t(:'address.singular')
|
7
7
|
.pull-right
|
8
|
-
= ajax_link_to_new t(:'address.add'), [:new, :admin, @school, @campus, :address], id: 'new-admin-school-campus-address-link', class: @campus.address.nil? ? "btn btn-primary" : 'btn btn-primary d-none'
|
9
|
-
= hr
|
8
|
+
= ajax_link_to_new t(:'address.add'), [:new, :admin, @school, @campus, :address], id: 'new-admin-school-campus-address-link', class: @campus.address.nil? ? "btn btn-primary" : 'btn btn-primary d-none'
|
10
9
|
|
11
10
|
= index_body do
|
12
11
|
= table_for 'admin-school-campus-addresses-index' do
|
@@ -19,6 +18,6 @@
|
|
19
18
|
= th t(:'address.city')
|
20
19
|
= th t(:'address.address1')
|
21
20
|
= th t(:'address.address2')
|
22
|
-
= th_actions 2
|
21
|
+
= th_actions 2
|
23
22
|
tbody
|
24
|
-
= render partial: 'gaku/admin/
|
23
|
+
= render partial: 'gaku/admin/campuses/addresses/address', locals: {address: @campus.address}
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#ajax-load').html('<%=j render "addresses" %>')
|
@@ -1,4 +1,4 @@
|
|
1
1
|
//edit from index
|
2
|
-
$('tr#address-<%= @address.id %>').html('<%= j render("gaku/admin/
|
2
|
+
$('tr#address-<%= @address.id %>').html('<%= j render("gaku/admin/campuses/addresses/address_row_fields", {address: @address, target: [@student, @guardian, @address]}) %>');
|
3
3
|
$("#edit-address-modal").modal("hide");
|
4
4
|
showNotice("<%= render_flash %>");
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#new-admin-school-campus-contact.d-none
|
5
5
|
.pull-left
|
6
6
|
= count_div "admin-school-campus-contacts-count" do
|
7
|
-
= print_count campus.contacts_count, t(:'contact.list')
|
7
|
+
= print_count @campus.contacts_count, t(:'contact.list')
|
8
8
|
.pull-right
|
9
|
-
= ajax_link_to_new t(:'contact.add'), [:new, :admin, @school, campus, :contact], id: 'new-admin-school-campus-contact-link'
|
9
|
+
= ajax_link_to_new t(:'contact.add'), [:new, :admin, @school, @campus, :contact], id: 'new-admin-school-campus-contact-link'
|
10
10
|
|
11
11
|
= index_body do
|
12
12
|
= table_for "admin-school-campus-contacts-index" do
|
@@ -17,6 +17,6 @@
|
|
17
17
|
= th t(:'contact.data')
|
18
18
|
= th t(:'contact.details')
|
19
19
|
= th t(:'contact.emergency')
|
20
|
-
= th_actions 2
|
20
|
+
= th_actions 2
|
21
21
|
tbody
|
22
|
-
= render partial: 'gaku/admin/
|
22
|
+
= render partial: 'gaku/admin/campuses/contacts/contact', collection: @campus.contacts, as: :contact
|
@@ -0,0 +1,11 @@
|
|
1
|
+
= render 'gaku/admin/campuses/contacts/primary_field', contact: contact
|
2
|
+
|
3
|
+
td = contact.name
|
4
|
+
td = contact.data
|
5
|
+
td = contact.details
|
6
|
+
td
|
7
|
+
= t(:'contact.emergency') if contact.emergency?
|
8
|
+
|
9
|
+
td
|
10
|
+
= ajax_link_to_edit [:edit, :admin, @school, @campus, contact]
|
11
|
+
= render 'gaku/admin/campuses/contacts/delete_link', contact: contact
|
@@ -0,0 +1,6 @@
|
|
1
|
+
td class="primary-contact" width="28px"
|
2
|
+
- if contact.primary?
|
3
|
+
= ajax_link_to_make_primary [:make_primary, :admin, @school, @campus, contact], method: :patch, id: 'set-primary-link', class: 'btn btn-xs btn-primary make-primary'
|
4
|
+
- else
|
5
|
+
= ajax_link_to_make_primary [:make_primary, :admin, @school, @campus, contact], method: :patch, id: 'set-primary-link', class: 'btn btn-xs btn-default'
|
6
|
+
|
@@ -5,7 +5,7 @@ $("#new-admin-school-campus-contact-link").show();
|
|
5
5
|
$('#new-admin-school-campus-contact').slide();
|
6
6
|
|
7
7
|
$('.admin-school-campus-contacts-count').html("<%= print_count(@count, t(:'contact.list')) %>");
|
8
|
-
$('
|
8
|
+
$('.contacts-count').html("<%= @count %>");
|
9
9
|
|
10
10
|
<% if @contact.primary? %>
|
11
11
|
$('#admin-school-campus-contacts-index tbody tr').each(function(){
|
@@ -5,4 +5,4 @@ showNotice("<%= render_flash %>");
|
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
$('.admin-school-campus-contacts-count').html("<%= print_count(@count, t(:'contact.list')) %>");
|
8
|
-
$('
|
8
|
+
$('.contacts-count').html("<%= @count %>");
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#ajax-load').html('<%=j render "contacts" %>')
|
@@ -0,0 +1,34 @@
|
|
1
|
+
.row
|
2
|
+
.col-md-2
|
3
|
+
.panel-group#accordion
|
4
|
+
.panel
|
5
|
+
.picture-upload
|
6
|
+
= render 'gaku/admin/shared/ajax_picture', resource: @campus
|
7
|
+
|
8
|
+
|
9
|
+
.panel.panel-default
|
10
|
+
.panel-heading
|
11
|
+
h4#campus-name.panel-title
|
12
|
+
= @campus.name
|
13
|
+
.panel-body
|
14
|
+
ul.list-unstyled
|
15
|
+
li = link_to t(:'edit'), [:edit, :admin, @school, @campus], remote: true
|
16
|
+
li#addresses-menu
|
17
|
+
= link_to badge_count(@campus.addresses_count, t(:'address.plural'), 'addresses-count'), [:admin, @campus, :addresses], remote: true
|
18
|
+
li#contacts-menu
|
19
|
+
= link_to badge_count(@campus.contacts_count, t(:'contact.plural'), 'contacts-count'), [:admin, @campus, :contacts], remote: true
|
20
|
+
|
21
|
+
.panel.panel-default
|
22
|
+
.panel-heading
|
23
|
+
h4.panel-title
|
24
|
+
= link_to t(:'admin.back_to_school'), [:edit, :admin, @school]
|
25
|
+
|
26
|
+
|
27
|
+
.panel.panel-default
|
28
|
+
.panel-heading
|
29
|
+
h4.panel-title
|
30
|
+
= link_to t(:'admin.back'), [:admin, :root]
|
31
|
+
|
32
|
+
.col-md-10#ajax-load
|
33
|
+
|
34
|
+
= render 'edit_form'
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#ajax-load').html('<%=j render "edit_form" %>')
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#ajax-load').html('<%=j render "campuses" %>')
|
@@ -0,0 +1,18 @@
|
|
1
|
+
.row
|
2
|
+
.col-md-12
|
3
|
+
#new-admin-commute-method-type.d-none
|
4
|
+
.pull-left
|
5
|
+
= count_div 'admin-commute-method-types-count' do
|
6
|
+
= print_count @count, t(:'commute_method_type.list')
|
7
|
+
.pull-right
|
8
|
+
= ajax_link_to_new t(:'commute_method_type.new'), [:new, :admin, :commute_method_type], id: 'new-admin-commute-method-type-link'
|
9
|
+
hr
|
10
|
+
|
11
|
+
#admin-commute-method-types
|
12
|
+
= table_for 'admin-commute-method-types-index' do
|
13
|
+
thead
|
14
|
+
tr
|
15
|
+
= th t(:'commute_method_type.plural')
|
16
|
+
= th_actions 2
|
17
|
+
tbody
|
18
|
+
= render partial: 'commute_method_type', collection: @commute_method_types, as: :commute_method_type
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#ajax-load').html('<%=j render "commute_method_types" %>')
|
@@ -0,0 +1,18 @@
|
|
1
|
+
.row
|
2
|
+
.col-md-12
|
3
|
+
#new-admin-contact-type.d-none
|
4
|
+
.pull-left
|
5
|
+
= count_div 'admin-contact-types-count' do
|
6
|
+
= print_count @count, t(:'contact_type.list')
|
7
|
+
.pull-right
|
8
|
+
= ajax_link_to_new t(:'contact_type.add'), [:new, :admin, :contact_type], id: 'new-admin-contact-type-link'
|
9
|
+
hr
|
10
|
+
|
11
|
+
#admin-contact-types
|
12
|
+
= table_for 'admin-contact-types-index' do
|
13
|
+
thead
|
14
|
+
tr
|
15
|
+
= th t(:'contact_type.singular')
|
16
|
+
= th_actions 2
|
17
|
+
tbody
|
18
|
+
= render partial: 'contact_type', collection: @contact_types, as: 'contact_type'
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#ajax-load').html('<%=j render "contact_types" %>')
|
@@ -0,0 +1,21 @@
|
|
1
|
+
.row
|
2
|
+
.col-md-12
|
3
|
+
#new-admin-department.d-none
|
4
|
+
.pull-left
|
5
|
+
= count_div 'admin-departments-count' do
|
6
|
+
= print_count @count, t(:'department.list')
|
7
|
+
.pull-right
|
8
|
+
= ajax_link_to_new t(:'department.add'), [:new, :admin, :department], id: 'new-admin-department-link'
|
9
|
+
|
10
|
+
hr
|
11
|
+
|
12
|
+
#admin-departments
|
13
|
+
= table_for 'admin-departments-index' do
|
14
|
+
thead
|
15
|
+
tr
|
16
|
+
= th t(:'department.name')
|
17
|
+
|
18
|
+
= th_actions 2
|
19
|
+
tbody
|
20
|
+
= render partial: 'gaku/admin/departments/department', collection: @departments, as: :department
|
21
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#ajax-load').html('<%=j render "departments" %>')
|
data/app/views/gaku/admin/enrollment_statuses/{index.html.slim → _enrollment_statuses.html.slim}
RENAMED
@@ -1,13 +1,12 @@
|
|
1
|
-
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
=
|
9
|
-
|
10
|
-
|
1
|
+
.row
|
2
|
+
.col-md-12
|
3
|
+
#new-admin-enrollment-status.d-none
|
4
|
+
.pull-left
|
5
|
+
= count_div 'admin-enrollment-statuses-count' do
|
6
|
+
= print_count @count, t(:'enrollment_status.list')
|
7
|
+
.pull-right
|
8
|
+
= ajax_link_to_new t(:'enrollment_status.add'), [:new, :admin, :enrollment_status], id: 'new-admin-enrollment-status-link'
|
9
|
+
hr
|
11
10
|
#admin-enrollment-statuses
|
12
11
|
= table_for 'admin-enrollment-statuses-index' do
|
13
12
|
thead
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#ajax-load').html('<%=j render "enrollment_statuses" %>')
|
@@ -4,6 +4,6 @@ td = boolean_image grading_method_set.display_deviation
|
|
4
4
|
td = boolean_image grading_method_set.display_rank
|
5
5
|
td = boolean_image grading_method_set.rank_order
|
6
6
|
td
|
7
|
-
=
|
7
|
+
= ajax_link_to_show [:admin, grading_method_set]
|
8
8
|
= ajax_link_to_edit [:edit, :admin, grading_method_set]
|
9
9
|
= ajax_link_to_delete [:admin, grading_method_set]
|