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.
Files changed (233) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/gaku/admin/admin.coffee +6 -6
  3. data/app/assets/javascripts/gaku/admin/base.js.coffee +11 -2
  4. data/app/assets/javascripts/gaku/admin.js.coffee +6 -0
  5. data/app/assets/stylesheets/gaku/admin/bootstrap_and_theme.css.scss +16 -1
  6. data/app/assets/stylesheets/gaku/admin.css +0 -1
  7. data/app/controllers/concerns/admin_picture_controller.rb +28 -0
  8. data/app/controllers/gaku/admin/attendance_types_controller.rb +8 -8
  9. data/app/controllers/gaku/admin/badge_types_controller.rb +9 -16
  10. data/app/controllers/gaku/admin/base_controller.rb +1 -1
  11. data/app/controllers/gaku/admin/{schools/campuses → campuses}/addresses_controller.rb +3 -9
  12. data/app/controllers/gaku/admin/{schools/campuses → campuses}/contacts_controller.rb +6 -10
  13. data/app/controllers/gaku/admin/{schools/campuses_controller.rb → campuses_controller.rb} +7 -11
  14. data/app/controllers/gaku/admin/commute_method_types_controller.rb +8 -7
  15. data/app/controllers/gaku/admin/contact_types_controller.rb +7 -7
  16. data/app/controllers/gaku/admin/departments_controller.rb +7 -7
  17. data/app/controllers/gaku/admin/enrollment_statuses_controller.rb +9 -8
  18. data/app/controllers/gaku/admin/grading_method_sets/grading_method_set_items_controller.rb +1 -1
  19. data/app/controllers/gaku/admin/grading_method_sets_controller.rb +11 -11
  20. data/app/controllers/gaku/admin/grading_methods_controller.rb +10 -9
  21. data/app/controllers/gaku/admin/home_controller.rb +11 -0
  22. data/app/controllers/gaku/admin/presets_controller.rb +4 -6
  23. data/app/controllers/gaku/admin/roles_controller.rb +8 -7
  24. data/app/controllers/gaku/admin/school_years/semesters_controller.rb +0 -1
  25. data/app/controllers/gaku/admin/school_years_controller.rb +3 -7
  26. data/app/controllers/gaku/admin/schools/programs_controller.rb +11 -4
  27. data/app/controllers/gaku/admin/schools_controller.rb +82 -79
  28. data/app/controllers/gaku/admin/{achievements/simple_grade_types_controller.rb → simple_grade_types_controller.rb} +4 -3
  29. data/app/controllers/gaku/admin/specialties_controller.rb +2 -5
  30. data/app/controllers/gaku/admin/states_controller.rb +71 -71
  31. data/app/controllers/gaku/admin/student_review_categories_controller.rb +57 -0
  32. data/app/controllers/gaku/admin/templates_controller.rb +47 -50
  33. data/app/controllers/gaku/admin/users_controller.rb +5 -7
  34. data/app/controllers/gaku/states_controller.rb +2 -0
  35. data/app/helpers/gaku/admin_helper.rb +16 -1
  36. data/app/helpers/gaku/shared_helper.rb +2 -2
  37. data/app/overrides/admin_menu.rb +7 -6
  38. data/app/views/gaku/admin/attendance_types/{index.html.slim → _attendance_types.html.slim} +9 -8
  39. data/app/views/gaku/admin/attendance_types/index.js.erb +1 -0
  40. data/app/views/gaku/admin/attendance_types/index.json.rb +1 -1
  41. data/app/views/gaku/admin/badge_types/{index.html.slim → _badge_types.html.slim} +9 -8
  42. data/app/views/gaku/admin/badge_types/_form.html.slim +1 -1
  43. data/app/views/gaku/admin/badge_types/_modal.html.slim +1 -1
  44. data/app/views/gaku/admin/badge_types/create.js.erb +7 -0
  45. data/app/views/gaku/admin/badge_types/index.js.erb +1 -0
  46. data/app/views/gaku/admin/badge_types/new.js.erb +1 -1
  47. data/app/views/gaku/admin/badge_types/update.js.erb +3 -0
  48. data/app/views/gaku/admin/campuses/_campus.html.slim +4 -0
  49. data/app/views/gaku/admin/{schools/campuses → campuses}/_campuses.html.slim +4 -6
  50. data/app/views/gaku/admin/campuses/_edit_form.html.slim +3 -0
  51. data/app/views/gaku/admin/campuses/addresses/_address.html.slim +6 -0
  52. data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_address_row_fields.html.slim +1 -1
  53. data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_addresses.html.slim +3 -4
  54. data/app/views/gaku/admin/campuses/addresses/index.js.erb +1 -0
  55. data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/update.js.erb +1 -1
  56. data/app/views/gaku/admin/campuses/contacts/_contact.html.slim +3 -0
  57. data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/_contacts.html.slim +4 -4
  58. data/app/views/gaku/admin/campuses/contacts/_fields.html.slim +11 -0
  59. data/app/views/gaku/admin/campuses/contacts/_primary_field.html.slim +6 -0
  60. data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/create.js.erb +1 -1
  61. data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/destroy.js.erb +1 -1
  62. data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/edit.js.erb +1 -1
  63. data/app/views/gaku/admin/campuses/contacts/index.js.erb +1 -0
  64. data/app/views/gaku/admin/campuses/edit.html.slim +34 -0
  65. data/app/views/gaku/admin/campuses/edit.js.erb +1 -0
  66. data/app/views/gaku/admin/campuses/index.js.erb +1 -0
  67. data/app/views/gaku/admin/campuses/update.js.erb +2 -0
  68. data/app/views/gaku/admin/commute_method_types/_commute_method_types.html.slim +18 -0
  69. data/app/views/gaku/admin/commute_method_types/index.js.erb +1 -0
  70. data/app/views/gaku/admin/contact_types/_contact_types.html.slim +18 -0
  71. data/app/views/gaku/admin/contact_types/index.js.erb +1 -0
  72. data/app/views/gaku/admin/departments/_departments.html.slim +21 -0
  73. data/app/views/gaku/admin/departments/index.js.erb +1 -0
  74. data/app/views/gaku/admin/enrollment_statuses/{index.html.slim → _enrollment_statuses.html.slim} +9 -10
  75. data/app/views/gaku/admin/enrollment_statuses/index.js.erb +1 -0
  76. data/app/views/gaku/admin/grading_method_sets/_fields.html.slim +1 -1
  77. data/app/views/gaku/admin/grading_method_sets/{index.html.slim → _grading_method_sets.html.slim} +9 -8
  78. data/app/views/gaku/admin/grading_method_sets/_show.html.slim +4 -0
  79. data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_fields.html.slim +2 -2
  80. data/app/views/gaku/admin/grading_method_sets/grading_method_set_items/_items.html.slim +1 -1
  81. data/app/views/gaku/admin/grading_method_sets/index.js.erb +1 -0
  82. data/app/views/gaku/admin/grading_method_sets/show.js.erb +1 -0
  83. data/app/views/gaku/admin/grading_methods/_criteria_form_fields.html.slim +19 -0
  84. data/app/views/gaku/admin/grading_methods/_criteria_template.html.slim +11 -0
  85. data/app/views/gaku/admin/grading_methods/_fields.html.slim +1 -1
  86. data/app/views/gaku/admin/grading_methods/_form_fields.html.slim +3 -2
  87. data/app/views/gaku/admin/grading_methods/_grading_methods.html.slim +21 -0
  88. data/app/views/gaku/admin/grading_methods/index.js.erb +1 -0
  89. data/app/views/gaku/admin/home/index.html.slim +5 -0
  90. data/app/views/gaku/admin/presets/_address.html.slim +8 -7
  91. data/app/views/gaku/admin/presets/_chooser_fields.html.slim +1 -1
  92. data/app/views/gaku/admin/presets/_export_formats.html.slim +5 -4
  93. data/app/views/gaku/admin/presets/_fields.html.slim +1 -1
  94. data/app/views/gaku/admin/presets/_grading.html.slim +4 -3
  95. data/app/views/gaku/admin/presets/_locale.html.slim +6 -3
  96. data/app/views/gaku/admin/presets/_names_order.html.slim +1 -1
  97. data/app/views/gaku/admin/presets/_pagination.html.slim +10 -9
  98. data/app/views/gaku/admin/presets/_person.html.slim +3 -2
  99. data/app/views/gaku/admin/presets/{index.html.slim → _presets.html.slim} +7 -4
  100. data/app/views/gaku/admin/presets/_student.html.slim +1 -1
  101. data/app/views/gaku/admin/presets/_tabs.html.slim +2 -3
  102. data/app/views/gaku/admin/presets/edit.js.erb +1 -0
  103. data/app/views/gaku/admin/presets/index.js.erb +1 -0
  104. data/app/views/gaku/admin/presets/update.js.erb +1 -0
  105. data/app/views/gaku/admin/roles/_roles.html.slim +21 -0
  106. data/app/views/gaku/admin/roles/index.js.erb +1 -0
  107. data/app/views/gaku/admin/school_years/_edit_form.html.slim +4 -0
  108. data/app/views/gaku/admin/school_years/_fields.html.slim +1 -2
  109. data/app/views/gaku/admin/school_years/_school_years.html.slim +23 -0
  110. data/app/views/gaku/admin/school_years/edit.html.slim +20 -0
  111. data/app/views/gaku/admin/school_years/edit.js.erb +4 -2
  112. data/app/views/gaku/admin/school_years/index.js.erb +1 -0
  113. data/app/views/gaku/admin/school_years/semesters/_semesters.html.slim +1 -1
  114. data/app/views/gaku/admin/school_years/semesters/index.js.erb +1 -0
  115. data/app/views/gaku/admin/schools/_edit_form.html.slim +3 -0
  116. data/app/views/gaku/admin/schools/_edit_master_form.html.slim +10 -0
  117. data/app/views/gaku/admin/schools/_school.html.slim +4 -2
  118. data/app/views/gaku/admin/schools/{index.html.slim → _schools.html.slim} +10 -9
  119. data/app/views/gaku/admin/schools/_tabs.html.slim +1 -1
  120. data/app/views/gaku/admin/schools/edit.html.slim +37 -14
  121. data/app/views/gaku/admin/schools/edit.js.erb +1 -0
  122. data/app/views/gaku/admin/schools/edit_master.html.slim +36 -16
  123. data/app/views/gaku/admin/schools/index.js.erb +1 -0
  124. data/app/views/gaku/admin/schools/programs/_fields.html.slim +3 -4
  125. data/app/views/gaku/admin/schools/programs/_programs.html.slim +2 -2
  126. data/app/views/gaku/admin/schools/programs/create.js.erb +1 -0
  127. data/app/views/gaku/admin/schools/programs/destroy.js.erb +1 -0
  128. data/app/views/gaku/admin/schools/programs/index.js.erb +1 -0
  129. data/app/views/gaku/admin/schools/update.js.erb +1 -0
  130. data/app/views/gaku/admin/shared/_ajax_picture.html.slim +8 -0
  131. data/app/views/gaku/admin/shared/_ajax_upload_picture.html.slim +14 -0
  132. data/app/views/gaku/admin/shared/remove_picture.js.erb +3 -0
  133. data/app/views/gaku/admin/shared/set_picture.js.erb +3 -0
  134. data/app/views/gaku/admin/simple_grade_types/_simple_grade_types.html.slim +24 -0
  135. data/app/views/gaku/admin/simple_grade_types/index.js.erb +1 -0
  136. data/app/views/gaku/admin/specialties/{index.html.slim → _specialties.html.slim} +9 -8
  137. data/app/views/gaku/admin/specialties/index.js.erb +1 -0
  138. data/app/views/gaku/admin/states/_country_select_form.html.slim +1 -2
  139. data/app/views/gaku/admin/states/_form_fields.html.slim +1 -1
  140. data/app/views/gaku/admin/states/_states.html.slim +16 -0
  141. data/app/views/gaku/admin/states/index.js.erb +1 -0
  142. data/app/views/gaku/admin/student_review_categories/_form.html.slim +3 -0
  143. data/app/views/gaku/admin/student_review_categories/_form_fields.html.slim +1 -0
  144. data/app/views/gaku/admin/student_review_categories/_modal.html.slim +4 -0
  145. data/app/views/gaku/admin/student_review_categories/_student_review_categories.html.slim +18 -0
  146. data/app/views/gaku/admin/student_review_categories/_student_review_category.html.slim +2 -0
  147. data/app/views/gaku/admin/student_review_categories/_table_fields.html.slim +4 -0
  148. data/app/views/gaku/admin/student_review_categories/create.js.erb +7 -0
  149. data/app/views/gaku/admin/student_review_categories/destroy.js.erb +2 -0
  150. data/app/views/gaku/admin/student_review_categories/edit.js.erb +3 -0
  151. data/app/views/gaku/admin/student_review_categories/index.js.erb +1 -0
  152. data/app/views/gaku/admin/student_review_categories/new.js.erb +3 -0
  153. data/app/views/gaku/admin/student_review_categories/update.js.erb +3 -0
  154. data/app/views/gaku/admin/templates/_fields.html.slim +2 -2
  155. data/app/views/gaku/admin/templates/_form.html.slim +1 -1
  156. data/app/views/gaku/admin/templates/_modal.html.slim +5 -2
  157. data/app/views/gaku/admin/templates/_templates.html.slim +21 -0
  158. data/app/views/gaku/admin/templates/create.js.erb +7 -0
  159. data/app/views/gaku/admin/templates/edit.js.erb +3 -0
  160. data/app/views/gaku/admin/templates/index.js.erb +1 -0
  161. data/app/views/gaku/admin/templates/new.js.erb +3 -0
  162. data/app/views/gaku/admin/templates/update.js.erb +3 -0
  163. data/app/views/gaku/admin/users/_users.html.slim +22 -0
  164. data/app/views/gaku/admin/users/index.js.erb +1 -0
  165. data/app/views/gaku/layouts/admin/index.html.slim +0 -1
  166. data/app/views/gaku/shared/menu/_admin.html.erb +1 -71
  167. data/app/views/gaku/shared/menu/_admin_menu.html.erb +154 -0
  168. data/config/routes.rb +20 -10
  169. data/lib/gaku/admin/engine.rb +3 -5
  170. data/lib/gaku/admin.rb +2 -1
  171. data/lib/gaku/app_responder.rb +1 -1
  172. data/lib/gaku_admin.rb +1 -1
  173. data/lib/tasks/admin_user.rake +2 -1
  174. metadata +456 -374
  175. data/app/views/gaku/admin/achievements/simple_grade_types/index.html.slim +0 -23
  176. data/app/views/gaku/admin/commute_method_types/index.html.slim +0 -18
  177. data/app/views/gaku/admin/contact_types/index.html.slim +0 -18
  178. data/app/views/gaku/admin/departments/index.html.slim +0 -20
  179. data/app/views/gaku/admin/grading_method_sets/show.html.slim +0 -13
  180. data/app/views/gaku/admin/grading_methods/index.html.slim +0 -20
  181. data/app/views/gaku/admin/roles/index.html.slim +0 -20
  182. data/app/views/gaku/admin/school_years/index.html.slim +0 -21
  183. data/app/views/gaku/admin/school_years/show.html.slim +0 -15
  184. data/app/views/gaku/admin/schools/campuses/_campus.html.slim +0 -6
  185. data/app/views/gaku/admin/schools/campuses/_picture.html.slim +0 -8
  186. data/app/views/gaku/admin/schools/campuses/_show_table.html.slim +0 -10
  187. data/app/views/gaku/admin/schools/campuses/_tabs.html.slim +0 -15
  188. data/app/views/gaku/admin/schools/campuses/_upload_picture.html.slim +0 -7
  189. data/app/views/gaku/admin/schools/campuses/addresses/_address.html.slim +0 -7
  190. data/app/views/gaku/admin/schools/campuses/contacts/_contact.html.slim +0 -3
  191. data/app/views/gaku/admin/schools/campuses/contacts/_fields.html.slim +0 -12
  192. data/app/views/gaku/admin/schools/campuses/contacts/_primary_field.html.slim +0 -13
  193. data/app/views/gaku/admin/schools/campuses/edit.html.slim +0 -19
  194. data/app/views/gaku/admin/schools/campuses/show.html.slim +0 -13
  195. data/app/views/gaku/admin/schools/show.html.slim +0 -13
  196. data/app/views/gaku/admin/schools/show_master.html.slim +0 -14
  197. data/app/views/gaku/admin/states/index.html.slim +0 -15
  198. data/app/views/gaku/admin/templates/edit.html.slim +0 -1
  199. data/app/views/gaku/admin/templates/index.html.slim +0 -20
  200. data/app/views/gaku/admin/templates/new.html.slim +0 -1
  201. data/app/views/gaku/admin/users/index.html.slim +0 -21
  202. data/config/initializers/client_side_validations.rb +0 -9
  203. /data/app/views/gaku/admin/{schools/campuses → campuses}/_form.html.slim +0 -0
  204. /data/app/views/gaku/admin/{schools/campuses → campuses}/_form_fields.html.slim +0 -0
  205. /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_fields.html.slim +0 -0
  206. /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_form.html.slim +0 -0
  207. /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_form_fields.html.slim +0 -0
  208. /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/_modal.html.slim +0 -0
  209. /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/create.js.erb +0 -0
  210. /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/destroy.js.erb +0 -0
  211. /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/edit.js.erb +0 -0
  212. /data/app/views/gaku/admin/{schools/campuses → campuses}/addresses/new.js.erb +0 -0
  213. /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/_delete_link.html.slim +0 -0
  214. /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/_form.html.slim +0 -0
  215. /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/_form_fields.html.slim +0 -0
  216. /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/_modal.html.slim +0 -0
  217. /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/make_primary.js.erb +0 -0
  218. /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/new.js.erb +0 -0
  219. /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/soft_delete.js.erb +0 -0
  220. /data/app/views/gaku/admin/{schools/campuses → campuses}/contacts/update.js.erb +0 -0
  221. /data/app/views/gaku/admin/{schools/campuses → campuses}/create.js.erb +0 -0
  222. /data/app/views/gaku/admin/{schools/campuses → campuses}/destroy.js.erb +0 -0
  223. /data/app/views/gaku/admin/{schools/campuses → campuses}/new.js.erb +0 -0
  224. /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/_fields.html.slim +0 -0
  225. /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/_form.html.slim +0 -0
  226. /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/_form_fields.html.slim +0 -0
  227. /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/_modal.html.slim +0 -0
  228. /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/_simple_grade_type.html.slim +0 -0
  229. /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/create.js.erb +0 -0
  230. /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/destroy.js.erb +0 -0
  231. /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/edit.js.erb +0 -0
  232. /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/new.js.erb +0 -0
  233. /data/app/views/gaku/admin/{achievements/simple_grade_types → simple_grade_types}/update.js.erb +0 -0
@@ -1,22 +1,42 @@
1
1
  .row
2
- .col-md-9
3
- = normal_nested_form_for [:admin, @school], url: {action: :update_master}, label: t(:'school.master') do |f|
4
- = render 'form_fields', f: f
5
- = f.fields_for :levels do |level|
6
- = level.text_field :name, label: t(:'school_level.singular'), class: 'school-level-name'
7
- = level.link_to_remove t(:'school_level.remove_school_level'), class: 'btn btn-danger remove-school-level'
8
- hr
9
- p = f.link_to_add t(:'school_level.add_school_level'), :levels, class: 'btn btn-success add-school-level'
2
+ .col-md-2
3
+ .panel-group#accordion
4
+ .panel
5
+ .picture-upload
6
+ = render 'gaku/admin/shared/ajax_picture', resource: @school
10
7
 
11
- = buttons_for @school, label: t(:'school.save'), resource: 'admin-school'
12
8
 
13
- .col-md-3
14
- = render 'gaku/admin/shared/picture', resource: @school
9
+ .panel.panel-default
10
+ .panel-heading
11
+ h4.panel-title
12
+ = @school.name
13
+ .panel-body
14
+ ul.list-unstyled
15
+ li = link_to t(:'edit'), admin_school_details_edit_path
15
16
 
16
- hr
17
17
 
18
- = render 'tabs', school: @school
18
+ .panel.panel-default
19
+ .panel-heading
20
+ h4#campuses-menu.panel-title
21
+ = link_to badge_count(@school.campuses.count, t(:'campus.plural'), 'campuses-count'), [:admin, @school, :campuses], remote: true
22
+ .panel-body
23
+ ul.list-unstyled
24
+ - @school.campuses.each do |campus|
25
+ li = link_to campus.name, [:edit, :admin, @school, campus]
19
26
 
20
- = footer do
21
- .col-md-12
22
- = link_to_back admin_school_details_path , id: 'back-admin-school-link'
27
+ .panel.panel-default
28
+ .panel-heading
29
+ h4#programs-menu.panel-title
30
+ = link_to badge_count(@school.programs.count, t(:'program.plural'), 'programs-count'), [:admin, @school, :programs], remote: true
31
+ .panel-body
32
+ ul.list-unstyled
33
+ - @school.programs.each do |program|
34
+ li = link_to program.name, [:edit, :admin, @school, program], remote: true
35
+
36
+ .panel.panel-default
37
+ .panel-heading
38
+ h4.panel-title
39
+ = link_to t(:'admin.back'), [:admin, :root]
40
+
41
+ .col-md-10#ajax-load
42
+ = render 'edit_master_form'
@@ -0,0 +1 @@
1
+ $('#ajax-load').html('<%=j render "schools" %>')
@@ -4,7 +4,6 @@ td = link_to t(:'program_level.list'), [:show_program_levels,:admin, @school, pr
4
4
  td = link_to t(:'program_syllabus.list'), [:show_program_syllabuses,:admin, @school, program], remote: true, class: 'program-syllabuses-list'
5
5
  td = link_to t(:'program_specialty.list'), [:show_program_specialties,:admin, @school, program], remote: true, class: 'program-specialties-list'
6
6
 
7
- - if can_edit?
8
- td
9
- = ajax_link_to_edit [:edit, :admin, @school, program]
10
- = ajax_link_to_delete [:admin, @school, program]
7
+ td
8
+ = ajax_link_to_edit [:edit, :admin, @school, program]
9
+ = ajax_link_to_delete [:admin, @school, program]
@@ -6,7 +6,7 @@
6
6
  = count_div 'admin-school-programs-count' do
7
7
  = print_count @school.programs.count, t(:'program.list')
8
8
  .pull-right
9
- = ajax_link_to_new t(:'program.add'), [:new, :admin, @school, :program], id: 'new-admin-school-program-link' if can_edit?
9
+ = ajax_link_to_new t(:'program.add'), [:new, :admin, @school, :program], id: 'new-admin-school-program-link'
10
10
  = hr
11
11
 
12
12
  = index_body do
@@ -18,6 +18,6 @@
18
18
  = th t(:'program.levels')
19
19
  = th t(:'syllabus.plural')
20
20
  = th t(:'specialty.plural')
21
- = th_actions 2 if can_edit?
21
+ = th_actions 2
22
22
  tbody
23
23
  = render partial: 'gaku/admin/schools/programs/program', collection: @school.programs, as: :program
@@ -4,4 +4,5 @@ $('#new-admin-school-program').slide();
4
4
  $('#new-admin-school-program-link').show();
5
5
 
6
6
  $('.admin-school-programs-count').html("<%= print_count(@count, t(:'program.list')) %>");
7
+ $('.programs-count').html("<%= @count %>");
7
8
  showNotice("<%= render_flash %>");
@@ -1,2 +1,3 @@
1
1
  $('.admin-school-programs-count').html("<%= print_count(@count, t(:'program.list')) %>");
2
+ $('.programs-count').html("<%= @count %>");
2
3
  showNotice("<%= render_flash %>");
@@ -0,0 +1 @@
1
+ $('#ajax-load').html('<%=j render "programs" %>')
@@ -0,0 +1 @@
1
+ showNotice("<%= render_flash %>");
@@ -0,0 +1,8 @@
1
+ a.thumbnail.mb-0#thumb-picture
2
+ = image_tag resource.picture.url(:thumb), id: "avatar-picture"
3
+ #popover-upload-picture.d-none
4
+ = link_to_upload_image 'JavaScript:void(0);', method: :get, id: "upload-picture-link", style: "width: 280px"
5
+ #upload-picture.d-none
6
+ .row
7
+ .col-md-12
8
+ = render 'gaku/admin/shared/ajax_upload_picture', resource: resource
@@ -0,0 +1,14 @@
1
+ = form_for([:set_picture, :admin, resource], remote: true, html: { multipart: true }) do |form|
2
+ .row
3
+ .col-md-12
4
+ .form-group
5
+ = form.file_field :picture, class: "form-file form-control "
6
+ .row
7
+ .col-md-12
8
+ -if resource.picture.file?
9
+ = button_tag class: 'col-md-8 btn btn-default', style: 'margin-right:13px'
10
+ = content_tag(:span, t('upload'), class: 'glyphicon glyphicon-upload')
11
+ = link_to [:remove_picture, :admin, resource], remote: true, method: :delete, class: 'col-md-3 btn btn-danger remove-picture-link', data: {confirm: t('confirm')} do
12
+ = content_tag(:span, nil, class: 'glyphicon glyphicon-trash')
13
+ -else
14
+ = link_to_upload class: 'col-md-12 btn btn-default'
@@ -0,0 +1,3 @@
1
+ $('.picture-upload').html('<%= j render("gaku/admin/shared/ajax_picture", resource: @resource) %>');
2
+ $('.picture-upload').popover('hide')
3
+ showNotice("<%= render_flash %>");
@@ -0,0 +1,3 @@
1
+ $('.picture-upload').html('<%= j render("gaku/admin/shared/ajax_picture", resource: @resource) %>');
2
+ showNotice("<%= render_flash %>");
3
+ $('.picture-upload').popover('hide')
@@ -0,0 +1,24 @@
1
+ .row
2
+ .col-md-12
3
+ #new-admin-simple-grade-type.d-none
4
+ .pull-left
5
+ = count_div 'admin-simple-grade-types-count' do
6
+ = print_count @count, t(:'simple_grade_type.list')
7
+ .pull-right
8
+ = ajax_link_to_new t(:'simple_grade_type.add'), [:new, :admin, :simple_grade_type], id: 'new-admin-simple-grade-type-link'
9
+
10
+ hr
11
+
12
+ #admin-simple-grade-types
13
+ = table_for 'admin-simple-grade-types-index' do
14
+ thead
15
+ tr
16
+ = th t(:'simple_grade_type.singular')
17
+ = th t(:'simple_grade_type.max_score')
18
+ = th t(:'simple_grade_type.passing_score')
19
+ = th t(:'school.singular')
20
+ = th t(:'grading_method.singular')
21
+ = th_actions 2
22
+ tbody
23
+ = render partial: 'simple_grade_type', collection: @simple_grade_types, as: :simple_grade_type
24
+
@@ -0,0 +1 @@
1
+ $('#ajax-load').html('<%=j render "simple_grade_types" %>')
@@ -1,12 +1,13 @@
1
- = content_for :index_header do
2
- .pull-left
3
- = count_div 'admin-specialties-count' do
4
- = print_count @count, t(:'specialty.list')
5
- .pull-right
6
- = ajax_link_to_new t(:'specialty.add'), [:new, :admin, :specialty], id: 'new-admin-specialty-link'
1
+ .row
2
+ .col-md-12
3
+ #new-admin-specialty.d-none
4
+ .pull-left
5
+ = count_div 'admin-specialties-count' do
6
+ = print_count @count, t(:'specialty.list')
7
+ .pull-right
8
+ = ajax_link_to_new t(:'specialty.add'), [:new, :admin, :specialty], id: 'new-admin-specialty-link'
7
9
 
8
- = content_for :new_form do
9
- #new-admin-specialty.d-none
10
+ hr
10
11
 
11
12
  #admin-specialties
12
13
  = table_for 'admin-specialties-index' do
@@ -0,0 +1 @@
1
+ $('#ajax-load').html('<%=j render "specialties" %>')
@@ -1,4 +1,3 @@
1
1
  = form_tag country_states_admin_states_path, { remote: true, class: 'form-inline' } do
2
- = label :state, t(:'address.country')
3
- = collection_select :state, :country_iso, Gaku::Country.all, :iso, :name, { selected: @default_country.try(:iso), prompt: t(:'address.choose_country') } , { class: 'input-normal', id: 'select-country' }
2
+ = collection_select :state, :country_iso, Gaku::Country.all, :iso, :name, { selected: @default_country.try(:iso), prompt: t(:'address.choose_country') } , { class: 'input-normal form-control', id: 'select-country' }
4
3
  = submit_tag 'Show States', class: 'btn btn-primary', id: 'admin-show-country-states-submit'
@@ -10,5 +10,5 @@
10
10
  = f.text_field :code, label: t(:'address.state.code')
11
11
  .row
12
12
  .col-md-6
13
- = f.select :country_iso, @countries, { prompt: t(:'address.choose_country') }, label: t(:'address.country')
13
+ = f.select :country_iso, @countries, { prompt: t(:'address.choose_country') }, label: t(:'address.country'), class: 'form-control'
14
14
 
@@ -0,0 +1,16 @@
1
+ .row
2
+ .col-md-12
3
+ #new-admin-state.d-none
4
+ .pull-left
5
+ = count_div 'admin-states-count' do
6
+ = print_count @count, t(:'address.state.list')
7
+ .pull-right
8
+ = ajax_link_to_new t(:'address.state.add'), [:new, :admin, :state], id: 'new-admin-state-link'
9
+
10
+ #show-admin-states-form
11
+ = render 'country_select_form'
12
+ hr
13
+
14
+ #admin-country-states
15
+ = render 'country_table', states: @country.states, country: @country if @country
16
+
@@ -0,0 +1 @@
1
+ $('#ajax-load').html('<%=j render "states" %>')
@@ -0,0 +1,3 @@
1
+ = remote_form_for [:admin, @student_review_category], resource: 'admin-student-review-category' do |f|
2
+ = render 'form_fields', f: f
3
+ = buttons_for @student_review_cateogry, resource: 'admin-student-review-category'
@@ -0,0 +1 @@
1
+ = f.text_field :name, validate: { uniqueness: true }, label: t(:'student_review_category.name')
@@ -0,0 +1,4 @@
1
+ = modal_for 'edit-student-review-category-modal' do
2
+ = modal_form_for [:admin, @student_review_category], resource: 'admin-student-review-category' do |f|
3
+ = render 'form_fields', f: f
4
+ = buttons_for @student_review_category, resource: 'admin-student-review-category'
@@ -0,0 +1,18 @@
1
+ .row
2
+ .col-md-12
3
+ #new-admin-student-review-category.d-none
4
+ .pull-left
5
+ = count_div 'admin-student-review-categories-count' do
6
+ = print_count @count, t(:'student_review_category.list')
7
+ .pull-right
8
+ = ajax_link_to_new t(:'student_review_category.new'), [:new, :admin, :student_review_category], id: 'new-admin-student-review-category-link'
9
+ hr
10
+
11
+ #admin-student-review-categories
12
+ = table_for 'admin-student-review-categories-index' do
13
+ thead
14
+ tr
15
+ = th t(:'student_review_category.plural')
16
+ = th_actions 2
17
+ tbody
18
+ = render partial: 'student_review_category', collection: @student_review_categories, as: :student_review_category
@@ -0,0 +1,2 @@
1
+ = tr_for student_review_category do
2
+ = render 'table_fields', student_review_category: student_review_category
@@ -0,0 +1,4 @@
1
+ td = student_review_category
2
+ td
3
+ = ajax_link_to_edit [:edit, :admin, student_review_category]
4
+ = ajax_link_to_delete [:admin, student_review_category]
@@ -0,0 +1,7 @@
1
+ $('#admin-student-review-categories-index tbody').append('<%= j render("student_review_category", {student_review_category: @student_review_category}) %>');
2
+
3
+ $('#new-admin-student-review-category').slide();
4
+ $('#new-admin-student-review-category-link').show();
5
+
6
+ $('.admin-student-review-categories-count').html("<%= print_count(@count, t(:'student_review_category.list')) %>");
7
+ showNotice("<%= render_flash %>");
@@ -0,0 +1,2 @@
1
+ $('.admin-student-review-categories-count').html("<%= print_count(@count , t(:'student_review_category.list')) %>");
2
+ showNotice("<%= render_flash %>");
@@ -0,0 +1,3 @@
1
+ $('#modal-dialogs').html('<%= j render("modal", {student_review_category: @student_review_category}) %>');
2
+ $('#edit-student-review-category-modal').modal('show');
3
+ $('.normal-form').enableValidations();
@@ -0,0 +1 @@
1
+ $('#ajax-load').html('<%=j render "student_review_categories" %>')
@@ -0,0 +1,3 @@
1
+ $('#new-admin-student-review-category').html('<%= j render("form") %>').slide();
2
+ $('#new-admin-student-review-category-link').hide();
3
+ $('.remote-form').enableValidations();
@@ -0,0 +1,3 @@
1
+ $('tr#student-review-category-<%= @student_review_category.id %>').html('<%= j render("table_fields", {student_review_category: @student_review_category}) %>');
2
+ $("#edit-student-review-category-modal").modal("hide");
3
+ showNotice("<%= render_flash %>");
@@ -2,7 +2,7 @@ td = template.name
2
2
  td = template.context
3
3
  td = boolean_image template.locked?
4
4
  td
5
- = link_to download_icon, [:download, :admin, template], class: 'btn btn-mini btn-success', style: 'margin-right:5px'
6
- = link_to_edit [:edit, :admin, template]
5
+ = link_to_download [:download, :admin, template]
6
+ = ajax_link_to_edit [:edit, :admin, template]
7
7
  = ajax_link_to_delete [:admin, template]
8
8
 
@@ -1,3 +1,3 @@
1
- = normal_form_for [:admin, @template], resource: 'admin-template' do |f|
1
+ = remote_form_for [:admin, @template], resource: 'admin-template' do |f|
2
2
  = render 'form_fields', f: f
3
3
  = buttons_for @template, resource: 'admin-template'
@@ -1,4 +1,7 @@
1
1
  = modal_for 'edit-template-modal' do
2
- = normal_modal_form_for [:admin, @template], resource: 'admin-template' do |f|
3
- = render 'form_fields', f: f
2
+ = modal_form_for [:admin, @template], resource: 'admin-template' do |f|
3
+ = f.text_field :name, label: t(:'name')
4
+ = f.text_field :context, label: t(:'template.context')
5
+ = f.check_box :locked, label: t(:'template.lock')
6
+
4
7
  = buttons_for @template, resource: 'admin-template'
@@ -0,0 +1,21 @@
1
+ .row
2
+ .col-md-12
3
+ #new-admin-template.d-none
4
+ .pull-left
5
+ = count_div 'admin-templates-count' do
6
+ = print_count @count, t(:'template.list')
7
+ .pull-right
8
+ = ajax_link_to_new t(:'template.add'), [:new, :admin, :template], id: 'new-admin-template-link'
9
+
10
+ hr
11
+
12
+ #admin-templates
13
+ = table_for 'admin-templates-index' do
14
+ thead
15
+ tr
16
+ = th t(:'template.singular')
17
+ = th t(:'template.context')
18
+ = th t(:'template.lock')
19
+ = th_actions 3
20
+ tbody
21
+ = render partial: 'template', collection: @templates, as: :template
@@ -0,0 +1,7 @@
1
+ $('#admin-templates-index tbody').append('<%= j render("template", {template: @template}) %>');
2
+
3
+ $('#new-admin-template').slide();
4
+ $('#new-admin-template-link').show();
5
+
6
+ showNotice("<%= render_flash %>");
7
+ $('.admin-templates-count').html("<%= print_count(@count, t(:'template.list')) %>");
@@ -0,0 +1,3 @@
1
+ $('#modal-dialogs').html('<%= j render("modal", {template: @template}) %>');
2
+ $('#edit-template-modal').modal('show');
3
+ $('.remote-form').enableValidations();
@@ -0,0 +1 @@
1
+ $('#ajax-load').html('<%=j render "templates" %>')
@@ -0,0 +1,3 @@
1
+ $('#new-admin-template').html('<%= j render("form") %>').slide();
2
+ $('#new-admin-template-link').hide();
3
+ $('.remote-form').enableValidations();
@@ -0,0 +1,3 @@
1
+ $('tr#template-<%= @template.id %>').html('<%= j render("fields", {template: @template}) %>');
2
+ $("#edit-template-modal").modal("hide");
3
+ showNotice("<%= render_flash %>");
@@ -0,0 +1,22 @@
1
+ .row
2
+ .col-md-12
3
+ #new-admin-user.d-none
4
+ .pull-left
5
+ = count_div 'admin-users-count' do
6
+ = print_count @count, t(:'user.list')
7
+ .pull-right
8
+ = ajax_link_to_new t(:'user.add'), [:new, :admin, :user], id: 'new-admin-user-link'
9
+
10
+ hr
11
+
12
+ #admin-users
13
+ = table_for 'admin-users-index' do
14
+ thead
15
+ tr
16
+ = th t(:'user.username')
17
+ = th t(:'user.email')
18
+ = th_actions 2
19
+ tbody
20
+ = render partial: 'gaku/admin/users/user', collection: @users, as: :user
21
+
22
+ = paginate @users, remote: true
@@ -0,0 +1 @@
1
+ $('#ajax-load').html('<%=j render "users" %>')
@@ -5,7 +5,6 @@
5
5
  .row
6
6
  .col-md-12
7
7
  = yield :index_header
8
- hr
9
8
 
10
9
  = yield
11
10
 
@@ -1,71 +1 @@
1
- <li class="dropdown" data-hook="admin_menu">
2
- <a class="dropdown-toggle" data-toggle="dropdown" href="#">
3
- <%= t('menu.admin.admin') %>
4
- <b class="caret"></b>
5
- </a>
6
- <ul class="dropdown-menu" data-hook="admin_dropdown_menu">
7
- <li data-hook="school_details"><%= link_to t('menu.admin.school_details'), admin_school_details_path %></li>
8
- <li data-hook="schools"><%= link_to t('menu.admin.schools'), admin_schools_path %></li>
9
- <li data-hook="school_years"><%= link_to t('menu.admin.school_years'), admin_school_years_path %></li>
10
- <li data-hook="specialties"><%= link_to t('menu.admin.specialties'), admin_specialties_path %></li>
11
- <li data-hook="badge_types"><%= link_to t('menu.admin.badge_types'), admin_badge_types_path %></li>
12
- <li data-hook="template"><%= link_to t('menu.admin.templates'), admin_templates_path %></li>
13
- <li data-hook="deparment"><%= link_to t('menu.admin.departments'), admin_departments_path %></li>
14
-
15
- <li class="dropdown-submenu" data-hook="achievements_sub_menu">
16
- <a tabindex='-1' href='#'><%= t('menu.admin.achievements.achievements') %></a>
17
- <ul class="dropdown-menu">
18
- <li data-hook="grading_methods"><%= link_to t('menu.admin.achievements.simple_grade_types'), admin_simple_grade_types_path %></li>
19
- </ul>
20
- </li>
21
- <li class="dropdown-submenu" data-hook="grading_sub_menu">
22
- <a tabindex='-1' href='#'><%= t('menu.admin.grading.grading') %></a>
23
- <ul class="dropdown-menu">
24
- <li data-hook="grading_methods"><%= link_to t('menu.admin.grading.grading_methods'), admin_grading_methods_path %></li>
25
- <li data-hook="grading_sets"><%= link_to t('menu.admin.grading.grading_sets'), admin_grading_method_sets_path %></li>
26
- </ul>
27
- </li>
28
- <li class="dropdown-submenu" data-hook="types_sub_menu">
29
- <a tabindex='-1' href='#'><%= t('menu.admin.types.types') %></a>
30
- <ul class="dropdown-menu">
31
- <li data-hook="contact_types"><%= link_to t('menu.admin.types.contact'), admin_contact_types_path %></li>
32
- <li data-hook="enrollment_status_types">
33
- <%= link_to t('menu.admin.types.enrollment_status'), admin_enrollment_statuses_path %>
34
- </li>
35
- <li data-hook="commute_method_types">
36
- <%= link_to t('menu.admin.types.commute_methods'), admin_commute_method_types_path %>
37
- </li>
38
- <li data-hook="attendance_types">
39
- <%= link_to t('menu.admin.types.attendance_types'), admin_attendance_types_path %>
40
- </li>
41
- <li data-hook="states">
42
- <%= link_to t('menu.admin.types.states'), admin_states_path %>
43
- </li>
44
- </ul>
45
- </li>
46
-
47
-
48
- <li class="dropdown-submenu" data-hook="users_and_roles_sub_menu">
49
- <a tabindex='-1' href='#'><%= t('menu.admin.users.users_and_roles') %></a>
50
- <ul class="dropdown-menu">
51
- <li data-hook="users"><%= link_to t('menu.admin.users.users'), admin_users_path %></li>
52
- <li data-hook="roles">
53
- <%= link_to t('menu.admin.users.roles'), admin_roles_path %>
54
- </li>
55
- </ul>
56
- </li>
57
-
58
- <li data-hook="presets"><%= link_to t('menu.admin.preset.plural'), admin_presets_path %></li>
59
-
60
-
61
- <li class="dropdown-submenu" data-hook="system_tools_sub_menu">
62
- <a tabindex='-1' href='#'><%= t('menu.admin.system.system_tools') %></a>
63
- <ul class="dropdown-menu">
64
- <li data-hook="student_presets"><%= link_to t('menu.admin.system.backup'), admin_system_tools_path %></li>
65
- </ul>
66
- </li>
67
-
68
-
69
- </ul>
70
- </li>
71
-
1
+ <li><%= link_to t(:'menu.admin.admin'), admin_root_path %></li>