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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e840a895799549aea22669598d77293d5d2e0dc
4
- data.tar.gz: 421b4b72480934dd87a50523a8580255e32d0b8c
3
+ metadata.gz: 98be1e120b74736790a719245f7c3933199959b1
4
+ data.tar.gz: 3a16cf2a75da88531167f5b7fc25931fa1154b92
5
5
  SHA512:
6
- metadata.gz: 62437e108a8062e65b41cb849f55fc1f7dae5f1dc66f61368c47f29bf566122b880942db66cdb03110a53ff22a77333c8603ba241f238dcc85c8c1629991abb8
7
- data.tar.gz: 590da37e13b5ae407eec989496c79508e73dc18f97bda4bc1b221977ea5a604b20df83401832863616774340cc749fda3166e13c0816cd99f981b4131e7d4cbf
6
+ metadata.gz: a12244f88eec759da4ac8563b18fdb5d4e16621e015d999c9aae9ddd04c20e96e31d248815af8191f193bc35a17ba5c1c8de7978111d52977bfad8b1a21fe5bb
7
+ data.tar.gz: ab2570575dfe3874d8b06c8d13a8fab7c7d444bdbdb9a3bdc83e1fff5c328c61f1fd0fb0bddef8a4542a6f9d86f2c33de373c092253b39f46cdd04dcba283fa9
@@ -17,16 +17,15 @@ ready = ->
17
17
  .find('.dynamicAttributeValue')
18
18
  value = nameElem.val()
19
19
 
20
- valueElem.attr 'id', "grading_method_arguments_#{value}"
21
- valueElem.attr 'name', "grading_method[arguments][#{value}]"
22
- valueElem.attr 'placeholder', "value for #{value}"
20
+ valueElem.attr 'id', "grading_method_criteria_#{value}"
21
+ valueElem.attr 'name', "grading_method[criteria][#{value}]"
23
22
 
24
- $(document).on 'click', '.remove-argument-row', (e)->
23
+ $(document).on 'click', '.remove-criteria-row', (e)->
25
24
  e.preventDefault()
26
25
  if confirm('Are you sure?')
27
26
  $(@).closest('.row').html ''
28
27
 
29
- $(document).on 'click', '.add-argument-row', (e)->
28
+ $(document).on 'click', '.add-criteria-row', (e)->
30
29
  e.preventDefault()
31
30
 
32
31
  contents = "<div class='row'> #{$('.attribute-template').html()} </div>"
@@ -35,9 +34,10 @@ ready = ->
35
34
 
36
35
  edit: ->
37
36
  self.admin.country_dropdown()
37
+ self.admin.upload_picture_ajax()
38
38
 
39
39
  edit_master: ->
40
- self.admin.upload_picture()
40
+ self.admin.upload_picture_ajax()
41
41
 
42
42
  new: ->
43
43
  self.admin.country_dropdown()
@@ -3,7 +3,7 @@ window.showNotice = (notice)->
3
3
  $(@).html('').show()
4
4
 
5
5
  $.fn.enableValidations = ->
6
- $(this).enableRails4ClientSideValidations()
6
+ $(this).enableClientSideValidations()
7
7
 
8
8
  $.fn.withAnimation = ->
9
9
  $(this).animate({height:"toggle", opacity:"toggle"})
@@ -88,9 +88,18 @@ ready = ->
88
88
  @edit()
89
89
 
90
90
  upload_picture: ->
91
- $("#upload-picture-link").click ->
91
+ $(document).on 'click', '#upload-picture-link', ->
92
92
  $("#upload-picture").toggle()
93
93
 
94
+ upload_picture_ajax: ->
95
+ $('body').popover
96
+ selector: '.picture-upload'
97
+ html: true
98
+ content: ()->
99
+ return $('#upload-picture').html()
100
+ placement: 'bottom'
101
+ trigger: 'click'
102
+
94
103
  country_dropdown: ->
95
104
  $('body').on 'change', '#country_dropdown', ->
96
105
  window.load_states()
@@ -14,7 +14,11 @@
14
14
  #= require bootstrap/button
15
15
  #= require bootstrap/tab
16
16
  #= require bootstrap/dropdown
17
+ #= require bootstrap/collapse
18
+ #= require bootstrap/transition
17
19
  #= require bootstrap/modal
20
+ #= require bootstrap/tooltip
21
+ #= require bootstrap/popover
18
22
 
19
23
 
20
24
  #= require nprogress
@@ -27,6 +31,8 @@
27
31
  #= require underscore
28
32
  #= require moment
29
33
  #= require rails.validations
34
+ #= require jquery.remotipart
35
+
30
36
  #= require gaku/admin/slide.js.erb
31
37
 
32
38
  #= require gaku/admin/base
@@ -22,6 +22,12 @@
22
22
  max-width: 1900px;
23
23
  }
24
24
 
25
+
26
+ #user_menu {
27
+ margin-right: 25px;
28
+ }
29
+
30
+
25
31
  .alert-dismissable .close {
26
32
  position: relative;
27
33
  top: -2px;
@@ -302,6 +308,10 @@ font-size: 24px;
302
308
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
303
309
  }
304
310
 
311
+ .navbar .navbarright {
312
+ margin-right: 0px;
313
+ }
314
+
305
315
  .navbar .navbar-nav > .active > a {
306
316
  background-color: #f8f8f8;
307
317
  }
@@ -568,4 +578,9 @@ font-size: 24px;
568
578
  background-repeat: repeat-x;
569
579
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); }
570
580
  }
571
- }
581
+ }
582
+
583
+ .modal-backdrop.in {
584
+ opacity: 0.70;
585
+ filter: alpha(opacity=70);
586
+ }
@@ -1,7 +1,6 @@
1
1
  /*
2
2
  *= require gaku/admin/bootstrap_and_theme
3
3
  *= require bootstrap-datepicker
4
- * require font-awesome
5
4
  *= require jquery.ui.autocomplete
6
5
  *= require jquery.minicolors
7
6
  *= require nprogress
@@ -0,0 +1,28 @@
1
+ module AdminPictureController
2
+ include Gaku::ClassNameDetector
3
+
4
+ def set_picture
5
+ @resource = set_resource
6
+ @resource.update params.require(param_name).permit(:picture)
7
+ flash.now[:notice] = t('notice.picture_update')
8
+ render 'gaku/admin/shared/set_picture'
9
+ end
10
+
11
+ def remove_picture
12
+ @resource = set_resource
13
+ @resource.update(picture: nil)
14
+ flash.now[:notice] = t('notice.picture_remove')
15
+ render 'gaku/admin/shared/remove_picture'
16
+ end
17
+
18
+ private
19
+
20
+ def set_resource
21
+ instance_variable_set("@#{class_name_underscored}", class_name.constantize.find(params[:id]))
22
+ end
23
+
24
+ def param_name
25
+ controller_name.singularize.to_sym
26
+ end
27
+
28
+ end
@@ -1,17 +1,14 @@
1
1
  module Gaku
2
2
  class Admin::AttendanceTypesController < Admin::BaseController
3
3
 
4
- #load_and_authorize_resource class: AttendanceType
5
-
6
4
  respond_to :json, only: :index
7
- respond_to :js, only: %i( new create edit update destroy )
8
- respond_to :html, only: :index
5
+ respond_to :js, only: %i( new create edit update destroy index )
9
6
 
10
7
  before_action :set_attendance_type, only: %i( edit update destroy )
11
8
 
12
9
  def index
13
10
  @attendance_types = AttendanceType.all
14
- @count = AttendanceType.count
11
+ set_count
15
12
  respond_with @attendance_types
16
13
  end
17
14
 
@@ -23,7 +20,7 @@ module Gaku
23
20
  def create
24
21
  @attendance_type = AttendanceType.new(attendance_type_params)
25
22
  @attendance_type.save
26
- @count = AttendanceType.count
23
+ set_count
27
24
  respond_with @attendance_type
28
25
  end
29
26
 
@@ -37,7 +34,7 @@ module Gaku
37
34
 
38
35
  def destroy
39
36
  @attendance_type.destroy
40
- @count = AttendanceType.count
37
+ set_count
41
38
  respond_with @attendance_type
42
39
  end
43
40
 
@@ -55,6 +52,9 @@ module Gaku
55
52
  %i(name color_code counted_absent disable_credit credit_rate auto_credit)
56
53
  end
57
54
 
55
+ def set_count
56
+ @count = AttendanceType.count
57
+ end
58
+
58
59
  end
59
60
  end
60
-
@@ -1,10 +1,7 @@
1
1
  module Gaku
2
2
  class Admin::BadgeTypesController < Admin::BaseController
3
3
 
4
- #load_and_authorize_resource class: Achievement
5
-
6
- respond_to :js, only: %i( new edit destroy )
7
- respond_to :html, only: %i( index create update )
4
+ respond_to :js, only: %i( new create edit update destroy index )
8
5
 
9
6
  before_action :set_badge_type, only: %i( edit update destroy )
10
7
 
@@ -21,10 +18,12 @@ module Gaku
21
18
 
22
19
  def create
23
20
  @badge_type = BadgeType.new(badge_type_params)
24
- @badge_type.save
25
- set_count
26
- flash[:notice] = t(:'notice.created', resource: t_resource)
27
- respond_with [:admin, :badge_types]
21
+ if @badge_type.save
22
+ set_count
23
+ respond_with @badge_type
24
+ else
25
+ render :new
26
+ end
28
27
  end
29
28
 
30
29
  def edit
@@ -32,13 +31,11 @@ module Gaku
32
31
 
33
32
  def update
34
33
  @badge_type.update(badge_type_params)
35
- flash[:notice] = t(:'notice.updated', resource: t_resource)
36
- respond_with [:admin, :badge_types]
34
+ respond_with @badge_type
37
35
  end
38
36
 
39
37
  def destroy
40
38
  @badge_type.destroy
41
- flash[:notice] = t(:'notice.destroyed', resource: t_resource)
42
39
  set_count
43
40
  respond_with @badge_type
44
41
  end
@@ -58,11 +55,7 @@ module Gaku
58
55
  end
59
56
 
60
57
  def attributes
61
- %i(name description code authority url issuer badge_image )
62
- end
63
-
64
- def t_resource
65
- t(:'badge_type.singular')
58
+ %i( name description code authority url issuer badge_image )
66
59
  end
67
60
 
68
61
  end
@@ -2,7 +2,7 @@ module Gaku
2
2
  module Admin
3
3
  class BaseController < CoreController
4
4
 
5
- self.responder = AppResponder
5
+ self.responder = Gaku::AppResponder
6
6
  respond_to :html
7
7
 
8
8
  layout :resolve_layout
@@ -1,10 +1,9 @@
1
1
  module Gaku
2
- class Admin::Schools::Campuses::AddressesController < Admin::BaseController
2
+ class Admin::Campuses::AddressesController < Admin::BaseController
3
3
 
4
4
  respond_to :js, only: %i( new create destroy edit update )
5
5
 
6
6
  before_action :set_address, only: %i( edit update destroy )
7
- before_action :set_school
8
7
  before_action :set_campus
9
8
  before_action :set_countries, only: %i( new edit )
10
9
 
@@ -30,7 +29,7 @@ module Gaku
30
29
 
31
30
  def update
32
31
  @address.update(address_params)
33
- respond_with @address, location: [:edit, :admin, @school, @campus]
32
+ respond_with @address
34
33
  end
35
34
 
36
35
  private
@@ -40,11 +39,7 @@ module Gaku
40
39
  end
41
40
 
42
41
  def attributes
43
- %i( title address1 address2 city zipcode state state_id country country_id deleted primary past )
44
- end
45
-
46
- def set_school
47
- @school = School.find(params[:school_id])
42
+ %i( title address1 address2 city zipcode state state_id country country_id primary past )
48
43
  end
49
44
 
50
45
  def set_campus
@@ -61,4 +56,3 @@ module Gaku
61
56
 
62
57
  end
63
58
  end
64
-
@@ -1,11 +1,10 @@
1
1
  module Gaku
2
- class Admin::Schools::Campuses::ContactsController < Admin::BaseController
2
+ class Admin::Campuses::ContactsController < Admin::BaseController
3
3
 
4
4
  respond_to :js
5
5
 
6
6
  before_action :set_contact_types, only: %i( new edit )
7
7
  before_action :set_contact, only: %i( edit update destroy make_primary )
8
- before_action :set_school
9
8
  before_action :set_campus
10
9
 
11
10
  def new
@@ -14,8 +13,9 @@ module Gaku
14
13
  end
15
14
 
16
15
  def create
17
- @contact = @campus.contacts.new(contact_params)
18
- @contact.save
16
+ creator = ContactCreation.new(contact_params.merge(contactable: @campus))
17
+ creator.save
18
+ @contact = creator.contact
19
19
  set_count
20
20
  respond_with @contact
21
21
  end
@@ -25,8 +25,9 @@ module Gaku
25
25
  end
26
26
 
27
27
  def update
28
+ ContactUpdation.new(@contact).update(contact_params)
28
29
  @contact.update(contact_params)
29
- respond_with @contact, location: [:edit, :admin, @school, @campus]
30
+ respond_with @contact
30
31
  end
31
32
 
32
33
  def destroy
@@ -37,7 +38,6 @@ module Gaku
37
38
  respond_with @contact
38
39
  end
39
40
 
40
-
41
41
  def make_primary
42
42
  @contact.make_primary
43
43
  respond_with @contact
@@ -49,10 +49,6 @@ module Gaku
49
49
  @contact = Contact.find(params[:id])
50
50
  end
51
51
 
52
- def set_school
53
- @school = School.find(params[:school_id])
54
- end
55
-
56
52
  def set_campus
57
53
  @campus = Campus.find(params[:campus_id])
58
54
  end
@@ -1,12 +1,12 @@
1
1
  module Gaku
2
- class Admin::Schools::CampusesController < Admin::BaseController
2
+ class Admin::CampusesController < Admin::BaseController
3
+ include AdminPictureController
3
4
 
4
- respond_to :js, only: %i( new create destroy )
5
- respond_to :html, only: %i( edit update show )
6
-
7
- before_action :set_campus, only: %i( edit show update destroy )
8
- before_action :set_school
5
+ respond_to :js, only: %i( new create destroy edit update index )
6
+ respond_to :html, only: %i( edit )
9
7
 
8
+ before_action :set_campus, only: %i( edit update destroy )
9
+ before_action :set_school, except: %i( set_picture remove_picture )
10
10
 
11
11
  def destroy
12
12
  @campus.destroy
@@ -31,13 +31,9 @@ module Gaku
31
31
  respond_with @campus
32
32
  end
33
33
 
34
- def show
35
- respond_with @campus
36
- end
37
-
38
34
  def update
39
35
  @campus.update(campus_params)
40
- respond_with @campus, location: [:edit, :admin, @school, @campus]
36
+ respond_with @campus
41
37
  end
42
38
 
43
39
  def index
@@ -1,16 +1,13 @@
1
1
  module Gaku
2
2
  class Admin::CommuteMethodTypesController < Admin::BaseController
3
3
 
4
- #load_and_authorize_resource class: CommuteMethodType
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_commute_method_type, only: %i( edit update destroy )
10
7
 
11
8
  def index
12
9
  @commute_method_types = CommuteMethodType.all
13
- @count = CommuteMethodType.count
10
+ set_count
14
11
  respond_with @commute_method_types
15
12
  end
16
13
 
@@ -22,7 +19,7 @@ module Gaku
22
19
  def create
23
20
  @commute_method_type = CommuteMethodType.new(commute_method_type_params)
24
21
  @commute_method_type.save
25
- @count = CommuteMethodType.count
22
+ set_count
26
23
  respond_with @commute_method_type
27
24
  end
28
25
 
@@ -36,7 +33,7 @@ module Gaku
36
33
 
37
34
  def destroy
38
35
  @commute_method_type.destroy
39
- @count = CommuteMethodType.count
36
+ set_count
40
37
  respond_with @commute_method_type
41
38
  end
42
39
 
@@ -50,5 +47,9 @@ module Gaku
50
47
  params.require(:commute_method_type).permit(:name)
51
48
  end
52
49
 
50
+ def set_count
51
+ @count = CommuteMethodType.count
52
+ end
53
+
53
54
  end
54
55
  end
@@ -1,16 +1,13 @@
1
1
  module Gaku
2
2
  class Admin::ContactTypesController < Admin::BaseController
3
3
 
4
- #load_and_authorize_resource class: ContactType
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_contact_type, only: %i( edit update destroy )
10
7
 
11
8
  def index
12
9
  @contact_types = ContactType.all
13
- @count = ContactType.count
10
+ set_count
14
11
  respond_with @contact_types
15
12
  end
16
13
 
@@ -22,7 +19,7 @@ module Gaku
22
19
  def create
23
20
  @contact_type = ContactType.new(contact_type_params)
24
21
  @contact_type.save
25
- @count = ContactType.count
22
+ set_count
26
23
  respond_with @contact_type
27
24
  end
28
25
 
@@ -36,7 +33,7 @@ module Gaku
36
33
 
37
34
  def destroy
38
35
  @contact_type.destroy
39
- @count = ContactType.count
36
+ set_count
40
37
  respond_with @contact_type
41
38
  end
42
39
 
@@ -50,6 +47,9 @@ module Gaku
50
47
  params.require(:contact_type).permit(:name)
51
48
  end
52
49
 
50
+ def set_count
51
+ @count = ContactType.count
52
+ end
53
53
 
54
54
  end
55
55
  end
@@ -1,16 +1,13 @@
1
1
  module Gaku
2
2
  class Admin::DepartmentsController < Admin::BaseController
3
3
 
4
- #load_and_authorize_resource class: Department
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_department, only: %i( edit update destroy )
10
7
 
11
8
  def index
12
9
  @departments = Department.all
13
- @count = Department.count
10
+ set_count
14
11
  respond_with @departments
15
12
  end
16
13
 
@@ -22,7 +19,7 @@ module Gaku
22
19
  def create
23
20
  @department = Department.new(department_params)
24
21
  @department.save
25
- @count = Department.count
22
+ set_count
26
23
  respond_with @department
27
24
  end
28
25
 
@@ -36,7 +33,7 @@ module Gaku
36
33
 
37
34
  def destroy
38
35
  @department.destroy
39
- @count = Department.count
36
+ set_count
40
37
  respond_with @department
41
38
  end
42
39
 
@@ -50,6 +47,9 @@ module Gaku
50
47
  params.require(:department).permit(:name)
51
48
  end
52
49
 
50
+ def set_count
51
+ @count = Department.count
52
+ end
53
53
 
54
54
  end
55
55
  end
@@ -1,16 +1,13 @@
1
1
  module Gaku
2
2
  class Admin::EnrollmentStatusesController < Admin::BaseController
3
3
 
4
- #load_and_authorize_resource class: EnrollmentStatus
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_enrollment_status, only: %i( edit update destroy )
10
7
 
11
8
  def index
12
9
  @enrollment_statuses = EnrollmentStatus.includes(:translations)
13
- @count = EnrollmentStatus.count
10
+ set_count
14
11
  respond_with @enrollment_statuss
15
12
  end
16
13
 
@@ -22,7 +19,7 @@ module Gaku
22
19
  def create
23
20
  @enrollment_status = EnrollmentStatus.new(enrollment_status_params)
24
21
  @enrollment_status.save
25
- @count = EnrollmentStatus.count
22
+ set_count
26
23
  respond_with @enrollment_status
27
24
  end
28
25
 
@@ -36,7 +33,7 @@ module Gaku
36
33
 
37
34
  def destroy
38
35
  @enrollment_status.destroy
39
- @count = EnrollmentStatus.count
36
+ set_count
40
37
  respond_with @enrollment_status
41
38
  end
42
39
 
@@ -51,7 +48,11 @@ module Gaku
51
48
  end
52
49
 
53
50
  def attributes
54
- %i(code name active immutable)
51
+ %i( code name active immutable )
52
+ end
53
+
54
+ def set_count
55
+ @count = EnrollmentStatus.count
55
56
  end
56
57
 
57
58
  end
@@ -63,7 +63,7 @@ module Gaku
63
63
  end
64
64
 
65
65
  def attributes
66
- %i(position grading_method_id grading_method_set_id)
66
+ %i( position grading_method_id grading_method_set_id )
67
67
  end
68
68
 
69
69
  end
@@ -1,16 +1,14 @@
1
1
  module Gaku
2
2
  class Admin::GradingMethodSetsController < Admin::BaseController
3
3
 
4
- #load_and_authorize_resource class: GradingMethodSet
5
-
6
- respond_to :js, only: %i( new create edit update destroy make_primary )
7
- respond_to :html, only: %i( index show )
4
+ respond_to :js, only: %i( new create edit update destroy make_primary index )
5
+ respond_to :html, only: %i( show )
8
6
 
9
7
  before_action :set_grading_method_set, only: %i( edit update show destroy make_primary )
10
8
 
11
9
  def index
12
10
  @grading_method_sets = GradingMethodSet.all
13
- @count = GradingMethodSet.count
11
+ set_count
14
12
  respond_with @grading_method_sets
15
13
  end
16
14
 
@@ -22,7 +20,7 @@ module Gaku
22
20
  def create
23
21
  @grading_method_set = GradingMethodSet.new(grading_method_set_params)
24
22
  @grading_method_set.save
25
- @count = GradingMethodSet.count
23
+ set_count
26
24
  respond_with @grading_method_set
27
25
  end
28
26
 
@@ -38,11 +36,9 @@ module Gaku
38
36
  end
39
37
 
40
38
  def destroy
41
- if @grading_method_set.primary?
42
- GradingMethodSet.first.try(:make_primary)
43
- end
39
+ GradingMethodSet.first.try(:make_primary) if @grading_method_set.primary?
44
40
  @grading_method_set.destroy
45
- @count = GradingMethodSet.count
41
+ set_count
46
42
  respond_with @grading_method_set
47
43
  end
48
44
 
@@ -62,7 +58,11 @@ module Gaku
62
58
  end
63
59
 
64
60
  def attributes
65
- %i(display_deviation display_rank name primary rank_order)
61
+ %i( display_deviation display_rank name primary rank_order )
62
+ end
63
+
64
+ def set_count
65
+ @count = GradingMethodSet.count
66
66
  end
67
67
 
68
68
  end