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
@@ -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,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,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
|
File without changes
|
@@ -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)
|
File without changes
|
@@ -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
|
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
|
@@ -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
|