red_base 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (278) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +339 -0
  3. data/README.rdoc +40 -0
  4. data/Rakefile +42 -0
  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/javascripts/red_base/application.js +20 -0
  18. data/app/assets/javascripts/red_base/dashboard/angular.js +9 -0
  19. data/app/assets/javascripts/red_base/dashboard/app.js +65 -0
  20. data/app/assets/javascripts/red_base/dashboard/application.js.erb +24 -0
  21. data/app/assets/javascripts/red_base/dashboard/functions.js.erb +91 -0
  22. data/app/assets/javascripts/red_base/dashboard/init.js +38 -0
  23. data/app/assets/javascripts/red_base/dashboard/init.js~ +0 -0
  24. data/app/assets/javascripts/red_base/dashboard/lib/angular-animate.js +1226 -0
  25. data/app/assets/javascripts/red_base/dashboard/lib/angular-gettext.js +202 -0
  26. data/app/assets/javascripts/red_base/dashboard/lib/angular-resource.js +578 -0
  27. data/app/assets/javascripts/red_base/dashboard/lib/angular-route.js +880 -0
  28. data/app/assets/javascripts/red_base/dashboard/lib/angular.js +20031 -0
  29. data/app/assets/javascripts/red_base/dashboard/lib/lodash.underscore.js +4893 -0
  30. data/app/assets/javascripts/red_base/dashboard/lib/restangular.js +1066 -0
  31. data/app/assets/javascripts/red_base/dashboard/locale/translations.js +5 -0
  32. data/app/assets/javascripts/red_base/dashboard/modules/anim.js +32 -0
  33. data/app/assets/javascripts/red_base/dashboard/modules/api.js +32 -0
  34. data/app/assets/javascripts/red_base/dashboard/modules/auth/auth.js +34 -0
  35. data/app/assets/javascripts/red_base/dashboard/modules/auth/group.js +174 -0
  36. data/app/assets/javascripts/red_base/dashboard/modules/auth/user.js +122 -0
  37. data/app/assets/javascripts/red_base/dashboard/modules/list-view.js +293 -0
  38. data/app/assets/javascripts/red_base/dashboard/modules/logs.js +41 -0
  39. data/app/assets/javascripts/red_base/dashboard/modules/modules.js +50 -0
  40. data/app/assets/javascripts/red_base/dashboard/modules/nav.js.erb +92 -0
  41. data/app/assets/javascripts/red_base/dashboard/templates/application.handlebars.erb +42 -0
  42. data/app/assets/javascripts/red_base/dashboard/templates/auth/groups/details.handlebars.erb +15 -0
  43. data/app/assets/javascripts/red_base/dashboard/templates/auth/groups/index.handlebars.erb +7 -0
  44. data/app/assets/javascripts/red_base/dashboard/templates/auth/groups/new.handlebars.erb +39 -0
  45. data/app/assets/javascripts/red_base/dashboard/templates/auth/index.handlebars.erb +31 -0
  46. data/app/assets/javascripts/red_base/dashboard/templates/auth/users/details.handlebars.erb +15 -0
  47. data/app/assets/javascripts/red_base/dashboard/templates/auth/users/index.handlebars.erb +11 -0
  48. data/app/assets/javascripts/red_base/dashboard/templates/auth/users/new.handlebars.erb +33 -0
  49. data/app/assets/javascripts/red_base/dashboard/templates/components/list-view.handlebars.erb +59 -0
  50. data/app/assets/javascripts/red_base/dashboard/templates/components/model-form.handlebars.erb +3 -0
  51. data/app/assets/javascripts/red_base/dashboard/templates/modules.handlebars.erb +15 -0
  52. data/app/assets/javascripts/red_base/dashboard/templates/navigation.handlebars.erb +43 -0
  53. data/app/assets/javascripts/red_base/dashboard/templates/widgets.handlebars +23 -0
  54. data/app/assets/javascripts/red_base/dashboard/variables.js.erb +17 -0
  55. data/app/assets/javascripts/red_base/groups.js +2 -0
  56. data/app/assets/javascripts/red_base/home.js +2 -0
  57. data/app/assets/javascripts/red_base/i18n.js +13 -0
  58. data/app/assets/javascripts/red_base/locale/en.json +27 -0
  59. data/app/assets/javascripts/red_base/locale/fa.json +27 -0
  60. data/app/assets/javascripts/red_base/users.js +2 -0
  61. data/app/assets/stylesheets/red_base/base.css.scss +402 -0
  62. data/app/assets/stylesheets/red_base/dashboard/dashboard.css.scss +169 -0
  63. data/app/assets/stylesheets/red_base/dashboard/ltr/application.css +21 -0
  64. data/app/assets/stylesheets/red_base/dashboard/ltr/base.css.scss.erb +28 -0
  65. data/app/assets/stylesheets/red_base/dashboard/ltr/base.css.scss~ +15 -0
  66. data/app/assets/stylesheets/red_base/dashboard/ltr/buttons.css.scss.erb +48 -0
  67. data/app/assets/stylesheets/red_base/dashboard/ltr/direction.css.scss +38 -0
  68. data/app/assets/stylesheets/red_base/dashboard/ltr/foundation_and_overrides.css.scss +1014 -0
  69. data/app/assets/stylesheets/red_base/dashboard/rtl/application.css +21 -0
  70. data/app/assets/stylesheets/red_base/dashboard/rtl/base.css.scss.erb +31 -0
  71. data/app/assets/stylesheets/red_base/dashboard/rtl/base.css.scss~ +1 -0
  72. data/app/assets/stylesheets/red_base/dashboard/rtl/base.css_flymake.scss +25 -0
  73. data/app/assets/stylesheets/red_base/dashboard/rtl/buttons.css.scss.erb +45 -0
  74. data/app/assets/stylesheets/red_base/dashboard/rtl/direction.css.scss +37 -0
  75. data/app/assets/stylesheets/red_base/dashboard/rtl/foundation_and_overrides.css.scss +1014 -0
  76. data/app/assets/stylesheets/red_base/dashboard/sidebar.css.scss +93 -0
  77. data/app/assets/stylesheets/red_base/devise.css.scss +34 -0
  78. data/app/assets/stylesheets/red_base/groups.css +4 -0
  79. data/app/assets/stylesheets/red_base/home.css.scss +14 -0
  80. data/app/assets/stylesheets/red_base/ltr/application.css +20 -0
  81. data/app/assets/stylesheets/red_base/ltr/buttons.css.scss.erb +48 -0
  82. data/app/assets/stylesheets/red_base/ltr/foundation_and_overrides.scss.erb +1012 -0
  83. data/app/assets/stylesheets/red_base/mixins.css.scss +15 -0
  84. data/app/assets/stylesheets/red_base/mixins.css.scss~ +7 -0
  85. data/app/assets/stylesheets/red_base/rtl/application.css +20 -0
  86. data/app/assets/stylesheets/red_base/rtl/buttons.css.scss.erb +48 -0
  87. data/app/assets/stylesheets/red_base/rtl/foundation_and_overrides.scss.erb +1012 -0
  88. data/app/assets/stylesheets/red_base/users.css +4 -0
  89. data/app/assets/stylesheets/red_base/variables.css.scss +100 -0
  90. data/app/controllers/red_base/api/v1/groups_controller.rb +65 -0
  91. data/app/controllers/red_base/api/v1/logs_controller.rb +12 -0
  92. data/app/controllers/red_base/api/v1/permissions_controller.rb +17 -0
  93. data/app/controllers/red_base/api/v1/users_controller.rb +54 -0
  94. data/app/controllers/red_base/api_controller.rb +51 -0
  95. data/app/controllers/red_base/application_controller.rb +34 -0
  96. data/app/controllers/red_base/dashboard_controller.rb +40 -0
  97. data/app/controllers/red_base/home_controller.rb +19 -0
  98. data/app/controllers/red_base/omniauth/callbacks_controller.rb +43 -0
  99. data/app/controllers/red_base/users/omniauth_callbacks_controller.rb~ +2 -0
  100. data/app/helpers/red_base/application_helper.rb +4 -0
  101. data/app/helpers/red_base/dashboard_helper.rb +5 -0
  102. data/app/helpers/red_base/groups_helper.rb +4 -0
  103. data/app/helpers/red_base/home_helper.rb +4 -0
  104. data/app/helpers/red_base/users_helper.rb +4 -0
  105. data/app/models/ability.rb +39 -0
  106. data/app/models/red_base/group.rb +27 -0
  107. data/app/models/red_base/permission.rb +15 -0
  108. data/app/models/red_base/user.rb +77 -0
  109. data/app/views/angularjs_templates/auth/groups/details.html +21 -0
  110. data/app/views/angularjs_templates/auth/groups/index.html +5 -0
  111. data/app/views/angularjs_templates/auth/groups/new.html +40 -0
  112. data/app/views/angularjs_templates/auth/index.html +30 -0
  113. data/app/views/angularjs_templates/auth/users/details.html +28 -0
  114. data/app/views/angularjs_templates/auth/users/index.html +6 -0
  115. data/app/views/angularjs_templates/auth/users/new.html +45 -0
  116. data/app/views/angularjs_templates/index.html +8 -0
  117. data/app/views/angularjs_templates/list-view/index.html +66 -0
  118. data/app/views/angularjs_templates/locale/fa.po +25 -0
  119. data/app/views/angularjs_templates/locale/templates.pot +24 -0
  120. data/app/views/angularjs_templates/logs/index.html +6 -0
  121. data/app/views/angularjs_templates/modules.html +17 -0
  122. data/app/views/angularjs_templates/nav.html.erb +38 -0
  123. data/app/views/angularjs_templates/nav.html.erb~ +43 -0
  124. data/app/views/devise/confirmations/new.html.erb +34 -0
  125. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  126. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  127. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  128. data/app/views/devise/passwords/edit.html.erb +44 -0
  129. data/app/views/devise/passwords/new.html.erb +32 -0
  130. data/app/views/devise/registrations/edit.html.erb +29 -0
  131. data/app/views/devise/registrations/new.html.erb +91 -0
  132. data/app/views/devise/sessions/new.html.erb +98 -0
  133. data/app/views/devise/shared/_links.erb +25 -0
  134. data/app/views/devise/unlocks/new.html.erb +30 -0
  135. data/app/views/layouts/red_base/application.html.erb +90 -0
  136. data/app/views/layouts/red_base/dashboard.html.erb +21 -0
  137. data/app/views/red_base/api/v1/groups/create.json.jbuilder +4 -0
  138. data/app/views/red_base/api/v1/groups/destroy.html.erb +2 -0
  139. data/app/views/red_base/api/v1/groups/destroy.json.jbuilder +1 -0
  140. data/app/views/red_base/api/v1/groups/edit.html.erb +2 -0
  141. data/app/views/red_base/api/v1/groups/index.html.erb +2 -0
  142. data/app/views/red_base/api/v1/groups/index.json.jbuilder +6 -0
  143. data/app/views/red_base/api/v1/groups/new.html.erb +2 -0
  144. data/app/views/red_base/api/v1/groups/show.html.erb +2 -0
  145. data/app/views/red_base/api/v1/groups/show.json.jbuilder +5 -0
  146. data/app/views/red_base/api/v1/groups/update.json.jbuilder +4 -0
  147. data/app/views/red_base/api/v1/logs/index.json.jbuilder +1 -0
  148. data/app/views/red_base/api/v1/permissions/index.json.jbuilder +1 -0
  149. data/app/views/red_base/api/v1/users/create.html.erb +2 -0
  150. data/app/views/red_base/api/v1/users/create.json.jbuilder +1 -0
  151. data/app/views/red_base/api/v1/users/destroy.json.jbuilder +1 -0
  152. data/app/views/red_base/api/v1/users/distroy.html.erb +2 -0
  153. data/app/views/red_base/api/v1/users/edit.html.erb +2 -0
  154. data/app/views/red_base/api/v1/users/index.html.erb +2 -0
  155. data/app/views/red_base/api/v1/users/index.json.jbuilder +4 -0
  156. data/app/views/red_base/api/v1/users/show.html.erb +2 -0
  157. data/app/views/red_base/api/v1/users/show.json.jbuilder +2 -0
  158. data/app/views/red_base/api/v1/users/update.json.jbuilder +1 -0
  159. data/app/views/red_base/dashboard/index.html.erb +37 -0
  160. data/app/views/red_base/home/index.html.erb +119 -0
  161. data/config/initializers/devise.rb +28 -0
  162. data/config/locales/devise.en.yml +59 -0
  163. data/config/locales/devise.fa.yml +56 -0
  164. data/config/locales/fa/LC_MESSAGES/red_base.mo +0 -0
  165. data/config/locales/fa/messages.mo +0 -0
  166. data/config/locales/fa/red_base.po +181 -0
  167. data/config/locales/red_base.pot +181 -0
  168. data/config/routes.rb +33 -0
  169. data/db/migrate/20131013091000_devise_create_red_base_users.rb +64 -0
  170. data/db/migrate/20131020124701_create_red_base_groups.rb +9 -0
  171. data/db/migrate/20131021170923_create_red_base_permissions.rb +10 -0
  172. data/db/migrate/20131123120422_add_permissions_groups_table.rb +8 -0
  173. data/db/seeds.rb +15 -0
  174. data/lib/devise_patch.rb~ +5 -0
  175. data/lib/generators/red_base/USAGE +8 -0
  176. data/lib/generators/red_base/angularjs_resource_generator.rb +74 -0
  177. data/lib/generators/red_base/install_all_generator.rb +38 -0
  178. data/lib/generators/red_base/install_generator.rb +42 -0
  179. data/lib/generators/red_base/install_specs_generator.rb +48 -0
  180. data/lib/generators/red_base/js_scaffold_generator.rb +232 -0
  181. data/lib/generators/red_base/templates/README +41 -0
  182. data/lib/generators/red_base/templates/README~ +4 -0
  183. data/lib/generators/red_base/templates/SPECS +13 -0
  184. data/lib/generators/red_base/templates/angularjs/details.html.erb +20 -0
  185. data/lib/generators/red_base/templates/angularjs/details.html.erb~ +0 -0
  186. data/lib/generators/red_base/templates/angularjs/index.html.erb +59 -0
  187. data/lib/generators/red_base/templates/angularjs/module.js.erb +259 -0
  188. data/lib/generators/red_base/templates/angularjs/new.html.erb +43 -0
  189. data/lib/generators/red_base/templates/api/controller.rb.erb +54 -0
  190. data/lib/generators/red_base/templates/api/controller.rb.erb~ +37 -0
  191. data/lib/generators/red_base/templates/devise.rb +251 -0
  192. data/lib/generators/red_base/templates/devise.rb~ +238 -0
  193. data/lib/generators/red_base/templates/fast_gettext.rb +4 -0
  194. data/lib/generators/red_base/templates/features/api.feature +92 -0
  195. data/lib/generators/red_base/templates/features/api.step.rb +7 -0
  196. data/lib/generators/red_base/templates/features/step_definitions/email_steps.rb +206 -0
  197. data/lib/generators/red_base/templates/features/support/email_spec.rb +1 -0
  198. data/lib/generators/red_base/templates/features/support/env.rb +79 -0
  199. data/lib/generators/red_base/templates/formtastic.rb +76 -0
  200. data/lib/generators/red_base/templates/js_scaffold.README +25 -0
  201. data/lib/generators/red_base/templates/red_base.rb +14 -0
  202. data/lib/generators/red_base/templates/red_base.rb~ +251 -0
  203. data/lib/generators/red_base/templates/seeds.rb +1 -0
  204. data/lib/generators/red_base/templates/spec/factories/groups.rb +5 -0
  205. data/lib/generators/red_base/templates/spec/factories/users.rb +10 -0
  206. data/lib/generators/red_base/templates/spec/spec_helper.rb +69 -0
  207. data/lib/generators/red_base/templates/spec/support/devise.rb +3 -0
  208. data/lib/generators/red_base/templates/views/create.json.jbuilder.erb +2 -0
  209. data/lib/generators/red_base/templates/views/destroy.json.jbuilder.erb +1 -0
  210. data/lib/generators/red_base/templates/views/index.json.jbuilder.erb +10 -0
  211. data/lib/generators/red_base/templates/views/index.json.jbuilder.erb~ +0 -0
  212. data/lib/generators/red_base/templates/views/show.json.jbuilder.erb +6 -0
  213. data/lib/generators/red_base/templates/views/update.json.jbuilder.erb +6 -0
  214. data/lib/generators/red_base/views_generator.rb +41 -0
  215. data/lib/red_base/active_record.rb +78 -0
  216. data/lib/red_base/active_record.rb~ +0 -0
  217. data/lib/red_base/api/groups_api.rb +41 -0
  218. data/lib/red_base/api/permissions_api.rb +24 -0
  219. data/lib/red_base/api/root.rb +15 -0
  220. data/lib/red_base/api/users_api.rb +20 -0
  221. data/lib/red_base/api.rb +61 -0
  222. data/lib/red_base/cucumber/auth.rb +45 -0
  223. data/lib/red_base/cucumber/exceptions.rb +40 -0
  224. data/lib/red_base/cucumber/interaction.rb +43 -0
  225. data/lib/red_base/cucumber/query.rb +28 -0
  226. data/lib/red_base/cucumber/urls.rb +76 -0
  227. data/lib/red_base/cucumber.rb +25 -0
  228. data/lib/red_base/dashboard/controller.rb +42 -0
  229. data/lib/red_base/dashboard/module.rb +45 -0
  230. data/lib/red_base/dashboard/module.rb~ +25 -0
  231. data/lib/red_base/dashboard.rb +60 -0
  232. data/lib/red_base/dashboard.rb~ +18 -0
  233. data/lib/red_base/engine.rb +132 -0
  234. data/lib/red_base/exceptions.rb +26 -0
  235. data/lib/red_base/i18n.rb +35 -0
  236. data/lib/red_base/initialize.rb +7 -0
  237. data/lib/red_base/omniauth/callbacks.rb +58 -0
  238. data/lib/red_base/omniauth/callbakcs.rb~ +7 -0
  239. data/lib/red_base/omniauth.rb +24 -0
  240. data/lib/red_base/omniauth.rb~ +1 -0
  241. data/lib/red_base/plugins.rb +44 -0
  242. data/lib/red_base/version.rb +22 -0
  243. data/lib/red_base.rb +30 -0
  244. data/lib/tasks/grunt/Gruntfile.js +25 -0
  245. data/lib/tasks/red_base_tasks.rake +23 -0
  246. data/spec/dummy/README.rdoc +28 -0
  247. data/spec/dummy/Rakefile +6 -0
  248. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  249. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  250. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  251. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  252. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  253. data/spec/dummy/bin/bundle +3 -0
  254. data/spec/dummy/bin/rails +4 -0
  255. data/spec/dummy/bin/rake +4 -0
  256. data/spec/dummy/config/application.rb +23 -0
  257. data/spec/dummy/config/boot.rb +5 -0
  258. data/spec/dummy/config/database.yml +25 -0
  259. data/spec/dummy/config/environment.rb +5 -0
  260. data/spec/dummy/config/environments/development.rb +29 -0
  261. data/spec/dummy/config/environments/production.rb +80 -0
  262. data/spec/dummy/config/environments/test.rb +36 -0
  263. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  264. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  265. data/spec/dummy/config/initializers/inflections.rb +16 -0
  266. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  267. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  268. data/spec/dummy/config/initializers/session_store.rb +3 -0
  269. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  270. data/spec/dummy/config/locales/en.yml +23 -0
  271. data/spec/dummy/config/routes.rb +4 -0
  272. data/spec/dummy/config.ru +4 -0
  273. data/spec/dummy/public/404.html +58 -0
  274. data/spec/dummy/public/422.html +58 -0
  275. data/spec/dummy/public/500.html +57 -0
  276. data/spec/dummy/public/favicon.ico +0 -0
  277. data/spec/spec_helper.rb +52 -0
  278. metadata +661 -0
@@ -0,0 +1,41 @@
1
+ /* -----------------------------------------------------------------------------
2
+ Red Base - Basic website skel engine
3
+ Copyright (C) 2012-2013 Yellowen
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License along
16
+ with this program; if not, write to the Free Software Foundation, Inc.,
17
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
+ ----------------------------------------------------------------------------- */
19
+ var Logs = angular.module("Logs", []);
20
+
21
+ Logs.config(["$routeProvider", function($routeProvider){
22
+
23
+ $routeProvider.
24
+ when("/logs/", {
25
+ templateUrl: template("logs/index"),
26
+ controller: "LogsController"
27
+ });
28
+ }]);
29
+
30
+ Logs.controller("LogsController", ["$scope", "Restangular","$sce",
31
+ function($scope, API, $sce){
32
+
33
+ API.all("logs").getList().then(function(data){
34
+ var content = data.content;
35
+ content = content.replace(/\n/gm, "<br />");
36
+ content = content.replace(/\t/gm, "&nbsp;");
37
+ content = content.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/gm, "");
38
+ $scope.logs = $sce.trustAsHtml(content);
39
+ });
40
+
41
+ }]);
@@ -0,0 +1,50 @@
1
+ /* -----------------------------------------------------------------------------
2
+ Red Base - Basic website skel engine
3
+ Copyright (C) 2012-2013 Yellowen
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License along
16
+ with this program; if not, write to the Free Software Foundation, Inc.,
17
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
+ ----------------------------------------------------------------------------- */
19
+
20
+ var Modules = angular.module("Modules", ["ngRoute", "ngAnimate"]);
21
+
22
+ Modules.controller("ModulesController", ["$location", "$scope", "$controller", function($location, $scope, $controller){
23
+ var that = this;
24
+ this.modules = _.filter(DModules, function(module){
25
+ if (module.sidemenu === true) {
26
+ module.menu_items = $controller(camelCase(module.resource) + "MenuController", {$scope: $scope}).menu_items;
27
+ module.show_menu = false;
28
+ }
29
+ return module.sidemenu || false;
30
+ });
31
+
32
+ this.on_click = function(url){
33
+ $location.path(url);
34
+ };
35
+ this.view_menu = function(module) {
36
+ module.show_menu = !module.show_menu;
37
+ };
38
+ }]);
39
+
40
+ Modules.animation(".slide", function(){
41
+ return {
42
+ leave: function(elem, done){
43
+ $(elem).slideUp(700, done);
44
+ },
45
+ enter: function(elem, done){
46
+ $(elem).slideDown(700, done);
47
+ return function(cancelled){};
48
+ }
49
+ };
50
+ });
@@ -0,0 +1,92 @@
1
+ /* -----------------------------------------------------------------------------
2
+ Red Base - Basic website skel engine
3
+ Copyright (C) 2012-2013 Yellowen
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License along
16
+ with this program; if not, write to the Free Software Foundation, Inc.,
17
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
+ ----------------------------------------------------------------------------- */
19
+
20
+ var Nav = angular.module("Navigation", ["ngAnimate"]);
21
+
22
+ Nav.controller("NavigationController", ["$location", "gettext", "$interval", function($location, gettext, $interval){
23
+
24
+ this.menu_items = [
25
+ {
26
+ title: gettext("Messages"),
27
+ icon: "fa fa-comments",
28
+ url: "/user/comments"
29
+ },
30
+ {
31
+ title: gettext("Languages"),
32
+ icon: "fa fa-flag",
33
+ items: [
34
+ <% ::I18n.available_locales.each do |locale| %>
35
+ {
36
+ url: '<%= "/#{locale.to_s}/#{RedBase::Engine.dashboard_namespace.to_s}/" %>',
37
+ title: "<%=locale %>"
38
+ },
39
+ <% end %>
40
+ ]
41
+ },
42
+ {
43
+ title: gettext("User"),
44
+ icon: "fa fa-user",
45
+ items: [
46
+ {
47
+ title: gettext("Logout"),
48
+ icon: "fa fa-power-off",
49
+ url: "/users/sign_out",
50
+ method: "delete"
51
+ },
52
+ {
53
+ title: gettext("Change Password"),
54
+ icon: "fa fa-exchange",
55
+ url: "#"
56
+ }
57
+ ]
58
+ }
59
+ ];
60
+
61
+ this.on_click = function(menu_item){
62
+ if ("url" in menu_item) {
63
+ $location.path(menu_item.url);
64
+ return;
65
+ }
66
+ this.menu_clicked = false;
67
+ var that = this;
68
+ $interval(function(){
69
+ that.menu_clicked = false;
70
+ }, 5000, 1);
71
+ if ("items" in menu_item) {
72
+ this.submenu_items = menu_item.items;
73
+ this.menu_clicked = true;
74
+
75
+ }
76
+ };
77
+ this.view_menu = function(module) {
78
+ module.show_menu = !module.show_menu;
79
+ };
80
+ }]);
81
+
82
+ Nav.animation(".subnav", function(){
83
+ return {
84
+ leave: function(elem, done){
85
+ $("#subnav").slideUp(700, done);
86
+ },
87
+ enter: function(elem, done){
88
+ $("#subnav").slideDown(700, done);
89
+ return function(cancelled){};
90
+ }
91
+ };
92
+ });
@@ -0,0 +1,42 @@
1
+ <div id="content" class="">
2
+ <header>
3
+ {{ render "navigation" }}
4
+ </header>
5
+
6
+ <section class="dashboard-body">
7
+ <div class="row">
8
+ <aside class="modulebar small-2 columns">
9
+ {{ render "modules"}}
10
+ </aside>
11
+
12
+ <section class="small-10 columns dashboard-content">
13
+
14
+ <div class="row content">
15
+ <div id="flash" class="row success">
16
+ <div class="small-12 columns">
17
+ </div>
18
+ </div>
19
+ </div>
20
+
21
+ <div class="row search-bar">
22
+ <div class="small-5 columns text-right float-right">
23
+ <div class="row collapse">
24
+
25
+ <div class="small-12 columns ">
26
+ <input type="search" class="append" placeholder="search ..."/>
27
+ <span class="append radius"><i class="fa fa-search"></i></span>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+
33
+
34
+ <div class="row content">
35
+ {{ outlet }}
36
+ </div>
37
+
38
+ </section>
39
+
40
+ </div>
41
+ </section>
42
+ </div>
@@ -0,0 +1,15 @@
1
+ <p>{{_ 'ID'}}: <strong>{{ id }}</strong></p>
2
+ <p>{{_ 'Name'}}: <strong>{{ name }}</strong></p>
3
+ <div class="row">
4
+ <div class="small-12 column text-right">
5
+ <ul class="button-group float-right">
6
+ {{#link-to user.edit class=" small"}}
7
+ <span class="fa fa-edit"></span> {{_ 'Edit'}}
8
+ {{/link-to}}
9
+ {{#link-to user.show class="small"}}
10
+ <span class="fa fa-eye"> {{_ 'Show'}}{{/link-to}}
11
+ {{#link-to user.show class="small"}}
12
+ <span class="fa fa-check-circle-o"> {{_ 'Active'}}{{/link-to}}
13
+ </ul>
14
+ </div>
15
+ </div>
@@ -0,0 +1,7 @@
1
+ <div class="row clearmargin">
2
+ <div class="small-6 column text-left clearpadding">
3
+ <h3><i class="fa fa-group"></i> {{_ 'Groups'}}</h3>
4
+ </div>
5
+ </div>
6
+
7
+ {{list-view model=model title_field="name" delete_items="delete_items" buttons=buttons details_template="auth/groups/details" items_per_page=5}}
@@ -0,0 +1,39 @@
1
+ <div class="newform">
2
+ <fieldset class="form">
3
+
4
+ <legend>{{_ 'New Group'}}</legend>
5
+
6
+ <div class="row">
7
+ <div class="small-4 columns">
8
+ <label >{{_ 'Name'}}:</label>
9
+ {{input id="new_name" type="text" value=new_name class=""}}
10
+ <small></small>
11
+ </div>
12
+ </div>
13
+
14
+ <div class="row">
15
+ <label for="permissions">{{_ "Permissions"}}:</label>
16
+
17
+ <div class="small-10 columns permissions">
18
+
19
+ <div class="row">
20
+ <div id="permissions" class="small-8 columns field">
21
+ <ul>
22
+ {{#each permission in permissions}}
23
+ <li {{bind-attr id=permission.name class=permission.is_selected:selected}} {{action 'select_permission' permission}}><i {{bind-attr class=":fa :fa-check permission.is_selected:green-text:hide"}}></i> {{ permission.string }} </li>
24
+ {{/each}}
25
+ </ul>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </fieldset>
31
+
32
+
33
+ <div class="row">
34
+ <div class="small-6 columns">
35
+ <button class="btn small green" {{action "save_group"}}><i class="fa fa-check"></i> {{_ "Save"}}</button>
36
+ <button class="btn small red" {{action "cancel"}}><i class="fa fa-times"></i> {{_ "Cancel"}}</button>
37
+ </div>
38
+ </div>
39
+ </div>
@@ -0,0 +1,31 @@
1
+ <div class="row clearmargin">
2
+
3
+ <div class="columns large-5 small-offset-1 clearpadding">
4
+ {{#link-to 'users'}}
5
+ <div class="widget red">
6
+
7
+ <div class="text-center">
8
+ <span class="icon text-4x"><i class="fa fa-user"></i></span>
9
+ <span class="text-2x">{{_ 'Users'}}</span>
10
+ </div>
11
+
12
+ </div>
13
+ {{/link-to}}
14
+ </div>
15
+
16
+
17
+ <div class="columns large-5 clearpadding">
18
+ {{#link-to 'groups'}}<div class="widget blue">
19
+
20
+ <div class=" text-center">
21
+ <span class="icon text-4x"><i class="fa fa-group"></i></span>
22
+ <span class="text-2x">{{_ 'Groups'}}</span>
23
+ </div>
24
+
25
+
26
+ </div>{{/link-to}}
27
+ </div>
28
+
29
+ </div>
30
+
31
+ {{outlet}}
@@ -0,0 +1,15 @@
1
+ <p>{{_ 'ID'}}: <strong>{{ id }}</strong></p>
2
+ <p>{{_ 'Email'}}: <strong>{{ email }}</strong></p>
3
+ <div class="row">
4
+ <div class="small-12 column text-right">
5
+ <ul class="button-group float-right">
6
+ {{#link-to user.edit class=" small"}}
7
+ <span class="fa fa-edit"></span> {{_ 'Edit'}}
8
+ {{/link-to}}
9
+ {{#link-to user.show class="small"}}
10
+ <span class="fa fa-eye"> {{_ 'Show'}}{{/link-to}}
11
+ {{#link-to user.show class="small"}}
12
+ <span class="fa fa-check-circle-o"> {{_ 'Active'}}{{/link-to}}
13
+ </ul>
14
+ </div>
15
+ </div>
@@ -0,0 +1,11 @@
1
+
2
+ <div class="row clearmargin">
3
+ <div class="small-6 column text-left clearpadding">
4
+ <h3><i class="fa fa-group"></i> {{_ 'Users'}}</h3>
5
+ </div>
6
+ </div>
7
+
8
+ {{ outlet }}
9
+
10
+
11
+ {{list-view model=model title_field="email" buttons=buttons delete_items="delete_items" details_template="auth/users/details" items_per_page=10}}
@@ -0,0 +1,33 @@
1
+ <div class="newform">
2
+ <fieldset class="form">
3
+
4
+ <legend>{{_ 'New User'}}</legend>
5
+
6
+ <div class="row">
7
+ <div class="small-6 columns">
8
+ <label for="first_name" >{{_ 'First Name'}}:</label>
9
+ {{input value=first_name id="first_name" type="text" name="first_name" value=first_name class="small-8 columns"}}
10
+ </div>
11
+
12
+ <div class="small-6 columns">
13
+ <label for="last_name" >{{_ 'Last Name'}}:</label>
14
+ {{input value=last_name id="last_name" type="text" name="last_name" value=last_name class="small-8 columns"}}
15
+ </div>
16
+
17
+ <div class="small-6 columns float-left">
18
+ <label for="email" >{{_ 'E-mail'}}:</label>
19
+ {{input value=email id="email" type="text" name="email" value=email class="small-8 columns"}}
20
+ </div>
21
+
22
+ </div>
23
+
24
+ </fieldset>
25
+
26
+
27
+ <div class="row">
28
+ <div class="small-6 columns">
29
+ <button class="btn small green" {{action "add_user"}}><i class="fa fa-check"></i> {{_ "Save"}}</button>
30
+ <button class="btn small red"><i class="fa fa-times"></i> {{_ "Cancel"}}</button>
31
+ </div>
32
+ </div>
33
+ </div>
@@ -0,0 +1,59 @@
1
+ <ul>
2
+ <li class="table-header">
3
+ <div class="small-6 columns text-left">
4
+ {{#each button in action_buttons }}
5
+ <span {{bind-attr class=button.classes }}">{{#link-to button.route }}<i {{bind-attr class=button.icon }}"></i> {{ button.label }}{{/link-to}}</span>
6
+ {{/each}}
7
+ </div>
8
+ <div class="small-4 columns text-right search-bar">
9
+ <input type="search" class="append " placeholder="{{_ 'Search'}} ..."/>
10
+ <span class="append radius"><i class="fa fa-search"></i></span>
11
+ </div>
12
+
13
+ </li>
14
+ {{#unless model}}
15
+ <li>{{_ 'There is not record'}}</li>
16
+ {{/unless}}
17
+ {{#each record in this_page}}
18
+ <li {{bind-attr class="record.is_selected:selected :pointer"}}>
19
+ {{#if is_ltr}}
20
+ <i {{action "toggle_details" record}} {{bind-attr class="record.view_details:fa-rotate-90 :handle :fa :fa-angle-right"}}></i>
21
+ {{else}}
22
+ <i {{action "toggle_details" record}} {{bind-attr class="record.view_details:fa-rotate-270 :handle :fa :fa-angle-left"}}></i>
23
+ {{/if}}
24
+ <div class="title" {{ action "select_item" record}}> {{ __title__ record title_field}}</div>
25
+
26
+ {{#if details_template}}
27
+ <div {{bind-attr class="record.view_details:show_details:hide_details :details"}}>
28
+ {{ dynamic_render details_template record }}
29
+ </div>
30
+ {{/if}}
31
+ </li>
32
+ {{/each}}
33
+ <li class="table-summery">
34
+ <div class="small-6 columns">
35
+ <div class="pagination">
36
+ {{# if has_pagination}}
37
+
38
+ <i {{bind-attr class=":fa is_ltr:fa-angle-double-left:fa-angle-double-right"}} {{ action go_to_first_page }}></i>
39
+ <i {{bind-attr class=":fa is_ltr:fa-angle-left:fa-angle-right"}} {{ action go_to_prev_page }}></i>
40
+ {{ input type="text" class="pagination_input" insert-newline="go_to_page"}}
41
+ <i {{bind-attr class=":fa is_ltr:fa-angle-right:fa-angle-left"}} {{ action go_to_next_page }}></i>
42
+ <i {{bind-attr class=":fa is_ltr:fa-angle-double-right:fa-angle-double-left"}} {{ action go_to_last_page }}></i>
43
+
44
+ <span class="elabel rounded lightergray" {{bind-attr title="asd"}}"><i class="fa fa-file-o"></i> {{ current_page }}</span>
45
+ <span class="elabel rounded lightergray" title="{{_ 'Total Pages'}}"><i class="fa fa-files-o"></i> {{ total_pages }}</span>
46
+ {{/if}}
47
+ <span class="elabel rounded lightergray" title="<%= _("Item(s)") %>"><i class="fa fa-list-ul"></i> {{count}}</span>
48
+ <span class="elabel rounded lightergray" title="{{_ 'Selected'}}"><i {{bind-attr class=":fa is_ltr:fa-hand-o-right:fa-hand-o-left"}}></i> {{ selected_count }}
49
+ </span>
50
+ </div>
51
+
52
+ </div>
53
+ <div class="small-6 columns text-right">
54
+ <span class="btn yellow tiny" {{ action "toggle_select" model}}>{{_ 'Toggle Select'}}</span>
55
+ <span class="btn blue tiny" {{ action "select_all" model}}>{{_ 'Select All'}}</span>
56
+ <span class="btn red tiny" {{ action 'delete_items' model}}>{{_ 'Delete'}}</span>
57
+ </div>
58
+ </li>
59
+ </ul>
@@ -0,0 +1,3 @@
1
+ {{#each field in fields}}
2
+ {{input value=field}}
3
+ {{/each}}
@@ -0,0 +1,15 @@
1
+
2
+ <ul>
3
+
4
+ {{#view Dashboard.LinkView route="widgets" content="" classes=""}}<i class="fa fa-dashboard"></i> {{_ 'Dashboard'}}{{/view}}
5
+
6
+ {{#each}}
7
+ {{#view Dashboard.LinkView resource=resource route=resource content=""}}<i {{bind-attr class=icon }}></i> {{ title }}{{/view}}
8
+ {{/each}}
9
+
10
+ </ul>
11
+
12
+ <div class="brand">
13
+ <h1><%= RedBase::Engine.site_title %></h1>
14
+ <span>{{_ 'Some slug'}}</span>
15
+ </div>
@@ -0,0 +1,43 @@
1
+ <% environment.context_class.instance_eval { include ActionView::Helpers::UrlHelper } %>
2
+ <% url = RedBase::Engine.routes.url_helpers %>
3
+
4
+ <div class="">
5
+ <div class="">
6
+ <nav class="clearpadding top-bar">
7
+ <section class="top-bar-section">
8
+ <ul class="title-area">
9
+ <li><a href="#"><i class="fa-cog fa icon-medium fa-2x"></i></a></li>
10
+ <!-- Title Area -->
11
+ <li class="name brand">
12
+ <h1><%= RedBase::Engine.site_title %></h1>
13
+
14
+ </li>
15
+ <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
16
+ <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
17
+ </ul>
18
+
19
+ </section>
20
+ <section class="top-bar-section">
21
+ <ul class="float-right">
22
+ <li class="has-dropdown"><a href="#"> {{_ 'Languages'}}</a>
23
+ <ul class="dropdown">
24
+ <% ::I18n.available_locales.each do |locale| %>
25
+ <li><a href="<%= "/#{locale.to_s}/#{RedBase::Engine.dashboard_namespace.to_s}/" %>"><%= locale %></a></li>
26
+ <% end %>
27
+ </ul>
28
+ </li>
29
+
30
+ <li class="has-dropdown"><a href="#">User{{ current_user.first_name }} {{ current_user.last_name }}</a>
31
+
32
+ <ul class="dropdown">
33
+ <li><a href="">Dashboard</a></li>
34
+ <li><a href="">Change Password</a></li>
35
+ <li><a href="<%= url.destroy_user_session_path %>" data-method="delete">Sign Out</a></li>
36
+ </ul>
37
+ </li>
38
+ </ul>
39
+ </section>
40
+
41
+ </nav>
42
+ </div>
43
+ </div>
@@ -0,0 +1,23 @@
1
+ <h2>{{_ 'Dashboard'}} </h2>
2
+
3
+ <div class="row clearmargin">
4
+ <div class="columns large-6 clearpadding">
5
+ <div class="widget blue">
6
+ sdfsd
7
+ </div>
8
+ </div>
9
+
10
+
11
+ <div class="row clearmargin">
12
+ <div class="columns large-3 clearpadding">
13
+ <div class="widget green">
14
+
15
+ </div>
16
+ </div>
17
+ <div class="columns large-3 clearpadding">
18
+ <div class="widget yellow">
19
+
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
@@ -0,0 +1,17 @@
1
+ //<% environment.context_class.instance_eval { include ActionView::Helpers::UrlHelper } %>
2
+ //<% url = RedBase::Engine.routes.url_helpers %>
3
+
4
+ // Prefix url of API
5
+ window.API_PREFIX = "/api/v1/";
6
+ // Modules is an array of dashboard modules
7
+ window.DModules = [];
8
+
9
+ // This variable will contains all the modules name which should be loaded
10
+ // as Dashboard application dependency
11
+ window.dashboard_dependencies = [];
12
+ // Template prefix
13
+ window.templates_path = "/templates/";
14
+
15
+ // Any element of this queue will be appear as error after load event
16
+ window.ErrorQueue = [];
17
+ window.DashboardURL = "<%= url.dashboard_path %>";
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,13 @@
1
+ window._ = function (str, options) {
2
+ var lang = $("html").attr("lang");
3
+ if (lang in I18n) {
4
+ if (str in I18n[lang]) {
5
+ if(I18n[lang][str] !== "") {
6
+ return I18n[lang][str];
7
+ }
8
+ return str;
9
+ }
10
+ }
11
+ console.log("I18n: Can't find translation for '" + str + "' in '" + lang + "'");
12
+ return str;
13
+ };
@@ -0,0 +1,27 @@
1
+ {
2
+ "Given page does not exists": "",
3
+ "New": "",
4
+ "Activate": "",
5
+ "Selected record(s) removed successfully.": "",
6
+ "Can not connect to remote, please try again": "",
7
+ "Dashboard": "",
8
+ "Some slug": "",
9
+ "Search": "",
10
+ "There is not record": "",
11
+ "Current Page": "",
12
+ "Total Pages": "",
13
+ "Selected": "",
14
+ "Toggle Select": "",
15
+ "Select All": "",
16
+ "Delete": "",
17
+ "Languages": "",
18
+ "ID": "",
19
+ "Email": "",
20
+ "Edit": "",
21
+ "Show": "",
22
+ "Active": "",
23
+ "New User": "",
24
+ "Users": "",
25
+ "Name": "",
26
+ "Groups": ""
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "Given page does not exists": "صفحه مورد نظر موجود نمی باشد.",
3
+ "New": "جدید",
4
+ "Activate": "فعال کردن",
5
+ "Selected record(s) removed successfully.": "رکورد های انتخاب شده با موفقیت حدف شد.",
6
+ "Can not connect to remote, please try again": "ارتیاط با سرور بر قرار نشد دوباره تلاش کنید.",
7
+ "Dashboard": "بخش کاربری",
8
+ "Some slug": "",
9
+ "Search": "جستو جو",
10
+ "There is not record": "رکوردی موجود نمی باشد",
11
+ "Current Page": "صفحه جاری",
12
+ "Total Pages": "کل صفحات",
13
+ "Selected": "انتخاب شده",
14
+ "Toggle Select": "بر عکس",
15
+ "Select All": "انتخاب همه",
16
+ "Delete": "حذف",
17
+ "Languages": "زبان ها",
18
+ "ID": "شناسه",
19
+ "Email": "ایمیل",
20
+ "Edit": "ویرایش",
21
+ "Show": "نمایش",
22
+ "Active": "فعال",
23
+ "New User": "کاربر جدید",
24
+ "Users": "کاربران",
25
+ "Name": "نام",
26
+ "Groups": "گروه ها"
27
+ }
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.