redde 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/redde/layout/layout_generator.rb +5 -0
  3. data/lib/generators/redde/layout/templates/form_builders/redde_form_builder.rb +63 -0
  4. data/lib/generators/redde/scaffold/templates/edit.html.haml +8 -16
  5. data/lib/redde/version.rb +1 -1
  6. data/spec/dummy/app/assets/images/admin/addphoto.png +0 -0
  7. data/spec/dummy/app/assets/images/admin/ajaxloader2.gif +0 -0
  8. data/spec/dummy/app/assets/images/admin/arrow_down.png +0 -0
  9. data/spec/dummy/app/assets/images/admin/arrow_enter.png +0 -0
  10. data/spec/dummy/app/assets/images/admin/arrow_right.png +0 -0
  11. data/spec/dummy/app/assets/images/admin/coins.png +0 -0
  12. data/spec/dummy/app/assets/images/admin/confirm.png +0 -0
  13. data/spec/dummy/app/assets/images/admin/del.png +0 -0
  14. data/spec/dummy/app/assets/images/admin/delete.png +0 -0
  15. data/spec/dummy/app/assets/images/admin/email.png +0 -0
  16. data/spec/dummy/app/assets/images/admin/error-label-triangle.png +0 -0
  17. data/spec/dummy/app/assets/images/admin/error.png +0 -0
  18. data/spec/dummy/app/assets/images/admin/favicon.png +0 -0
  19. data/spec/dummy/app/assets/images/admin/fio.png +0 -0
  20. data/spec/dummy/app/assets/images/admin/folder.png +0 -0
  21. data/spec/dummy/app/assets/images/admin/folder_.png +0 -0
  22. data/spec/dummy/app/assets/images/admin/icon_eye.gif +0 -0
  23. data/spec/dummy/app/assets/images/admin/lightbox/css/jquery.lightbox-0.5.css +101 -0
  24. data/spec/dummy/app/assets/images/admin/lightbox/images/lightbox-blank.gif +0 -0
  25. data/spec/dummy/app/assets/images/admin/lightbox/images/lightbox-btn-close.gif +0 -0
  26. data/spec/dummy/app/assets/images/admin/lightbox/images/lightbox-btn-next.gif +0 -0
  27. data/spec/dummy/app/assets/images/admin/lightbox/images/lightbox-btn-prev.gif +0 -0
  28. data/spec/dummy/app/assets/images/admin/lightbox/images/lightbox-ico-loading.gif +0 -0
  29. data/spec/dummy/app/assets/images/admin/lightbox/js/jquery.js +32 -0
  30. data/spec/dummy/app/assets/images/admin/lightbox/js/jquery.lightbox-0.5.js +477 -0
  31. data/spec/dummy/app/assets/images/admin/lightbox/js/jquery.lightbox-0.5.min.js +42 -0
  32. data/spec/dummy/app/assets/images/admin/lightbox/js/jquery.lightbox-0.5.pack.js +14 -0
  33. data/spec/dummy/app/assets/images/admin/logo.png +0 -0
  34. data/spec/dummy/app/assets/images/admin/logo_reddeshop.png +0 -0
  35. data/spec/dummy/app/assets/images/admin/move_handler.png +0 -0
  36. data/spec/dummy/app/assets/images/admin/phone.png +0 -0
  37. data/spec/dummy/app/assets/images/admin/photo_ico.png +0 -0
  38. data/spec/dummy/app/assets/images/admin/print.png +0 -0
  39. data/spec/dummy/app/assets/images/admin/refresh.png +0 -0
  40. data/spec/dummy/app/assets/images/admin/submit.png +0 -0
  41. data/spec/dummy/app/assets/images/admin/submit_hover.png +0 -0
  42. data/spec/dummy/app/assets/images/admin/view.png +0 -0
  43. data/spec/dummy/app/assets/images/admin/view_mk.png +0 -0
  44. data/spec/dummy/app/assets/images/redactor/icons.png +0 -0
  45. data/spec/dummy/app/assets/images/redactor/plugins/file.html +3 -0
  46. data/spec/dummy/app/assets/images/redactor/plugins/image.html +39 -0
  47. data/spec/dummy/app/assets/images/redactor/plugins/image_edit.html +35 -0
  48. data/spec/dummy/app/assets/images/redactor/plugins/link.html +74 -0
  49. data/spec/dummy/app/assets/images/redactor/plugins/table.html +25 -0
  50. data/spec/dummy/app/assets/images/redactor/plugins/video.html +15 -0
  51. data/spec/dummy/app/assets/javascripts/admin/jquery.mjs.nestedSortable.js +429 -0
  52. data/spec/dummy/app/assets/javascripts/admin.js +21 -0
  53. data/spec/dummy/app/assets/javascripts/jquery-migrate-1.2.1.js +521 -0
  54. data/spec/dummy/app/assets/javascripts/redactor/langs/en.js +76 -0
  55. data/spec/dummy/app/assets/javascripts/redactor/langs/ru.js +75 -0
  56. data/spec/dummy/app/assets/javascripts/redactor/redactor.js.erb +2248 -0
  57. data/spec/dummy/app/assets/javascripts/redactor/toolbars/default.js +219 -0
  58. data/spec/dummy/app/assets/stylesheets/admin/blocks/error-msg.sass +47 -0
  59. data/spec/dummy/app/assets/stylesheets/admin/blocks/list.scss +22 -0
  60. data/spec/dummy/app/assets/stylesheets/admin/blocks/notice.scss +39 -0
  61. data/spec/dummy/app/assets/stylesheets/admin/blocks/orders.scss +22 -0
  62. data/spec/dummy/app/assets/stylesheets/admin/blocks/paginate.sass +28 -0
  63. data/spec/dummy/app/assets/stylesheets/admin/blocks/pagination.scss +28 -0
  64. data/spec/dummy/app/assets/stylesheets/admin/blocks/partners.scss +15 -0
  65. data/spec/dummy/app/assets/stylesheets/admin/blocks/phead-tabs.sass +27 -0
  66. data/spec/dummy/app/assets/stylesheets/admin/blocks/photos.scss +31 -0
  67. data/spec/dummy/app/assets/stylesheets/admin/blocks/sortable.sass +44 -0
  68. data/spec/dummy/app/assets/stylesheets/admin/custom/index.scss +1 -0
  69. data/spec/dummy/app/assets/stylesheets/admin/defaults/index.scss +131 -0
  70. data/spec/dummy/app/assets/stylesheets/admin/defaults/input.sass +35 -0
  71. data/spec/dummy/app/assets/stylesheets/admin/defaults/reset.sass +33 -0
  72. data/spec/dummy/app/assets/stylesheets/admin/defaults/table.scss +24 -0
  73. data/spec/dummy/app/assets/stylesheets/admin/index.scss +6 -0
  74. data/spec/dummy/app/assets/stylesheets/admin/layouts/header.sass +50 -0
  75. data/spec/dummy/app/assets/stylesheets/admin/layouts/launchbar.sass +23 -0
  76. data/spec/dummy/app/assets/stylesheets/admin/layouts/login.sass +25 -0
  77. data/spec/dummy/app/assets/stylesheets/admin/layouts/main.sass +38 -0
  78. data/spec/dummy/app/assets/stylesheets/admin/layouts/page-header.sass +22 -0
  79. data/spec/dummy/app/assets/stylesheets/admin/layouts/page-sidebar.sass +24 -0
  80. data/spec/dummy/app/assets/stylesheets/admin/layouts/sidebar.sass +30 -0
  81. data/spec/dummy/app/assets/stylesheets/admin/shop/_filter.scss +16 -0
  82. data/spec/dummy/app/assets/stylesheets/admin/shop/_order-sh.scss +59 -0
  83. data/spec/dummy/app/assets/stylesheets/admin/shop/_pe.scss +43 -0
  84. data/spec/dummy/app/assets/stylesheets/redactor/index.scss +369 -0
  85. data/spec/dummy/app/assets/stylesheets/redactor/wym.css +136 -0
  86. data/spec/dummy/app/controllers/admin/base_controller.rb +28 -0
  87. data/spec/dummy/app/controllers/admin/managers_controller.rb +36 -0
  88. data/spec/dummy/app/controllers/managers/registrations_controller.rb +21 -0
  89. data/spec/dummy/app/helpers/admin_helper.rb +94 -0
  90. data/spec/dummy/app/views/admin/base/_header.html.haml +12 -0
  91. data/spec/dummy/app/views/admin/base/_launchbar.html.haml +11 -0
  92. data/spec/dummy/app/views/admin/base/_sidebar.html.haml +14 -0
  93. data/spec/dummy/app/views/admin/base/_validate.haml +8 -0
  94. data/spec/dummy/app/views/admin/base/welcome.haml +2 -0
  95. data/spec/dummy/app/views/layouts/admin.html.haml +29 -0
  96. data/spec/dummy/app/views/layouts/login.html.haml +32 -0
  97. data/spec/dummy/config/routes.rb +1 -0
  98. data/spec/generators/layout_generator_spec.rb +4 -1
  99. metadata +185 -2
@@ -0,0 +1,369 @@
1
+ .redactor_box {
2
+ position: relative;
3
+ border: 1px solid #ddd;
4
+ line-height: 0;
5
+ }
6
+ .redactor_box, .redactor_box textarea {
7
+ background-color: #fff;
8
+ }
9
+ .redactor_box iframe {
10
+ outline: none;
11
+ width: 100%;
12
+ background: #fff;
13
+ display: block;
14
+ overflow: auto;
15
+ }
16
+ .redactor_box textarea {
17
+ font-family: Menlo, Monaco, monospace, sans-serif;
18
+ font-size: 13px;
19
+ overflow: auto;
20
+ resize: none;
21
+ margin: 0;
22
+ padding: 0;
23
+ display: block;
24
+ position: relative;
25
+ z-index: 1004;
26
+ outline: none;
27
+ border: none;
28
+ width: 100%;
29
+ }
30
+ .redactor_box textarea:focus {
31
+ outline: none !important;
32
+ border: none !important;
33
+ box-shadow: none;
34
+ }
35
+
36
+ /*
37
+ Fuulscreen
38
+ */
39
+ body .redactor_box_fullscreen {
40
+ border: medium none !important;
41
+ height: 100%;
42
+ left: 0;
43
+ position: absolute;
44
+ top: 0;
45
+ width: 100% !important;
46
+ z-index: 2000;
47
+ }
48
+
49
+ /*
50
+ TOOLBAR
51
+ */
52
+ .redactor_toolbar {
53
+ position: relative;
54
+ /*z-index: 2002;*/
55
+ height: 33px;
56
+ left: 0;
57
+ top: 0;
58
+ margin: 0 !important;
59
+ padding: 0 !important;
60
+ line-height: 0 !important;
61
+ list-style: none;
62
+ font-size: 0;
63
+ background: #f2f2f2;
64
+ background: -moz-linear-gradient(top, #f5f5f5 0%, #ddd 100%);
65
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#ddd));
66
+ background: -webkit-linear-gradient(top, #f5f5f5 0%,#ddd 100%);
67
+ background: -o-linear-gradient(top, #f5f5f5 0%,#ddd 100%);
68
+ background: -ms-linear-gradient(top, #f5f5f5 0%,#ddd 100%);
69
+ background: linear-gradient(top, #f5f5f5 0%,#ddd 100%);
70
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dddddd',GradientType=0 );
71
+ overflow: hidden;
72
+ border-bottom: 1px solid #c2c2c2;
73
+ }
74
+ .redactor_toolbar li {
75
+ float: left !important;
76
+ padding: 3px 1px;
77
+ padding-right: 0;
78
+ list-style-type: none;
79
+ }
80
+ .redactor_toolbar li.redactor_separator {
81
+ float: left;
82
+ height: 34px;
83
+ border-left: 1px solid #d7d7d7;
84
+ border-right: 1px solid #eee;
85
+ padding: 0;
86
+ margin: 0 2px 0 3px;
87
+ }
88
+ li.redactor_toolbar_right {
89
+ float: none;
90
+ float: right !important;
91
+ padding: 2px 0;
92
+ padding-right: 1px !important;
93
+ }
94
+ .redactor_toolbar li a, .redactor_toolbar li a span {
95
+ width: 25px;
96
+ height: 26px;
97
+ }
98
+ .redactor_toolbar li a {
99
+ border: 1px solid transparent;
100
+ * border: 1px solid #eee;
101
+ display: block;
102
+ line-height: 0;
103
+ font-size: 0;
104
+ cursor: pointer;
105
+ zoom: 1;
106
+ text-decoration: none;
107
+ }
108
+ .redactor_toolbar li a span {
109
+ display: block;
110
+ text-indent: -9999px;
111
+ background: image-url("redactor/icons.png") no-repeat top left;
112
+ }
113
+
114
+ .redactor_toolbar li a:hover {
115
+ border-color: #98a6ba;
116
+ background-color: #dde4ef;
117
+ }
118
+ .redactor_toolbar li a:active, .redactor_toolbar li a.act {
119
+ border-color: #b5b5b5;
120
+ background-color: #e8e8e8;
121
+ }
122
+
123
+
124
+ /*
125
+ BUTTONS
126
+ step 25px
127
+ */
128
+ body .redactor_toolbar li a.redactor_btn_html span { background-position: 0; }
129
+ body .redactor_toolbar li a.redactor_btn_styles span { background-position: -25px; }
130
+ body .redactor_toolbar li a.redactor_btn_bold span { background-position: -50px; }
131
+ body .redactor_toolbar li a.redactor_btn_italic span { background-position: -75px; }
132
+ body .redactor_toolbar li a.redactor_btn_deleted span { background-position: -550px; }
133
+ body .redactor_toolbar li a.redactor_btn_insertunorderedlist span { background-position: -100px; }
134
+ body .redactor_toolbar li a.redactor_btn_insertorderedlist span { background-position: -125px; }
135
+ body .redactor_toolbar li a.redactor_btn_outdent span { background-position: -150px; }
136
+ body .redactor_toolbar li a.redactor_btn_indent span { background-position: -175px; }
137
+ body .redactor_toolbar li a.redactor_btn_image span { background-position: -200px; }
138
+ body .redactor_toolbar li a.redactor_btn_video span { background-position: -225px; }
139
+ body .redactor_toolbar li a.redactor_btn_file span { background-position: -250px; }
140
+ body .redactor_toolbar li a.redactor_btn_table span { background-position: -275px; }
141
+ body .redactor_toolbar li a.redactor_btn_link span { background-position: -300px; }
142
+ body .redactor_toolbar li a.redactor_btn_fontcolor span { background-position: -325px; }
143
+ body .redactor_toolbar li a.redactor_btn_backcolor span { background-position: -350px; }
144
+ body .redactor_toolbar li a.redactor_btn_justifyleft span { background-position: -375px; }
145
+ body .redactor_toolbar li a.redactor_btn_justifycenter span { background-position: -400px; }
146
+ body .redactor_toolbar li a.redactor_btn_justifyright span { background-position: -425px; }
147
+ body .redactor_toolbar li a.redactor_btn_justify span { background-position: -450px; }
148
+ body .redactor_toolbar li a.redactor_btn_horizontalrule span { background-position: -475px; }
149
+ body .redactor_toolbar li a.redactor_btn_fullscreen span { background-position: -500px; }
150
+ body .redactor_toolbar li a.redactor_btn_format span { background-position: -575px; }
151
+ body .redactor_toolbar li a.redactor_btn_normalscreen span { background-position: -525px !important; }
152
+
153
+
154
+ /*
155
+ RESIZER
156
+ */
157
+ .redactor_resizer {
158
+ font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif;
159
+ background-color: #f5f5f5;
160
+ padding-top: 2px;
161
+ line-height: 4px;
162
+ font-size: 12px;
163
+ color: #ddd;
164
+ text-align: center;
165
+ text-shadow: 0 -1px 0 #aaa;
166
+ cursor: s-resize;
167
+ }
168
+
169
+
170
+
171
+ /*
172
+ DROPDOWN
173
+ */
174
+ .redactor_dropdown {
175
+ top: 28px;
176
+ left: 0;
177
+ z-index: 2004;
178
+ position: absolute;
179
+ width: 200px;
180
+ background-color: #fff;
181
+ border: 1px solid #ccc;
182
+ font-size: 13px;
183
+ -webkit-box-shadow: 0 2px 4px #ccc;
184
+ -moz-box-shadow: 0 2px 4px #ccc;
185
+ box-shadow: 0 2px 4px #ccc;
186
+ line-height: 21px;
187
+ padding: 10px;
188
+ }
189
+ .redactor_separator_drop {
190
+ border-top: 1px solid #ddd;;
191
+ padding: 0 !important;
192
+ line-height: 0;
193
+ font-size: 0;
194
+ }
195
+ .redactor_dropdown a {
196
+ display: block;
197
+ color: #000;
198
+ padding: 3px 5px;
199
+ text-decoration: none;
200
+ }
201
+ .redactor_dropdown a:hover {
202
+ color: #444 !important;
203
+ text-decoration: none;
204
+ background-color: #dde4ef;
205
+ }
206
+
207
+ /* ColorPicker */
208
+ .redactor_color_link {
209
+ padding: 0 !important;
210
+ width: 15px !important;
211
+ height: 15px !important;
212
+ float: left !important;
213
+ border: 2px solid #fff !important;
214
+ font-size: 0;
215
+ }
216
+ .redactor_color_none {
217
+ font-size: 11px;
218
+ }
219
+
220
+
221
+
222
+ /* MODAL */
223
+ #redactor_modal_overlay {
224
+ position: fixed;
225
+ margin: auto;
226
+ top: 0;
227
+ left: 0;
228
+ width: 100%;
229
+ height: 100%;
230
+ z-index: 50000;
231
+
232
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
233
+ filter:alpha(opacity=70);
234
+ opacity: 0.70;
235
+
236
+ background-color: #fff !important;
237
+ }
238
+
239
+ #redactor_modal {
240
+ background-color: #fff;
241
+ padding: 0;
242
+ position: fixed;
243
+ top: 50%;
244
+ left: 50%;
245
+
246
+ box-shadow: 0px 5px 20px #999;
247
+ -webkit-box-shadow: 0 5px 20px #999;
248
+ -moz-box-shadow: 0 5px 20px #999;
249
+
250
+ -webkit-border-radius: 8px;
251
+ -moz-border-radius: 8px;
252
+ border-radius: 8px;
253
+
254
+ z-index: 50001;
255
+ font-family: "Trebuchet MS", "Helvetica Neue", "Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
256
+ color: #000;
257
+ }
258
+ #redactor_modal_header {
259
+ padding: 15px;
260
+ font-size: 18px;
261
+
262
+ border-radius: 8px 8px 0 0;
263
+
264
+ font-weight: bold;
265
+ background-color: #f6f6f6;
266
+ border-bottom: 1px solid #ddd;
267
+ }
268
+ #redactor_modal_inner {
269
+ padding: 30px;
270
+ }
271
+ #redactor_modal_close {
272
+ position: absolute;
273
+ right: 0px;
274
+ top: 11px;
275
+ font-size: 24px;
276
+ width: 30px;
277
+ height: 30px;
278
+ color: #999;
279
+ cursor: pointer;
280
+ }
281
+ #redactor_modal_close:hover {
282
+ color: #000;
283
+ }
284
+ #redactor_modal label {
285
+ display: inline !important;
286
+ }
287
+ .redactor_ruler {
288
+ margin-bottom: 10px;
289
+ width: 99% !important;
290
+ }
291
+ .redactor_ruler td {
292
+ font-size: 12px !important;
293
+ padding: 5px !important;
294
+ border: none !important;
295
+ vertical-align: middle !important;
296
+ }
297
+ #redactor_image_box {
298
+ height: 270px;
299
+ overflow: auto;
300
+ margin-bottom: 10px;
301
+ }
302
+ #redactor_image_box img {
303
+ margin-right: 10px;
304
+ margin-bottom: 10px;
305
+ cursor: pointer;
306
+ }
307
+ #redactor_tabs {
308
+ margin-bottom: 18px;
309
+ }
310
+ #redactor_tabs a {
311
+ display: inline-block;
312
+ border: 1px solid #ddd;
313
+ padding: 4px 14px;
314
+ font-size: 12px;
315
+ text-decoration: none;
316
+ color: #000;
317
+ line-height: 1;
318
+ -webkit-border-radius: 10px;
319
+ -moz-border-radius: 10px;
320
+ border-radius: 10px;
321
+ }
322
+ #redactor_tabs a:hover, #redactor_tabs a.redactor_tabs_act {
323
+ background-color: #eee;
324
+ color: #777 !important;
325
+ text-decoration: none !important;
326
+ }
327
+ .redactor_btns_box {
328
+ float: right;
329
+ padding: 6px 16px;
330
+ background-color: #eee;
331
+ -webkit-border-radius: 5px;
332
+ -moz-border-radius: 5px;
333
+ border-radius: 5px;
334
+ }
335
+
336
+ /* Drag and Drop Area */
337
+ .redactor_droparea {
338
+ position: relative;
339
+ width: 100%;
340
+ margin: auto;
341
+ margin-bottom: 5px;
342
+ }
343
+ .redactor_droparea .redactor_dropareabox {
344
+ z-index: 1;
345
+ position: relative;
346
+ text-align: center;
347
+ width: 99%;
348
+ padding: 60px 0;
349
+ border: 2px dashed #bbb;
350
+ }
351
+ .redactor_droparea .redactor_dropareabox, .redactor_dropalternative {
352
+ color: #777;
353
+ font-size: 12px;
354
+ }
355
+ .redactor_dropalternative {
356
+ margin: 4px 0 2px 0;
357
+ }
358
+ .redactor_dropareabox.hover {
359
+ background: #efe3b8;
360
+ border-color: #aaa;
361
+ }
362
+ .redactor_dropareabox.error {
363
+ background: #f7e5e5;
364
+ border-color: #dcc3c3;
365
+ }
366
+ .redactor_dropareabox.drop {
367
+ background: #f4f4ee;
368
+ border-color: #e0e5d6;
369
+ }
@@ -0,0 +1,136 @@
1
+
2
+ body {
3
+ font-family: "PT Sans", "Trebuchet MS", Verdana, Arial, Tahoma, sans-serif;
4
+ font-size: 14px;
5
+ margin: 0;
6
+ padding: 0;
7
+ overflow-x: hidden;
8
+ background-color: #f8f8f8;
9
+ }
10
+
11
+ #page {
12
+ margin: 20px;
13
+ background: #f8f8f8;
14
+ border: none;
15
+ padding: 0;
16
+ }
17
+ #page:focus {
18
+ outline: none;
19
+ }
20
+
21
+
22
+ div,
23
+ p,
24
+ ul,
25
+ ol,
26
+ table,
27
+ dl,
28
+ pre,
29
+ h1,
30
+ h2,
31
+ h3,
32
+ h4,
33
+ h5,
34
+ blockquote {
35
+ background-color: #fff;
36
+ border: 1px solid #ebebeb;
37
+ padding: 10px;
38
+ margin: 10px 0;
39
+ }
40
+
41
+ p ul,
42
+ p ol {
43
+ margin: 0;
44
+ padding: 0;
45
+ border: none;
46
+ }
47
+
48
+ div,
49
+ p,
50
+ ul,
51
+ ol,
52
+ table,
53
+ dl,
54
+ blockquote,
55
+ pre,
56
+ iframe,
57
+ object,
58
+ hr {
59
+ margin-bottom: 15px;
60
+ line-height: 1.5em;
61
+ }
62
+ blockquote {
63
+ margin-left: 3em;
64
+ font-style: italic;
65
+ color: #777;
66
+ }
67
+ div {
68
+ background-color: #fff;
69
+ border: 1px dashed #ebebeb;
70
+ }
71
+ ul, ol {
72
+ padding-left: 2em !important;
73
+ }
74
+ ul ul,
75
+ ol ol,
76
+ ul ol,
77
+ ol ul {
78
+ border: none;
79
+ margin: 2px !important;
80
+ padding: 0;
81
+ padding-left: 2em;
82
+ }
83
+ dl dt { font-weight: bold; }
84
+ dd { margin-left: 1em;}
85
+
86
+ table {
87
+ border-collapse: collapse;
88
+ font-size: 1em;
89
+ }
90
+ table td {
91
+ border: 1px solid #ddd;
92
+ padding: 5px;
93
+ }
94
+ table thead td {
95
+ border-bottom: 2px solid #000 !important;
96
+ font-weight: bold;
97
+ }
98
+ code, pre {
99
+ font-family: monospace sans-serif;
100
+ }
101
+ code {
102
+ background-color: #d8d7d7;
103
+ }
104
+ pre {
105
+ padding: 1em;
106
+ border: 1px dashed #ccc;
107
+ background: #f5f5f5;
108
+ overflow: auto;
109
+ }
110
+ hr {
111
+ display: block;
112
+ height: 1px;
113
+ border: 0;
114
+ border-top: 1px solid #ccc;
115
+ }
116
+
117
+ h1, h2, h3, h4,h5 {
118
+ font-weight: bold;
119
+ margin-bottom: 10px;
120
+ }
121
+
122
+ h1 {
123
+ font-size: 36px;
124
+ }
125
+ h2 {
126
+ font-size: 30px;
127
+ }
128
+ h3 {
129
+ font-size: 24px;
130
+ }
131
+ h4 {
132
+ font-size: 18px;
133
+ }
134
+ h4 {
135
+ font-size: 1em;
136
+ }
@@ -0,0 +1,28 @@
1
+ class Admin::BaseController < ActionController::Base
2
+ layout 'admin'
3
+ before_filter :authenticate_manager!
4
+ include AdminHelper
5
+
6
+ def welcome
7
+ end
8
+
9
+ private
10
+
11
+ def redirect_or_edit(obj, saved, notice = nil)
12
+ if saved
13
+ redirect_to url_for_obj(obj), notice: notice_for(obj, notice)
14
+ else
15
+ render 'edit'
16
+ end
17
+ end
18
+
19
+ def notice_for(obj, notice = nil)
20
+ notice ||= 'сохранен'
21
+ "#{obj.class.model_name.human} #{notice}."
22
+ end
23
+
24
+ def url_for_obj(obj)
25
+ return [:edit, :admin, obj] if params[:commit] == 'Применить'
26
+ [:admin, obj.class.model_name.plural.to_sym]
27
+ end
28
+ end
@@ -0,0 +1,36 @@
1
+ class Admin::ManagersController < Admin::BaseController
2
+ def index
3
+ @managers = Manager.all
4
+ end
5
+
6
+ def new
7
+ @manager = Manager.new
8
+ render 'edit'
9
+ end
10
+
11
+ def create
12
+ @manager = Manager.new(manager_params)
13
+ redirect_or_edit(@manager, @manager.save)
14
+ end
15
+
16
+ def edit
17
+ @manager = Manager.find(params[:id])
18
+ end
19
+
20
+ def update
21
+ @manager = Manager.find(params[:id])
22
+ redirect_or_edit(@manager, @manager.update(manager_params))
23
+ end
24
+
25
+ def destroy
26
+ @manager = Manager.find(params[:id])
27
+ @manager.destroy if current_manager.id != @manager.id
28
+ redirect_to [:admin, :managers], alert: 'Администратор удален'
29
+ end
30
+
31
+ private
32
+
33
+ def manager_params
34
+ params[:manager].permit!
35
+ end
36
+ end
@@ -0,0 +1,21 @@
1
+ class Managers::RegistrationsController < Devise::RegistrationsController
2
+ def new
3
+ redirect_to root_path, alert: 'Регистрация закрыта'
4
+ end
5
+
6
+ def create
7
+ redirect_to root_path, alert: 'Регистрация закрыта'
8
+ end
9
+
10
+ def edit
11
+ redirect_to root_path, alert: 'Регистрация закрыта'
12
+ end
13
+
14
+ def update
15
+ redirect_to root_path, alert: 'Регистрация закрыта'
16
+ end
17
+
18
+ def destroy
19
+ redirect_to root_path, alert: 'Регистрация закрыта'
20
+ end
21
+ end
@@ -0,0 +1,94 @@
1
+ # coding: utf-8
2
+ module AdminHelper
3
+ def act_menu(cond)
4
+ cond ? 'active' : nil
5
+ end
6
+
7
+ def sortable(url)
8
+ html = %Q{
9
+ <script type="text/javascript">
10
+ $(document).ready(function() {
11
+ $("table.sortable").each(function(){
12
+ var self = $(this);
13
+ self.sortable({
14
+ dropOnEmpty: false,
15
+ cursor: 'crosshair',
16
+ opacity: 0.75,
17
+ handle: '.handle',
18
+ axis: 'y',
19
+ items: 'tr',
20
+ scroll: true,
21
+ update: function() {
22
+ $.ajax({
23
+ type: 'post',
24
+ data: self.sortable('serialize') + '&authenticity_token=#{u(form_authenticity_token)}',
25
+ dataType: 'script',
26
+ url: '#{url}'
27
+ })
28
+ }
29
+ });
30
+ });
31
+ });
32
+ </script>
33
+ }.gsub(/[\n ]+/, ' ').strip.html_safe
34
+ content_for(:js, html)
35
+ end
36
+
37
+ def show_tree(c)
38
+ link = link_to c.name, [:edit, :admin, c]
39
+ edit = link_to 'Удал', [:admin, c], data: { confirm: 'Точно удалить?' },
40
+ method: :delete, class: 'del'
41
+ html = content_tag(:div, link + content_tag(:p, edit))
42
+ if c.children.any?
43
+ html << content_tag(:ol) do
44
+ raw c.children.map { |ch| show_tree(ch) }.join('')
45
+ end
46
+ end
47
+ content_tag :li, raw(html), id: "list_#{c.id}"
48
+ end
49
+
50
+ def sort_tree(url, maxLevels = 2)
51
+ %Q{
52
+ <script type="text/javascript">
53
+ $(document).ready(function(){
54
+
55
+ $('ol.sortable').nestedSortable({
56
+ disableNesting: 'no-nest',
57
+ forcePlaceholderSize: true,
58
+ handle: 'div',
59
+ helper: 'clone',
60
+ items: 'li',
61
+ maxLevels: #{maxLevels},
62
+ opacity: .6,
63
+ placeholder: 'placeholder',
64
+ revert: 250,
65
+ rootID: 'root',
66
+ tabSize: 25,
67
+ tolerance: 'pointer',
68
+ toleranceElement: '> div',
69
+ update: function(){
70
+ var serialized = $(this).nestedSortable('serialize');
71
+ $.ajax({
72
+ method: 'POST',
73
+ url: '#{url}',
74
+ data: serialized
75
+ });
76
+ }
77
+ });
78
+ });
79
+ </script>
80
+ }.gsub(/[\n ]+/, ' ').strip.html_safe
81
+ end
82
+
83
+ def tsingular(model)
84
+ model.model_name.human
85
+ end
86
+
87
+ def taccusative(model_name)
88
+ t("activerecord.models.#{model_name}.acc")
89
+ end
90
+
91
+ def tplural(model)
92
+ model.model_name.human(count: 'other')
93
+ end
94
+ end
@@ -0,0 +1,12 @@
1
+ %header.header
2
+ .header__init
3
+ = link_to admin_root_path || '/admin', class: 'header__logo' do
4
+ ReddeCMS
5
+ %br
6
+ %span custom system
7
+ .header__links
8
+ - if current_manager
9
+ = mail_to current_manager.email
10
+ = link_to 'Выход', destroy_manager_session_path, method: :delete
11
+ .header__center
12
+ = link_to Rails.application.class.parent_name, root_path || '/', target: :_blank
@@ -0,0 +1,11 @@
1
+ - case controller_name
2
+ - when 'products' then @active = :shop
3
+ - when 'articles' then @active = :materials
4
+ - when 'users', 'managers' then @active = :system
5
+
6
+ .launchbar
7
+ %nav.launchbar__menu
8
+ = link_to 'Материалы', nil, class: ['launchbar__link', ('_active' if @active == :shop)]
9
+ = link_to 'Обратная связь', nil, class: ['launchbar__link', ('_active' if @active == :materials)]
10
+ = link_to 'Система', [:admin, :managers], class: ['launchbar__link', ('_active' if @active == :system)]
11
+ %span.launchbar__time= Russian.strftime(Time.now, '%d %b, %Y %H:%M ')