faalis 1.0.0 → 2.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (498) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +0 -0
  3. data/README.md +17 -43
  4. data/Rakefile +2 -5
  5. data/app/assets/fonts/DroidNaskh-Bold.ttf +0 -0
  6. data/app/assets/fonts/DroidNaskh-Regular.ttf +0 -0
  7. data/app/assets/fonts/OpenSans-Bold.ttf +0 -0
  8. data/app/assets/fonts/OpenSans-BoldItalic.ttf +0 -0
  9. data/app/assets/fonts/OpenSans-ExtraBold.ttf +0 -0
  10. data/app/assets/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  11. data/app/assets/fonts/OpenSans-Italic.ttf +0 -0
  12. data/app/assets/fonts/OpenSans-Light.ttf +0 -0
  13. data/app/assets/fonts/OpenSans-LightItalic.ttf +0 -0
  14. data/app/assets/fonts/OpenSans-Regular.ttf +0 -0
  15. data/app/assets/fonts/OpenSans-Semibold.ttf +0 -0
  16. data/app/assets/fonts/OpenSans-SemiboldItalic.ttf +0 -0
  17. data/app/assets/images/faalis/select2-spinner.gif +0 -0
  18. data/app/assets/images/faalis/select2.png +0 -0
  19. data/app/assets/images/faalis/select2x2.png +0 -0
  20. data/app/assets/javascripts/faalis/application.js +0 -0
  21. data/app/assets/javascripts/faalis/dashboard/application.js.erb +16 -6
  22. data/app/assets/javascripts/faalis/dashboard/functions.js.erb +0 -102
  23. data/app/assets/javascripts/faalis/dashboard/init.js.coffee +34 -0
  24. data/app/assets/javascripts/faalis/dashboard/lib/actions.js +7 -0
  25. data/app/assets/javascripts/faalis/dashboard/lib/flash_message.js +71 -0
  26. data/app/assets/javascripts/faalis/dashboard/lib/locale.js +14 -0
  27. data/app/assets/javascripts/faalis/dashboard/lib/misc.js +5 -0
  28. data/app/assets/javascripts/faalis/dashboard/lib/string.js +3 -0
  29. data/app/assets/javascripts/faalis/dashboard/variables.js.erb +0 -19
  30. data/app/assets/javascripts/faalis/groups.js +0 -0
  31. data/app/assets/javascripts/faalis/home.js +0 -0
  32. data/app/assets/javascripts/faalis/i18n.js +0 -0
  33. data/app/assets/javascripts/faalis/simple.js +20 -0
  34. data/app/assets/javascripts/faalis/users.js +0 -0
  35. data/app/assets/locale/templates.fa.pot +0 -0
  36. data/app/assets/locale/templates.pot +0 -0
  37. data/app/assets/stylesheets/faalis/dashboard/loadindicator.scss +11 -0
  38. data/app/assets/stylesheets/faalis/dashboard/ltr/application.css +20 -10
  39. data/app/assets/stylesheets/faalis/dashboard/rtl/application.css +19 -3
  40. data/app/assets/stylesheets/faalis/dashboard/share.scss +37 -0
  41. data/app/assets/stylesheets/faalis/simple/ltr/application.css +2 -0
  42. data/app/assets/stylesheets/faalis/simple/rtl/application.css +2 -0
  43. data/app/assets/stylesheets/faalis/simple/rtl/rtl.scss +16 -0
  44. data/app/assets/stylesheets/faalis/simple/share.scss +11 -0
  45. data/app/controllers/faalis/#dashboard_controller.rb# +65 -0
  46. data/app/controllers/faalis/api/v1/conversations_controller.rb +0 -0
  47. data/app/controllers/faalis/api/v1/groups_controller.rb +0 -0
  48. data/app/controllers/faalis/api/v1/logs_controller.rb +0 -0
  49. data/app/controllers/faalis/api/v1/permissions_controller.rb +0 -0
  50. data/app/controllers/faalis/api/v1/profiles_controller.rb +0 -0
  51. data/app/controllers/faalis/api/v1/users_controller.rb +0 -0
  52. data/app/controllers/faalis/api_controller.rb +7 -7
  53. data/app/controllers/faalis/application_controller.rb +5 -8
  54. data/app/controllers/faalis/dashboard/application_controller.rb +40 -0
  55. data/app/controllers/faalis/dashboard/groups_controller.rb +64 -58
  56. data/app/controllers/faalis/dashboard/profile_controller.rb +49 -0
  57. data/app/controllers/faalis/dashboard/users_controller.rb +90 -80
  58. data/app/controllers/faalis/dashboard_controller.rb +3 -50
  59. data/app/controllers/faalis/omniauth/callbacks_controller.rb +0 -0
  60. data/app/helpers/faalis/application_helper.rb +0 -0
  61. data/app/helpers/faalis/dashboard_helper.rb +37 -0
  62. data/app/helpers/faalis/groups_helper.rb +0 -0
  63. data/app/helpers/faalis/home_helper.rb +0 -0
  64. data/app/helpers/faalis/users_helper.rb +0 -0
  65. data/app/models/faalis/concerns/assignment.rb +0 -0
  66. data/app/models/faalis/concerns/user/auth_definitions.rb +0 -0
  67. data/app/models/faalis/concerns/user/gravatar.rb +11 -0
  68. data/app/models/faalis/concerns/user/mongoid_fields.rb +0 -0
  69. data/app/models/faalis/concerns/user/permission.rb +0 -0
  70. data/app/models/faalis/concerns/user/user_roles.rb +0 -0
  71. data/app/models/faalis/group.rb +0 -0
  72. data/app/models/faalis/permission.rb +2 -1
  73. data/app/models/faalis/permissions/auth.rb +0 -0
  74. data/app/models/faalis/user.rb +3 -0
  75. data/app/policies/faalis/admin_only_policy.rb +0 -0
  76. data/app/policies/faalis/application_policy.rb +0 -0
  77. data/app/policies/faalis/group_policy.rb +0 -0
  78. data/app/policies/faalis/user_policy.rb +0 -0
  79. data/app/views/angular/auth/groups/details.html +0 -0
  80. data/app/views/angular/auth/groups/index.html +0 -0
  81. data/app/views/angular/auth/groups/new.html +0 -0
  82. data/app/views/angular/auth/index.html +0 -0
  83. data/app/views/angular/auth/profile/edit.html +0 -0
  84. data/app/views/angular/auth/users/details.html +0 -0
  85. data/app/views/angular/auth/users/index.html +0 -0
  86. data/app/views/angular/auth/users/new.html +0 -0
  87. data/app/views/angular/conversations/details.html +0 -0
  88. data/app/views/angular/conversations/index.html +0 -0
  89. data/app/views/angular/conversations/new.html +0 -0
  90. data/app/views/angular/conversations/show.html +0 -0
  91. data/app/views/angular/conversations/show_details.html +0 -0
  92. data/app/views/angular/faalis/views/generic_add_view.html.slim +0 -0
  93. data/app/views/angular/fields/boolean/boolean.html +0 -0
  94. data/app/views/angular/fields/control-combo/control-list.html +0 -0
  95. data/app/views/angular/fields/datetime/datetime.html +0 -0
  96. data/app/views/angular/fields/datetime/time.html +0 -0
  97. data/app/views/angular/fields/file/file.html.slim +0 -0
  98. data/app/views/angular/fields/float/float.html +0 -0
  99. data/app/views/angular/fields/image/image.html +0 -0
  100. data/app/views/angular/fields/integer/integer.html +0 -0
  101. data/app/views/angular/fields/relation/relation.html +0 -0
  102. data/app/views/angular/fields/string/string.html +0 -0
  103. data/app/views/angular/fields/tag/tag.html +0 -0
  104. data/app/views/angular/fields/text/text.html +0 -0
  105. data/app/views/angular/filter/index.html +0 -0
  106. data/app/views/angular/index.html +0 -0
  107. data/app/views/angular/locale/fa.po +0 -0
  108. data/app/views/angular/locale/templates.pot +0 -0
  109. data/app/views/angular/logs/index.html +0 -0
  110. data/app/views/angular/modules.html +0 -0
  111. data/app/views/angular/nav.html.erb +2 -0
  112. data/app/views/devise/registrations/edit.html.erb +0 -0
  113. data/app/views/devise/registrations/new.html.erb +30 -89
  114. data/app/views/devise/sessions/new.html.erb +29 -54
  115. data/app/views/devise/shared/_links.erb +5 -13
  116. data/app/views/devise/shared/_omni_link.erb +33 -0
  117. data/app/views/faalis/api/v1/conversations/create.json.jbuilder +0 -0
  118. data/app/views/faalis/api/v1/conversations/destroy.json.jbuilder +0 -0
  119. data/app/views/faalis/api/v1/conversations/index.json.jbuilder +0 -0
  120. data/app/views/faalis/api/v1/conversations/reply.json.jbuilder +0 -0
  121. data/app/views/faalis/api/v1/conversations/show.json.jbuilder +0 -0
  122. data/app/views/faalis/api/v1/conversations/trash.json.jbuilder +0 -0
  123. data/app/views/faalis/api/v1/groups/create.json.jbuilder +0 -0
  124. data/app/views/faalis/api/v1/groups/destroy.html.erb +0 -0
  125. data/app/views/faalis/api/v1/groups/destroy.json.jbuilder +0 -0
  126. data/app/views/faalis/api/v1/groups/edit.html.erb +0 -0
  127. data/app/views/faalis/api/v1/groups/index.html.erb +0 -0
  128. data/app/views/faalis/api/v1/groups/index.json.jbuilder +0 -0
  129. data/app/views/faalis/api/v1/groups/new.html.erb +0 -0
  130. data/app/views/faalis/api/v1/groups/show.html.erb +0 -0
  131. data/app/views/faalis/api/v1/groups/show.json.jbuilder +0 -0
  132. data/app/views/faalis/api/v1/groups/update.json.jbuilder +0 -0
  133. data/app/views/faalis/api/v1/logs/index.json.jbuilder +0 -0
  134. data/app/views/faalis/api/v1/permissions/index.json.jbuilder +0 -0
  135. data/app/views/faalis/api/v1/permissions/user_permissions.json.jbuilder +0 -0
  136. data/app/views/faalis/api/v1/users/create.html.erb +0 -0
  137. data/app/views/faalis/api/v1/users/create.json.jbuilder +0 -0
  138. data/app/views/faalis/api/v1/users/destroy.json.jbuilder +0 -0
  139. data/app/views/faalis/api/v1/users/distroy.html.erb +0 -0
  140. data/app/views/faalis/api/v1/users/edit.html.erb +0 -0
  141. data/app/views/faalis/api/v1/users/index.html.erb +0 -0
  142. data/app/views/faalis/api/v1/users/index.json.jbuilder +0 -0
  143. data/app/views/faalis/api/v1/users/show.html.erb +0 -0
  144. data/app/views/faalis/api/v1/users/show.json.jbuilder +0 -0
  145. data/app/views/faalis/api/v1/users/update.json.jbuilder +0 -0
  146. data/app/views/faalis/dashboard/groups/_form.html.slim +12 -16
  147. data/app/views/faalis/dashboard/groups/create.js.erb +1 -1
  148. data/app/views/faalis/dashboard/groups/edit.html.slim +0 -0
  149. data/app/views/faalis/dashboard/groups/errors.js.erb +0 -0
  150. data/app/views/faalis/dashboard/groups/index.html.slim +47 -0
  151. data/app/views/faalis/dashboard/groups/new.html.slim +1 -1
  152. data/app/views/faalis/dashboard/groups/update.js.erb +1 -1
  153. data/app/views/faalis/dashboard/index.html.erb +0 -37
  154. data/app/views/faalis/dashboard/login_required_page.html.erb +2 -2
  155. data/app/views/faalis/dashboard/not_found.html.slim +9 -0
  156. data/app/views/faalis/dashboard/not_found.js.erb +1 -0
  157. data/app/views/faalis/dashboard/profile/_form.html.erb +33 -0
  158. data/app/views/faalis/dashboard/profile/_profile_form.html.erb +33 -0
  159. data/app/views/faalis/dashboard/profile/create.js.erb +3 -0
  160. data/app/views/faalis/dashboard/profile/edit.html.erb +2 -0
  161. data/app/views/faalis/dashboard/profile/edit_password.html.erb +2 -0
  162. data/app/views/faalis/dashboard/profile/errors.js.erb +3 -0
  163. data/app/views/faalis/dashboard/resource/_form.html.slim +32 -0
  164. data/app/views/faalis/dashboard/resource/_input.html.slim +3 -0
  165. data/app/views/faalis/dashboard/resource/create.js.erb +3 -0
  166. data/app/views/faalis/dashboard/resource/destroy.js.erb +2 -0
  167. data/app/views/faalis/dashboard/resource/edit.html.slim +3 -0
  168. data/app/views/faalis/dashboard/resource/index.html.slim +54 -0
  169. data/app/views/faalis/dashboard/resource/new.html.slim +2 -0
  170. data/app/views/faalis/dashboard/resource/show.html.slim +23 -0
  171. data/app/views/faalis/dashboard/resource/update.js.erb +3 -0
  172. data/app/views/faalis/dashboard/users/_form.html.slim +17 -20
  173. data/app/views/faalis/dashboard/users/_password_form.html.slim +5 -5
  174. data/app/views/faalis/dashboard/users/create.js.erb +2 -2
  175. data/app/views/faalis/dashboard/users/destroy.js.erb +2 -0
  176. data/app/views/faalis/dashboard/users/edit.html.slim +2 -2
  177. data/app/views/faalis/dashboard/users/edit_password.html.slim +0 -0
  178. data/app/views/faalis/dashboard/users/errors.js.erb +0 -0
  179. data/app/views/faalis/dashboard/users/index.html.slim +21 -22
  180. data/app/views/faalis/dashboard/users/new.html.slim +1 -1
  181. data/app/views/faalis/dashboard/users/show.html.slim +0 -0
  182. data/app/views/faalis/dashboard/users/update.js.erb +1 -1
  183. data/app/views/faalis/dashboard/users/update_password.js.erb +1 -1
  184. data/app/views/faalis/relations/_belongs_to.json.jbuilder +0 -0
  185. data/app/views/faalis/shared/_content_header.html.slim +15 -0
  186. data/app/views/faalis/shared/_control_sidebar.html.slim +50 -0
  187. data/app/views/faalis/shared/_footer.html.slim +7 -0
  188. data/app/views/faalis/shared/_header.html.erb +98 -0
  189. data/app/views/faalis/shared/_sidebar.html.erb +65 -0
  190. data/app/views/faalis/shared/errors.js.erb +3 -0
  191. data/app/views/kaminari/_first_page.html.slim +3 -0
  192. data/app/views/kaminari/_gap.html.slim +2 -0
  193. data/app/views/kaminari/_last_page.html.slim +3 -0
  194. data/app/views/kaminari/_next_page.html.slim +3 -0
  195. data/app/views/kaminari/_page.html.slim +3 -0
  196. data/app/views/kaminari/_paginator.html.slim +13 -0
  197. data/app/views/kaminari/_prev_page.html.slim +3 -0
  198. data/app/views/layouts/faalis/application.html.erb +6 -6
  199. data/app/views/layouts/faalis/dashboard.html.erb +45 -16
  200. data/app/views/layouts/faalis/simple.html.erb +21 -29
  201. data/config/initializers/devise.rb +0 -0
  202. data/config/locales/app.pot +253 -0
  203. data/config/locales/devise.en.yml +0 -0
  204. data/config/locales/devise.fa.yml +0 -0
  205. data/config/locales/faalis.en.yml +72 -0
  206. data/config/locales/faalis.fa.yml +37 -0
  207. data/config/routes.rb +33 -15
  208. data/config/spring.rb +0 -0
  209. data/db/migrate/20131013091000_devise_create_faalis_users.rb +0 -0
  210. data/db/migrate/20131020124701_create_faalis_groups.rb +0 -0
  211. data/db/migrate/20131021170923_create_faalis_permissions.rb +0 -0
  212. data/db/migrate/20131123120422_add_permissions_groups_table.rb +0 -0
  213. data/db/migrate/20140613120923_add_users_groups_table.rb +0 -0
  214. data/db/seeds.rb +4 -5
  215. data/lib/faalis.rb +8 -0
  216. data/lib/faalis/action_dispatch.rb +0 -0
  217. data/lib/faalis/api.rb +0 -0
  218. data/lib/faalis/api/groups_api.rb +0 -0
  219. data/lib/faalis/api/permissions_api.rb +0 -0
  220. data/lib/faalis/api/root.rb +0 -0
  221. data/lib/faalis/api/users_api.rb +0 -0
  222. data/lib/faalis/concerns.rb +0 -0
  223. data/lib/faalis/concerns/authorizable.rb +1 -1
  224. data/lib/faalis/configuration.rb +0 -0
  225. data/lib/faalis/cucumber.rb +0 -0
  226. data/lib/faalis/cucumber/auth.rb +0 -0
  227. data/lib/faalis/cucumber/exceptions.rb +0 -0
  228. data/lib/faalis/cucumber/interaction.rb +0 -0
  229. data/lib/faalis/cucumber/query.rb +0 -0
  230. data/lib/faalis/cucumber/urls.rb +0 -0
  231. data/lib/faalis/dashboard.rb +5 -56
  232. data/lib/faalis/dashboard/dsl.rb +41 -0
  233. data/lib/faalis/dashboard/dsl/base.rb +119 -0
  234. data/lib/faalis/dashboard/dsl/create.rb +117 -0
  235. data/lib/faalis/dashboard/dsl/form_fields_properties.rb +62 -0
  236. data/lib/faalis/dashboard/dsl/index.rb +24 -0
  237. data/lib/faalis/dashboard/dsl/update.rb +6 -0
  238. data/lib/faalis/dashboard/models/sidebar.rb +92 -0
  239. data/lib/faalis/dashboard/sections/resource.rb +165 -0
  240. data/lib/faalis/dashboard/sections/resource_create.rb +211 -0
  241. data/lib/faalis/dashboard/sections/resource_destroy.rb +18 -0
  242. data/lib/faalis/dashboard/sections/resource_show.rb +74 -0
  243. data/lib/faalis/dashboard/sections/resources_index.rb +68 -0
  244. data/lib/faalis/dashboard/sections/sidebar.rb +41 -0
  245. data/lib/faalis/discovery.rb +0 -0
  246. data/lib/faalis/discovery/permissions.rb +0 -9
  247. data/lib/faalis/engine.rb +8 -62
  248. data/lib/faalis/exceptions.rb +0 -0
  249. data/lib/faalis/extension.rb +0 -0
  250. data/lib/faalis/extension/base.rb +0 -0
  251. data/lib/faalis/fake_assets.rb +6 -10
  252. data/lib/faalis/generators.rb +0 -0
  253. data/lib/faalis/generators/concerns.rb +0 -0
  254. data/lib/faalis/generators/concerns/allow_query_on.rb +0 -0
  255. data/lib/faalis/generators/concerns/angular.rb +0 -0
  256. data/lib/faalis/generators/concerns/bulk.rb +0 -0
  257. data/lib/faalis/generators/concerns/child.rb +0 -0
  258. data/lib/faalis/generators/concerns/dependency.rb +0 -0
  259. data/lib/faalis/generators/concerns/fieldset.rb +0 -0
  260. data/lib/faalis/generators/concerns/globalize.rb +0 -0
  261. data/lib/faalis/generators/concerns/hstore.rb +0 -0
  262. data/lib/faalis/generators/concerns/input_file.rb +0 -0
  263. data/lib/faalis/generators/concerns/menu.rb +0 -0
  264. data/lib/faalis/generators/concerns/model.rb +0 -0
  265. data/lib/faalis/generators/concerns/parent.rb +0 -0
  266. data/lib/faalis/generators/concerns/render.rb +0 -0
  267. data/lib/faalis/generators/concerns/required.rb +0 -0
  268. data/lib/faalis/generators/concerns/resource_fields.rb +0 -0
  269. data/lib/faalis/generators/concerns/resource_name.rb +0 -0
  270. data/lib/faalis/generators/concerns/tabs.rb +0 -0
  271. data/lib/faalis/generators/concerns/where.rb +0 -0
  272. data/lib/faalis/generators/dashboard_scaffold.rb +0 -0
  273. data/lib/faalis/generators/fields/#relation.rb# +61 -0
  274. data/lib/faalis/generators/fields/relation.rb +0 -0
  275. data/lib/faalis/i18n.rb +0 -0
  276. data/lib/faalis/initialize.rb +0 -7
  277. data/lib/faalis/middlewares.rb +0 -0
  278. data/lib/faalis/middlewares/locale.rb +0 -0
  279. data/lib/faalis/omniauth.rb +0 -0
  280. data/lib/faalis/omniauth/callbacks.rb +0 -0
  281. data/lib/faalis/orm.rb +0 -0
  282. data/lib/faalis/route.rb +43 -63
  283. data/lib/faalis/version.rb +1 -1
  284. data/lib/faalis_application.rb +0 -0
  285. data/lib/faalis_plugin.rb +0 -0
  286. data/lib/generators/faalis/USAGE +0 -0
  287. data/lib/generators/faalis/angularjs_resource_generator.rb +0 -0
  288. data/lib/generators/faalis/install_all_generator.rb +0 -0
  289. data/lib/generators/faalis/install_generator.rb +69 -14
  290. data/lib/generators/faalis/install_specs_generator.rb +0 -0
  291. data/lib/generators/faalis/js/install_i18n_generator.rb +0 -0
  292. data/lib/generators/faalis/js/list_view_generator.rb +0 -0
  293. data/lib/generators/faalis/resource_generator.rb +42 -0
  294. data/lib/generators/faalis/resources_generator.rb +20 -0
  295. data/lib/generators/faalis/scaffold_generator.rb +0 -0
  296. data/lib/generators/faalis/templates/README +4 -17
  297. data/lib/generators/faalis/templates/SPECS +0 -0
  298. data/lib/generators/faalis/templates/api/controller.rb.erb +0 -0
  299. data/lib/generators/faalis/templates/api_controller.rb +0 -0
  300. data/lib/generators/faalis/templates/dashboard/controller.rb.erb +2 -0
  301. data/lib/generators/faalis/templates/dashboard_controller.rb +18 -0
  302. data/lib/generators/faalis/templates/devise.rb +0 -0
  303. data/lib/generators/faalis/templates/faalis.rb +0 -0
  304. data/lib/generators/faalis/templates/features/api.feature +0 -0
  305. data/lib/generators/faalis/templates/features/api.step.rb +0 -0
  306. data/lib/generators/faalis/templates/features/step_definitions/email_steps.rb +0 -0
  307. data/lib/generators/faalis/templates/features/support/email_spec.rb +0 -0
  308. data/lib/generators/faalis/templates/features/support/env.rb +0 -0
  309. data/{spec/dummy/tmp/app/assets/javascripts/controlpanel → lib/generators/faalis/templates/javascripts}/application.js +1 -4
  310. data/lib/generators/faalis/templates/policy/application_policy.rb +0 -0
  311. data/lib/generators/faalis/templates/policy/policy.rb.erb +0 -0
  312. data/lib/generators/faalis/templates/seeds.rb +0 -0
  313. data/lib/generators/faalis/templates/spec/factories/groups.rb +0 -0
  314. data/lib/generators/faalis/templates/spec/factories/users.rb +0 -0
  315. data/lib/generators/faalis/templates/spec/spec_helper.rb +0 -0
  316. data/lib/generators/faalis/templates/spec/support/devise.rb +0 -0
  317. data/lib/generators/faalis/templates/stylesheets/dashboard/ltr/application.css +0 -0
  318. data/lib/generators/faalis/templates/stylesheets/dashboard/rtl/application.css +0 -0
  319. data/lib/generators/faalis/templates/stylesheets/ltr/application.css +0 -0
  320. data/lib/generators/faalis/templates/stylesheets/rtl/application.css +0 -0
  321. data/lib/generators/faalis/templates/views/create.json.jbuilder.erb +0 -0
  322. data/lib/generators/faalis/templates/views/destroy.json.jbuilder.erb +1 -1
  323. data/lib/generators/faalis/templates/views/index.json.jbuilder.erb +0 -0
  324. data/lib/generators/faalis/templates/views/show.json.jbuilder.erb +0 -0
  325. data/lib/generators/faalis/templates/views/update.json.jbuilder.erb +0 -0
  326. data/lib/generators/faalis/views_generator.rb +0 -0
  327. data/lib/tasks/docs.rake +0 -0
  328. data/lib/tasks/faalis_tasks.rake +0 -39
  329. data/lib/tasks/sync.rake +0 -0
  330. data/spec/dummy/README.rdoc +0 -0
  331. data/spec/dummy/Rakefile +0 -0
  332. data/spec/dummy/app/assets/javascripts/application.js +0 -0
  333. data/{lib/generators/faalis/templates → spec/dummy/app/assets/javascripts/dashboard}/application.js +2 -11
  334. data/spec/dummy/app/assets/stylesheets/application.css +0 -0
  335. data/spec/dummy/app/assets/stylesheets/dashboard/ltr/application.css +3 -0
  336. data/spec/dummy/app/assets/stylesheets/dashboard/rtl/application.css +3 -0
  337. data/spec/dummy/app/assets/stylesheets/ltr/application.css +3 -0
  338. data/spec/dummy/app/assets/stylesheets/rtl/application.css +3 -0
  339. data/spec/dummy/app/controllers/api_controller.rb +0 -3
  340. data/spec/dummy/app/controllers/application_controller.rb +1 -0
  341. data/spec/dummy/app/controllers/dashboard/application_controller.rb +18 -0
  342. data/spec/dummy/app/helpers/application_helper.rb +0 -0
  343. data/spec/dummy/app/policies/application_policy.rb +2 -0
  344. data/spec/dummy/app/views/layouts/application.html.erb +0 -0
  345. data/spec/dummy/config.ru +0 -0
  346. data/spec/dummy/config/application.rb +0 -0
  347. data/spec/dummy/config/boot.rb +0 -0
  348. data/spec/dummy/config/database.yml +0 -0
  349. data/spec/dummy/config/environment.rb +0 -0
  350. data/spec/dummy/config/environments/development.rb +0 -0
  351. data/spec/dummy/config/environments/production.rb +0 -0
  352. data/spec/dummy/config/environments/test.rb +1 -1
  353. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -0
  354. data/spec/dummy/config/initializers/devise.rb +251 -0
  355. data/spec/dummy/config/initializers/faalis.rb +3 -30
  356. data/spec/dummy/config/initializers/faalis_assets.rb +1 -0
  357. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -0
  358. data/spec/dummy/{tmp/config → config}/initializers/formstatic.rb +0 -0
  359. data/{lib/generators/faalis/templates → spec/dummy/config/initializers}/formtastic.rb +37 -3
  360. data/spec/dummy/config/initializers/inflections.rb +0 -0
  361. data/spec/dummy/config/initializers/kaminari_config.rb +10 -0
  362. data/spec/dummy/config/initializers/mime_types.rb +0 -0
  363. data/spec/dummy/config/initializers/secret_token.rb +0 -0
  364. data/spec/dummy/config/initializers/session_store.rb +0 -0
  365. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -0
  366. data/spec/dummy/config/locales/en.yml +0 -0
  367. data/spec/dummy/config/routes.rb +10 -1
  368. data/spec/dummy/db/development.sqlite3 +0 -0
  369. data/spec/dummy/db/migrate/{20150723215115_create_application_models.model_discovery_engine.rb → 20150120211313_create_application_models.model_discovery_engine.rb} +0 -0
  370. data/spec/dummy/db/migrate/{20150725103007_devise_create_faalis_users.faalis.rb → 20150915130413_devise_create_faalis_users.faalis.rb} +0 -0
  371. data/spec/dummy/db/migrate/{20150725103008_create_faalis_groups.faalis.rb → 20150915130414_create_faalis_groups.faalis.rb} +0 -0
  372. data/spec/dummy/db/migrate/{20150725103009_create_faalis_permissions.faalis.rb → 20150915130415_create_faalis_permissions.faalis.rb} +0 -0
  373. data/spec/dummy/db/migrate/{20150725103010_add_permissions_groups_table.faalis.rb → 20150915130416_add_permissions_groups_table.faalis.rb} +0 -0
  374. data/spec/dummy/db/migrate/{20150725103011_add_users_groups_table.faalis.rb → 20150915130417_add_users_groups_table.faalis.rb} +0 -0
  375. data/spec/dummy/db/schema.rb +2 -5
  376. data/spec/dummy/db/seeds.rb~ +1 -0
  377. data/spec/dummy/db/test.sqlite3 +0 -0
  378. data/spec/dummy/lib/templates/slim/scaffold/_form.html.slim +8 -0
  379. data/spec/dummy/log/development.log +865 -6456
  380. data/spec/dummy/log/test.log +11329 -25067
  381. data/spec/dummy/public/404.html +0 -0
  382. data/spec/dummy/public/422.html +0 -0
  383. data/spec/dummy/public/500.html +0 -0
  384. data/spec/dummy/public/favicon.ico +0 -0
  385. data/spec/dummy/tmp/Gemfile +8 -0
  386. data/spec/dummy/tmp/app/assets/javascripts/dashboard/application.js +19 -0
  387. data/spec/dummy/tmp/app/controllers/dashboard/application_controller.rb +18 -0
  388. data/spec/dummy/tmp/config/initializers/devise.rb +2 -2
  389. data/spec/dummy/tmp/config/initializers/faalis_assets.rb +1 -0
  390. data/spec/factories/faalis/groups.rb +0 -0
  391. data/spec/factories/faalis/permissions.rb +0 -0
  392. data/spec/factories/faalis/users.rb +0 -0
  393. data/spec/features/dashboard_spec.rb +36 -0
  394. data/spec/features/record_not_found_spec.rb +30 -0
  395. data/spec/features/sign_in_spec.rb +37 -0
  396. data/spec/generators/install_spec.rb +53 -0
  397. data/spec/models/faalis/group_spec.rb +0 -0
  398. data/spec/models/faalis/permission_spec.rb +0 -0
  399. data/spec/models/faalis/user_spec.rb +0 -0
  400. data/spec/policies/faalis/admin_only_policy_spec.rb +0 -0
  401. data/spec/policies/faalis/application_policy_spec.rb +0 -0
  402. data/spec/spec_helper.rb +19 -3
  403. data/spec/support/factory_girl.rb +0 -0
  404. metadata +227 -310
  405. data/app/assets/javascripts/faalis/angular-manifest.js +0 -22
  406. data/app/assets/javascripts/faalis/dashboard/app.js +0 -91
  407. data/app/assets/javascripts/faalis/dashboard/controllers/group.js.coffee +0 -45
  408. data/app/assets/javascripts/faalis/dashboard/controllers/user.js +0 -11
  409. data/app/assets/javascripts/faalis/dashboard/init.js +0 -18
  410. data/app/assets/javascripts/faalis/dashboard/lib/api_result.js.coffee +0 -5
  411. data/app/assets/javascripts/faalis/dashboard/lib/button.js.coffee +0 -17
  412. data/app/assets/javascripts/faalis/dashboard/lib/controllers.js.coffee +0 -11
  413. data/app/assets/javascripts/faalis/dashboard/lib/controllers/base_controller.js.coffee +0 -14
  414. data/app/assets/javascripts/faalis/dashboard/lib/controllers/generic_add_controller.js.coffee +0 -33
  415. data/app/assets/javascripts/faalis/dashboard/lib/controllers/generic_index_controller.js.coffee +0 -92
  416. data/app/assets/javascripts/faalis/dashboard/lib/fields/base.js.coffee +0 -8
  417. data/app/assets/javascripts/faalis/dashboard/lib/fields/has_many_field.js.coffee +0 -28
  418. data/app/assets/javascripts/faalis/dashboard/lib/fields/string_field.js.coffee +0 -2
  419. data/app/assets/javascripts/faalis/dashboard/lib/resource.js.coffee +0 -183
  420. data/app/assets/javascripts/faalis/dashboard/locale/translations.js +0 -5
  421. data/app/assets/javascripts/faalis/dashboard/modules/anim.js +0 -13
  422. data/app/assets/javascripts/faalis/dashboard/modules/api.js +0 -13
  423. data/app/assets/javascripts/faalis/dashboard/modules/auth/auth.js +0 -17
  424. data/app/assets/javascripts/faalis/dashboard/modules/auth/profile.js +0 -41
  425. data/app/assets/javascripts/faalis/dashboard/modules/auth/user.js +0 -11
  426. data/app/assets/javascripts/faalis/dashboard/modules/conversations.js +0 -182
  427. data/app/assets/javascripts/faalis/dashboard/modules/errors.js +0 -34
  428. data/app/assets/javascripts/faalis/dashboard/modules/fake.js +0 -41
  429. data/app/assets/javascripts/faalis/dashboard/modules/fields/#image.js# +0 -43
  430. data/app/assets/javascripts/faalis/dashboard/modules/fields/boolean.js +0 -42
  431. data/app/assets/javascripts/faalis/dashboard/modules/fields/controlcombo-field.js +0 -63
  432. data/app/assets/javascripts/faalis/dashboard/modules/fields/date.js +0 -51
  433. data/app/assets/javascripts/faalis/dashboard/modules/fields/datetime.js +0 -62
  434. data/app/assets/javascripts/faalis/dashboard/modules/fields/fields.js +0 -3
  435. data/app/assets/javascripts/faalis/dashboard/modules/fields/file.js +0 -43
  436. data/app/assets/javascripts/faalis/dashboard/modules/fields/float.js +0 -50
  437. data/app/assets/javascripts/faalis/dashboard/modules/fields/image.js +0 -43
  438. data/app/assets/javascripts/faalis/dashboard/modules/fields/input-grid.js +0 -46
  439. data/app/assets/javascripts/faalis/dashboard/modules/fields/input-list.js +0 -31
  440. data/app/assets/javascripts/faalis/dashboard/modules/fields/integer.js +0 -50
  441. data/app/assets/javascripts/faalis/dashboard/modules/fields/relation.js +0 -166
  442. data/app/assets/javascripts/faalis/dashboard/modules/fields/string.js +0 -83
  443. data/app/assets/javascripts/faalis/dashboard/modules/fields/tag.js +0 -70
  444. data/app/assets/javascripts/faalis/dashboard/modules/fields/text.js +0 -41
  445. data/app/assets/javascripts/faalis/dashboard/modules/fields/time.js +0 -55
  446. data/app/assets/javascripts/faalis/dashboard/modules/filter.js +0 -25
  447. data/app/assets/javascripts/faalis/dashboard/modules/logs.js +0 -24
  448. data/app/assets/javascripts/faalis/dashboard/modules/permissions.js.coffee +0 -38
  449. data/app/assets/javascripts/faalis/dashboard/modules/services/upload_service.js +0 -17
  450. data/app/assets/javascripts/faalis/dashboard/objects.js +0 -37
  451. data/app/assets/javascripts/faalis/dashboard/resources/group_resource.js.coffee +0 -11
  452. data/app/assets/javascripts/faalis/dashboard/resources/permission_resource.js.coffee +0 -9
  453. data/app/assets/javascripts/faalis/dashboard/resources/user_resource.js.coffee +0 -0
  454. data/app/assets/javascripts/faalis/dashboard/services/api.js.coffee +0 -75
  455. data/app/assets/javascripts/faalis/dashboard/services/resource_factory.js.coffee +0 -48
  456. data/app/assets/javascripts/faalis/dashboard/services/user.js.coffee +0 -0
  457. data/app/assets/javascripts/faalis/locale/en.json +0 -27
  458. data/app/assets/javascripts/faalis/locale/fa.json +0 -27
  459. data/app/assets/javascripts/faalis/locale/translations.fa.js +0 -4
  460. data/app/controllers/faalis/home_controller.rb +0 -19
  461. data/app/views/devise/confirmations/new.html.erb +0 -34
  462. data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
  463. data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
  464. data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
  465. data/app/views/devise/passwords/edit.html.erb +0 -44
  466. data/app/views/devise/passwords/new.html.erb +0 -32
  467. data/app/views/devise/unlocks/new.html.erb +0 -30
  468. data/app/views/faalis/home/index.html.erb +0 -122
  469. data/config/locales/fa/LC_MESSAGES/faalis.mo +0 -0
  470. data/config/locales/fa/faalis.edit.mo +0 -0
  471. data/config/locales/fa/faalis.edit.po +0 -104
  472. data/config/locales/fa/faalis.mo +0 -0
  473. data/config/locales/fa/faalis.po +0 -102
  474. data/config/locales/fa/faalis.po.time_stamp +0 -0
  475. data/config/locales/fa/messages.mo +0 -0
  476. data/config/locales/faalis.pot +0 -103
  477. data/lib/faalis/dashboard/controller.rb +0 -42
  478. data/lib/faalis/dashboard/module.rb +0 -45
  479. data/lib/generators/faalis/templates/angularjs/details.html.erb +0 -20
  480. data/lib/generators/faalis/templates/angularjs/index.html.erb +0 -62
  481. data/lib/generators/faalis/templates/angularjs/module.js.erb +0 -336
  482. data/lib/generators/faalis/templates/angularjs/new.html.erb +0 -62
  483. data/lib/generators/faalis/templates/fast_gettext.rb +0 -4
  484. data/lib/generators/faalis/templates/i18n/Gruntfile.js.erb +0 -30
  485. data/lib/generators/faalis/templates/i18n/README +0 -13
  486. data/lib/generators/faalis/templates/i18n/fa.js +0 -3
  487. data/lib/generators/faalis/templates/js/list_view/README +0 -31
  488. data/lib/generators/faalis/templates/js/list_view/details.html.erb +0 -43
  489. data/lib/generators/faalis/templates/js/list_view/index.html.erb +0 -62
  490. data/lib/generators/faalis/templates/js/list_view/module.js.erb +0 -10
  491. data/lib/generators/faalis/templates/js/list_view/new.html.erb +0 -64
  492. data/lib/generators/faalis/templates/js/list_view/partials/add_controller.js.erb +0 -99
  493. data/lib/generators/faalis/templates/js/list_view/partials/config.js.erb +0 -20
  494. data/lib/generators/faalis/templates/js/list_view/partials/index_controller.js.erb +0 -183
  495. data/lib/generators/faalis/templates/js/list_view/partials/menu.js.erb +0 -6
  496. data/lib/generators/faalis/templates/js_scaffold.README +0 -31
  497. data/lib/tasks/grunt/Gruntfile.js +0 -30
  498. data/spec/dummy/tmp/config/initializers/fast_gettext.rb +0 -4
@@ -1,183 +0,0 @@
1
- // <%= resource %> index controller -------------------------------------------------------
2
- // This controller is responsible for list page (index)
3
- <%= resource.pluralize %>.controller("<%= resource %>Controller", ["$scope", "gettext", "Restangular", "catch_error", "$location", "$stateParams", function($scope, gettext, API, catch_error, $location, $stateParams){
4
-
5
- <% parents.each do |parent| %>
6
- $scope.<%= parent %>_id = $stateParams.<%= parent %>_id;
7
- <% end %>
8
- <% unless no_filter? %>$scope.filter_config = {
9
- list: <% if parent? %>API.<% parents.each do |parent| %>one("<%= parent %>", $scope.<%= parent %>_id)<% end %>.all("<%= resource.pluralize.underscore %>")<% else %>API.all("<%= resource.pluralize.underscore %>")<% end %>
10
- };
11
- $scope.<%= resource.pluralize.underscore %> = [];<% end %>
12
- <% unless no_bulk? %>// Cache object for each field name possible values
13
- $scope.cache = {};
14
-
15
- // Change event handler for field_name combobox in bulk edit
16
- $scope.field_name_change = function(x){
17
- var current_value = $("#field_name").val();
18
- $scope.current_field= _.find($scope.fields, function(x){
19
- return x.name == current_value;
20
- });
21
- if( "to" in $scope.current_field ){
22
- if (! ($scope.current_field.name in $scope.cache)) {
23
- $scope.current_field.to().then(function(x){
24
- $scope.cache[$scope.current_field.name] = x;
25
- });
26
- }
27
- }
28
- };
29
-
30
- $scope.columns = [<% grid_fields.each do |name, type| %>
31
- {field:'<%= name %>', displayName: gettext('<%= name.capitalize.humanize %>')},
32
- <% end %>];
33
- $scope.fields = [<% bulk_edit_fields.each do |name| %>
34
- {
35
- name: "<%= name %><% if ["belongs_to", "has_many"].include? fields_hash[name] %>_id<% end %>",
36
- title: gettext("<%= name.capitalize.humanize %>"),
37
- type: "<%= fields_hash[name] %>"<% if ["belongs_to", "has_many"].include? fields_hash[name] %>,
38
- to: API.all("<%= fields_hash[name].to %>").getList<% end %>
39
- },<% end %>
40
- ];<% end %>
41
-
42
- // details_template is the address of template which should load for
43
- // each item details section
44
- $scope.details_template = template("<%= resource_path %>/details");
45
-
46
- // Buttons for top of the list-view
47
- $scope.buttons = [
48
- {
49
- title: gettext("New"),
50
- icon: "fa fa-plus",
51
- classes: "btn btn-success",
52
- permission: {
53
- name: "create",
54
- model: "<% if model_specified? %><%= model %><% else %><%= resource.classify %><% end %>"
55
- },
56
- route: "#<% parents.each do |p| %>/<%= p %>/" + $scope.<%= p %>_id + "<% end %>/<%= resource_url %>/new"
57
-
58
- },<% unless no_bulk? %>
59
- {
60
- title: gettext("Bulk Edit"),
61
- icon: "fa fa-edit",
62
- classes: "btn btn-warning",
63
- permission: {
64
- name: "update",
65
- model: "<% if model_specified? %><%= model %><% else %><%= resource.classify %><% end %>"
66
- },
67
- action: function(){
68
- $scope.$apply("bulk_edit = ! bulk_edit");
69
- },
70
-
71
- },<% end %>
72
- {
73
- title: gettext("Duplicate"),
74
- icon: "fa fa-files-o",
75
- classes: "btn btn-danger",
76
- permission: {
77
- name: "create",
78
- model: "<% if model_specified? %><%= model %><% else %><%= resource.classify %><% end %>"
79
- },
80
- action: function(){
81
- var selected = _.find($scope.<%= resource.pluralize.underscore %>, function(x){
82
- return x.is_selected === true;
83
- });
84
-
85
- if (selected === undefined ) {
86
- error_message(gettext("You should only select one item to copy."));
87
- }
88
- else {
89
- $location.path("<% parents.each do |p| %><%= p %>/" + $scope.<%= p %>_id + "<% end %>/<%= resource.pluralize.underscore %>/-" + selected.id + "/edit");
90
- }
91
- }
92
- }
93
-
94
- ];<% unless no_bulk? %>
95
-
96
- /*
97
- * On bulk save event
98
- */
99
- $scope.bulk_save = function(){
100
-
101
- $scope.view_progressbar = true;
102
- var value = $("#field_value").val();
103
- var field = $scope.current_field.name;
104
- var type = $scope.current_field.type;
105
- var field_name = $scope.current_field.title;
106
- if ((type == "has_many") || (type == "belongs_to")) {
107
- value = parseInt(value, 10);
108
- }
109
- var requests_count = 0;
110
-
111
- $scope.rfiller = 0;
112
- $scope.sfiller = 0;
113
- $scope.success = 0;
114
- $scope.failed = 0;
115
- $scope.total = _.where($scope.<%= resource.pluralize.underscore %>, function(x){return x.is_selected === true;}).length;
116
-
117
- _.each($scope.<%= resource.pluralize.underscore %>, function(x){
118
- if( x.is_selected === true ){
119
- x[field] = value;
120
- requests_count++;
121
-
122
- var rwidth = (requests_count * 100) / $scope.total;
123
- if (requests_count == $scope.total) { rwidth = 100; }
124
- $scope.rfiller = rwidth + "%";
125
-
126
- API.one("<%= resource.pluralize.underscore %>", x.id).patch(x).then(function(data){
127
- $scope.success++;
128
- var swidth = parseInt(($scope.success * 100) / $scope.total);
129
- if ($scope.sucess == $scope.total) { swidth = 100; }
130
- $scope.sfiller = swidth + "%";
131
- x[field_name.toLowerCase()] = data[field_name.toLowerCase()];
132
- }, function(data){
133
- $scope.failed++;
134
- catch_error(data);
135
- });
136
-
137
- }
138
- });
139
-
140
- };
141
-
142
- /*
143
- * On bulk cancel event
144
- */
145
- $scope.bulk_cancel = function(){
146
- $("#field_name").val(0);
147
- document.getElementById("bulk_form").reset();
148
- $scope.view_progressbar = false;
149
- $scope.bulk_edit = false;
150
- };
151
- <% end %>
152
- /*
153
- * On delete event handler - `items` is an array of objects to delete
154
- */
155
- $scope.on_delete = function(items){
156
-
157
- var query = [];
158
- items.forEach(function(item){
159
- query.push(item.id);
160
- });
161
-
162
- API.<% parents.each do |p| %>all("<%=p %>").<% end %>all("<%= resource.pluralize.underscore %>").customDELETE(query.join(","))
163
- .then(function(data) {
164
-
165
- $scope.<%= resource.pluralize.underscore %> = _.filter($scope.<%= resource.pluralize.underscore %>, function(x){
166
- return !(query.indexOf(x.id) != -1);
167
- });
168
- success_message(data.msg);
169
- }, function(data){
170
- catch_error(data);
171
- });
172
-
173
- };
174
- <% unless no_filter? %>/*<% end %>
175
- <% if parent? %>API.<% parents.each do |parent| %>one("<%= parent %>", $scope.<%= parent %>_id)<% end %>.all("<%= resource.pluralize.underscore %>").getList()<% else %>
176
- API.all("<%= resource.pluralize.underscore %>").getList()<% end %>
177
- .then(function(data){
178
- $scope.<%= resource.pluralize.underscore %> = data;
179
- }, function(data){
180
- catch_error(data);
181
- });
182
- <% unless no_filter? %>*/<% end %>
183
- }]);
@@ -1,6 +0,0 @@
1
- <% if has_menu? %>
2
- <%= resource.pluralize %>.controller("<%= resource %>MenuController", ["gettext", function(gettext){
3
- this.menu_items = [<% resource_data["menu"].each do |menu| %>
4
- {title: gettext("<%= menu["title"] %>"), url: "<%= menu["url"] %>"<% if menu.include? "model" %>, permission: {action: "<%= menu["perm_action"] || 'read' %>", model: "<%= menu["model"] %>"}<% end %>},<% end %>
5
- ];
6
- }]);<% end %>
@@ -1,31 +0,0 @@
1
- ==================================================
2
- Steps to installation:
3
-
4
- 0. You have to have a working model to use this scaffold. So create
5
- your model and setup validations, relations and other stuff.
6
-
7
- 1. Add resource to routes.rb for example in case of `car` scaffold do:
8
-
9
- namespace :api, :defaults => {:format => :json} do
10
- namespace :v1 do
11
- resources :cars
12
- end
13
- end
14
-
15
- 2. The Angularjs module of your resource should be added as an dependency
16
- to another Angularjs module. Add it by hand or if you want to view module
17
- in dashboard's main page add your resource to `config/initializers/faalis.rb`
18
- like this:
19
-
20
- config.dashboard_modules = {
21
- :car => {
22
- :icon => "fa fa-car",
23
- :sidemenu => true,
24
- },
25
- }
26
-
27
- 3. Make sure that you have `api_controller.rb` in your `app/controllers` with this content:
28
-
29
-
30
- class APIController < Faalis::APIController
31
- end
@@ -1,30 +0,0 @@
1
- module.exports = function (grunt) {
2
- grunt.initConfig({
3
- nggettext_extract: {
4
- pot: {
5
- files: {
6
- 'app/assets/locales/templates.pot': ['app/views/angular/**/*.html',
7
- 'app/views/angular/**/*.html.erb',
8
- 'app/assets/javascripts/**/*.js',
9
- 'app/assets/javascripts/**/*.js',
10
- 'app/assets/javascripts/**/*.coffee',
11
- 'app/assets/javascripts/**/*.coffee.erb']
12
- }
13
- }
14
- },
15
- nggettext_compile: {
16
- all: {
17
- options: {
18
- module: "Dashboard"
19
- },
20
- files: {
21
- 'app/assets/javascripts/faalis/locale/translations.fa.js': ['app/assets/locale/*.fa.pot']
22
- }
23
- }
24
- }
25
-
26
- });
27
-
28
- grunt.loadNpmTasks('grunt-angular-gettext');
29
- grunt.registerTask('default', ['nggettext_extract', 'nggettext_compile']);
30
- };
@@ -1,4 +0,0 @@
1
- FastGettext.add_text_domain 'app', :path => 'config/locales', :type => :po
2
- # All languages you want to allow
3
- FastGettext.default_available_locales = ['en', 'fa']
4
- FastGettext.default_text_domain = 'app'