fae-railsz 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (328) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +5 -0
  3. data/Rakefile +37 -0
  4. data/app/assets/fonts/fae/icons.eot +0 -0
  5. data/app/assets/fonts/fae/icons.svg +56 -0
  6. data/app/assets/fonts/fae/icons.ttf +0 -0
  7. data/app/assets/fonts/fae/icons.woff +0 -0
  8. data/app/assets/fonts/fae/lato-bold-webfont.eot +0 -0
  9. data/app/assets/fonts/fae/lato-bold-webfont.svg +4551 -0
  10. data/app/assets/fonts/fae/lato-bold-webfont.ttf +0 -0
  11. data/app/assets/fonts/fae/lato-bold-webfont.woff +0 -0
  12. data/app/assets/fonts/fae/lato-light-webfont.eot +0 -0
  13. data/app/assets/fonts/fae/lato-light-webfont.svg +4241 -0
  14. data/app/assets/fonts/fae/lato-light-webfont.ttf +0 -0
  15. data/app/assets/fonts/fae/lato-light-webfont.woff +0 -0
  16. data/app/assets/fonts/fae/lato-regular-webfont.eot +0 -0
  17. data/app/assets/fonts/fae/lato-regular-webfont.svg +4241 -0
  18. data/app/assets/fonts/fae/lato-regular-webfont.ttf +0 -0
  19. data/app/assets/fonts/fae/lato-regular-webfont.woff +0 -0
  20. data/app/assets/fonts/fae/selection.json +1334 -0
  21. data/app/assets/images/fae/error_bg.jpg +0 -0
  22. data/app/assets/images/fae/error_sad_face.png +0 -0
  23. data/app/assets/images/fae/icons/alert.svg +9 -0
  24. data/app/assets/images/fae/icons/arrow_down.svg +8 -0
  25. data/app/assets/images/fae/icons/arrow_left.svg +9 -0
  26. data/app/assets/images/fae/icons/arrow_right.svg +9 -0
  27. data/app/assets/images/fae/icons/arrow_stacked.svg +8 -0
  28. data/app/assets/images/fae/icons/arrow_up.svg +8 -0
  29. data/app/assets/images/fae/icons/calendar.svg +17 -0
  30. data/app/assets/images/fae/icons/check.svg +7 -0
  31. data/app/assets/images/fae/icons/checkmark.svg +8 -0
  32. data/app/assets/images/fae/icons/chevron_down.svg +7 -0
  33. data/app/assets/images/fae/icons/chevron_left.svg +10 -0
  34. data/app/assets/images/fae/icons/chevron_right.svg +10 -0
  35. data/app/assets/images/fae/icons/chevron_up.svg +7 -0
  36. data/app/assets/images/fae/icons/delete.svg +8 -0
  37. data/app/assets/images/fae/icons/delete_x.svg +8 -0
  38. data/app/assets/images/fae/icons/edit.svg +11 -0
  39. data/app/assets/images/fae/icons/handle.svg +13 -0
  40. data/app/assets/images/fae/icons/home.svg +10 -0
  41. data/app/assets/images/fae/icons/logout.svg +12 -0
  42. data/app/assets/images/fae/icons/magnifying_glass.svg +10 -0
  43. data/app/assets/images/fae/icons/menu.svg +11 -0
  44. data/app/assets/images/fae/icons/offlink.svg +25 -0
  45. data/app/assets/images/fae/icons/plus.svg +8 -0
  46. data/app/assets/images/fae/icons/pulldown.svg +11 -0
  47. data/app/assets/images/fae/icons/search.svg +11 -0
  48. data/app/assets/images/fae/icons/settings.svg +12 -0
  49. data/app/assets/images/fae/icons/sort.svg +11 -0
  50. data/app/assets/images/fae/icons/support.svg +15 -0
  51. data/app/assets/images/fae/icons/trash.svg +10 -0
  52. data/app/assets/images/fae/icons/trumbowyg.svg +1 -0
  53. data/app/assets/images/fae/icons/user.svg +13 -0
  54. data/app/assets/images/fae/icons/users.svg +19 -0
  55. data/app/assets/images/fae/icons/zoom.svg +12 -0
  56. data/app/assets/images/fae/tutorial_model_location.png +0 -0
  57. data/app/assets/images/fae/youtube_helper.jpg +0 -0
  58. data/app/assets/javascripts/fae/_modals.js +60 -0
  59. data/app/assets/javascripts/fae/_tables.js +403 -0
  60. data/app/assets/javascripts/fae/admin.js.erb +11 -0
  61. data/app/assets/javascripts/fae/application.js +63 -0
  62. data/app/assets/javascripts/fae/fae_init.js +8 -0
  63. data/app/assets/javascripts/fae/form/_ajax.js +380 -0
  64. data/app/assets/javascripts/fae/form/_cancel.js +38 -0
  65. data/app/assets/javascripts/fae/form/_filtering.js +276 -0
  66. data/app/assets/javascripts/fae/form/_form.js +60 -0
  67. data/app/assets/javascripts/fae/form/_slugger.js.erb +100 -0
  68. data/app/assets/javascripts/fae/form/_validator.js +459 -0
  69. data/app/assets/javascripts/fae/form/fae_chosen.js +44 -0
  70. data/app/assets/javascripts/fae/form/fileinputer.js +178 -0
  71. data/app/assets/javascripts/fae/form/hinter.js +111 -0
  72. data/app/assets/javascripts/fae/form/inputs/_checkbox.js +27 -0
  73. data/app/assets/javascripts/fae/form/inputs/_color.js +42 -0
  74. data/app/assets/javascripts/fae/form/inputs/_dates.js +78 -0
  75. data/app/assets/javascripts/fae/form/inputs/_select.js +162 -0
  76. data/app/assets/javascripts/fae/form/inputs/_text.js +118 -0
  77. data/app/assets/javascripts/fae/navigation/_global_search.js +184 -0
  78. data/app/assets/javascripts/fae/navigation/_language.js +89 -0
  79. data/app/assets/javascripts/fae/navigation/_navigation.js +206 -0
  80. data/app/assets/javascripts/fae/navigation/_subnav_highlighter.js +81 -0
  81. data/app/assets/javascripts/fae/navigation/sticky.js +186 -0
  82. data/app/assets/javascripts/fae/vendor/chosen.jquery.min.js +2 -0
  83. data/app/assets/javascripts/fae/vendor/frob_core_helpers.js +587 -0
  84. data/app/assets/javascripts/fae/vendor/fryr.js +437 -0
  85. data/app/assets/javascripts/fae/vendor/jqColorPicker.min.js +4 -0
  86. data/app/assets/javascripts/fae/vendor/jquery.daterangepicker.js +1292 -0
  87. data/app/assets/javascripts/fae/vendor/jquery.multi-select.js +534 -0
  88. data/app/assets/javascripts/fae/vendor/jquery.simplemodal.1.4.4.js +719 -0
  89. data/app/assets/javascripts/fae/vendor/jquery.tablesorter.js +1901 -0
  90. data/app/assets/javascripts/fae/vendor/js.cookie.js +139 -0
  91. data/app/assets/javascripts/fae/vendor/moment.min.js +7 -0
  92. data/app/assets/javascripts/fae/vendor/simplemde.min.js +13 -0
  93. data/app/assets/javascripts/fae/vendor/touch_punch.js +11 -0
  94. data/app/assets/javascripts/fae/vendor/trumbowyg.js.erb +4 -0
  95. data/app/assets/javascripts/fae/vendor/trumbowyg/plugins/upload/trumbowyg.upload.js +223 -0
  96. data/app/assets/javascripts/fae/vendor/trumbowyg/trumbowyg.js +1603 -0
  97. data/app/assets/stylesheets/fae/application.css +8 -0
  98. data/app/assets/stylesheets/fae/base.scss +82 -0
  99. data/app/assets/stylesheets/fae/globals/_fonts.scss +43 -0
  100. data/app/assets/stylesheets/fae/globals/_icons.scss +15 -0
  101. data/app/assets/stylesheets/fae/globals/_plugins.scss +51 -0
  102. data/app/assets/stylesheets/fae/globals/_tags.scss +68 -0
  103. data/app/assets/stylesheets/fae/globals/imports/_extends.scss +53 -0
  104. data/app/assets/stylesheets/fae/globals/imports/_mixins.scss +58 -0
  105. data/app/assets/stylesheets/fae/globals/imports/_variables.scss +165 -0
  106. data/app/assets/stylesheets/fae/globals/imports/finescss/_fine.scss +7 -0
  107. data/app/assets/stylesheets/fae/globals/imports/finescss/_fine_functions.scss +88 -0
  108. data/app/assets/stylesheets/fae/globals/imports/finescss/_fine_mixins.scss +280 -0
  109. data/app/assets/stylesheets/fae/globals/imports/finescss/_fine_variables.scss +30 -0
  110. data/app/assets/stylesheets/fae/globals/layout/_base.scss +48 -0
  111. data/app/assets/stylesheets/fae/globals/layout/_breadcrumbs.scss +45 -0
  112. data/app/assets/stylesheets/fae/globals/layout/_content-header.scss +99 -0
  113. data/app/assets/stylesheets/fae/globals/legacy/_pre-1.3.scss +659 -0
  114. data/app/assets/stylesheets/fae/globals/navigation/_base.scss +22 -0
  115. data/app/assets/stylesheets/fae/globals/navigation/_footer.scss +50 -0
  116. data/app/assets/stylesheets/fae/globals/navigation/_header.scss +149 -0
  117. data/app/assets/stylesheets/fae/globals/navigation/_mobilenav.scss +149 -0
  118. data/app/assets/stylesheets/fae/globals/navigation/_search.scss +76 -0
  119. data/app/assets/stylesheets/fae/globals/navigation/_sidenav.scss +142 -0
  120. data/app/assets/stylesheets/fae/globals/navigation/_utility.scss +95 -0
  121. data/app/assets/stylesheets/fae/modules/_alerts.scss +50 -0
  122. data/app/assets/stylesheets/fae/modules/_buttons.scss +62 -0
  123. data/app/assets/stylesheets/fae/modules/_modal.scss +78 -0
  124. data/app/assets/stylesheets/fae/modules/_toggles.scss +48 -0
  125. data/app/assets/stylesheets/fae/modules/forms/_asset-actions.scss +83 -0
  126. data/app/assets/stylesheets/fae/modules/forms/_base.scss +100 -0
  127. data/app/assets/stylesheets/fae/modules/forms/_checkbox.scss +87 -0
  128. data/app/assets/stylesheets/fae/modules/forms/_colorpicker.scss +57 -0
  129. data/app/assets/stylesheets/fae/modules/forms/_date.scss +335 -0
  130. data/app/assets/stylesheets/fae/modules/forms/_hints.scss +40 -0
  131. data/app/assets/stylesheets/fae/modules/forms/_label.scss +57 -0
  132. data/app/assets/stylesheets/fae/modules/forms/_radio.scss +69 -0
  133. data/app/assets/stylesheets/fae/modules/forms/_select.scss +317 -0
  134. data/app/assets/stylesheets/fae/modules/forms/_simple-mde.scss +29 -0
  135. data/app/assets/stylesheets/fae/modules/forms/_text.scss +62 -0
  136. data/app/assets/stylesheets/fae/modules/forms/_textarea.scss +16 -0
  137. data/app/assets/stylesheets/fae/modules/forms/_validation.scss +63 -0
  138. data/app/assets/stylesheets/fae/modules/tables/_actions.scss +41 -0
  139. data/app/assets/stylesheets/fae/modules/tables/_base.scss +63 -0
  140. data/app/assets/stylesheets/fae/modules/tables/_collapsible.scss +76 -0
  141. data/app/assets/stylesheets/fae/modules/tables/_filters.scss +61 -0
  142. data/app/assets/stylesheets/fae/modules/tables/_image.scss +21 -0
  143. data/app/assets/stylesheets/fae/modules/tables/_pagination.scss +34 -0
  144. data/app/assets/stylesheets/fae/modules/tables/_sorting.scss +58 -0
  145. data/app/assets/stylesheets/fae/modules/tables/_sticky.scss +9 -0
  146. data/app/assets/stylesheets/fae/modules/tables/_tooltips.scss +24 -0
  147. data/app/assets/stylesheets/fae/pages/_error.scss +35 -0
  148. data/app/assets/stylesheets/fae/pages/_help.scss +28 -0
  149. data/app/assets/stylesheets/fae/pages/_home.scss +18 -0
  150. data/app/assets/stylesheets/fae/pages/_login.scss +137 -0
  151. data/app/assets/stylesheets/fae/vendor/chosen.css +377 -0
  152. data/app/assets/stylesheets/fae/vendor/daterangepicker.css +227 -0
  153. data/app/assets/stylesheets/fae/vendor/reset.css +48 -0
  154. data/app/assets/stylesheets/fae/vendor/simplemde.min.css +7 -0
  155. data/app/assets/stylesheets/fae/vendor/trumbowyg.css +584 -0
  156. data/app/controllers/concerns/fae/application_controller_concern.rb +1 -0
  157. data/app/controllers/concerns/fae/asset_cloner.rb +46 -0
  158. data/app/controllers/concerns/fae/cloneable.rb +136 -0
  159. data/app/controllers/fae/application_controller.rb +123 -0
  160. data/app/controllers/fae/base_controller.rb +117 -0
  161. data/app/controllers/fae/files_controller.rb +26 -0
  162. data/app/controllers/fae/images_controller.rb +37 -0
  163. data/app/controllers/fae/nested_base_controller.rb +100 -0
  164. data/app/controllers/fae/options_controller.rb +29 -0
  165. data/app/controllers/fae/pages_controller.rb +44 -0
  166. data/app/controllers/fae/setup_controller.rb +54 -0
  167. data/app/controllers/fae/static_pages_controller.rb +54 -0
  168. data/app/controllers/fae/users_controller.rb +71 -0
  169. data/app/controllers/fae/utilities_controller.rb +61 -0
  170. data/app/helpers/fae/application_helper.rb +114 -0
  171. data/app/helpers/fae/fae_helper.rb +6 -0
  172. data/app/helpers/fae/form_helper.rb +240 -0
  173. data/app/helpers/fae/nested_form_helper.rb +39 -0
  174. data/app/helpers/fae/view_helper.rb +175 -0
  175. data/app/inputs/date_range_input.rb +17 -0
  176. data/app/inputs/radio_collection_input.rb +17 -0
  177. data/app/inputs/symbol_input.rb +5 -0
  178. data/app/models/concerns/fae/assets_validatable.rb +12 -0
  179. data/app/models/concerns/fae/authorization_concern.rb +12 -0
  180. data/app/models/concerns/fae/base_model_concern.rb +105 -0
  181. data/app/models/concerns/fae/change_concern.rb +1 -0
  182. data/app/models/concerns/fae/file_concern.rb +1 -0
  183. data/app/models/concerns/fae/image_concern.rb +1 -0
  184. data/app/models/concerns/fae/navigation_concern.rb +10 -0
  185. data/app/models/concerns/fae/option_concern.rb +1 -0
  186. data/app/models/concerns/fae/page_validatable.rb +26 -0
  187. data/app/models/concerns/fae/paper_trailer.rb +8 -0
  188. data/app/models/concerns/fae/role_concern.rb +1 -0
  189. data/app/models/concerns/fae/sortable.rb +51 -0
  190. data/app/models/concerns/fae/static_page_concern.rb +1 -0
  191. data/app/models/concerns/fae/text_area_concern.rb +1 -0
  192. data/app/models/concerns/fae/text_field_concern.rb +1 -0
  193. data/app/models/concerns/fae/trackable.rb +124 -0
  194. data/app/models/concerns/fae/user_concern.rb +7 -0
  195. data/app/models/fae/authorization.rb +8 -0
  196. data/app/models/fae/change.rb +53 -0
  197. data/app/models/fae/file.rb +24 -0
  198. data/app/models/fae/image.rb +33 -0
  199. data/app/models/fae/navigation.rb +132 -0
  200. data/app/models/fae/option.rb +38 -0
  201. data/app/models/fae/role.rb +18 -0
  202. data/app/models/fae/static_page.rb +109 -0
  203. data/app/models/fae/text_area.rb +14 -0
  204. data/app/models/fae/text_field.rb +14 -0
  205. data/app/models/fae/user.rb +67 -0
  206. data/app/uploaders/fae/file_uploader.rb +26 -0
  207. data/app/uploaders/fae/image_uploader.rb +28 -0
  208. data/app/validators/fae/cross_model_uniqueness_validator.rb +14 -0
  209. data/app/views/devise/confirmations/new.html.slim +13 -0
  210. data/app/views/devise/mailer/confirmation_instructions.html.slim +3 -0
  211. data/app/views/devise/mailer/reset_password_instructions.html.slim +5 -0
  212. data/app/views/devise/mailer/unlock_instructions.html.slim +4 -0
  213. data/app/views/devise/passwords/edit.html.slim +10 -0
  214. data/app/views/devise/passwords/new.html.slim +10 -0
  215. data/app/views/devise/registrations/edit.html.slim +22 -0
  216. data/app/views/devise/registrations/new.html.slim +15 -0
  217. data/app/views/devise/sessions/new.html.slim +7 -0
  218. data/app/views/devise/shared/_links.slim +25 -0
  219. data/app/views/devise/unlocks/new.html.slim +13 -0
  220. data/app/views/fae/application/_breadcrumb.html.slim +19 -0
  221. data/app/views/fae/application/_content_form.html.slim +55 -0
  222. data/app/views/fae/application/_credit.slim +6 -0
  223. data/app/views/fae/application/_file_uploader.html.slim +36 -0
  224. data/app/views/fae/application/_flash_messages.slim +2 -0
  225. data/app/views/fae/application/_global_search_results.html.slim +37 -0
  226. data/app/views/fae/application/_header.slim +50 -0
  227. data/app/views/fae/application/_markdown_helper.slim +41 -0
  228. data/app/views/fae/application/_mobilenav.slim +66 -0
  229. data/app/views/fae/application/_sidenav.slim +23 -0
  230. data/app/views/fae/application/_user_log.html.slim +36 -0
  231. data/app/views/fae/images/_image_uploader.html.slim +66 -0
  232. data/app/views/fae/options/_form.html.slim +16 -0
  233. data/app/views/fae/options/edit.html.slim +1 -0
  234. data/app/views/fae/pages/activity_log.html.slim +32 -0
  235. data/app/views/fae/pages/disabled_environment.html.slim +4 -0
  236. data/app/views/fae/pages/error404.html.slim +7 -0
  237. data/app/views/fae/pages/help.html.slim +35 -0
  238. data/app/views/fae/pages/home.html.slim +36 -0
  239. data/app/views/fae/setup/first_user.html.slim +11 -0
  240. data/app/views/fae/shared/_errors.slim +4 -0
  241. data/app/views/fae/shared/_form_header.html.slim +40 -0
  242. data/app/views/fae/shared/_index_header.html.slim +26 -0
  243. data/app/views/fae/shared/_nested_table.html.slim +49 -0
  244. data/app/views/fae/shared/_recent_changes.html.slim +22 -0
  245. data/app/views/fae/shared/_shared_nested_table.html.slim +46 -0
  246. data/app/views/fae/static_pages/index.html.slim +13 -0
  247. data/app/views/fae/users/_form.html.slim +19 -0
  248. data/app/views/fae/users/edit.html.slim +1 -0
  249. data/app/views/fae/users/index.html.slim +23 -0
  250. data/app/views/fae/users/new.html.slim +1 -0
  251. data/app/views/fae/users/settings.html.slim +1 -0
  252. data/app/views/kaminari/fae/_gap.html.slim +8 -0
  253. data/app/views/kaminari/fae/_next_page.html.slim +9 -0
  254. data/app/views/kaminari/fae/_page.html.slim +15 -0
  255. data/app/views/kaminari/fae/_paginator.html.slim +15 -0
  256. data/app/views/kaminari/fae/_prev_page.html.slim +9 -0
  257. data/app/views/layouts/devise.html.slim +29 -0
  258. data/app/views/layouts/fae/application.html.slim +23 -0
  259. data/app/views/layouts/fae/error.html.slim +11 -0
  260. data/config/deploy.rb +73 -0
  261. data/config/deploy/dev.rb +19 -0
  262. data/config/deploy/prod.rb +19 -0
  263. data/config/deploy/stage.rb +19 -0
  264. data/config/initializers/assets.rb +1 -0
  265. data/config/initializers/carrierwave.rb +3 -0
  266. data/config/initializers/devise.rb +258 -0
  267. data/config/initializers/devise_monkeypatch.rb +11 -0
  268. data/config/initializers/fae_judge.rb +3 -0
  269. data/config/initializers/inflections.rb +16 -0
  270. data/config/initializers/kaminari_config.rb +10 -0
  271. data/config/initializers/simple_form.rb +147 -0
  272. data/config/initializers/time_formats.rb +3 -0
  273. data/config/locales/devise.en.yml +59 -0
  274. data/config/locales/devise.zh-CN.yml +59 -0
  275. data/config/locales/fae.en.yml +10 -0
  276. data/config/locales/fae.zh-CN.yml +10 -0
  277. data/config/locales/simple_form.en.yml +26 -0
  278. data/config/locales/simple_form.zh-CN.yml +26 -0
  279. data/config/routes.rb +46 -0
  280. data/db/migrate/20140809222030_add_user_table.rb +49 -0
  281. data/db/migrate/20140822224029_create_fae_roles.rb +10 -0
  282. data/db/migrate/20141008180718_create_fae_images_table.rb +19 -0
  283. data/db/migrate/20141017194616_create_fae_options.rb +16 -0
  284. data/db/migrate/20141021181327_create_fae_files.rb +17 -0
  285. data/db/migrate/20141021183047_create_fae_text_areas.rb +16 -0
  286. data/db/migrate/20141021184311_create_fae_pages.rb +13 -0
  287. data/db/migrate/20141105214814_create_fae_text_fields.rb +15 -0
  288. data/db/migrate/20150930224821_create_fae_changes.rb +17 -0
  289. data/lib/fae-rails.rb +6 -0
  290. data/lib/fae/concerns/models/base.rb +8 -0
  291. data/lib/fae/engine.rb +37 -0
  292. data/lib/fae/options.rb +35 -0
  293. data/lib/fae/validation_helper_collection.rb +76 -0
  294. data/lib/fae/version.rb +3 -0
  295. data/lib/file_size_validator.rb +71 -0
  296. data/lib/generators/fae/base_generator.rb +156 -0
  297. data/lib/generators/fae/controller_generator.rb +13 -0
  298. data/lib/generators/fae/install_generator.rb +61 -0
  299. data/lib/generators/fae/model_generator.rb +11 -0
  300. data/lib/generators/fae/nested_index_scaffold_generator.rb +36 -0
  301. data/lib/generators/fae/nested_scaffold_generator.rb +51 -0
  302. data/lib/generators/fae/page_generator.rb +65 -0
  303. data/lib/generators/fae/scaffold_generator.rb +15 -0
  304. data/lib/generators/fae/templates/assets/fae.js +6 -0
  305. data/lib/generators/fae/templates/assets/fae.scss +2 -0
  306. data/lib/generators/fae/templates/controllers/nested_index_scaffold_controller.rb +81 -0
  307. data/lib/generators/fae/templates/controllers/nested_scaffold_controller.rb +13 -0
  308. data/lib/generators/fae/templates/controllers/scaffold_controller.rb +13 -0
  309. data/lib/generators/fae/templates/controllers/static_pages_controller.rb +10 -0
  310. data/lib/generators/fae/templates/initializers/fae.rb +63 -0
  311. data/lib/generators/fae/templates/initializers/fae_fine.rb +51 -0
  312. data/lib/generators/fae/templates/initializers/judge.rb +6 -0
  313. data/lib/generators/fae/templates/models/concerns/authorization_concern.rb +27 -0
  314. data/lib/generators/fae/templates/models/concerns/navigation_concern.rb +33 -0
  315. data/lib/generators/fae/templates/models/pages_model.rb +14 -0
  316. data/lib/generators/fae/templates/tasks/fae_tasks.rake +19 -0
  317. data/lib/generators/fae/templates/views/_form.html.slim +18 -0
  318. data/lib/generators/fae/templates/views/_form_index_nested.html.slim +13 -0
  319. data/lib/generators/fae/templates/views/_form_nested.html.slim +17 -0
  320. data/lib/generators/fae/templates/views/edit.html.slim +1 -0
  321. data/lib/generators/fae/templates/views/edit_nested.html.slim +3 -0
  322. data/lib/generators/fae/templates/views/index.html.slim +35 -0
  323. data/lib/generators/fae/templates/views/index_nested.html.slim +8 -0
  324. data/lib/generators/fae/templates/views/new.html.slim +1 -0
  325. data/lib/generators/fae/templates/views/new_nested.html.slim +3 -0
  326. data/lib/generators/fae/templates/views/static_page_form.html.slim +15 -0
  327. data/lib/generators/fae/templates/views/table_nested.html.slim +4 -0
  328. metadata +692 -0
@@ -0,0 +1,11 @@
1
+ # Devise::FailureApp controls how warden hands unauthentiacted requests
2
+ # there's a bug in Devise 3.4.1 in this private method
3
+ # the fix is on master, yet is unreleased
4
+ # chances are this can be removed after the next Devise release
5
+ Devise::FailureApp.class_eval do
6
+ def scope_url
7
+ context = send(Devise.available_router_name)
8
+ route = :"new_#{scope}_session_url"
9
+ context.send(route, {})
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ Judge.configure do
2
+ expose Fae::User, :email
3
+ end
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,10 @@
1
+ Kaminari.configure do |config|
2
+ config.default_per_page = 25
3
+ # config.max_per_page = nil
4
+ config.window = 3
5
+ # config.outer_window = 0
6
+ config.left = 1
7
+ config.right = 1
8
+ # config.page_method_name = :page
9
+ # config.param_name = :page
10
+ end
@@ -0,0 +1,147 @@
1
+ # Use this setup block to configure all options available in SimpleForm.
2
+ SimpleForm.setup do |config|
3
+ # Wrappers are used by the form builder to generate a
4
+ # complete input. You can remove any component from the
5
+ # wrapper, change the order or even add your own to the
6
+ # stack. The options given below are used to wrap the
7
+ # whole input.
8
+ config.wrappers :default, class: :input,
9
+ hint_class: :field_with_hint, error_class: :field_with_errors do |b|
10
+
11
+ b.use :judge
12
+ ## Extensions enabled by default
13
+ # Any of these extensions can be disabled for a
14
+ # given input by passing: `f.input EXTENSION_NAME => false`.
15
+ # You can make any of these extensions optional by
16
+ # renaming `b.use` to `b.optional`.
17
+
18
+ # Determines whether to use HTML5 (:email, :url, ...)
19
+ # and required attributes
20
+ b.use :html5
21
+
22
+ # Calculates placeholders automatically from I18n
23
+ # You can also pass a string as f.input placeholder: "Placeholder"
24
+ b.use :placeholder
25
+
26
+ ## Optional extensions
27
+ # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
28
+ # to the input. If so, they will retrieve the values from the model
29
+ # if any exists. If you want to enable the lookup for any of those
30
+ # extensions by default, you can change `b.optional` to `b.use`.
31
+
32
+ # Calculates maxlength from length validations for string inputs
33
+ b.optional :maxlength
34
+
35
+ # Calculates pattern from format validations for string inputs
36
+ b.optional :pattern
37
+
38
+ # Calculates min and max from length validations for numeric inputs
39
+ b.optional :min_max
40
+
41
+ # Calculates readonly automatically from readonly attributes
42
+ b.optional :readonly
43
+
44
+ ## Inputs
45
+ b.use :label_input
46
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
47
+ b.use :error, wrap_with: { tag: :span, class: :error }
48
+ end
49
+
50
+ # The default wrapper to be used by the FormBuilder.
51
+ config.default_wrapper = :default
52
+
53
+ # Define the way to render check boxes / radio buttons with labels.
54
+ # Defaults to :nested for bootstrap config.
55
+ # inline: input + label
56
+ # nested: label > input
57
+ config.boolean_style = :nested
58
+
59
+ # Default class for buttons
60
+ config.button_class = 'btn'
61
+
62
+ # Method used to tidy up errors. Specify any Rails Array method.
63
+ # :first lists the first message for each field.
64
+ # Use :to_sentence to list all errors for each field.
65
+ config.error_method = :first
66
+
67
+ # Default tag used for error notification helper.
68
+ config.error_notification_tag = :div
69
+
70
+ # CSS class to add for error notification helper.
71
+ config.error_notification_class = 'alert alert-error'
72
+
73
+ # ID to add for error notification helper.
74
+ # config.error_notification_id = nil
75
+
76
+ # Series of attempts to detect a default label method for collection.
77
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
78
+
79
+ # Series of attempts to detect a default value method for collection.
80
+ # config.collection_value_methods = [ :id, :to_s ]
81
+
82
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
83
+ # config.collection_wrapper_tag = nil
84
+
85
+ # You can define the class to use on all collection wrappers. Defaulting to none.
86
+ # config.collection_wrapper_class = nil
87
+
88
+ # You can wrap each item in a collection of radio/check boxes with a tag,
89
+ # defaulting to :span. Please note that when using :boolean_style = :nested,
90
+ # SimpleForm will force this option to be a label.
91
+ # config.item_wrapper_tag = :span
92
+
93
+ # You can define a class to use in all item wrappers. Defaulting to none.
94
+ # config.item_wrapper_class = nil
95
+
96
+ # How the label text should be generated altogether with the required text.
97
+ # config.label_text = lambda { |label, required| "#{required} #{label}" }
98
+
99
+ # You can define the class to use on all labels. Default is nil.
100
+ config.label_class = 'control-label'
101
+
102
+ # You can define the class to use on all forms. Default is simple_form.
103
+ # config.form_class = :simple_form
104
+
105
+ # You can define which elements should obtain additional classes
106
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
107
+
108
+ # Whether attributes are required by default (or not). Default is true.
109
+ # config.required_by_default = true
110
+
111
+ # Tell browsers whether to use the native HTML5 validations (novalidate form option).
112
+ # These validations are enabled in SimpleForm's internal config but disabled by default
113
+ # in this configuration, which is recommended due to some quirks from different browsers.
114
+ # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
115
+ # change this configuration to true.
116
+ config.browser_validations = false
117
+
118
+ # Collection of methods to detect if a file type was given.
119
+ # config.file_methods = [ :mounted_as, :file?, :public_filename ]
120
+
121
+ # Custom mappings for input types. This should be a hash containing a regexp
122
+ # to match as key, and the input type that will be used when the field name
123
+ # matches the regexp as value.
124
+ # config.input_mappings = { /count/ => :integer }
125
+
126
+ # Custom wrappers for input types. This should be a hash containing an input
127
+ # type as key and the wrapper that will be used for all inputs with specified type.
128
+ # config.wrapper_mappings = { string: :prepend }
129
+
130
+ # Default priority for time_zone inputs.
131
+ # config.time_zone_priority = nil
132
+
133
+ # Default priority for country inputs.
134
+ # config.country_priority = nil
135
+
136
+ # When false, do not use translations for labels.
137
+ # config.translate_labels = true
138
+
139
+ # Automatically discover new inputs in Rails' autoload path.
140
+ # config.inputs_discovery = true
141
+
142
+ # Cache SimpleForm inputs discovery
143
+ # config.cache_discovery = !Rails.env.development?
144
+
145
+ # Default class for inputs
146
+ # config.input_class = nil
147
+ end
@@ -0,0 +1,3 @@
1
+ Date::DATE_FORMATS[:default] = "%b %d, %Y"
2
+ Time::DATE_FORMATS[:default] = "%b %d, %Y %I:%M%P"
3
+ Time::DATE_FORMATS[:filename] = "%Y%m%d%H%M%S"
@@ -0,0 +1,59 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your account was successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "You’ll need a user name and a password that works. We’re sticklers for this stuff."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account will be locked."
15
+ not_found_in_database: "You’ll need a user name and a password that works. We’re sticklers for this stuff."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in before moving on."
18
+ unconfirmed: "You have to confirm your account before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock Instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password was changed successfully. You are now signed in."
34
+ updated_not_active: "Your password was changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
42
+ updated: "You updated your account successfully."
43
+ sessions:
44
+ signed_in: "You’re here, officially."
45
+ signed_out: "Goodbye for now."
46
+ unlocks:
47
+ send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
48
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
49
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
50
+ errors:
51
+ messages:
52
+ already_confirmed: "was already confirmed, please try signing in"
53
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
54
+ expired: "has expired, please request a new one"
55
+ not_found: "not found"
56
+ not_locked: "was not locked"
57
+ not_saved:
58
+ one: "1 error prohibited this %{resource} from being saved:"
59
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -0,0 +1,59 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ zh-CN:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "你的电子邮件地址以被成功确认。"
7
+ send_instructions: "你在几分钟后会收到一封电子邮件告诉你如何确认你的电子邮件地址。"
8
+ send_paranoid_instructions: "如果我们的数据库中保存有你的电子邮件地址,你会在几分钟内收到一封邮件告诉你如何确认的电子邮件。"
9
+ failure:
10
+ already_authenticated: "你已经登录。"
11
+ inactive: "你的帐户还未激活。"
12
+ invalid: "你需要合法的用户名和密码。"
13
+ locked: "你的帐号已被锁定。"
14
+ last_attempt: "你还有最后一次尝试机会,如果再次失败你的帐号将被锁定。"
15
+ not_found_in_database: "你需要合法的用户名和密码。"
16
+ timeout: "你的登录超时,请重新登录。"
17
+ unauthenticated: "你需要登录才能继续操作。"
18
+ unconfirmed: "你需要确认你的帐户才能继续。"
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "帐户确认指南"
22
+ reset_password_instructions:
23
+ subject: "重置密码指南"
24
+ unlock_instructions:
25
+ subject: "Pivorak: 解锁指南"
26
+ omniauth_callbacks:
27
+ failure: "由于%{reason},无法从%{kind} 认证。"
28
+ success: "成功从 %{kind} 认证帐户。"
29
+ passwords:
30
+ no_token: "如果没有密码重置邮件无法访问这个页面。如果你是从密码重置邮件访问过来的,请确认输入的网址完整。"
31
+ send_instructions: "在几分钟内你会收到一封密码重置邮件。"
32
+ send_paranoid_instructions: "如果我们的数据库中保存有你的电子邮件地址,你会在几分钟内收到一封如何恢复密码的邮件。"
33
+ updated: "你的密码已被成功更改,你现在已经登录。"
34
+ updated_not_active: "你的密码已被成功更改。"
35
+ registrations:
36
+ destroyed: "再见!你的帐户已被成功取消。希望能再次见到你。"
37
+ signed_up: "欢迎!你已经成功注册。"
38
+ signed_up_but_inactive: "你已经成功注册。但是由于你的帐户未激活,你仍无法登录。"
39
+ signed_up_but_locked: "你已经成功注册。但是由于你的帐户被锁定,你仍无法登录。"
40
+ signed_up_but_unconfirmed: "我们已向你的邮箱发送了一封确认邮件。请单击邮件中的链接激活你的帐户。"
41
+ update_needs_confirmation: "你已经成功更新帐户,但我们需要验证你的电子邮件地址。请检查你的邮件并确认你的子邮件地址。"
42
+ updated: "你的帐户已被成功更新。"
43
+ sessions:
44
+ signed_in: "你已登录成功。"
45
+ signed_out: "再见。"
46
+ unlocks:
47
+ send_instructions: "在几分钟内你会收到一封如何解锁帐户的邮件。"
48
+ send_paranoid_instructions: "如果你的帐户存在,在几分钟内你会收到一封如何解锁帐户的邮件。"
49
+ unlocked: "你的帐户已被成功解锁,请重新登录。"
50
+ errors:
51
+ messages:
52
+ already_confirmed: "已确认,请尝试登录"
53
+ confirmation_period_expired: "需要在 %{period} 内确认,请重新申请"
54
+ expired: "已过期,请重新申请"
55
+ not_found: "未找到"
56
+ not_locked: "未被锁定"
57
+ not_saved:
58
+ one: "出现一个错误导致 %{resource} 不能被保存:"
59
+ other: "出现 %{count} 个错误导致 %{resource} 不能被保存:"
@@ -0,0 +1,10 @@
1
+ en:
2
+ fae:
3
+ save_notice: 'Success. You’ve done good.'
4
+ save_error: 'Let’s slow down a bit. Check your form for errors.'
5
+ delete_notice: 'Item was successfully removed.'
6
+ delete_error: 'This item has associated objects that prevent it from being removed.'
7
+ delete_confirmation: 'Are you sure you want to permanently delete this item?'
8
+ clone_confirmation: "Once you clone, you'll need to delete if you later change your mind. Still want to?"
9
+ unauthorized_error: 'You are not authorized to view that page.'
10
+ exceeded_upload_limit: "Let's aim for smaller. This asset is larger than the ### MB limit. Got another?"
@@ -0,0 +1,10 @@
1
+ zh-CN:
2
+ fae:
3
+ save_notice: '保存成功。'
4
+ save_error: '请检查你的表单错误。'
5
+ delete_notice: '记录被成功删除。'
6
+ delete_error: '和这条记录相关的对象使得它不能被删除。'
7
+ delete_confirmation: '你确定要永久删除这条记录?'
8
+ clone_confirmation: "一旦克隆,如果随后改变主意,你需要删除它。继续吗?"
9
+ unauthorized_error: '你未被授权访问这个页面。'
10
+ exceeded_upload_limit: "这个资源超过文件大小限制,试试另外一个?"
@@ -0,0 +1,26 @@
1
+ en:
2
+ simple_form:
3
+ "yes": 'Yes'
4
+ "no": 'No'
5
+ required:
6
+ text: 'required'
7
+ mark: '*'
8
+ # You can uncomment the line below if you need to overwrite the whole required html.
9
+ # When using html, text and mark won't be used.
10
+ # html: '<abbr title="required">*</abbr>'
11
+ error_notification:
12
+ default_message: "Please review the problems below:"
13
+ # Labels and hints examples
14
+ # labels:
15
+ # defaults:
16
+ # password: 'Password'
17
+ # user:
18
+ # new:
19
+ # email: 'E-mail to sign in.'
20
+ # edit:
21
+ # email: 'E-mail.'
22
+ # hints:
23
+ # defaults:
24
+ # username: 'User name to sign in.'
25
+ # password: 'No special characters, please.'
26
+
@@ -0,0 +1,26 @@
1
+ zh-CN:
2
+ simple_form:
3
+ "yes": '是'
4
+ "no": '否'
5
+ required:
6
+ text: '必填'
7
+ mark: '*'
8
+ # You can uncomment the line below if you need to overwrite the whole required html.
9
+ # When using html, text and mark won't be used.
10
+ # html: '<abbr title="required">*</abbr>'
11
+ error_notification:
12
+ default_message: "请检查如下错误:"
13
+ # Labels and hints examples
14
+ # labels:
15
+ # defaults:
16
+ # password: 'Password'
17
+ # user:
18
+ # new:
19
+ # email: 'E-mail to sign in.'
20
+ # edit:
21
+ # email: 'E-mail.'
22
+ # hints:
23
+ # defaults:
24
+ # username: 'User name to sign in.'
25
+ # password: 'No special characters, please.'
26
+
@@ -0,0 +1,46 @@
1
+ Fae::Engine.routes.draw do
2
+
3
+ mount Judge::Engine => '/judge'
4
+
5
+ root 'pages#home'
6
+
7
+ devise_for :users, class_name: "Fae::User", module: :devise, skip: [:sessions]
8
+ as :user do
9
+ if Fae::User.devise_modules.include? :database_authenticatable
10
+ get 'login' => '/devise/sessions#new', as: :new_user_session
11
+ post 'login' => '/devise/sessions#create', as: :user_session
12
+ get 'logout' => '/devise/sessions#destroy', as: :destroy_user_session
13
+ end
14
+ end
15
+ resources :users
16
+
17
+ get 'settings' => 'users#settings', as: 'settings'
18
+ get 'help' => 'pages#help', as: 'help'
19
+ get 'activity' => 'pages#activity_log', as: 'activity_log'
20
+ post 'activity/filter' => 'pages#activity_log_filter', as: 'activity_log_filter'
21
+
22
+ get 'first_user' => 'setup#first_user'
23
+ post 'first_user' => 'setup#create_first_user'
24
+
25
+ # AJAX
26
+ delete 'files/:id/delete_file' => 'files#delete_file', as: :delete_file
27
+ delete 'images/:id/delete_image' => 'images#delete_image', as: :delete_image
28
+
29
+ post 'toggle/:object/:id/:attr', to: 'utilities#toggle', as: 'toggle'
30
+ post 'sort/:object', to: 'utilities#sort', as: 'sort'
31
+ post 'language_preference/:language', to: 'utilities#language_preference'
32
+ post 'search/:query', to: 'utilities#global_search'
33
+ post 'search', to: 'utilities#global_search'
34
+ post 'html_embedded_image', to: 'images#create_html_embedded'
35
+
36
+ get '/root' => 'options#edit', as: :option
37
+ match '/root' => 'options#update', via: [:put, :patch]
38
+
39
+ get 'pages' => '/admin/content_blocks#index', as: 'pages'
40
+ get 'content_blocks/:slug' => '/admin/content_blocks#edit', as: 'edit_content_block'
41
+ match 'content_blocks/:slug/update' => '/admin/content_blocks#update', via: [:put, :patch], as: 'update_content_block'
42
+
43
+ # catch all 404
44
+ match "*path" => 'pages#error404', via: [:get, :post]
45
+
46
+ end
@@ -0,0 +1,49 @@
1
+ class AddUserTable < ActiveRecord::Migration[4.2]
2
+ def change
3
+ create_table(:fae_users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0, :null => false
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Confirmable
23
+ t.string :confirmation_token
24
+ t.datetime :confirmed_at
25
+ t.datetime :confirmation_sent_at
26
+ t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts
30
+ t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ t.datetime :locked_at
32
+
33
+ # non-devise attributes
34
+ t.string :first_name
35
+ t.string :last_name
36
+ t.integer :role_id
37
+ t.boolean :active
38
+ t.string :language
39
+
40
+ t.timestamps
41
+ end
42
+
43
+ add_index :fae_users, :email, :unique => true
44
+ add_index :fae_users, :reset_password_token, :unique => true
45
+ add_index :fae_users, :confirmation_token, :unique => true
46
+ add_index :fae_users, :unlock_token, :unique => true
47
+ add_index :fae_users, :role_id
48
+ end
49
+ end