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
@@ -2,12 +2,21 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Rademade Admin</title>
5
- <%= stylesheet_link_tag(:rademade_admin, :media => "all", "data-turbolinks-track" => true) %>
6
- <%= javascript_include_tag(:rademade_admin, "data-turbolinks-track" => true) %>
5
+ <%= stylesheet_link_tag(:rademade_admin, :media => 'all', 'data-turbolinks-track' => true) %>
6
+ <%= javascript_include_tag(:rademade_admin, 'data-turbolinks-track' => true) %>
7
7
  <%= csrf_meta_tags %>
8
- <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
9
8
  </head>
9
+
10
10
  <body>
11
- <%= yield %>
11
+ <div class="wrapper">
12
+ <%= yield %>
13
+ </div>
12
14
  </body>
15
+
16
+ <%= javascript_tag do %>
17
+ I18n.defaultLocale = "<%= I18n.default_locale %>";
18
+ I18n.locale = "<%= I18n.locale %>";
19
+ I18n.fallbacks = true;
20
+ <% end %>
21
+
13
22
  </html>
@@ -1,30 +1,37 @@
1
- <header class="navbar navbar-inverse">
2
-
3
- <div class="navbar-header">
4
- <button class="navbar-toggle" type="button" data-toggle="collapse" id="menu-toggler">
5
- <span class="sr-only">Toggle navigation</span>
6
- <span class="icon-bar"></span>
7
- <span class="icon-bar"></span>
8
- <span class="icon-bar"></span>
9
- </button>
10
-
11
- <a class="navbar-brand" href="<%=url_for(:root)%>">
12
- <img src="<%=image_path 'rademade_admin/logos/logo.png'%>" alt="logo">
13
- </a>
14
- </div>
15
-
16
- <ul class="nav navbar-nav pull-right hidden-xs">
17
- <li class="dropdown">
18
- <a href="javascript:void(0);" class="dropdown-toggle hidden-xs hidden-sm" data-toggle="dropdown">
19
- <span><%= @current_user %></span>
20
- <b class="caret"></b>
1
+ <header>
2
+ <div class="header">
3
+ <div class="fix">
4
+ <a class="header-logo fl-l" href="<%= url_for(:root) %>">
5
+ <img src="<%= image_path 'rademade_admin/logos/logo.png' %>" alt="Rademade admin">
21
6
  </a>
22
-
23
- <ul class="dropdown-menu">
24
- <li><%=link_to 'Exit', [:logout, :sessions], {:method => :delete}%></li>
25
- </ul>
26
-
27
- </li>
28
- </ul>
29
-
7
+ <div class="fl-r">
8
+ <form class="header-search fl-l" role="search">
9
+ <div class="header-search-box">
10
+ <input type="text" class="header-search-input" placeholder="<%= t('rademade_admin.search') %>">
11
+ </div>
12
+ <button type="submit" class="header-search-btn"><%= t('rademade_admin.submit') %></button>
13
+ </form>
14
+ <div class="header-menu fl-l">
15
+ <div class="menu-item">
16
+ <span class="menu-link disabled"><%= @current_user %> <b class="caret"></b></span>
17
+ </div>
18
+ <div class="menu-item js-box">
19
+ <span class="menu-link js-link"><i class="glyphicon glyphicon-list"></i></span>
20
+ <div class="menu-droplist js-droplist">
21
+ <%# <div class="menu-droplist-header">Active links</div>
22
+ <a class="menu-droplist-link" href="#">Link</a>
23
+ <a class="menu-droplist-link" href="#">Link</a>
24
+ <div class="menu-droplist-header">Disable links</div>
25
+ <span class="menu-droplist-link disabled">Disable link</span>
26
+ <span class="menu-droplist-link disabled">Disable link</span> %>
27
+ <%= link_to t('rademade_admin.exit'), [:logout, :sessions], { :method => :delete, :class => 'menu-droplist-link last' } %>
28
+ </div>
29
+ </div>
30
+ <div class="menu-item">
31
+ <%= link_to t('rademade_admin.exit'), [:logout, :sessions], { :method => :delete, :class => 'menu-link last' } %>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
30
37
  </header>
@@ -1,45 +1,42 @@
1
- <div id="sidebar-nav">
1
+ <div id="sidebar-nav" class="content-menu">
2
2
  <ul id="dashboard-menu"><%
3
3
  main_menu.each do |menu_item|
4
4
  has_sub_items = (menu_item[:sub].is_a? Array and menu_item[:sub].size > 0)
5
5
  if has_sub_items || menu_item[:uri]
6
- item_name = menu_item[:name] || admin_list_name(menu_item[:model_info], false)
6
+ item_name = menu_item[:name] || menu_item[:model_info].item_name
7
7
  is_active = active?(menu_item)
8
- %><li<%
8
+ %><li class="menu-box<%
9
9
  if is_active
10
- %> class="active"<%
10
+ %> active<%
11
11
  end
12
- %>>
13
-
14
- <% if is_active %>
15
- <div class="pointer">
12
+ %>"><%
13
+ if is_active
14
+ %><div class="pointer">
16
15
  <div class="arrow"></div>
17
16
  <div class="arrow_border"></div>
18
- </div>
19
- <% end %>
17
+ </div><%
18
+ end
20
19
 
21
- <a href="<%= menu_item[:uri] %>"<%
20
+ %><a href="<%= menu_item[:uri] %>" class="menu-link<%
22
21
  if has_sub_items
23
- %> class="dropdown-toggle"<%
22
+ %> dropdown-toggle<%
24
23
  end
25
- %>>
24
+ %>">
26
25
  <i class="<%= menu_item[:ico] %>"></i>
27
- <span><%= item_name %></span>
28
- <% if has_sub_items %>
29
- <i class="fa fa-chevron-down"></i>
30
- <% end %>
31
- </a><%
32
-
26
+ <span><%= item_name %></span><%
27
+ if has_sub_items
28
+ %><span class="caret"></span><%
29
+ end
30
+ %></a><%
33
31
  if has_sub_items
34
32
  %><ul class="submenu"><%
35
- concat render 'rademade_admin/_blocks/sub_menu/link', {
33
+ concat render @template_service.sub_menu_link_block, {
36
34
  :uri => admin_list_uri(menu_item[:model_info]),
37
- :title => admin_list_name(menu_item[:model_info])
35
+ :title => menu_item[:model_info].item_name
38
36
  }
39
- concat render 'rademade_admin/_blocks/sub_menu', :menu_item => menu_item
37
+ concat render @template_service.sub_menu_block, :menu_item => menu_item
40
38
  %></ul><%
41
39
  end
42
-
43
40
  %></li><%
44
41
  end
45
42
  end
@@ -0,0 +1,15 @@
1
+ <div class="select-list fl-r">
2
+ <div class="select-list-text fl-l">
3
+ <span><%= t('rademade_admin.show_results') %></span>
4
+ </div>
5
+ <div class="select-list-box fl-r">
6
+ <form action="#" method="get">
7
+ <select class="btn blue-btn select-btn fl-l" id="perPageSelect" name="paginate"><%
8
+ [20, 40, 60].each do |per_page|
9
+ concat pagination_option(per_page)
10
+ end
11
+ %></select>
12
+ </form>
13
+ </div>
14
+ </div>
15
+ <div class="clear"></div>
@@ -1,18 +1 @@
1
- <div class="paginator">
2
- <%= paginate @items %>
3
- </div>
4
-
5
- <div class="paginator-stats">
6
- <%= page_entries_info @items %><br>
7
- <span>Show results on page</span>
8
- </div>
9
-
10
- <div class="paginator-controll">
11
- <form action="#" method="get">
12
- <select id="perPageSelect" name="paginate"><%
13
- [20, 40, 60].each do |per_page|
14
- concat pagination_option(per_page)
15
- end
16
- %></select>
17
- </form>
18
- </div>
1
+ <%= paginate @items, :params => {:admin_params => {}} %>
@@ -1,10 +1,10 @@
1
1
  <ul class="submenu"><%
2
2
  menu_item[:sub].each do |sub_item|
3
- concat render 'rademade_admin/_blocks/sub_menu/link', {
3
+ concat render @template_service.sub_menu_link_block, {
4
4
  :uri => admin_list_uri(sub_item[:model_info]),
5
- :title => admin_list_name(sub_item[:model_info])
5
+ :title => sub_item[:model_info].item_name
6
6
  }
7
- concat render 'rademade_admin/_blocks/sub_menu', {
7
+ concat render @template_service.sub_menu_block, {
8
8
  :menu_item => sub_item
9
9
  }
10
10
  end
@@ -0,0 +1,3 @@
1
+ <%= f.button :submit, :class => 'blue-btn' %>
2
+ <span class="btn-sep"><%= t('rademade_admin.or') %></span>
3
+ <%= link_to t('rademade_admin.cancel'), admin_list_uri(@model), :class => 'cancel-btn' %>
@@ -0,0 +1,19 @@
1
+ <%
2
+ if @form_fields_with_locale.length > 0
3
+ %><div data-lang-panel>
4
+ <ul><%
5
+ I18n.available_locales.each do |locale|
6
+ %><li class="btn blue-btn" style="margin-right: 10px; padding: 0px">
7
+ <a href="#locale-<%= locale %>" style="color: #ffffff; display: block; width: 37px; line-height: 30px"><%= locale %></a>
8
+ </li><%
9
+ end
10
+ %></ul><%
11
+ I18n.available_locales.each do |locale|
12
+ %><div id="locale-<%= locale %>"><%
13
+ @form_fields_with_locale.each do |form_field|
14
+ admin_localized_field(f, form_field, @model_info, locale)
15
+ end
16
+ %></div><%
17
+ end
18
+ %></div><%
19
+ end %>
@@ -1,5 +1,6 @@
1
- <% unless uri.nil? %>
2
- <li>
3
- <a href="<%= uri %>"><%= title %></a>
4
- </li>
5
- <% end %>
1
+ <%
2
+ unless uri.nil?
3
+ %><li class="menu-box">
4
+ <a class="menu-link" href="<%= uri %>"><%= title %></a>
5
+ </li><%
6
+ end %>
@@ -0,0 +1,13 @@
1
+ <thead class="table-header">
2
+ <tr class="table-line"><%
3
+ list_fields.each do |field|
4
+ %><th class="table-item" data-column="<%= field.name %>">
5
+ <span><%= field.label + @sortable_service.sorting_sign(field) %></span>
6
+ </th><%
7
+ end
8
+ %><th class="table-item">
9
+ <span class="line"></span>
10
+ <span><%= t('rademade_admin.management') %></span>
11
+ </th>
12
+ </tr>
13
+ </thead>
@@ -1,37 +1,25 @@
1
- <%= render :partial => 'rademade_admin/_blocks/header' %>
2
- <%= render :partial => 'rademade_admin/_blocks/menu' %>
3
- <div class="content">
4
- <div id="pad-wrapper" class="form-page">
5
- <div class="table-wrapper products-table">
6
-
7
- <div class="row">
8
- <div class="breadcrumbs col-md-12">
9
- <%= link_to 'Dashboard', :root %>
10
- <% if content_for?(:last_crumbs) %>
11
- <span class="separator">-></span>
12
- <%= yield(:last_crumbs) %>
13
- <% end %>
14
- </div>
1
+ <%
2
+ concat render @template_service.header_block
3
+ %><div class="page">
4
+ <div class="fix"><%
5
+ concat render @template_service.menu_block
6
+ %><div id="pad-wrapper" class="content"><%
7
+ concat breadcrumbs.render(:format => :rademade)
8
+ %><div class="table-wrapper products-table content-box"><%
9
+ if content_for?(:page_header)
10
+ %><div class="page-headline">
11
+ <%= yield(:page_header) %> <span class="small-desc hide">In this field small page description</span>
12
+ </div><%
13
+ end
14
+ if content_for?(:nav_buttons)
15
+ %><div class="row filter-block">
16
+ <div class="pull-right">
17
+ <%= yield(:nav_buttons) %>
18
+ </div>
19
+ </div><%
20
+ end
21
+ %><%= yield(:content) if content_for?(:content) %>
15
22
  </div>
16
-
17
- <% if content_for?(:page_header) %>
18
- <div class="row head">
19
- <div class="col-md-12">
20
- <%= yield(:page_header) %>
21
- </div>
22
- </div>
23
- <% end %>
24
-
25
- <% if content_for?(:nav_buttons) %>
26
- <div class="row filter-block">
27
- <div class="pull-right">
28
- <%= yield(:nav_buttons) %>
29
- </div>
30
- </div>
31
- <% end %>
32
-
33
- <%= yield(:content) if content_for?(:content) %>
34
-
35
23
  </div>
36
24
  </div>
37
25
  </div>
@@ -1,15 +1,8 @@
1
- <% content_for(:last_crumbs) do %>
2
- <%= link_to @item_name + ' list', admin_list_uri(@model_info) %>
3
- <span class="separator">-></span>
4
- <%= yield(:form_last_crumbs) if content_for?(:form_last_crumbs) %>
5
- <% end %>
6
-
7
1
  <% content_for(:content) do %>
8
2
  <div class="row form-wrapper">
9
- <div class="col-md-9 with-sidebar">
10
- <%= render @form_template_path %>
11
- </div>
12
- </div>
13
- <% end %>
14
-
15
- <%= render :template => 'rademade_admin/_layouts/inner' %>
3
+ <div class="col-md-9 with-sidebar"><%
4
+ concat render @form_template_path
5
+ %></div>
6
+ </div><%
7
+ end
8
+ concat render :template => @template_service.inner_layout %>
@@ -1,59 +1,35 @@
1
- <% content_for :content do %>
2
- <% if @sortable_service.can_reset? %>
3
- <a href="<%= request.path %>">Reset sorting</a>
4
- <% end %>
5
- <table class="table table-hover">
6
-
7
- <thead>
8
- <tr>
9
- <% @list_fields.each_with_index do |name, index| %>
10
- <th class="col-md-3 sort-button" data-column="<%=name%>">
11
- <% unless index == 0 %>
12
- <span class="line"></span>
13
- <% end %>
14
- <span><%= field_to_label(name) + @sortable_service.sorting_sign(name) %></span>
15
- </th>
16
- <% end %>
17
-
18
- <th class="col-md-3 align-right">
19
- <span class="line"></span>
20
- <span>Management</span>
21
- </th>
22
- </tr>
23
- </thead>
24
-
25
- <% has_position = @sortable_service.has_position? %>
26
- <tbody class="table-sortable" data-position='<%= has_position %>'>
27
- <% @items.each_with_index do |item, index| %>
28
- <tr<%
1
+ <% content_for :content do %><%
2
+ concat render @template_service.on_page_select_block
3
+ if @sortable_service.can_reset?
4
+ %><a href="<%= request.path %>"><%= t('rademade_admin.reset_sort') %></a><%
5
+ end
6
+ %><table class="table-box"><%
7
+ concat render @template_service.table_head_block, {
8
+ :list_fields => @list_fields
9
+ }
10
+ has_position = @sortable_service.has_position?
11
+ %><tbody class="table-content" data-sortable="<%= has_position %>"><%
12
+ @items.each do |item|
13
+ %><tr id="item_<%= item.id %>" class="table-line" data-id="<%= item.id %>"<%
29
14
  if has_position
30
- %> id='<%= item.position %>'<%
15
+ %> data-position="<%= item.position %>"<%
31
16
  end
32
- %> data-id='<%= item.id %>'>
33
- <% @list_fields.each do |name|
34
- %><td><%
35
- td_data = item.send(name)
36
- if td_data.is_a? Mongoid::Document #rm_todo remove hard code, extract helper (data adapter)
37
- concat link_to td_data.to_s, admin_edit_uri(td_data)
38
- else
39
- concat td_data
40
- end
41
- %></td>
42
- <% end %>
43
- <td>
44
- <ul class="actions">
45
- <li><%= link_to 'Edit', admin_edit_uri(item) %></li>
46
- <li><%= button_to 'Destroy', admin_delete_uri(item), {
17
+ %>><%
18
+ @list_fields.each do |field|
19
+ %><td class="table-item"><%= display_item_value(item, field) %></td><%
20
+ end
21
+ %><td class="table-item">
22
+ <span class="table-actions"><%
23
+ concat link_to t('rademade_admin.edit'), admin_edit_uri(item), :class => 'glyphicon glyphicon-pencil fl-l'
24
+ concat button_to t('rademade_admin.destroy'), admin_delete_uri(item), {
47
25
  :method => :delete,
48
- :form => {:class => 'delete-item-form'}
49
- } %></li>
50
- </ul>
26
+ :form => { :class => 'delete-item-form' }
27
+ }
28
+ %></span>
51
29
  </td>
52
- </tr>
53
- <% end %>
54
- </tbody>
55
- </table>
56
-
57
- <%= render 'rademade_admin/_blocks/pagination' %>
58
-
59
- <% end %>
30
+ </tr><%
31
+ end
32
+ %></tbody>
33
+ </table><%
34
+ concat render @template_service.pagination_block
35
+ end %>
@@ -1,54 +1,26 @@
1
- <% content_for :content do %>
2
- <table class="table table-hover">
3
- <thead>
4
- <tr>
5
- <% @list_fields.each_with_index do |name, index| %>
6
- <th class="col-md-3 sort-button" data-column="<%=name%>">
7
- <% unless index == 0 %>
8
- <span class="line"></span>
9
- <% end %>
10
- <span><%= field_to_label(name) + @sortable_service.sorting_sign(name) %></span>
11
- </th>
12
- <% end %>
13
-
14
- <th class="col-md-3 align-right">
15
- <span class="line"></span>
16
- <span>Management</span>
17
- </th>
18
- </tr>
19
- </thead>
20
-
21
- <% has_position = @sortable_service.has_position? %>
22
- <tbody data-position='false'>
23
- <% @items.each_with_index do |item, index| %>
24
- <tr<%
25
- if has_position
26
- %> id='<%= item.position %>'<%
27
- end
28
- %> data-id='<%= item.id %>'>
29
- <% @list_fields.each do |name|
30
- %><td><%
31
- td_data = item.send(name)
32
- if td_data.is_a? Mongoid::Document #rm_todo remove hard code, extract helper (data adapter)
33
- concat link_to td_data.to_s, admin_edit_uri(td_data)
34
- else
35
- concat td_data
36
- end
37
- %></td>
38
- <% end %>
39
- <td>
40
- <ul class="actions">
41
- <li><%= button_to 'Unlink', admin_unlink_uri(item, params[:parent], params[:parent_id]), {
42
- :method => :patch,
43
- :form => {:class => 'delete-item-form'}
44
- } %></li>
45
- </ul>
46
- </td>
47
- </tr>
48
- <% end %>
49
- </tbody>
50
- </table>
51
-
52
- <%= render 'rademade_admin/_blocks/pagination' %>
53
-
54
- <% end %>
1
+ <% content_for :content do %><%
2
+ concat render @template_service.on_page_select_block
3
+ %><table class="table-box"><%
4
+ concat render @template_service.table_head_block, {
5
+ :list_fields => @list_fields
6
+ }
7
+ %><tbody class="table-content" data-sortable="false"><%
8
+ @items.each do |item|
9
+ %><tr id="item_<%= item.id %>" class="table-line" data-id="<%= item.id %>"><%
10
+ @list_fields.each do |field|
11
+ %><td class="table-item"><%= display_item_value(item, field) %></td><%
12
+ end
13
+ %><td class="table-item">
14
+ <span class="table-actions"><%
15
+ concat button_to t('rademade_admin.unlink'), admin_unlink_uri(item, params[:parent], params[:parent_id]), {
16
+ :method => :patch,
17
+ :form => { :class => 'delete-item-form' }
18
+ }
19
+ %></span>
20
+ </td>
21
+ </tr><%
22
+ end
23
+ %></tbody>
24
+ </table><%
25
+ concat render @template_service.pagination_block
26
+ end %>