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.
- checksums.yaml +4 -4
- data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/images/rademade_admin/ico/btn-attach.png +0 -0
- data/app/assets/images/rademade_admin/logos/logo.png +0 -0
- data/app/assets/javascripts/rademade_admin.coffee +8 -4
- data/app/assets/javascripts/rademade_admin/app/app.coffee +2 -1
- data/app/assets/javascripts/rademade_admin/app/common/datetime-picker.coffee +7 -0
- data/app/assets/javascripts/rademade_admin/app/common/dnd-sort.coffee +23 -32
- data/app/assets/javascripts/rademade_admin/app/common/droplist.coffee +8 -0
- data/app/assets/javascripts/rademade_admin/app/common/lang-panel.coffee +6 -0
- data/app/assets/javascripts/rademade_admin/app/common/related-index.coffee +6 -9
- data/app/assets/javascripts/rademade_admin/app/common/sort-list.coffee +10 -14
- data/app/assets/javascripts/rademade_admin/app/common/uploader.coffee +3 -3
- data/app/assets/javascripts/rademade_admin/app/form-popup/initializer.coffee +24 -37
- data/app/assets/javascripts/rademade_admin/app/form-popup/view.coffee +32 -18
- data/app/assets/javascripts/rademade_admin/app/forms/remove.coffee +4 -3
- data/app/assets/javascripts/rademade_admin/app/select2/model.coffee +7 -0
- data/app/assets/javascripts/rademade_admin/app/select2/related/collection-view.coffee +35 -0
- data/app/assets/javascripts/rademade_admin/app/select2/related/collection.coffee +28 -0
- data/app/assets/javascripts/rademade_admin/app/select2/related/model.coffee +15 -0
- data/app/assets/javascripts/rademade_admin/app/select2/related/view.coffee +40 -0
- data/app/assets/javascripts/rademade_admin/app/select2/view.coffee +78 -0
- data/app/assets/javascripts/rademade_admin/form/form-ajax.coffee +48 -0
- data/app/assets/javascripts/rademade_admin/form/form-initializater.coffee +45 -0
- data/app/assets/javascripts/rademade_admin/form/form-validation.coffee +42 -0
- data/app/assets/javascripts/rademade_admin/form/form.coffee +62 -0
- data/app/assets/javascripts/rademade_admin/library/ckeditor/config.js +14 -12
- data/app/assets/stylesheets/{rademade_admin/bootstrap → old/-bootstrap}/bootstrap-overrides.css.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/bootstrap → old/-bootstrap}/main.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/chart-showcase.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/datatables.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/elements.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/error.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/form-showcase.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/form-wizard.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/gallery.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/grids.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/icons.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/index.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/layout.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/new-user.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/personal-info.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/popup.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/signin.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/tables.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/ui-elements.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/user-list.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/user-profile.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/detail_admin → old/-detail_admin}/web-app-icons.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/lib → old/-lib}/bootstrap.datepicker.css.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin/lib → old/-lib}/morris.css.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin → old}/base.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin → old}/edit.css +0 -0
- data/app/assets/stylesheets/{rademade_admin → old}/file-upload.scss.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin → old}/notifier.custom.css.erb +0 -0
- data/app/assets/stylesheets/{rademade_admin → old}/scaffolds.scss.erb +0 -0
- data/app/assets/stylesheets/rademade_admin.sass.erb +96 -0
- data/app/assets/stylesheets/rademade_admin/base/main.sass +71 -0
- data/app/assets/stylesheets/rademade_admin/blocks/buttons/main.sass +81 -0
- data/app/assets/stylesheets/rademade_admin/blocks/form/input.sass +29 -0
- data/app/assets/stylesheets/rademade_admin/blocks/form/label.sass +31 -0
- data/app/assets/stylesheets/rademade_admin/blocks/form/select.sass +26 -0
- data/app/assets/stylesheets/rademade_admin/blocks/form/select2.sass +67 -0
- data/app/assets/stylesheets/rademade_admin/blocks/form/table.sass +42 -0
- data/app/assets/stylesheets/rademade_admin/blocks/form/texarea.sass +20 -0
- data/app/assets/stylesheets/rademade_admin/blocks/header/_logo.sass +7 -0
- data/app/assets/stylesheets/rademade_admin/blocks/header/_menu.sass +80 -0
- data/app/assets/stylesheets/rademade_admin/blocks/header/_search.sass +37 -0
- data/app/assets/stylesheets/rademade_admin/blocks/page/content/_main.sass +11 -0
- data/app/assets/stylesheets/rademade_admin/blocks/page/headline/main.sass +44 -0
- data/app/assets/stylesheets/rademade_admin/blocks/page/menu/_main.sass +31 -0
- data/app/assets/stylesheets/rademade_admin/lib/datepicker.sass +373 -0
- data/app/assets/stylesheets/rademade_admin/lib/glyphicon.sass.erb +618 -0
- data/app/assets/stylesheets/rademade_admin/lib/notifier.css.erb +661 -0
- data/app/assets/stylesheets/rademade_admin/lib/uploader.sass +66 -0
- data/app/assets/stylesheets/rademade_admin/mixins/clear.sass +5 -0
- data/app/assets/stylesheets/rademade_admin/mixins/fonts.sass +8 -0
- data/app/assets/stylesheets/rademade_admin/mixins/sprite.sass +7 -0
- data/app/assets/stylesheets/rademade_admin/mixins/text-overflow.sass +6 -0
- data/app/assets/stylesheets/rademade_admin/mixins/user-select.sass +5 -0
- data/app/assets/stylesheets/rademade_admin/modules/breadcrumbs/main.sass +30 -0
- data/app/assets/stylesheets/rademade_admin/modules/errors/error.sass.erb +19 -0
- data/app/assets/stylesheets/rademade_admin/modules/form/main.sass +15 -0
- data/app/assets/stylesheets/rademade_admin/modules/header/main.sass +6 -0
- data/app/assets/stylesheets/rademade_admin/modules/login/_main.sass +79 -0
- data/app/assets/stylesheets/rademade_admin/modules/main-menu/main.sass +0 -0
- data/app/assets/stylesheets/rademade_admin/modules/page/main.sass +16 -0
- data/app/assets/stylesheets/rademade_admin/modules/pagination/main.sass +51 -0
- data/app/assets/stylesheets/rademade_admin/modules/popup/new.sass +18 -0
- data/app/assets/stylesheets/rademade_admin/var/colors.sass +0 -0
- data/app/assets/stylesheets/rademade_admin/var/images.sass +2 -0
- data/app/assets/stylesheets/rademade_admin/var/width.sass +13 -0
- data/app/controllers/rademade_admin/abstract_controller.rb +18 -2
- data/app/controllers/rademade_admin/application_controller.rb +1 -1
- data/app/controllers/rademade_admin/dashboard_controller.rb +1 -1
- data/app/controllers/rademade_admin/file_controller.rb +25 -0
- data/app/controllers/rademade_admin/model_controller.rb +66 -47
- data/app/controllers/rademade_admin/sessions_controller.rb +3 -3
- data/app/helpers/rademade_admin/field_helper.rb +21 -32
- data/app/helpers/rademade_admin/form_helper.rb +57 -27
- data/app/helpers/rademade_admin/menu_helper.rb +12 -5
- data/app/helpers/rademade_admin/uri_helper.rb +50 -62
- data/app/inputs/rademade_admin/date_time_input.rb +13 -0
- data/app/inputs/rademade_admin/file_input.rb +72 -0
- data/app/inputs/rademade_admin/related_select_input.rb +78 -0
- data/app/serializers/autocomplete/link_serializer.rb +6 -4
- data/app/services/linker.rb +8 -14
- data/app/services/login.rb +5 -3
- data/app/services/model_controller/breadcrumbs.rb +36 -0
- data/app/services/model_controller/instance_options.rb +7 -5
- data/app/services/model_controller/model_options.rb +10 -7
- data/app/services/model_controller/notifier.rb +10 -6
- data/app/services/model_controller/templates.rb +4 -3
- data/app/services/relation_service.rb +11 -0
- data/app/services/saver.rb +59 -24
- data/app/services/search/conditions/abstract.rb +15 -14
- data/app/services/search/conditions/autocomplete.rb +11 -9
- data/app/services/search/conditions/list.rb +6 -5
- data/app/services/search/conditions/related_list.rb +17 -13
- data/app/services/search/{conditions/part/where.rb → part/abstract.rb} +7 -9
- data/app/services/search/part/order.rb +17 -0
- data/app/services/search/part/where.rb +19 -0
- data/app/services/sortable_service.rb +27 -27
- data/app/services/template_service.rb +68 -0
- data/app/services/upload/preview_service.rb +86 -0
- data/app/views/layouts/rademade_admin.html.erb +13 -4
- data/app/views/rademade_admin/_blocks/_header.html.erb +35 -28
- data/app/views/rademade_admin/_blocks/_menu.html.erb +20 -23
- data/app/views/rademade_admin/_blocks/_on_page_select.html.erb +15 -0
- data/app/views/rademade_admin/_blocks/_pagination.html.erb +1 -18
- data/app/views/rademade_admin/_blocks/_sub_menu.html.erb +3 -3
- data/app/views/rademade_admin/_blocks/form/_control.html.erb +3 -0
- data/app/views/rademade_admin/_blocks/form/_lang_panel.html.erb +19 -0
- data/app/views/rademade_admin/_blocks/sub_menu/_link.html.erb +6 -5
- data/app/views/rademade_admin/_blocks/table/_head.html.erb +13 -0
- data/app/views/rademade_admin/_layouts/inner.html.erb +21 -33
- data/app/views/rademade_admin/_layouts/inner/form.html.erb +6 -13
- data/app/views/rademade_admin/_layouts/inner/index_table.html.erb +31 -55
- data/app/views/rademade_admin/_layouts/inner/related_index_table.html.erb +26 -54
- data/app/views/rademade_admin/abstract/_form.html.erb +6 -9
- data/app/views/rademade_admin/abstract/edit.html.erb +3 -8
- data/app/views/rademade_admin/abstract/index.html.erb +38 -67
- data/app/views/rademade_admin/abstract/new.html.erb +3 -8
- data/app/views/rademade_admin/abstract/related.html.erb +48 -0
- data/app/views/rademade_admin/dashboard/index.html.erb +4 -5
- data/app/views/rademade_admin/dashboard/login.html.erb +19 -30
- data/config/initializers/carrier_wave/mongoid.rb +48 -0
- data/config/initializers/ckeditor.rb +3 -0
- data/config/initializers/kaminari_route_proxy.rb +16 -0
- data/config/initializers/simple_form.rb +147 -0
- data/config/initializers/simple_form/rademade_component.rb +9 -0
- data/config/initializers/simple_form/wrappers.rb +28 -0
- data/config/locales/rademade_admin.en.yml +28 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/routes.rb +1 -2
- data/lib/rademade_admin.rb +7 -5
- data/lib/rademade_admin/bower/performer.rb +1 -1
- data/lib/rademade_admin/breadcrumbs/render/rademade.rb +31 -0
- data/lib/rademade_admin/engine.rb +2 -2
- data/lib/rademade_admin/input/related_select_input/model_data.rb +40 -0
- data/lib/rademade_admin/input/related_select_input/related_list.rb +60 -0
- data/lib/rademade_admin/model/adapter/data.rb +119 -0
- data/lib/rademade_admin/model/adapter/data/active_record.rb +109 -0
- data/lib/rademade_admin/model/adapter/data/mongoid.rb +77 -0
- data/{app/services/search/query_adapter/abstract.rb → lib/rademade_admin/model/adapter/query.rb} +15 -5
- data/lib/rademade_admin/model/adapter/query/active_record.rb +50 -0
- data/lib/rademade_admin/model/adapter/query/mongoid.rb +57 -0
- data/lib/rademade_admin/model/configuration.rb +43 -16
- data/lib/rademade_admin/model/configuration/field_label.rb +16 -0
- data/lib/rademade_admin/model/configuration/fields.rb +47 -21
- data/lib/rademade_admin/model/configuration/fields_labels.rb +31 -0
- data/lib/rademade_admin/model/configuration/form_field.rb +27 -0
- data/lib/rademade_admin/model/configuration/form_fields.rb +18 -0
- data/lib/rademade_admin/model/configuration/list_field.rb +21 -0
- data/lib/rademade_admin/model/configuration/list_fields.rb +18 -0
- data/lib/rademade_admin/model/graph.rb +9 -9
- data/lib/rademade_admin/model/info.rb +53 -68
- data/lib/rademade_admin/model/info/data_item.rb +130 -0
- data/lib/rademade_admin/model/info/data_items.rb +130 -0
- data/lib/rademade_admin/model/info/field.rb +39 -0
- data/lib/rademade_admin/model/info/fields.rb +87 -0
- data/lib/rademade_admin/model/info/relation.rb +49 -0
- data/lib/rademade_admin/model/info/relations.rb +40 -0
- data/lib/rademade_admin/model/info/uploader.rb +16 -0
- data/lib/rademade_admin/model/info/uploaders.rb +35 -0
- data/lib/rademade_admin/model/reflection.rb +38 -9
- data/lib/rademade_admin/routing/mapper.rb +9 -5
- data/lib/rademade_admin/search/searcher.rb +22 -0
- data/lib/rademade_admin/sortable.rb +1 -0
- data/lib/rademade_admin/uploader/photo.rb +1 -0
- data/lib/rademade_admin/user.rb +7 -6
- data/lib/rademade_admin/version.rb +1 -1
- data/lib/tasks/rademade_bower_install.rake +10 -2
- data/lib/templates/erb/scaffold/_form.html.erb +13 -0
- metadata +195 -109
- data/app/assets/javascripts/rademade_admin/app/common/relation-list.coffee +0 -109
- data/app/assets/javascripts/rademade_admin/app/form-popup/collection.coffee +0 -20
- data/app/assets/javascripts/rademade_admin/app/form-popup/model.coffee +0 -4
- data/app/assets/javascripts/rademade_admin/detail_admin/theme.js +0 -56
- data/app/assets/javascripts/rademade_admin/form/form-ajax-submit.coffee +0 -157
- data/app/assets/stylesheets/rademade_admin.scss.erb +0 -19
- data/app/helpers/rademade_admin/name_helper.rb +0 -18
- data/app/helpers/rademade_admin/upload_preview_helper.rb +0 -60
- data/app/inputs/rademade_admin/admin_file_input.rb +0 -71
- data/app/inputs/rademade_admin/admin_select_input.rb +0 -82
- data/app/inputs/rademade_admin/admin_textarea_input.rb +0 -6
- data/app/inputs/rademade_admin/boolean_input.rb +0 -14
- data/app/services/form_builder.rb +0 -4
- data/app/services/search/query_adapter/active_record.rb +0 -45
- data/app/services/search/query_adapter/mongoid.rb +0 -51
- data/app/services/search/searcher.rb +0 -20
- data/app/views/rademade_admin/_blocks/_form_control.html.erb +0 -5
- data/app/views/rademade_admin/abstract/related_index.html.erb +0 -85
- data/config/initializers/devise.rb +0 -251
- data/config/initializers/formtastic.rb +0 -13
- data/lib/rademade_admin/model/data_adapter.rb +0 -64
- data/lib/rademade_admin/model/data_adapter/active_record.rb +0 -59
- data/lib/rademade_admin/model/data_adapter/mongoid.rb +0 -54
- data/lib/rademade_admin/model/reflection/data.rb +0 -48
- data/lib/rademade_admin/model/reflection/uploader.rb +0 -18
@@ -1,10 +1,7 @@
|
|
1
|
-
<%= admin_form(@item, @model_class) do |f|
|
2
|
-
|
3
|
-
|
4
|
-
admin_field(f, name, field_params, @model_info, @item)
|
1
|
+
<%= admin_form(@item, @model_class) do |f| %><%
|
2
|
+
@form_fields_without_locale.each do |form_field|
|
3
|
+
admin_field(f, form_field, @model_info)
|
5
4
|
end
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end %>
|
5
|
+
concat render @template_service.form_lang_panel, { :f => f }
|
6
|
+
concat render @template_service.form_control_block, { :f => f }
|
7
|
+
end %>
|
@@ -1,9 +1,4 @@
|
|
1
|
-
<% content_for :form_last_crumbs do %>
|
2
|
-
<span>Edit</span>
|
3
|
-
<% end %>
|
4
|
-
|
5
1
|
<% content_for :page_header do %>
|
6
|
-
<h3
|
7
|
-
<% end
|
8
|
-
|
9
|
-
<%= render :template => 'rademade_admin/_layouts/inner/form' %>
|
2
|
+
<h3><%= t('rademade_admin.edit') %> "<%= @item.to_s %>"</h3>
|
3
|
+
<% end
|
4
|
+
concat render :template => @template_service.inner_form_layout %>
|
@@ -1,78 +1,49 @@
|
|
1
|
-
<% content_for :last_crumbs do %>
|
2
|
-
<span><%= admin_list_name(@model_info) %></span>
|
3
|
-
<% end %>
|
4
|
-
|
5
1
|
<% content_for :page_header do %>
|
6
|
-
<h3><%=
|
2
|
+
<h3><%= @model_info.item_name %></h3>
|
7
3
|
<% end %>
|
8
4
|
|
9
5
|
<% content_for :nav_buttons do %><%
|
10
6
|
new_uri = admin_new_uri(@model_info)
|
11
7
|
if new_uri
|
12
|
-
concat link_to
|
8
|
+
concat link_to t('rademade_admin.new_record') + '+', new_uri, :class => 'btn yellow-btn fl-l'
|
13
9
|
end
|
14
|
-
|
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">
|
10
|
+
end %>
|
21
11
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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 class="table-sortable" data-position='<%= has_position %>'>
|
43
|
-
<% @items.each_with_index do |item| %>
|
44
|
-
<tr<%
|
12
|
+
<% content_for :content do %><%
|
13
|
+
concat render @template_service.on_page_select_block
|
14
|
+
if @sortable_service.can_reset?
|
15
|
+
%><a href="<%= request.path %>"><%= t('rademade_admin.reset_sort') %></a><%
|
16
|
+
end
|
17
|
+
%><table class="table-box"><%
|
18
|
+
concat render @template_service.table_head_block, {
|
19
|
+
:list_fields => @list_fields
|
20
|
+
}
|
21
|
+
has_position = @sortable_service.has_position?
|
22
|
+
%><tbody class="table-content" data-sortable="<%= has_position %>"><%
|
23
|
+
@items.each do |item|
|
24
|
+
%><tr id="item_<%= item.id %>" class="table-line" data-id="<%= item.id %>"<%
|
45
25
|
if has_position
|
46
|
-
%>
|
26
|
+
%> data-position="<%= item.position %>"<%
|
47
27
|
end
|
48
|
-
|
49
|
-
|
50
|
-
%><td><%
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
concat
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
<li><%= link_to 'Edit', admin_edit_uri(item) %></li>
|
63
|
-
<li><%= button_to 'Destroy', admin_delete_uri(item), {
|
64
|
-
:method => :delete,
|
65
|
-
:form => {:class => 'delete-item-form'}
|
66
|
-
} %></li>
|
67
|
-
</ul>
|
28
|
+
%>><%
|
29
|
+
@list_fields.each do |field|
|
30
|
+
%><td class="table-item"><%= display_item_value(item, field) %></td><%
|
31
|
+
end
|
32
|
+
%><td class="table-item">
|
33
|
+
<span class="table-actions"><%
|
34
|
+
concat link_to t('rademade_admin.edit'), admin_edit_uri(item), :class => 'glyphicon glyphicon-pencil fl-l'
|
35
|
+
%><div class="glyphicon glyphicon-remove fl-l"><%
|
36
|
+
concat button_to t('rademade_admin.destroy'), admin_delete_uri(item), {
|
37
|
+
:method => :delete,
|
38
|
+
:form => { :class => 'delete-item-form' }
|
39
|
+
}
|
40
|
+
%></div>
|
41
|
+
</span>
|
68
42
|
</td>
|
69
|
-
</tr
|
70
|
-
|
71
|
-
|
72
|
-
</table
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
<% end %>
|
77
|
-
|
78
|
-
<%= render :template => 'rademade_admin/_layouts/inner' %>
|
43
|
+
</tr><%
|
44
|
+
end
|
45
|
+
%></tbody>
|
46
|
+
</table><%
|
47
|
+
concat render @template_service.pagination_block
|
48
|
+
end
|
49
|
+
concat render :template => @template_service.inner_layout %>
|
@@ -1,9 +1,4 @@
|
|
1
|
-
<% content_for(:form_last_crumbs) do %>
|
2
|
-
<span>Add</span>
|
3
|
-
<% end %>
|
4
|
-
|
5
1
|
<% content_for(:page_header) do %>
|
6
|
-
<h3><%=
|
7
|
-
<% end
|
8
|
-
|
9
|
-
<%= render :template => 'rademade_admin/_layouts/inner/form' %>
|
2
|
+
<h3><%= t('rademade_admin.new_record') %></h3>
|
3
|
+
<% end
|
4
|
+
concat render :template => @template_service.inner_form_layout %>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<%
|
2
|
+
related_list_fields = @related_model_info.data_items.list_fields
|
3
|
+
%><% content_for :page_header do %>
|
4
|
+
<h3><%= @related_model_info.item_name %></h3><%
|
5
|
+
end
|
6
|
+
%><% content_for :content do %><%
|
7
|
+
autocomplete_uri = admin_link_autocomplete_uri(@item, params[:relation], {
|
8
|
+
:format => :json
|
9
|
+
})
|
10
|
+
%><%= content_tag(
|
11
|
+
:input,
|
12
|
+
nil,
|
13
|
+
:type => 'hidden',
|
14
|
+
:class => 'select2-add-link',
|
15
|
+
:'data-model' => @model_class.to_s,
|
16
|
+
:'data-rel-list-url' => autocomplete_uri
|
17
|
+
)%><table class="table-box"><%
|
18
|
+
concat render @template_service.table_head_block, {
|
19
|
+
:list_fields => related_list_fields
|
20
|
+
}
|
21
|
+
has_position = @sortable_service.has_position?
|
22
|
+
%><tbody class="table-content" data-position='false'><%
|
23
|
+
@items.each do |item|
|
24
|
+
%><tr class="table-line" <%
|
25
|
+
if has_position
|
26
|
+
%> id='<%= item.position %>'<%
|
27
|
+
end
|
28
|
+
%> data-id='<%= item.id %>'><%
|
29
|
+
related_list_fields.each do |field|
|
30
|
+
%><td><%= display_item_value(item, field) %></td><%
|
31
|
+
end
|
32
|
+
%><td class="table-item">
|
33
|
+
<span class="table-actions"><%=
|
34
|
+
button_to t('rademade_admin.unlink'), admin_unlink_uri(@item, params[:relation], {
|
35
|
+
:related_id => item.id
|
36
|
+
}), {
|
37
|
+
:method => :delete,
|
38
|
+
:form => { :class => 'delete-item-form' }
|
39
|
+
} %></span>
|
40
|
+
</td>
|
41
|
+
</tr><%
|
42
|
+
end
|
43
|
+
%></tbody>
|
44
|
+
</table><%
|
45
|
+
concat render @template_service.pagination_block
|
46
|
+
end
|
47
|
+
|
48
|
+
concat render :template => @template_service.inner_layout %>
|
@@ -1,9 +1,8 @@
|
|
1
1
|
<% content_for(:content) do %>
|
2
|
-
|
3
|
-
|
4
|
-
<
|
2
|
+
<div class="page-headline">
|
3
|
+
<h1><%= t('rademade_admin.hello') %>, <%= @current_user %></h1>
|
4
|
+
<span class="title-description"><%= t('rademade_admin.title_description') %></span>
|
5
5
|
</div>
|
6
|
-
|
7
6
|
<% end %>
|
8
7
|
|
9
|
-
<%= render :template =>
|
8
|
+
<%= render :template => @template_service.inner_layout %>
|
@@ -1,31 +1,20 @@
|
|
1
1
|
<div class="login-bg">
|
2
|
-
<
|
3
|
-
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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>
|
2
|
+
<img class="admin-logo" src="<%= image_path('rademade_admin/logos/logo.png') %>" alt="Rademade.com">
|
3
|
+
<div class="login-form">
|
4
|
+
<p class="login-form-title"><%= t('rademade_admin.login') %></p>
|
5
|
+
<%= simple_form_for(RademadeAdmin.user_class.new, :url => [:sessions], :as => :data, :html => { :id => 'login-form' }) do |f| %>
|
6
|
+
<%#= rm_todo wrapper %>
|
7
|
+
<div class="form-box"><%
|
8
|
+
concat f.input :email, :label => false, :input_html => { :class => 'form-input' }
|
9
|
+
%><label class="form-label login" for="data_email"><i class="glyphicon glyphicon-user"></i></label>
|
10
|
+
</div>
|
11
|
+
<div class="form-box"><%
|
12
|
+
concat f.input :password, :label => false, :input_html => { :class => 'form-input' }
|
13
|
+
%><label class="form-label password" for="data_password"><i class="glyphicon glyphicon-lock"></i></label>
|
14
|
+
</div>
|
15
|
+
<div class="form-box"><%
|
16
|
+
concat f.submit t('rademade_admin.login'), :class => 'btn blue-btn login-btn'
|
17
|
+
%></div><%
|
18
|
+
end
|
19
|
+
%></div>
|
20
|
+
</div>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module CarrierWave
|
2
|
+
module Mongoid
|
3
|
+
|
4
|
+
alias_method :original_mount_uploader, :mount_uploader
|
5
|
+
|
6
|
+
def mount_uploader(column, uploader = nil, options = {}, &block)
|
7
|
+
if options[:localize]
|
8
|
+
|
9
|
+
field options[:mount_on] || column, :localize => true
|
10
|
+
|
11
|
+
I18n.available_locales.each do |locale|
|
12
|
+
original_mount_uploader("#{column}_#{locale}", uploader, options, &block)
|
13
|
+
end
|
14
|
+
|
15
|
+
# todo if it is ok - make also remove method
|
16
|
+
class_eval <<-RUBY, __FILE__, __LINE__+1
|
17
|
+
|
18
|
+
def #{column}=(new_file)
|
19
|
+
send(:"#{column}_\#{I18n.locale}=", new_file)
|
20
|
+
end
|
21
|
+
|
22
|
+
def #{column}
|
23
|
+
send(:"#{column}_\#{I18n.locale}")
|
24
|
+
end
|
25
|
+
|
26
|
+
def #{column}_translations=(translations)
|
27
|
+
translations.each do |locale, translation|
|
28
|
+
send(:"#{column}_\#{locale}=", translation)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def #{column}_translations
|
33
|
+
translations = {}
|
34
|
+
I18n.available_locales.each do |locale|
|
35
|
+
translations[locale] = send(:"#{column}_\#{locale}")
|
36
|
+
end
|
37
|
+
translations
|
38
|
+
end
|
39
|
+
|
40
|
+
RUBY
|
41
|
+
|
42
|
+
else
|
43
|
+
original_mount_uploader(column, uploader, options, &block)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Kaminari
|
2
|
+
module Helpers
|
3
|
+
class Tag
|
4
|
+
def page_url_for(page)
|
5
|
+
admin_params = @params.extract!(:admin_params)
|
6
|
+
params = @params.merge(@param_name => (page <= 1 ? nil : page), :only_path => true)
|
7
|
+
if admin_params.empty?
|
8
|
+
@template.url_for params
|
9
|
+
else
|
10
|
+
symbolized_params = params.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
11
|
+
Rails.application.routes.url_for(symbolized_params)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,147 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
# Wrappers are used by the form builder to generate a
|
4
|
+
# complete input. You can remove any component from the
|
5
|
+
# wrapper, change the order or even add your own to the
|
6
|
+
# stack. The options given below are used to wrap the
|
7
|
+
# whole input.
|
8
|
+
|
9
|
+
config.wrappers :default, class: :input,
|
10
|
+
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
|
11
|
+
## Extensions enabled by default
|
12
|
+
# Any of these extensions can be disabled for a
|
13
|
+
# given input by passing: `f.input EXTENSION_NAME => false`.
|
14
|
+
# You can make any of these extensions optional by
|
15
|
+
# renaming `b.use` to `b.optional`.
|
16
|
+
|
17
|
+
# Determines whether to use HTML5 (:email, :url, ...)
|
18
|
+
# and required attributes
|
19
|
+
b.use :html5
|
20
|
+
|
21
|
+
# Calculates placeholders automatically from I18n
|
22
|
+
# You can also pass a string as f.input placeholder: "Placeholder"
|
23
|
+
b.use :placeholder
|
24
|
+
|
25
|
+
## Optional extensions
|
26
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
|
27
|
+
# to the input. If so, they will retrieve the values from the model
|
28
|
+
# if any exists. If you want to enable the lookup for any of those
|
29
|
+
# extensions by default, you can change `b.optional` to `b.use`.
|
30
|
+
|
31
|
+
# Calculates maxlength from length validations for string inputs
|
32
|
+
b.optional :maxlength
|
33
|
+
|
34
|
+
# Calculates pattern from format validations for string inputs
|
35
|
+
b.optional :pattern
|
36
|
+
|
37
|
+
# Calculates min and max from length validations for numeric inputs
|
38
|
+
b.optional :min_max
|
39
|
+
|
40
|
+
# Calculates readonly automatically from readonly attributes
|
41
|
+
b.optional :readonly
|
42
|
+
|
43
|
+
## Inputs
|
44
|
+
b.use :label_input
|
45
|
+
b.use :hint, wrap_with: { tag: :span, class: :hint }
|
46
|
+
b.use :error, wrap_with: { tag: :span, class: :error }
|
47
|
+
end
|
48
|
+
|
49
|
+
# The default wrapper to be used by the FormBuilder.
|
50
|
+
config.default_wrapper = :default
|
51
|
+
|
52
|
+
# Define the way to render check boxes / radio buttons with labels.
|
53
|
+
# Defaults to :nested for bootstrap config.
|
54
|
+
# inline: input + label
|
55
|
+
# nested: label > input
|
56
|
+
config.boolean_style = :inline
|
57
|
+
|
58
|
+
# Default class for buttons
|
59
|
+
config.button_class = 'btn'
|
60
|
+
|
61
|
+
# Method used to tidy up errors. Specify any Rails Array method.
|
62
|
+
# :first lists the first message for each field.
|
63
|
+
# Use :to_sentence to list all errors for each field.
|
64
|
+
# config.error_method = :first
|
65
|
+
|
66
|
+
# Default tag used for error notification helper.
|
67
|
+
config.error_notification_tag = :div
|
68
|
+
|
69
|
+
# CSS class to add for error notification helper.
|
70
|
+
config.error_notification_class = 'alert alert-error'
|
71
|
+
|
72
|
+
# ID to add for error notification helper.
|
73
|
+
# config.error_notification_id = nil
|
74
|
+
|
75
|
+
# Series of attempts to detect a default label method for collection.
|
76
|
+
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
77
|
+
|
78
|
+
# Series of attempts to detect a default value method for collection.
|
79
|
+
# config.collection_value_methods = [ :id, :to_s ]
|
80
|
+
|
81
|
+
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
82
|
+
# config.collection_wrapper_tag = nil
|
83
|
+
|
84
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
85
|
+
# config.collection_wrapper_class = nil
|
86
|
+
|
87
|
+
# You can wrap each item in a collection of radio/check boxes with a tag,
|
88
|
+
# defaulting to :span. Please note that when using :boolean_style = :nested,
|
89
|
+
# SimpleForm will force this option to be a label.
|
90
|
+
# config.item_wrapper_tag = :span
|
91
|
+
|
92
|
+
# You can define a class to use in all item wrappers. Defaulting to none.
|
93
|
+
# config.item_wrapper_class = nil
|
94
|
+
|
95
|
+
# How the label text should be generated altogether with the required text.
|
96
|
+
# config.label_text = lambda { |label, required| "#{required} #{label}" }
|
97
|
+
|
98
|
+
# You can define the class to use on all labels. Default is nil.
|
99
|
+
config.label_class = 'control-label'
|
100
|
+
|
101
|
+
# You can define the class to use on all forms. Default is simple_form.
|
102
|
+
# config.form_class = :simple_form
|
103
|
+
|
104
|
+
# You can define which elements should obtain additional classes
|
105
|
+
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
106
|
+
|
107
|
+
# Whether attributes are required by default (or not). Default is true.
|
108
|
+
# config.required_by_default = true
|
109
|
+
|
110
|
+
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
|
111
|
+
# These validations are enabled in SimpleForm's internal config but disabled by default
|
112
|
+
# in this configuration, which is recommended due to some quirks from different browsers.
|
113
|
+
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
|
114
|
+
# change this configuration to true.
|
115
|
+
config.browser_validations = false
|
116
|
+
|
117
|
+
# Collection of methods to detect if a file type was given.
|
118
|
+
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
119
|
+
|
120
|
+
# Custom mappings for input types. This should be a hash containing a regexp
|
121
|
+
# to match as key, and the input type that will be used when the field name
|
122
|
+
# matches the regexp as value.
|
123
|
+
# config.input_mappings = { /count/ => :integer }
|
124
|
+
|
125
|
+
# Custom wrappers for input types. This should be a hash containing an input
|
126
|
+
# type as key and the wrapper that will be used for all inputs with specified type.
|
127
|
+
# config.wrapper_mappings = { string: :prepend }
|
128
|
+
|
129
|
+
# Default priority for time_zone inputs.
|
130
|
+
# config.time_zone_priority = nil
|
131
|
+
|
132
|
+
# Default priority for country inputs.
|
133
|
+
# config.country_priority = nil
|
134
|
+
|
135
|
+
# When false, do not use translations for labels.
|
136
|
+
# config.translate_labels = true
|
137
|
+
|
138
|
+
# Automatically discover new inputs in Rails' autoload path.
|
139
|
+
# config.inputs_discovery = true
|
140
|
+
|
141
|
+
# Cache SimpleForm inputs discovery
|
142
|
+
# config.cache_discovery = !Rails.env.development?
|
143
|
+
|
144
|
+
# Default class for inputs
|
145
|
+
# config.input_class = nil
|
146
|
+
|
147
|
+
end
|