rademade_admin 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  3. data/app/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  4. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  5. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  6. data/app/assets/images/rademade_admin/ico/btn-attach.png +0 -0
  7. data/app/assets/images/rademade_admin/logos/logo.png +0 -0
  8. data/app/assets/javascripts/rademade_admin.coffee +8 -4
  9. data/app/assets/javascripts/rademade_admin/app/app.coffee +2 -1
  10. data/app/assets/javascripts/rademade_admin/app/common/datetime-picker.coffee +7 -0
  11. data/app/assets/javascripts/rademade_admin/app/common/dnd-sort.coffee +23 -32
  12. data/app/assets/javascripts/rademade_admin/app/common/droplist.coffee +8 -0
  13. data/app/assets/javascripts/rademade_admin/app/common/lang-panel.coffee +6 -0
  14. data/app/assets/javascripts/rademade_admin/app/common/related-index.coffee +6 -9
  15. data/app/assets/javascripts/rademade_admin/app/common/sort-list.coffee +10 -14
  16. data/app/assets/javascripts/rademade_admin/app/common/uploader.coffee +3 -3
  17. data/app/assets/javascripts/rademade_admin/app/form-popup/initializer.coffee +24 -37
  18. data/app/assets/javascripts/rademade_admin/app/form-popup/view.coffee +32 -18
  19. data/app/assets/javascripts/rademade_admin/app/forms/remove.coffee +4 -3
  20. data/app/assets/javascripts/rademade_admin/app/select2/model.coffee +7 -0
  21. data/app/assets/javascripts/rademade_admin/app/select2/related/collection-view.coffee +35 -0
  22. data/app/assets/javascripts/rademade_admin/app/select2/related/collection.coffee +28 -0
  23. data/app/assets/javascripts/rademade_admin/app/select2/related/model.coffee +15 -0
  24. data/app/assets/javascripts/rademade_admin/app/select2/related/view.coffee +40 -0
  25. data/app/assets/javascripts/rademade_admin/app/select2/view.coffee +78 -0
  26. data/app/assets/javascripts/rademade_admin/form/form-ajax.coffee +48 -0
  27. data/app/assets/javascripts/rademade_admin/form/form-initializater.coffee +45 -0
  28. data/app/assets/javascripts/rademade_admin/form/form-validation.coffee +42 -0
  29. data/app/assets/javascripts/rademade_admin/form/form.coffee +62 -0
  30. data/app/assets/javascripts/rademade_admin/library/ckeditor/config.js +14 -12
  31. data/app/assets/stylesheets/{rademade_admin/bootstrap → old/-bootstrap}/bootstrap-overrides.css.erb +0 -0
  32. data/app/assets/stylesheets/{rademade_admin/bootstrap → old/-bootstrap}/main.scss.erb +0 -0
  33. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/chart-showcase.scss.erb +0 -0
  34. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/datatables.scss.erb +0 -0
  35. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/elements.scss.erb +0 -0
  36. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/error.scss.erb +0 -0
  37. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/form-showcase.scss.erb +0 -0
  38. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/form-wizard.scss.erb +0 -0
  39. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/gallery.scss.erb +0 -0
  40. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/grids.scss.erb +0 -0
  41. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/icons.scss.erb +0 -0
  42. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/index.scss.erb +0 -0
  43. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/layout.scss.erb +0 -0
  44. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/new-user.scss.erb +0 -0
  45. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/personal-info.scss.erb +0 -0
  46. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/popup.scss.erb +0 -0
  47. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/signin.scss.erb +0 -0
  48. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/tables.scss.erb +0 -0
  49. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/ui-elements.scss.erb +0 -0
  50. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/user-list.scss.erb +0 -0
  51. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/user-profile.scss.erb +0 -0
  52. data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/web-app-icons.scss.erb +0 -0
  53. data/app/assets/stylesheets/{rademade_admin/lib → old/-lib}/bootstrap.datepicker.css.erb +0 -0
  54. data/app/assets/stylesheets/{rademade_admin/lib → old/-lib}/morris.css.erb +0 -0
  55. data/app/assets/stylesheets/{rademade_admin → old}/base.scss.erb +0 -0
  56. data/app/assets/stylesheets/{rademade_admin → old}/edit.css +0 -0
  57. data/app/assets/stylesheets/{rademade_admin → old}/file-upload.scss.erb +0 -0
  58. data/app/assets/stylesheets/{rademade_admin → old}/notifier.custom.css.erb +0 -0
  59. data/app/assets/stylesheets/{rademade_admin → old}/scaffolds.scss.erb +0 -0
  60. data/app/assets/stylesheets/rademade_admin.sass.erb +96 -0
  61. data/app/assets/stylesheets/rademade_admin/base/main.sass +71 -0
  62. data/app/assets/stylesheets/rademade_admin/blocks/buttons/main.sass +81 -0
  63. data/app/assets/stylesheets/rademade_admin/blocks/form/input.sass +29 -0
  64. data/app/assets/stylesheets/rademade_admin/blocks/form/label.sass +31 -0
  65. data/app/assets/stylesheets/rademade_admin/blocks/form/select.sass +26 -0
  66. data/app/assets/stylesheets/rademade_admin/blocks/form/select2.sass +67 -0
  67. data/app/assets/stylesheets/rademade_admin/blocks/form/table.sass +42 -0
  68. data/app/assets/stylesheets/rademade_admin/blocks/form/texarea.sass +20 -0
  69. data/app/assets/stylesheets/rademade_admin/blocks/header/_logo.sass +7 -0
  70. data/app/assets/stylesheets/rademade_admin/blocks/header/_menu.sass +80 -0
  71. data/app/assets/stylesheets/rademade_admin/blocks/header/_search.sass +37 -0
  72. data/app/assets/stylesheets/rademade_admin/blocks/page/content/_main.sass +11 -0
  73. data/app/assets/stylesheets/rademade_admin/blocks/page/headline/main.sass +44 -0
  74. data/app/assets/stylesheets/rademade_admin/blocks/page/menu/_main.sass +31 -0
  75. data/app/assets/stylesheets/rademade_admin/lib/datepicker.sass +373 -0
  76. data/app/assets/stylesheets/rademade_admin/lib/glyphicon.sass.erb +618 -0
  77. data/app/assets/stylesheets/rademade_admin/lib/notifier.css.erb +661 -0
  78. data/app/assets/stylesheets/rademade_admin/lib/uploader.sass +66 -0
  79. data/app/assets/stylesheets/rademade_admin/mixins/clear.sass +5 -0
  80. data/app/assets/stylesheets/rademade_admin/mixins/fonts.sass +8 -0
  81. data/app/assets/stylesheets/rademade_admin/mixins/sprite.sass +7 -0
  82. data/app/assets/stylesheets/rademade_admin/mixins/text-overflow.sass +6 -0
  83. data/app/assets/stylesheets/rademade_admin/mixins/user-select.sass +5 -0
  84. data/app/assets/stylesheets/rademade_admin/modules/breadcrumbs/main.sass +30 -0
  85. data/app/assets/stylesheets/rademade_admin/modules/errors/error.sass.erb +19 -0
  86. data/app/assets/stylesheets/rademade_admin/modules/form/main.sass +15 -0
  87. data/app/assets/stylesheets/rademade_admin/modules/header/main.sass +6 -0
  88. data/app/assets/stylesheets/rademade_admin/modules/login/_main.sass +79 -0
  89. data/app/assets/stylesheets/rademade_admin/modules/main-menu/main.sass +0 -0
  90. data/app/assets/stylesheets/rademade_admin/modules/page/main.sass +16 -0
  91. data/app/assets/stylesheets/rademade_admin/modules/pagination/main.sass +51 -0
  92. data/app/assets/stylesheets/rademade_admin/modules/popup/new.sass +18 -0
  93. data/app/assets/stylesheets/rademade_admin/var/colors.sass +0 -0
  94. data/app/assets/stylesheets/rademade_admin/var/images.sass +2 -0
  95. data/app/assets/stylesheets/rademade_admin/var/width.sass +13 -0
  96. data/app/controllers/rademade_admin/abstract_controller.rb +18 -2
  97. data/app/controllers/rademade_admin/application_controller.rb +1 -1
  98. data/app/controllers/rademade_admin/dashboard_controller.rb +1 -1
  99. data/app/controllers/rademade_admin/file_controller.rb +25 -0
  100. data/app/controllers/rademade_admin/model_controller.rb +66 -47
  101. data/app/controllers/rademade_admin/sessions_controller.rb +3 -3
  102. data/app/helpers/rademade_admin/field_helper.rb +21 -32
  103. data/app/helpers/rademade_admin/form_helper.rb +57 -27
  104. data/app/helpers/rademade_admin/menu_helper.rb +12 -5
  105. data/app/helpers/rademade_admin/uri_helper.rb +50 -62
  106. data/app/inputs/rademade_admin/date_time_input.rb +13 -0
  107. data/app/inputs/rademade_admin/file_input.rb +72 -0
  108. data/app/inputs/rademade_admin/related_select_input.rb +78 -0
  109. data/app/serializers/autocomplete/link_serializer.rb +6 -4
  110. data/app/services/linker.rb +8 -14
  111. data/app/services/login.rb +5 -3
  112. data/app/services/model_controller/breadcrumbs.rb +36 -0
  113. data/app/services/model_controller/instance_options.rb +7 -5
  114. data/app/services/model_controller/model_options.rb +10 -7
  115. data/app/services/model_controller/notifier.rb +10 -6
  116. data/app/services/model_controller/templates.rb +4 -3
  117. data/app/services/relation_service.rb +11 -0
  118. data/app/services/saver.rb +59 -24
  119. data/app/services/search/conditions/abstract.rb +15 -14
  120. data/app/services/search/conditions/autocomplete.rb +11 -9
  121. data/app/services/search/conditions/list.rb +6 -5
  122. data/app/services/search/conditions/related_list.rb +17 -13
  123. data/app/services/search/{conditions/part/where.rb → part/abstract.rb} +7 -9
  124. data/app/services/search/part/order.rb +17 -0
  125. data/app/services/search/part/where.rb +19 -0
  126. data/app/services/sortable_service.rb +27 -27
  127. data/app/services/template_service.rb +68 -0
  128. data/app/services/upload/preview_service.rb +86 -0
  129. data/app/views/layouts/rademade_admin.html.erb +13 -4
  130. data/app/views/rademade_admin/_blocks/_header.html.erb +35 -28
  131. data/app/views/rademade_admin/_blocks/_menu.html.erb +20 -23
  132. data/app/views/rademade_admin/_blocks/_on_page_select.html.erb +15 -0
  133. data/app/views/rademade_admin/_blocks/_pagination.html.erb +1 -18
  134. data/app/views/rademade_admin/_blocks/_sub_menu.html.erb +3 -3
  135. data/app/views/rademade_admin/_blocks/form/_control.html.erb +3 -0
  136. data/app/views/rademade_admin/_blocks/form/_lang_panel.html.erb +19 -0
  137. data/app/views/rademade_admin/_blocks/sub_menu/_link.html.erb +6 -5
  138. data/app/views/rademade_admin/_blocks/table/_head.html.erb +13 -0
  139. data/app/views/rademade_admin/_layouts/inner.html.erb +21 -33
  140. data/app/views/rademade_admin/_layouts/inner/form.html.erb +6 -13
  141. data/app/views/rademade_admin/_layouts/inner/index_table.html.erb +31 -55
  142. data/app/views/rademade_admin/_layouts/inner/related_index_table.html.erb +26 -54
  143. data/app/views/rademade_admin/abstract/_form.html.erb +6 -9
  144. data/app/views/rademade_admin/abstract/edit.html.erb +3 -8
  145. data/app/views/rademade_admin/abstract/index.html.erb +38 -67
  146. data/app/views/rademade_admin/abstract/new.html.erb +3 -8
  147. data/app/views/rademade_admin/abstract/related.html.erb +48 -0
  148. data/app/views/rademade_admin/dashboard/index.html.erb +4 -5
  149. data/app/views/rademade_admin/dashboard/login.html.erb +19 -30
  150. data/config/initializers/carrier_wave/mongoid.rb +48 -0
  151. data/config/initializers/ckeditor.rb +3 -0
  152. data/config/initializers/kaminari_route_proxy.rb +16 -0
  153. data/config/initializers/simple_form.rb +147 -0
  154. data/config/initializers/simple_form/rademade_component.rb +9 -0
  155. data/config/initializers/simple_form/wrappers.rb +28 -0
  156. data/config/locales/rademade_admin.en.yml +28 -0
  157. data/config/locales/simple_form.en.yml +26 -0
  158. data/config/routes.rb +1 -2
  159. data/lib/rademade_admin.rb +7 -5
  160. data/lib/rademade_admin/bower/performer.rb +1 -1
  161. data/lib/rademade_admin/breadcrumbs/render/rademade.rb +31 -0
  162. data/lib/rademade_admin/engine.rb +2 -2
  163. data/lib/rademade_admin/input/related_select_input/model_data.rb +40 -0
  164. data/lib/rademade_admin/input/related_select_input/related_list.rb +60 -0
  165. data/lib/rademade_admin/model/adapter/data.rb +119 -0
  166. data/lib/rademade_admin/model/adapter/data/active_record.rb +109 -0
  167. data/lib/rademade_admin/model/adapter/data/mongoid.rb +77 -0
  168. data/{app/services/search/query_adapter/abstract.rb → lib/rademade_admin/model/adapter/query.rb} +15 -5
  169. data/lib/rademade_admin/model/adapter/query/active_record.rb +50 -0
  170. data/lib/rademade_admin/model/adapter/query/mongoid.rb +57 -0
  171. data/lib/rademade_admin/model/configuration.rb +43 -16
  172. data/lib/rademade_admin/model/configuration/field_label.rb +16 -0
  173. data/lib/rademade_admin/model/configuration/fields.rb +47 -21
  174. data/lib/rademade_admin/model/configuration/fields_labels.rb +31 -0
  175. data/lib/rademade_admin/model/configuration/form_field.rb +27 -0
  176. data/lib/rademade_admin/model/configuration/form_fields.rb +18 -0
  177. data/lib/rademade_admin/model/configuration/list_field.rb +21 -0
  178. data/lib/rademade_admin/model/configuration/list_fields.rb +18 -0
  179. data/lib/rademade_admin/model/graph.rb +9 -9
  180. data/lib/rademade_admin/model/info.rb +53 -68
  181. data/lib/rademade_admin/model/info/data_item.rb +130 -0
  182. data/lib/rademade_admin/model/info/data_items.rb +130 -0
  183. data/lib/rademade_admin/model/info/field.rb +39 -0
  184. data/lib/rademade_admin/model/info/fields.rb +87 -0
  185. data/lib/rademade_admin/model/info/relation.rb +49 -0
  186. data/lib/rademade_admin/model/info/relations.rb +40 -0
  187. data/lib/rademade_admin/model/info/uploader.rb +16 -0
  188. data/lib/rademade_admin/model/info/uploaders.rb +35 -0
  189. data/lib/rademade_admin/model/reflection.rb +38 -9
  190. data/lib/rademade_admin/routing/mapper.rb +9 -5
  191. data/lib/rademade_admin/search/searcher.rb +22 -0
  192. data/lib/rademade_admin/sortable.rb +1 -0
  193. data/lib/rademade_admin/uploader/photo.rb +1 -0
  194. data/lib/rademade_admin/user.rb +7 -6
  195. data/lib/rademade_admin/version.rb +1 -1
  196. data/lib/tasks/rademade_bower_install.rake +10 -2
  197. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  198. metadata +195 -109
  199. data/app/assets/javascripts/rademade_admin/app/common/relation-list.coffee +0 -109
  200. data/app/assets/javascripts/rademade_admin/app/form-popup/collection.coffee +0 -20
  201. data/app/assets/javascripts/rademade_admin/app/form-popup/model.coffee +0 -4
  202. data/app/assets/javascripts/rademade_admin/detail_admin/theme.js +0 -56
  203. data/app/assets/javascripts/rademade_admin/form/form-ajax-submit.coffee +0 -157
  204. data/app/assets/stylesheets/rademade_admin.scss.erb +0 -19
  205. data/app/helpers/rademade_admin/name_helper.rb +0 -18
  206. data/app/helpers/rademade_admin/upload_preview_helper.rb +0 -60
  207. data/app/inputs/rademade_admin/admin_file_input.rb +0 -71
  208. data/app/inputs/rademade_admin/admin_select_input.rb +0 -82
  209. data/app/inputs/rademade_admin/admin_textarea_input.rb +0 -6
  210. data/app/inputs/rademade_admin/boolean_input.rb +0 -14
  211. data/app/services/form_builder.rb +0 -4
  212. data/app/services/search/query_adapter/active_record.rb +0 -45
  213. data/app/services/search/query_adapter/mongoid.rb +0 -51
  214. data/app/services/search/searcher.rb +0 -20
  215. data/app/views/rademade_admin/_blocks/_form_control.html.erb +0 -5
  216. data/app/views/rademade_admin/abstract/related_index.html.erb +0 -85
  217. data/config/initializers/devise.rb +0 -251
  218. data/config/initializers/formtastic.rb +0 -13
  219. data/lib/rademade_admin/model/data_adapter.rb +0 -64
  220. data/lib/rademade_admin/model/data_adapter/active_record.rb +0 -59
  221. data/lib/rademade_admin/model/data_adapter/mongoid.rb +0 -54
  222. data/lib/rademade_admin/model/reflection/data.rb +0 -48
  223. data/lib/rademade_admin/model/reflection/uploader.rb +0 -18
@@ -0,0 +1,66 @@
1
+ .uploader-block
2
+ .uploader-wrapper
3
+ position: relative
4
+ width: 250px
5
+ overflow: hidden
6
+ +box-sizing(border-box)
7
+
8
+ .file-preview-wrapper
9
+ width: 250px
10
+ padding: 0 5px
11
+ height: 34px
12
+ background-color: #fff
13
+ border: 1px solid #cccccc
14
+ +to
15
+ +box-sizing(border-box)
16
+ +border-radius(4px)
17
+ span
18
+ font-size: 14px
19
+ line-height: 34px
20
+ color: #555
21
+
22
+ .image-preview-wrapper,
23
+ .video-preview-wrapper
24
+ display: table-cell
25
+ width: 250px
26
+ padding: 5px
27
+ height: 150px
28
+ vertical-align: middle
29
+ text-align: center
30
+ background-color: #fff
31
+ border: 1px solid #cccccc
32
+ +box-sizing(border-box)
33
+ +border-radius(4px)
34
+
35
+ .no-file
36
+ font-size: 14px
37
+ line-height: 19px
38
+ color: #555
39
+
40
+ .uploader-input-file
41
+ position: absolute
42
+ top: 0
43
+ right: 0
44
+ font-size: 500px
45
+ text-align: right
46
+ z-index: 2
47
+ +opacity(0)
48
+
49
+ .upload-btn
50
+ float: left
51
+ margin-top: 10px
52
+
53
+ .upload-progress-wrapper
54
+ display: none
55
+ float: right
56
+ margin-top: 18px
57
+ width: 130px
58
+ height: 10px
59
+ border: 1px solid #bdc3c7
60
+ +border-radius(11px)
61
+
62
+ .upload-progress
63
+ height: 100%
64
+ width: 0
65
+ background: #00c83e
66
+ +border-radius(11px)
@@ -0,0 +1,5 @@
1
+ =clear
2
+ &:after
3
+ display: table
4
+ content: " "
5
+ clear: both
@@ -0,0 +1,8 @@
1
+ =arial
2
+ font-family: "Arial", sans-serif
3
+
4
+ =payfair
5
+ font-family: 'Playfair Display', serif
6
+
7
+ =glyph
8
+ font-family: 'Glyphicons Halflings'
@@ -0,0 +1,7 @@
1
+ $ico-layout: horizontal
2
+ $ico-spacing: 10px
3
+ $ico-sprite-dimensions: true
4
+
5
+ @import "rademade_admin/ico/*.png"
6
+
7
+ +all-ico-sprites
@@ -0,0 +1,6 @@
1
+ =to
2
+ white-space: nowrap
3
+ overflow: hidden
4
+ text-overflow: ellipsis
5
+ -o-text-overflow: ellipsis
6
+ -moz-text-overflow: ellipsis
@@ -0,0 +1,5 @@
1
+ =user-select
2
+ -webkit-user-select: none
3
+ -moz-user-select: none
4
+ -ms-user-select: none
5
+ user-select: none
@@ -0,0 +1,30 @@
1
+ .breadcrumbs
2
+ padding: 11px 20px
3
+ list-style: none
4
+ background-color: #ecf0f1
5
+ border-bottom: 1px solid #bdc3c7
6
+ +border-radius(0 4px 0 0)
7
+ +clear
8
+
9
+ .breadcrumbs-link
10
+ float: left
11
+ color: #428bca
12
+ font-size: 14px
13
+ line-height: 14px
14
+ border-bottom: 1px solid transparent
15
+ &:hover
16
+ border-bottom: 1px solid transparentize(#428bca,0.6)
17
+
18
+ &.current
19
+ color: #777
20
+ border-bottom: 1px solid transparent
21
+
22
+ .breadcrumbs-sep
23
+ float: left
24
+
25
+ &:before
26
+ padding: 0 5px 0 9px
27
+ color: #ccc
28
+ font-size: 14px
29
+ line-height: 14px
30
+ content: "/\00a0"
@@ -0,0 +1,19 @@
1
+
2
+ .error-message
3
+ position: absolute
4
+ top: 100%
5
+ left: 0
6
+ padding: 3px 10px 4px 10px
7
+ color: #fff
8
+ font-size: 12px
9
+ background-color: #cf7573
10
+ font-weight: bold
11
+ +arial
12
+
13
+ .error-buble
14
+ position: absolute
15
+ top: 0
16
+ left: -5px
17
+ width: 5px
18
+ height: 6px
19
+ /*background: url(<%=image_path('rademade_admin/icons/buble.png')%>) 0 0 no-repeat*/
@@ -0,0 +1,15 @@
1
+ .content
2
+ .form-box
3
+ position: relative
4
+ padding-left: 285px
5
+ margin-bottom: 20px
6
+ +clear
7
+ .form-label
8
+ position: absolute
9
+ top: 0
10
+ left: 0
11
+ width: 265px
12
+ .input-holder
13
+ float: left
14
+ width: 100%
15
+ max-width: 600px
@@ -0,0 +1,6 @@
1
+ .header
2
+ position: relative
3
+ height: 50px
4
+ background-color: #34495e
5
+ border-top: 0
6
+ +clear
@@ -0,0 +1,79 @@
1
+ .login-bg
2
+ position: absolute
3
+ top: 0
4
+ left: 0
5
+ width: 100%
6
+ height: 100%
7
+ background-color: #34495e
8
+
9
+ .admin-logo
10
+ position: absolute
11
+ top: 100px
12
+ left: 50%
13
+ margin-left: -88px
14
+ width: 175px
15
+ height: 20px
16
+
17
+ .login-form
18
+ position: absolute
19
+ top: 150px
20
+ left: 50%
21
+ margin-left: -200px
22
+ padding: 20px 30px
23
+ width: 400px
24
+ background-color: #ecf0f1
25
+ +box-sizing(border-box)
26
+ +border-radius(6px)
27
+
28
+ .login-form
29
+ li
30
+ list-style: none
31
+
32
+ .login-form-title
33
+ margin-bottom: 20px
34
+ color: #2c3e50
35
+ font-size: 25px
36
+ text-align: center
37
+
38
+
39
+ .form-input:focus + label
40
+ color: #34495e
41
+
42
+ .form-box
43
+ position: relative
44
+ margin-bottom: 20px
45
+ +clear
46
+
47
+ .form-label
48
+ position: absolute
49
+ float: none
50
+ width: auto
51
+ margin: 0
52
+ padding: 0
53
+ color: #bfc9ca
54
+ top: 14px
55
+ right: 15px
56
+ font-size: 20px
57
+ +glyph
58
+ &:after
59
+ display: none
60
+ &.password
61
+ right: 14px
62
+
63
+ .form-input
64
+ display: inline-block
65
+ width: 100%
66
+ border: 2px solid #fff
67
+ color: #34495e
68
+ font-size: 15px
69
+ padding: 8px 12px
70
+ height: 42px
71
+ background-color: #fff
72
+ +box-sizing(border-box)
73
+ +border-radius(6px)
74
+ +transition(border .25s linear, color .25s linear, background-color .25s linear)
75
+ &:focus
76
+ border: 2px solid #34495e
77
+ &:-webkit-autofill
78
+ color: #34495e
79
+ -webkit-box-shadow: 0 0 0px 1000px white inset
@@ -0,0 +1,16 @@
1
+ .page
2
+ margin-top: -50px
3
+ padding-top: 50px
4
+ width: 100%
5
+ height: 100%
6
+ min-height: 100%
7
+ +box-sizing(border-box)
8
+
9
+ .fix
10
+ position: relative
11
+ padding: 0
12
+ width: 100%
13
+ min-height: 100%
14
+ left: 300px
15
+ background: #ecf0f1
16
+ +clear
@@ -0,0 +1,51 @@
1
+ .pagination
2
+ margin-top: 25px
3
+ +clear
4
+ .first
5
+ padding: 0 15px
6
+ .prev
7
+ padding: 0 15px
8
+ .next
9
+ padding: 0 15px
10
+ .last
11
+ padding: 0 15px
12
+
13
+ span
14
+ float: left
15
+ margin: 0 -1px 0 0
16
+ padding: 0
17
+ width: auto
18
+ border: 1px solid #dddddd
19
+ +box-sizing(border-box)
20
+ &:first-child
21
+ +border-radius(4px 0 0 4px)
22
+ &:last-child
23
+ +border-radius(0 4px 4px 0)
24
+ &:hover
25
+ border-bottom: 1px solid #34495e
26
+ a
27
+ color: #34495e
28
+ a
29
+ display: inline-block
30
+ padding: 0 5px
31
+ min-width: 35px
32
+ height: 35px
33
+ line-height: 35px
34
+ font-size: 14px
35
+ color: #34495e
36
+ text-align: center
37
+ +box-sizing(border-box)
38
+ &.current
39
+ display: inline-block
40
+ padding: 0 5px
41
+ min-width: 37px
42
+ height: 37px
43
+ line-height: 35px
44
+ color: #fff
45
+ font-size: 14px
46
+ text-align: center
47
+ background-color: #34495e
48
+ border: 1px solid #dddddd
49
+ +box-sizing(border-box)
50
+ a
51
+ color: #34495e
@@ -0,0 +1,18 @@
1
+ .add_new_popup
2
+ position: fixed
3
+ top: -50px
4
+ left: 0
5
+ padding-top: 50px
6
+ width: 100%
7
+ height: 100%
8
+ overflow-y: scroll
9
+ min-height: 100%
10
+ background-color: rgba(0, 0, 0, 0.6)
11
+ z-index: 999
12
+
13
+ .simple_form
14
+ width: 700px
15
+ margin: 0 auto 50px auto
16
+ padding: 30px 35px
17
+ background-color: #ecf0f1
18
+ +box-sizing(4px)
@@ -0,0 +1,2 @@
1
+ $path: "../images/main/"
2
+ $pathImg: "../images/"
@@ -0,0 +1,13 @@
1
+ $fix-width: "only screen and (max-width : 960px)"
2
+ $width: device-width
3
+
4
+ @-webkit-viewport
5
+ width: $width
6
+ @-moz-viewport
7
+ width: $width
8
+ @-ms-viewport
9
+ width: $width
10
+ @-o-viewport
11
+ width: $width
12
+ @viewport
13
+ width: $width
@@ -1,18 +1,30 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module RademadeAdmin
3
3
  class AbstractController < ApplicationController
4
+
4
5
  include ::RademadeAdmin::UriHelper
6
+ include ::RademadeAdmin::Breadcrumbs
5
7
 
6
8
  layout 'rademade_admin'
7
9
 
8
- before_action :require_login
10
+ before_action :init_user, :init_template_service, :require_login, :root_breadcrumbs
9
11
 
10
12
  rescue_from ::CanCan::AccessDenied do |exception|
11
13
  redirect_to root_url, :alert => exception.message
12
14
  end
13
15
 
16
+ protected
17
+
14
18
  def require_login
15
- redirect_to :controller => 'dashboard', :action => 'login' unless user_signed_in?
19
+ redirect_to :controller => 'dashboard', :action => 'login' unless admin_logged_in?
20
+ end
21
+
22
+ def init_user
23
+ @current_user = RademadeAdmin.user_class.find(session[:user_id]) if session[:user_id].present?
24
+ end
25
+
26
+ def init_template_service
27
+ @template_service = RademadeAdmin::TemplateService.new('rademade_admin')
16
28
  end
17
29
 
18
30
  def render_errors(errors)
@@ -22,5 +34,9 @@ module RademadeAdmin
22
34
  }, :status => :unprocessable_entity
23
35
  end
24
36
 
37
+ def admin_logged_in?
38
+ @current_user.is_a? RademadeAdmin.user_class and @current_user.admin?
39
+ end
40
+
25
41
  end
26
42
  end
@@ -3,7 +3,7 @@ module RademadeAdmin
3
3
  class ApplicationController < ActionController::Base
4
4
 
5
5
  def current_ability
6
- @current_ability ||= RademadeAdmin::Ability.new(current_user)
6
+ @current_ability ||= RademadeAdmin::Ability.new(@current_user)
7
7
  end
8
8
 
9
9
  end
@@ -9,7 +9,7 @@ module RademadeAdmin
9
9
  end
10
10
 
11
11
  def login
12
- redirect_to :action => 'index' if user_signed_in?
12
+ redirect_to :action => 'index' if admin_logged_in?
13
13
  end
14
14
 
15
15
  end
@@ -0,0 +1,25 @@
1
+ # -*- encoding : utf-8 -*-
2
+ class RademadeAdmin::FileController < RademadeAdmin::AbstractController
3
+
4
+ def upload
5
+ param_key = params[:column].to_sym
6
+ uploader.store!(params[param_key])
7
+ upload_preview_service = RademadeAdmin::Upload::PreviewService.new(uploader)
8
+ render :json => {
9
+ :html => upload_preview_service.preview_html,
10
+ :file => uploader
11
+ }
12
+ rescue CarrierWave::UploadError => e
13
+ render :json => { :error => e.to_s }, :status => :unprocessable_entity
14
+ end
15
+
16
+ def uploader
17
+ @uploader ||= RademadeAdmin::LoaderService.const_get(params[:uploader]).new(model, params[:column])
18
+ end
19
+
20
+ def model
21
+ model_class = RademadeAdmin::LoaderService.const_get(params[:model])
22
+ params[:saved].to_i.zero? ? model_class.new : model_class.find(params[:id])
23
+ end
24
+
25
+ end