rademade_admin 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +34 -0
  4. data/app/assets/fonts/rademade_admin/glyphicons-halflings-regular.eot +0 -0
  5. data/app/assets/fonts/rademade_admin/glyphicons-halflings-regular.svg +228 -0
  6. data/app/assets/fonts/rademade_admin/glyphicons-halflings-regular.ttf +0 -0
  7. data/app/assets/fonts/rademade_admin/glyphicons-halflings-regular.woff +0 -0
  8. data/app/assets/images/rademade_admin/backgrounds/back-blue.jpg +0 -0
  9. data/app/assets/images/rademade_admin/backgrounds/back-green.jpg +0 -0
  10. data/app/assets/images/rademade_admin/backgrounds/back-orange.png +0 -0
  11. data/app/assets/images/rademade_admin/backgrounds/blueish.jpg +0 -0
  12. data/app/assets/images/rademade_admin/backgrounds/select-bg.png +0 -0
  13. data/app/assets/images/rademade_admin/datatables/back_disabled.png +0 -0
  14. data/app/assets/images/rademade_admin/datatables/back_enabled.png +0 -0
  15. data/app/assets/images/rademade_admin/datatables/back_enabled_hover.png +0 -0
  16. data/app/assets/images/rademade_admin/datatables/forward_disabled.png +0 -0
  17. data/app/assets/images/rademade_admin/datatables/forward_enabled.png +0 -0
  18. data/app/assets/images/rademade_admin/datatables/forward_enabled_hover.png +0 -0
  19. data/app/assets/images/rademade_admin/datatables/sort_asc.png +0 -0
  20. data/app/assets/images/rademade_admin/datatables/sort_asc_disabled.png +0 -0
  21. data/app/assets/images/rademade_admin/datatables/sort_both.png +0 -0
  22. data/app/assets/images/rademade_admin/datatables/sort_desc.png +0 -0
  23. data/app/assets/images/rademade_admin/datatables/sort_desc_disabled.png +0 -0
  24. data/app/assets/images/rademade_admin/icons/btn-attach.png +0 -0
  25. data/app/assets/images/rademade_admin/icons/btn-setting.png +0 -0
  26. data/app/assets/images/rademade_admin/icons/btn-shuffle.png +0 -0
  27. data/app/assets/images/rademade_admin/icons/btn-tool.png +0 -0
  28. data/app/assets/images/rademade_admin/icons/buble.png +0 -0
  29. data/app/assets/images/rademade_admin/icons/glyphicons-halflings-white.png +0 -0
  30. data/app/assets/images/rademade_admin/icons/glyphicons-halflings.png +0 -0
  31. data/app/assets/images/rademade_admin/icons/ico-arrow-black.png +0 -0
  32. data/app/assets/images/rademade_admin/icons/ico-gallery-edit.png +0 -0
  33. data/app/assets/images/rademade_admin/icons/ico-gallery-trash.png +0 -0
  34. data/app/assets/images/rademade_admin/icons/ico-mail.png +0 -0
  35. data/app/assets/images/rademade_admin/icons/ico-phone.png +0 -0
  36. data/app/assets/images/rademade_admin/icons/ico-table-delete.png +0 -0
  37. data/app/assets/images/rademade_admin/icons/ico-table-edit.png +0 -0
  38. data/app/assets/images/rademade_admin/icons/ico-table-new.png +0 -0
  39. data/app/assets/images/rademade_admin/icons/lens.png +0 -0
  40. data/app/assets/images/rademade_admin/icons/skin-nav-bullets.png +0 -0
  41. data/app/assets/images/rademade_admin/icons/table-icons.png +0 -0
  42. data/app/assets/images/rademade_admin/icons/table-img.png +0 -0
  43. data/app/assets/images/rademade_admin/jquery-ui/animated-overlay.gif +0 -0
  44. data/app/assets/images/rademade_admin/jquery-ui/slider-handler.png +0 -0
  45. data/app/assets/images/rademade_admin/jquery-ui/slider-handler2.png +0 -0
  46. data/app/assets/images/rademade_admin/jquery-ui/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  47. data/app/assets/images/rademade_admin/jquery-ui/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  48. data/app/assets/images/rademade_admin/jquery-ui/ui-bg_flat_10_000000_40x100.png +0 -0
  49. data/app/assets/images/rademade_admin/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  50. data/app/assets/images/rademade_admin/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  51. data/app/assets/images/rademade_admin/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  52. data/app/assets/images/rademade_admin/jquery-ui/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  53. data/app/assets/images/rademade_admin/jquery-ui/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  54. data/app/assets/images/rademade_admin/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  55. data/app/assets/images/rademade_admin/jquery-ui/ui-icons_222222_256x240.png +0 -0
  56. data/app/assets/images/rademade_admin/jquery-ui/ui-icons_228ef1_256x240.png +0 -0
  57. data/app/assets/images/rademade_admin/jquery-ui/ui-icons_ef8c08_256x240.png +0 -0
  58. data/app/assets/images/rademade_admin/jquery-ui/ui-icons_ffd27a_256x240.png +0 -0
  59. data/app/assets/images/rademade_admin/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
  60. data/app/assets/images/rademade_admin/logos/logo-white.png +0 -0
  61. data/app/assets/images/rademade_admin/logos/logo.png +0 -0
  62. data/app/assets/images/rademade_admin/notifier-loader-clean.gif +0 -0
  63. data/app/assets/images/rademade_admin/notifier-loader-plastic.gif +0 -0
  64. data/app/assets/images/rademade_admin/placeholders/new-gallery-img.png +0 -0
  65. data/app/assets/images/rademade_admin/placeholders/no-img-gallery.png +0 -0
  66. data/app/assets/images/rademade_admin/select2/select2.png +0 -0
  67. data/app/assets/images/rademade_admin/select2/select2x2.png +0 -0
  68. data/app/assets/images/rademade_admin/select2/spinner.gif +0 -0
  69. data/app/assets/images/rademade_admin/uniform/bg-input-focus.png +0 -0
  70. data/app/assets/images/rademade_admin/uniform/bg-input.png +0 -0
  71. data/app/assets/images/rademade_admin/uniform/sprite.png +0 -0
  72. data/app/assets/javascripts/rademade_admin.coffee +14 -0
  73. data/app/assets/javascripts/rademade_admin/app/app.coffee +1 -0
  74. data/app/assets/javascripts/rademade_admin/app/common/dnd-sort.coffee +42 -0
  75. data/app/assets/javascripts/rademade_admin/app/common/pagination.coffee +6 -0
  76. data/app/assets/javascripts/rademade_admin/app/common/related-index.coffee +54 -0
  77. data/app/assets/javascripts/rademade_admin/app/common/relation-list.coffee +109 -0
  78. data/app/assets/javascripts/rademade_admin/app/common/sort-list.coffee +47 -0
  79. data/app/assets/javascripts/rademade_admin/app/common/uploader.coffee +53 -0
  80. data/app/assets/javascripts/rademade_admin/app/form-popup/collection.coffee +20 -0
  81. data/app/assets/javascripts/rademade_admin/app/form-popup/initializer.coffee +43 -0
  82. data/app/assets/javascripts/rademade_admin/app/form-popup/model.coffee +4 -0
  83. data/app/assets/javascripts/rademade_admin/app/form-popup/view.coffee +57 -0
  84. data/app/assets/javascripts/rademade_admin/app/forms/insert.coffee +7 -0
  85. data/app/assets/javascripts/rademade_admin/app/forms/login.coffee +4 -0
  86. data/app/assets/javascripts/rademade_admin/app/forms/remove.coffee +6 -0
  87. data/app/assets/javascripts/rademade_admin/app/notifier/initialize.js +31 -0
  88. data/app/assets/javascripts/rademade_admin/detail_admin/theme.js +56 -0
  89. data/app/assets/javascripts/rademade_admin/form/form-ajax-submit.coffee +153 -0
  90. data/app/assets/javascripts/rademade_admin/form/library/jquery.form-serialize.js +54 -0
  91. data/app/assets/javascripts/rademade_admin/form/library/jquery.form.js +1121 -0
  92. data/app/assets/javascripts/rademade_admin/form/library/jquery.formrestrict.js +27 -0
  93. data/app/assets/javascripts/rademade_admin/form/library/jquery.validate.js +1231 -0
  94. data/app/assets/javascripts/rademade_admin/form/library/jquery.validate.messages_ru.js +27 -0
  95. data/app/assets/javascripts/rademade_admin/library/backbone.js +1581 -0
  96. data/app/assets/javascripts/rademade_admin/library/bootstrap/bootstrap.datepicker.js +989 -0
  97. data/app/assets/javascripts/rademade_admin/library/bootstrap/bootstrap.js +1992 -0
  98. data/app/assets/javascripts/rademade_admin/library/ckeditor/config.js +12 -0
  99. data/app/assets/javascripts/rademade_admin/library/jquery/jquery-ui-1.10.4.custom.min.js +6 -0
  100. data/app/assets/javascripts/rademade_admin/library/jquery/jquery.dataTables.js +12099 -0
  101. data/app/assets/javascripts/rademade_admin/library/jquery/jquery.flot.js +2960 -0
  102. data/app/assets/javascripts/rademade_admin/library/jquery/jquery.flot.resize.js +60 -0
  103. data/app/assets/javascripts/rademade_admin/library/jquery/jquery.flot.stack.js +188 -0
  104. data/app/assets/javascripts/rademade_admin/library/jquery/jquery.knob.js +661 -0
  105. data/app/assets/javascripts/rademade_admin/library/jquery/jquery.tablednd.js +1 -0
  106. data/app/assets/javascripts/rademade_admin/library/jquery/jquery.uniform.min.js +1 -0
  107. data/app/assets/javascripts/rademade_admin/library/notifier.custom.js +431 -0
  108. data/app/assets/javascripts/rademade_admin/library/notifier.custom.min.js +15 -0
  109. data/app/assets/javascripts/rademade_admin/library/underscore.js +1276 -0
  110. data/app/assets/javascripts/rademade_admin/library/wysihtml5-0.3.0.js +9463 -0
  111. data/app/assets/stylesheets/rademade_admin.css +14 -0
  112. data/app/assets/stylesheets/rademade_admin/base.scss.erb +23 -0
  113. data/app/assets/stylesheets/rademade_admin/bootstrap/bootstrap-overrides.css.erb +341 -0
  114. data/app/assets/stylesheets/rademade_admin/bootstrap/bootstrap.css.erb +5911 -0
  115. data/app/assets/stylesheets/rademade_admin/bootstrap/main.scss.erb +78 -0
  116. data/app/assets/stylesheets/rademade_admin/detail_admin/chart-showcase.scss.erb +33 -0
  117. data/app/assets/stylesheets/rademade_admin/detail_admin/datatables.scss.erb +3 -0
  118. data/app/assets/stylesheets/rademade_admin/detail_admin/elements.scss.erb +665 -0
  119. data/app/assets/stylesheets/rademade_admin/detail_admin/error.scss.erb +19 -0
  120. data/app/assets/stylesheets/rademade_admin/detail_admin/form-showcase.scss.erb +87 -0
  121. data/app/assets/stylesheets/rademade_admin/detail_admin/form-wizard.scss.erb +261 -0
  122. data/app/assets/stylesheets/rademade_admin/detail_admin/gallery.scss.erb +106 -0
  123. data/app/assets/stylesheets/rademade_admin/detail_admin/grids.scss.erb +21 -0
  124. data/app/assets/stylesheets/rademade_admin/detail_admin/icons.scss.erb +115 -0
  125. data/app/assets/stylesheets/rademade_admin/detail_admin/index.scss.erb +290 -0
  126. data/app/assets/stylesheets/rademade_admin/detail_admin/layout.scss.erb +523 -0
  127. data/app/assets/stylesheets/rademade_admin/detail_admin/new-user.scss.erb +49 -0
  128. data/app/assets/stylesheets/rademade_admin/detail_admin/personal-info.scss.erb +144 -0
  129. data/app/assets/stylesheets/rademade_admin/detail_admin/popup.scss.erb +3 -0
  130. data/app/assets/stylesheets/rademade_admin/detail_admin/signin.scss.erb +128 -0
  131. data/app/assets/stylesheets/rademade_admin/detail_admin/tables.scss.erb +195 -0
  132. data/app/assets/stylesheets/rademade_admin/detail_admin/ui-elements.scss.erb +177 -0
  133. data/app/assets/stylesheets/rademade_admin/detail_admin/user-list.scss.erb +112 -0
  134. data/app/assets/stylesheets/rademade_admin/detail_admin/user-profile.scss.erb +169 -0
  135. data/app/assets/stylesheets/rademade_admin/detail_admin/web-app-icons.scss.erb +25 -0
  136. data/app/assets/stylesheets/rademade_admin/edit.css +7 -0
  137. data/app/assets/stylesheets/rademade_admin/file-upload.scss.erb +12 -0
  138. data/app/assets/stylesheets/rademade_admin/lib/bootstrap.datepicker.css.erb +302 -0
  139. data/app/assets/stylesheets/rademade_admin/lib/jquery-ui-1.10.2.custom.css.erb +544 -0
  140. data/app/assets/stylesheets/rademade_admin/lib/morris.css.erb +2 -0
  141. data/app/assets/stylesheets/rademade_admin/lib/select2.css.erb +513 -0
  142. data/app/assets/stylesheets/rademade_admin/lib/uniform.default.css.erb +366 -0
  143. data/app/assets/stylesheets/rademade_admin/notifier.custom.css.erb +661 -0
  144. data/app/assets/stylesheets/rademade_admin/scaffolds.scss.erb +32 -0
  145. data/app/controllers/rademade_admin/abstract_controller.rb +24 -0
  146. data/app/controllers/rademade_admin/admin_users_controller.rb +16 -0
  147. data/app/controllers/rademade_admin/application_controller.rb +7 -0
  148. data/app/controllers/rademade_admin/dashboard_controller.rb +16 -0
  149. data/app/controllers/rademade_admin/model_controller.rb +122 -0
  150. data/app/controllers/rademade_admin/sessions_controller.rb +22 -0
  151. data/app/helpers/rademade_admin/field_helper.rb +27 -0
  152. data/app/helpers/rademade_admin/form_helper.rb +63 -0
  153. data/app/helpers/rademade_admin/menu_helper.rb +45 -0
  154. data/app/helpers/rademade_admin/name_helper.rb +17 -0
  155. data/app/helpers/rademade_admin/upload_preview_helper.rb +59 -0
  156. data/app/helpers/rademade_admin/uri_helper.rb +104 -0
  157. data/app/inputs/rademade_admin/admin_file_input.rb +70 -0
  158. data/app/inputs/rademade_admin/admin_select_input.rb +81 -0
  159. data/app/inputs/rademade_admin/admin_textarea_input.rb +5 -0
  160. data/app/inputs/rademade_admin/boolean_input.rb +13 -0
  161. data/app/models/rademade_admin/ability.rb +39 -0
  162. data/app/models/rademade_admin/user.rb +6 -0
  163. data/app/serializers/autocomplete_serializer.rb +46 -0
  164. data/app/services/form_builder.rb +3 -0
  165. data/app/services/loader_service.rb +7 -0
  166. data/app/services/login.rb +18 -0
  167. data/app/services/login/error.rb +17 -0
  168. data/app/services/model_controller/instance_options.rb +38 -0
  169. data/app/services/model_controller/linker.rb +49 -0
  170. data/app/services/model_controller/model_options.rb +39 -0
  171. data/app/services/model_controller/notifier.rb +40 -0
  172. data/app/services/model_controller/templates.rb +27 -0
  173. data/app/services/saver.rb +69 -0
  174. data/app/services/search/conditions/abstract.rb +53 -0
  175. data/app/services/search/conditions/autocomplete.rb +44 -0
  176. data/app/services/search/conditions/list.rb +35 -0
  177. data/app/services/search/query_adapter/abstract.rb +54 -0
  178. data/app/services/search/query_adapter/active_record.rb +33 -0
  179. data/app/services/search/query_adapter/mongoid.rb +33 -0
  180. data/app/services/search/searcher.rb +19 -0
  181. data/app/services/sortable_service.rb +37 -0
  182. data/app/services/video_service.rb +22 -0
  183. data/app/views/layouts/rademade_admin.html.erb +13 -0
  184. data/app/views/rademade_admin/_blocks/_form_control.html.erb +5 -0
  185. data/app/views/rademade_admin/_blocks/_header.html.erb +30 -0
  186. data/app/views/rademade_admin/_blocks/_menu.html.erb +41 -0
  187. data/app/views/rademade_admin/_blocks/_pagination.html.erb +18 -0
  188. data/app/views/rademade_admin/_blocks/_sub_menu.html.erb +19 -0
  189. data/app/views/rademade_admin/_blocks/sub_menu/_link.html.erb +5 -0
  190. data/app/views/rademade_admin/_layouts/inner.html.erb +37 -0
  191. data/app/views/rademade_admin/_layouts/inner/form.html.erb +15 -0
  192. data/app/views/rademade_admin/_layouts/inner/index_table.html.erb +59 -0
  193. data/app/views/rademade_admin/_layouts/inner/related_index_table.html.erb +55 -0
  194. data/app/views/rademade_admin/abstract/_form.html.erb +10 -0
  195. data/app/views/rademade_admin/abstract/edit.html.erb +9 -0
  196. data/app/views/rademade_admin/abstract/form.html.erb +1 -0
  197. data/app/views/rademade_admin/abstract/index.html.erb +77 -0
  198. data/app/views/rademade_admin/abstract/new.html.erb +9 -0
  199. data/app/views/rademade_admin/abstract/related_index.html.erb +78 -0
  200. data/app/views/rademade_admin/dashboard/index.html.erb +9 -0
  201. data/app/views/rademade_admin/dashboard/login.html.erb +31 -0
  202. data/config/initializers/devise.rb +250 -0
  203. data/config/initializers/routes.rb +3 -0
  204. data/config/locales/devise.en.yml +59 -0
  205. data/config/routes.rb +17 -0
  206. data/lib/rademade_admin.rb +26 -0
  207. data/lib/rademade_admin/configuration.rb +17 -0
  208. data/lib/rademade_admin/engine.rb +22 -0
  209. data/lib/rademade_admin/file_info_formatter.rb +12 -0
  210. data/lib/rademade_admin/hrml_buffer.rb +14 -0
  211. data/lib/rademade_admin/model/configuration.rb +52 -0
  212. data/lib/rademade_admin/model/configuration/fields.rb +33 -0
  213. data/lib/rademade_admin/model/data_adapter.rb +59 -0
  214. data/lib/rademade_admin/model/data_adapter/active_record.rb +53 -0
  215. data/lib/rademade_admin/model/data_adapter/mongoid.rb +49 -0
  216. data/lib/rademade_admin/model/graph.rb +36 -0
  217. data/lib/rademade_admin/model/info.rb +106 -0
  218. data/lib/rademade_admin/model/reflection.rb +31 -0
  219. data/lib/rademade_admin/model/reflection/data.rb +47 -0
  220. data/lib/rademade_admin/model/reflection/uploader.rb +18 -0
  221. data/lib/rademade_admin/routing.rb +3 -0
  222. data/lib/rademade_admin/routing/mapper.rb +42 -0
  223. data/lib/rademade_admin/routing/resource.rb +6 -0
  224. data/lib/rademade_admin/sortable.rb +12 -0
  225. data/lib/rademade_admin/uploader/photo.rb +13 -0
  226. data/lib/rademade_admin/uploader/video.rb +11 -0
  227. data/lib/rademade_admin/user.rb +16 -0
  228. data/lib/rademade_admin/version.rb +3 -0
  229. data/lib/tasks/rademade_admin_tasks.rake +4 -0
  230. data/test/dummy/README.rdoc +28 -0
  231. data/test/dummy/Rakefile +6 -0
  232. data/test/dummy/app/assets/javascripts/application.js +13 -0
  233. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  234. data/test/dummy/app/controllers/application_controller.rb +5 -0
  235. data/test/dummy/app/controllers/rademade_admin/posts_controller.rb +9 -0
  236. data/test/dummy/app/controllers/rademade_admin/users_controller.rb +14 -0
  237. data/test/dummy/app/helpers/application_helper.rb +2 -0
  238. data/test/dummy/app/models/post.rb +9 -0
  239. data/test/dummy/app/models/user.rb +7 -0
  240. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  241. data/test/dummy/bin/bundle +3 -0
  242. data/test/dummy/bin/rails +4 -0
  243. data/test/dummy/bin/rake +4 -0
  244. data/test/dummy/config.ru +4 -0
  245. data/test/dummy/config/application.rb +29 -0
  246. data/test/dummy/config/boot.rb +5 -0
  247. data/test/dummy/config/environment.rb +5 -0
  248. data/test/dummy/config/environments/development.rb +29 -0
  249. data/test/dummy/config/environments/production.rb +80 -0
  250. data/test/dummy/config/environments/test.rb +36 -0
  251. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  252. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  253. data/test/dummy/config/initializers/inflections.rb +16 -0
  254. data/test/dummy/config/initializers/mime_types.rb +5 -0
  255. data/test/dummy/config/initializers/rademade_admin.rb +3 -0
  256. data/test/dummy/config/initializers/secret_token.rb +12 -0
  257. data/test/dummy/config/initializers/session_store.rb +3 -0
  258. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  259. data/test/dummy/config/locales/en.yml +23 -0
  260. data/test/dummy/config/mongoid.yml +6 -0
  261. data/test/dummy/config/routes.rb +8 -0
  262. data/test/dummy/db/development.sqlite3 +0 -0
  263. data/test/dummy/public/404.html +58 -0
  264. data/test/dummy/public/422.html +58 -0
  265. data/test/dummy/public/500.html +57 -0
  266. data/test/dummy/public/favicon.ico +0 -0
  267. data/test/integration/navigation_test.rb +10 -0
  268. data/test/rademade_admin_test.rb +7 -0
  269. data/test/test_helper.rb +15 -0
  270. metadata +691 -0
@@ -0,0 +1 @@
1
+ <%= render @form_template_path %>
@@ -0,0 +1,77 @@
1
+ <% content_for :last_crumbs do %>
2
+ <span><%= admin_list_name(@model_info) %></span>
3
+ <% end %>
4
+
5
+ <% content_for :page_header do %>
6
+ <h3><%= admin_list_name(@model_info) %></h3>
7
+ <% end %>
8
+
9
+ <% content_for :nav_buttons do %><%
10
+ new_uri = admin_new_uri(@model_info)
11
+ if new_uri
12
+ concat link_to admin_add_name(@model_info) + '+', new_uri, :class => 'btn-flat success new-product'
13
+ end
14
+ %><% end %>
15
+
16
+ <% content_for :content do %>
17
+ <% if @sortable_service.can_reset? %>
18
+ <a href="<%= request.path %>">Reset sorting</a>
19
+ <% end %>
20
+ <table class="table table-hover">
21
+
22
+ <thead>
23
+ <tr>
24
+ <% @list_fields.each_with_index do |name, index| %>
25
+ <th class="col-md-3 sort-button" data-column="<%= name %>">
26
+ <% unless index == 0 %>
27
+ <span class="line"></span>
28
+ <% end %>
29
+ <span><%= field_to_label(name) + @sortable_service.sorting_sign(name) %></span>
30
+ </th>
31
+ <% end %>
32
+
33
+ <th class="col-md-3 align-right">
34
+ <span class="line"></span>
35
+ <span>Management</span>
36
+ </th>
37
+ </tr>
38
+ </thead>
39
+
40
+ <% has_position = @sortable_service.has_position? %>
41
+ <tbody class="table-sortable" data-position='<%= has_position %>'>
42
+ <% @items.each_with_index do |item, index| %>
43
+ <tr<%
44
+ if has_position
45
+ %> id='<%= item.position %>'<%
46
+ end
47
+ %> data-id='<%= item.id %>'>
48
+ <% @list_fields.each do |name|
49
+ %><td><%
50
+ value = item.send(name)
51
+ # todo remove hard code, extract helper (data adapter)
52
+ if value.respond_to? :id
53
+ concat link_to value.to_s, admin_edit_uri(value)
54
+ else
55
+ concat value
56
+ end
57
+ %></td>
58
+ <% end %>
59
+ <td>
60
+ <ul class="actions">
61
+ <li><%= link_to 'Edit', admin_edit_uri(item) %></li>
62
+ <li><%= button_to 'Destroy', admin_delete_uri(item), {
63
+ :method => :delete,
64
+ :form => {:class => 'delete-item-form'}
65
+ } %></li>
66
+ </ul>
67
+ </td>
68
+ </tr>
69
+ <% end %>
70
+ </tbody>
71
+ </table>
72
+
73
+ <%= render 'rademade_admin/_blocks/pagination' %>
74
+
75
+ <% end %>
76
+
77
+ <%= render :template => 'rademade_admin/_layouts/inner' %>
@@ -0,0 +1,9 @@
1
+ <% content_for(:form_last_crumbs) do %>
2
+ <span>Add</span>
3
+ <% end %>
4
+
5
+ <% content_for(:page_header) do %>
6
+ <h3><%= admin_add_name(@model_info) %></h3>
7
+ <% end %>
8
+
9
+ <%= render :template => 'rademade_admin/_layouts/inner/form' %>
@@ -0,0 +1,78 @@
1
+ <% content_for :last_crumbs do %>
2
+ <%= link_to("#{params[:parent]}", admin_model_url_for(params[:parent], {
3
+ :action => :edit,
4
+ :id => params[:parent_id]
5
+ })) %>
6
+ <span class="separator">-></span>
7
+ <span><%= admin_list_name(@model_info) %></span>
8
+ <% end %>
9
+
10
+ <% content_for :page_header do %>
11
+ <h3><%= admin_list_name(@model_info) %> of <%= params[:parent] %></h3>
12
+ <% end %>
13
+
14
+ <% content_for :content do %>
15
+ <%= content_tag(
16
+ :input,
17
+ nil,
18
+ :type => 'hidden',
19
+ :class => 'select2-add-link',
20
+ :'data-model' => @model_class.to_s,
21
+ :'data-rel-list-url' => admin_autocomplete_uri(@model_info) + '.json')
22
+ %><table class="table table-hover">
23
+ <thead>
24
+ <tr>
25
+ <% @list_fields.each_with_index do |name, index| %>
26
+ <th class="col-md-3 sort-button" data-column="<%=name%>">
27
+ <% unless index == 0 %>
28
+ <span class="line"></span>
29
+ <% end %>
30
+ <span><%= field_to_label(name) + @sortable_service.sorting_sign(name) %></span>
31
+ </th>
32
+ <% end %>
33
+
34
+ <th class="col-md-3 align-right">
35
+ <span class="line"></span>
36
+ <span>Management</span>
37
+ </th>
38
+ </tr>
39
+ </thead>
40
+
41
+ <% has_position = @sortable_service.has_position? %>
42
+ <tbody data-position='false'>
43
+ <% @items.each_with_index do |item, index| %>
44
+ <tr<%
45
+ if has_position
46
+ %> id='<%= item.position %>'<%
47
+ end
48
+ %> data-id='<%= item.id %>'>
49
+ <% @list_fields.each do |name|
50
+ %><td><%
51
+ td_data = item.send(name)
52
+ if td_data.respond_to? :id
53
+ concat link_to td_data.to_s, admin_edit_uri(td_data)
54
+ else
55
+ concat td_data
56
+ end
57
+ %></td>
58
+ <% end %>
59
+ <td>
60
+ <ul class="actions">
61
+ <li>
62
+ <%= button_to 'Unlink', admin_unlink_uri(item, params[:parent], params[:parent_id]), {
63
+ :method => :patch,
64
+ :form => {:class => 'delete-item-form'}
65
+ } %>
66
+ </li>
67
+ </ul>
68
+ </td>
69
+ </tr>
70
+ <% end %>
71
+ </tbody>
72
+ </table>
73
+
74
+ <%= render 'rademade_admin/_blocks/pagination' %>
75
+
76
+ <% end %>
77
+
78
+ <%= render :template => 'rademade_admin/_layouts/inner' %>
@@ -0,0 +1,9 @@
1
+ <% content_for(:content) do %>
2
+
3
+ <div class="head">
4
+ <h3>Hello, <%= current_user %></h3>
5
+ </div>
6
+
7
+ <% end %>
8
+
9
+ <%= render :template => 'rademade_admin/_layouts/inner' %>
@@ -0,0 +1,31 @@
1
+ <div class="login-bg">
2
+ <div class="login-wrapper">
3
+ <img class="logo" src="<%=image_path('rademade_admin/logos/logo-white.png')%>" alt="Rademade.com">
4
+ <div class="box">
5
+ <div class="content-wrap">
6
+ <h6>Log in</h6>
7
+
8
+ <%=semantic_form_for(RademadeAdmin.user_class.new,
9
+ :url => [:sessions],
10
+ :as => :data,
11
+ :html => { :id => 'login-form'}) do |f|
12
+
13
+ concat f.input :email,
14
+ :label => false,
15
+ :input_html => {:class => 'form-control'}
16
+
17
+ concat f.input :password,
18
+ :label => false,
19
+ :input_html => {:class => 'form-control'}
20
+
21
+ concat f.action :submit,
22
+ :label => 'Log in',
23
+ :as => :button,
24
+ :button_html => {:class => 'btn-glow primary login'}
25
+
26
+ end
27
+
28
+ %></div>
29
+ </div>
30
+ </div>
31
+ </div>
@@ -0,0 +1,250 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ # config.secret_key = 'a8e93fea4fcfb7b5344e894821ce50b935c6e8a16ec3e654a8ad400b0a8c1fe2e91a816fed223f885c090327701b2aa557d3ca97b02942e89d5410461490b81a'
8
+
9
+ # ==> Mailer Configuration
10
+ # Configure the e-mail address which will be shown in Devise::Mailer,
11
+ # note that it will be overwritten if you use your own mailer class
12
+ # with default "from" parameter.
13
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
14
+
15
+ # Configure the class responsible to send e-mails.
16
+ # config.mailer = 'Devise::Mailer'
17
+
18
+ # ==> Configuration for any authentication mechanism
19
+ # Configure which keys are used when authenticating a user. The default is
20
+ # just :email. You can configure it to use [:username, :subdomain], so for
21
+ # authenticating a user, both parameters are required. Remember that those
22
+ # parameters are used only when authenticating and not when retrieving from
23
+ # session. If you need permissions, you should implement that in a before filter.
24
+ # You can also supply a hash where the value is a boolean determining whether
25
+ # or not authentication should be aborted when the value is not present.
26
+ # config.authentication_keys = [ :email ]
27
+
28
+ # Configure parameters from the request object used for authentication. Each entry
29
+ # given should be a request method and it will automatically be passed to the
30
+ # find_for_authentication method and considered in your model lookup. For instance,
31
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
32
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
33
+ # config.request_keys = []
34
+
35
+ # Configure which authentication keys should be case-insensitive.
36
+ # These keys will be downcased upon creating or modifying a user and when used
37
+ # to authenticate or find a user. Default is :email.
38
+ config.case_insensitive_keys = [ :email ]
39
+
40
+ # Configure which authentication keys should have whitespace stripped.
41
+ # These keys will have whitespace before and after removed upon creating or
42
+ # modifying a user and when used to authenticate or find a user. Default is :email.
43
+ config.strip_whitespace_keys = [ :email ]
44
+
45
+ # Tell if authentication through request.params is enabled. True by default.
46
+ # It can be set to an array that will enable params authentication only for the
47
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
48
+ # enable it only for database (email + password) authentication.
49
+ # config.params_authenticatable = true
50
+
51
+ # Tell if authentication through HTTP Auth is enabled. False by default.
52
+ # It can be set to an array that will enable http authentication only for the
53
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
54
+ # enable it only for database authentication. The supported strategies are:
55
+ # :database = Support basic authentication with authentication key + password
56
+ # config.http_authenticatable = false
57
+
58
+ # If http headers should be returned for AJAX requests. True by default.
59
+ # config.http_authenticatable_on_xhr = true
60
+
61
+ # The realm used in Http Basic Authentication. 'Application' by default.
62
+ # config.http_authentication_realm = 'Application'
63
+
64
+ # It will change confirmation, password recovery and other workflows
65
+ # to behave the same regardless if the e-mail provided was right or wrong.
66
+ # Does not affect registerable.
67
+ # config.paranoid = true
68
+
69
+ # By default Devise will store the user in session. You can skip storage for
70
+ # particular strategies by setting this option.
71
+ # Notice that if you are skipping storage for all authentication paths, you
72
+ # may want to disable generating routes to Devise's sessions controller by
73
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
74
+ config.skip_session_storage = [:http_auth]
75
+
76
+ # By default, Devise cleans up the CSRF token on authentication to
77
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
78
+ # requests for sign in and sign up, you need to get a new CSRF token
79
+ # from the server. You can disable this option at your own risk.
80
+ # config.clean_up_csrf_token_on_authentication = true
81
+
82
+ # ==> Configuration for :database_authenticatable
83
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
84
+ # using other encryptors, it sets how many times you want the password re-encrypted.
85
+ #
86
+ # Limiting the stretches to just one in testing will increase the performance of
87
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
88
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
89
+ # encryptor), the cost increases exponentially with the number of stretches (e.g.
90
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
91
+ config.stretches = Rails.env.test? ? 1 : 10
92
+
93
+ # Setup a pepper to generate the encrypted password.
94
+ # config.pepper = '600068784bb72c4fe901cac99128dece3d376d51aa531b132d0e4768e75e5d4d7cd7f022e7a81f46a83d6b47b43466fd5205515625b665888324300fc105ffca'
95
+
96
+ # ==> Configuration for :confirmable
97
+ # A period that the user is allowed to access the website even without
98
+ # confirming their account. For instance, if set to 2.days, the user will be
99
+ # able to access the website for two days without confirming their account,
100
+ # access will be blocked just in the third day. Default is 0.days, meaning
101
+ # the user cannot access the website without confirming their account.
102
+ # config.allow_unconfirmed_access_for = 2.days
103
+
104
+ # A period that the user is allowed to confirm their account before their
105
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
106
+ # their account within 3 days after the mail was sent, but on the fourth day
107
+ # their account can't be confirmed with the token any more.
108
+ # Default is nil, meaning there is no restriction on how long a user can take
109
+ # before confirming their account.
110
+ # config.confirm_within = 3.days
111
+
112
+ # If true, requires any email changes to be confirmed (exactly the same way as
113
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
114
+ # db field (see migrations). Until confirmed, new email is stored in
115
+ # unconfirmed_email column, and copied to email column on successful confirmation.
116
+ config.reconfirmable = true
117
+
118
+ # Defines which key will be used when confirming an account
119
+ # config.confirmation_keys = [ :email ]
120
+
121
+ # ==> Configuration for :rememberable
122
+ # The time the user will be remembered without asking for credentials again.
123
+ # config.remember_for = 2.weeks
124
+
125
+ # If true, extends the user's remember period when remembered via cookie.
126
+ # config.extend_remember_period = false
127
+
128
+ # Options to be passed to the created cookie. For instance, you can set
129
+ # secure: true in order to force SSL only cookies.
130
+ # config.rememberable_options = {}
131
+
132
+ # ==> Configuration for :validatable
133
+ # Range for password length.
134
+ config.password_length = 8..128
135
+
136
+ # Email regex used to validate email formats. It simply asserts that
137
+ # one (and only one) @ exists in the given string. This is mainly
138
+ # to give user feedback and not to assert the e-mail validity.
139
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
140
+
141
+ # ==> Configuration for :timeoutable
142
+ # The time you want to timeout the user session without activity. After this
143
+ # time the user will be asked for credentials again. Default is 30 minutes.
144
+ # config.timeout_in = 30.minutes
145
+
146
+ # If true, expires auth token on session timeout.
147
+ # config.expire_auth_token_on_timeout = false
148
+
149
+ # ==> Configuration for :lockable
150
+ # Defines which strategy will be used to lock an account.
151
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
152
+ # :none = No lock strategy. You should handle locking by yourself.
153
+ # config.lock_strategy = :failed_attempts
154
+
155
+ # Defines which key will be used when locking and unlocking an account
156
+ # config.unlock_keys = [ :email ]
157
+
158
+ # Defines which strategy will be used to unlock an account.
159
+ # :email = Sends an unlock link to the user email
160
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
161
+ # :both = Enables both strategies
162
+ # :none = No unlock strategy. You should handle unlocking by yourself.
163
+ # config.unlock_strategy = :both
164
+
165
+ # Number of authentication tries before locking an account if lock_strategy
166
+ # is failed attempts.
167
+ # config.maximum_attempts = 20
168
+
169
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
170
+ # config.unlock_in = 1.hour
171
+
172
+ # Warn on the last attempt before the account is locked.
173
+ # config.last_attempt_warning = false
174
+
175
+ # ==> Configuration for :recoverable
176
+ #
177
+ # Defines which key will be used when recovering the password for an account
178
+ # config.reset_password_keys = [ :email ]
179
+
180
+ # Time interval you can reset your password with a reset password key.
181
+ # Don't put a too small interval or your users won't have the time to
182
+ # change their passwords.
183
+ config.reset_password_within = 6.hours
184
+
185
+ # ==> Configuration for :encryptable
186
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
187
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
188
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
189
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
190
+ # REST_AUTH_SITE_KEY to pepper).
191
+ #
192
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
193
+ # config.encryptor = :sha512
194
+
195
+ # ==> Scopes configuration
196
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
197
+ # "users/sessions/new". It's turned off by default because it's slower if you
198
+ # are using only default views.
199
+ # config.scoped_views = false
200
+
201
+ # Configure the default scope given to Warden. By default it's the first
202
+ # devise role declared in your routes (usually :user).
203
+ # config.default_scope = :user
204
+
205
+ # Set this configuration to false if you want /users/sign_out to sign out
206
+ # only the current scope. By default, Devise signs out all scopes.
207
+ # config.sign_out_all_scopes = true
208
+
209
+ # ==> Navigation configuration
210
+ # Lists the formats that should be treated as navigational. Formats like
211
+ # :html, should redirect to the sign in page when the user does not have
212
+ # access, but formats like :xml or :json, should return 401.
213
+ #
214
+ # If you have any extra navigational formats, like :iphone or :mobile, you
215
+ # should add them to the navigational formats lists.
216
+ #
217
+ # The "*/*" below is required to match Internet Explorer requests.
218
+ # config.navigational_formats = ['*/*', :html]
219
+
220
+ # The default HTTP method used to sign out a resource. Default is :delete.
221
+ config.sign_out_via = :delete
222
+
223
+ # ==> OmniAuth
224
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
225
+ # up on your models and hooks.
226
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
227
+
228
+ # ==> Warden configuration
229
+ # If you want to use other strategies, that are not supported by Devise, or
230
+ # change the failure app, you can configure them inside the config.warden block.
231
+ #
232
+ # config.warden do |manager|
233
+ # manager.intercept_401 = false
234
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
235
+ # end
236
+
237
+ # ==> Mountable engine configurations
238
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
239
+ # is mountable, there are some extra configurations to be taken into account.
240
+ # The following options are available, assuming the engine is mounted as:
241
+ #
242
+ # mount MyEngine, at: '/my_engine'
243
+ #
244
+ # The router that invoked `devise_for`, in the example above, would be:
245
+ config.router_name = :rademade_admin
246
+ #
247
+ # When using omniauth, Devise cannot automatically set Omniauth path,
248
+ # so you need to do it manually. For the users scope, it would be:
249
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
250
+ end