drg_cms 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/drg_cms/drg_cms.js +17 -2
  3. data/app/assets/stylesheets/drg_cms/drg_cms.css +197 -68
  4. data/app/controllers/cmsedit_controller.rb +3 -3
  5. data/app/controllers/dc_application_controller.rb +71 -43
  6. data/app/forms/cms_menu.yml +42 -55
  7. data/app/forms/dc_page.yml +1 -1
  8. data/app/forms/dc_site.yml +8 -0
  9. data/app/helpers/cmsedit_helper.rb +8 -2
  10. data/app/helpers/dc_application_helper.rb +58 -12
  11. data/app/helpers/dc_common_renderer.rb +5 -4
  12. data/app/helpers/dc_menu_renderer.rb +2 -2
  13. data/app/helpers/dc_page_renderer.rb +3 -1
  14. data/app/helpers/dc_part_renderer.rb +41 -1
  15. data/app/helpers/dc_simple_menu_renderer.rb +2 -1
  16. data/app/models/dc_page.rb +0 -2
  17. data/app/models/dc_site.rb +4 -0
  18. data/app/models/drgcms_form_fields.rb +27 -18
  19. data/app/views/cmsedit/_edit_stuff.html.erb +54 -38
  20. data/app/views/cmsedit/_form.html.erb +1 -1
  21. data/app/views/cmsedit/edit.html.erb +0 -1
  22. data/app/views/cmsedit/login.html.erb +2 -1
  23. data/app/views/cmsedit/{_edit_stuff.js.erb → remove_edit_stuff.js.erb} +0 -0
  24. data/app/views/layouts/{cmsedit.html.erb → __cmsedit.html.erb} +0 -0
  25. data/app/views/layouts/cms.html.erb +3 -1
  26. data/app/views/layouts/content.html.erb +1 -1
  27. data/config/locales/drgcms_en.yml +2 -0
  28. data/config/locales/drgcms_sl.yml +2 -0
  29. data/config/locales/models_en.yml +4 -1
  30. data/config/locales/models_sl.yml +3 -1
  31. data/lib/drg_cms/version.rb +1 -1
  32. data/lib/tasks/dc_at_the_beginning.rake +5 -5
  33. data/lib/tasks/dc_cleanup.rake +8 -2
  34. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d887c0659fd8bf3a65bef4b1efb17f8337119c48
4
- data.tar.gz: 4d950c6bb8e59d9b8973842653c7d1cbb9fd9e4c
3
+ metadata.gz: f15153abc4771ed08a6ffbe80f70b4922b55f05e
4
+ data.tar.gz: 0eb5f0a39892fac760bf75460821d9bc9deef1e7
5
5
  SHA512:
6
- metadata.gz: 9ea94cdd52753eb84264c8672371f79dd7d0775fbe9e7cbab6038ba612b260dfaaaf8740dfdf57eb9e65e1dc4dd38e8fae981362b11e2b9c4580eb6ebff2c20a
7
- data.tar.gz: 14dfc42786eaa772a444b5e5fe6e68b6e73cb1e94700f18bc03d2a3f07f61fce7d26d86858061940fa71fe1c4becd0d3d10dbd209cc29b1523f242d92159b35a
6
+ metadata.gz: 2c9080f136311b94f6eae470ff7c0e09712b621875cd616bdf48a1d8563faec4cc9fab67b79bec8b6197032c971f3b0afae1e21c67aa1256686e211df880ace4
7
+ data.tar.gz: e1bca3a5c70f23342f58e1c6be16be0b2eee186dc223ccdd02efa8161155e3bfcfb8d566b433012213aaed16f03fde738ae602421f7b6f989eb34e38111b488a
@@ -159,6 +159,20 @@ function dc_reload_window() {
159
159
  location.reload();
160
160
  }
161
161
 
162
+ /*******************************************************************
163
+ * I would like to resize window to display whole tab. This will
164
+ * be a job for someone with better javascrip knowledge.
165
+ *******************************************************************/
166
+ function dc_resize_to_tab() {
167
+ dom = $('iframe');
168
+ if (dom.contentWindow.document.body.offsetHeight > 10) {
169
+ alert(dom.style.height);
170
+ dom.style.height = (dom.contentWindow.document.body.offsetHeight + 30) + 'px';
171
+ // scroll to top
172
+ // $('#' + iframe_name).dc_scroll_view();
173
+ }
174
+ };
175
+
162
176
  /*******************************************************************
163
177
  * Will scroll to position on the screen. This is replacement for
164
178
  * location.hash, which doesn't work in Chrome.
@@ -168,7 +182,7 @@ function dc_reload_window() {
168
182
  $.fn.dc_scroll_view = function () {
169
183
  return this.each(function () {
170
184
  $('html, body').animate({
171
- scrollTop: $(this).offset().top - 50
185
+ scrollTop: $(this).offset().top - 20
172
186
  }, 500);
173
187
  });
174
188
  };
@@ -237,6 +251,7 @@ $(document).ready( function() {
237
251
  $('#data_' + old_id).toggleClass('div-hidden');
238
252
  $('#data_' + e.target.getAttribute("data-div")).toggleClass('div-hidden');
239
253
  }
254
+ // dc_resize_to_tab();
240
255
  });
241
256
 
242
257
  /*******************************************************************
@@ -248,7 +263,7 @@ $(document).ready( function() {
248
263
  new_height = this.contentWindow.document.body.offsetHeight + 50;
249
264
  if (new_height < 500 & new_height > 60) new_height = 500;
250
265
  this.style.height = new_height + 'px';
251
- remove_background_from_iframe(this.contentWindow.document);
266
+ // remove_background_from_iframe(this.contentWindow.document);
252
267
  $('#iframe_cms').dc_scroll_view();
253
268
  });
254
269
 
@@ -23,6 +23,57 @@
23
23
  #++
24
24
  */
25
25
 
26
+ /* Web reset. Countributed by
27
+ /* http://meyerweb.com/eric/tools/css/reset/
28
+ v2.0 | 20110126
29
+ License: none (public domain)
30
+ */
31
+
32
+ html, body, div, span, applet, object, iframe,
33
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
34
+ a, abbr, acronym, address, big, cite, code,
35
+ del, dfn, em, img, ins, kbd, q, s, samp,
36
+ small, strike, sub, sup, tt, var,
37
+ b, u, i, center,
38
+ dl, dt, dd, ol, ul, li,
39
+ fieldset, form, label, legend,
40
+ table, caption, tbody, tfoot, thead, tr, th, td,
41
+ article, aside, canvas, details, embed,
42
+ figure, figcaption, footer, header, hgroup,
43
+ menu, nav, output, ruby, section, summary,
44
+ time, mark, audio, video {
45
+ margin: 0;
46
+ padding: 0;
47
+ border: 0;
48
+ font-size: 100%;
49
+ font: inherit;
50
+ vertical-align: baseline;
51
+ }
52
+ /* HTML5 display-role reset for older browsers */
53
+ article, aside, details, figcaption, figure,
54
+ footer, header, hgroup, menu, nav, section {
55
+ display: block;
56
+ }
57
+ body {
58
+ /* line-height: 1; */
59
+ }
60
+ ol, ul {
61
+ list-style: none;
62
+ }
63
+ blockquote, q {
64
+ quotes: none;
65
+ }
66
+ blockquote:before, blockquote:after,
67
+ q:before, q:after {
68
+ content: '';
69
+ content: none;
70
+ }
71
+ table {
72
+ border-collapse: separate;
73
+ border-spacing: 0;
74
+ }
75
+ /* END */
76
+
26
77
  body {
27
78
  font-family: helvetica;
28
79
  font-size: 12px;
@@ -57,22 +108,22 @@ height: 2px;
57
108
  }
58
109
 
59
110
  .div {
60
- background-color: red;
61
111
  border: 0px;
62
112
  padding: 0px;
63
113
  }
64
114
 
115
+
65
116
  .normal {
66
117
  text-align: left;
67
118
  }
68
119
 
120
+ td { vertical-align: middle; }
121
+
69
122
  th {
70
- padding: 5px 1px;
71
- text-align: left;
72
- border-bottom:2px solid #ccc;
73
- background: #fff;
74
- /* border-top:1px solid #ccc;
75
- background: linear-gradient(#eee 5%, #fff 100%); */
123
+ padding: 5px 1px;
124
+ text-align: left;
125
+ border-bottom:2px solid #ccc;
126
+ background: #fff;
76
127
  }
77
128
 
78
129
  th a:hover { color: #000;}
@@ -154,11 +205,12 @@ background-color: #eee;
154
205
  }
155
206
 
156
207
  .dc-link-ajax:hover {
208
+ cursor: pointer;
157
209
  color: #fff;
158
210
  background-color: #888;
159
211
  }
160
212
 
161
- .dc-link-ajax:hover a { color: #fff; }
213
+ .dc-link-ajax:hover a { color: #fff; cursor: pointer }
162
214
 
163
215
  .dc-link-img {
164
216
  padding: 3px;
@@ -167,6 +219,7 @@ background-color: #eee;
167
219
  }
168
220
 
169
221
  .dc-link-img:hover {
222
+ cursor: pointer;
170
223
  background-color: #eee;
171
224
  }
172
225
 
@@ -219,19 +272,21 @@ background-color: #888;
219
272
  .dc-link-submit {
220
273
  text-align: left;
221
274
  padding: 5px 6px;
222
- /* border:1px solid #eee;
223
- padding: 0px;*/
224
275
  margin-right: 4px;
225
276
 
226
277
  border-radius: 5px;
227
278
  background-color: #eee;
228
- /* background: linear-gradient(#eee 5%, #fff 100%); */
229
279
  }
230
280
 
281
+ .dc-link-submit .fa {
282
+ color: #888;
283
+ }
284
+ .dc-link-submit:hover .fa {
285
+ color: #fff;
286
+ }
231
287
  .dc-link-submit:hover {
232
288
  color: #000;
233
289
  background-color: #888;
234
- /* background: linear-gradient(#fff 5%, #eee 100%); */
235
290
  }
236
291
  .dc-link-submit:hover .dc-submit {
237
292
  color: #fff;
@@ -243,7 +298,6 @@ background-color: #888;
243
298
  font-weight: bold;
244
299
  box-shadow: none;
245
300
  background: none;
246
- /* background-color: none; */
247
301
  padding: 0px 2px;
248
302
  border-radius: 0px;
249
303
  }
@@ -252,8 +306,6 @@ background-color: #888;
252
306
  cursor: pointer;
253
307
  text-decoration: none;
254
308
  color: #fff;
255
- /* border-bottom: 1px solid #888;
256
- padding-top: 1px;*/
257
309
  background-color: #888;
258
310
  }
259
311
  /*
@@ -368,29 +420,21 @@ background-color: #888;
368
420
  margin-left: 2px;
369
421
  margin-top: 2px;
370
422
  padding: 2px;
371
- /*
372
- border: solid 1px #e8e8e8;
373
- border-radius: 2px;
374
- background: linear-gradient(#eee 1%, #fff 90%);
375
- background-color: #eee; */
376
423
  }
377
424
 
378
425
  .dc-color-odd {
379
- /* background-color: #f4f4f4;
380
- border-bottom: solid 1px #eee; */
426
+ background-color: #f4f4f4;
427
+ /* border-bottom: solid 1px #eee; */
381
428
  }
382
429
  .dc-color-even {
383
- background-color: #f4f4f4;
384
430
  /* border-bottom: solid 1px #eee; */
385
431
  }
386
432
 
387
433
  .dc-form-ul {
388
- margin-top: 10px;
389
- margin-bottom: 3px;
390
- padding-right: 2px;
391
- padding-left: 2px;
392
- padding-bottom: 2px;
393
- border-bottom: 1px solid #eee;
434
+ margin-top: 6px;
435
+ /*margin-bottom: 3px;*/
436
+ padding: 2px;
437
+ border-bottom: 1px solid #eee;
394
438
  }
395
439
 
396
440
  .dc-spinner {
@@ -405,33 +449,16 @@ background-color: #888;
405
449
  text-align: center;
406
450
  font-weight: bold;
407
451
 
408
- /*
409
- border-bottom: none;
410
- border-top: 1px solid #ccc;
411
- border-left: 1px solid #ccc;
412
- border-right: 1px solid #fff;
413
- */
414
- padding:3px 15px;
452
+ padding:2px 15px;
415
453
  border-radius: 4px 4px 0px 0px;
416
454
  background: #eee;
417
455
  margin-right: 2px;
418
- /* background: linear-gradient(#eee 2%, #fff 100%); */
419
456
  }
420
457
 
421
458
  .dc-form-li:hover, .dc-form-li-selected {
422
459
  cursor: pointer;
423
460
  color: #fff;
424
461
  background: #888;
425
- /*
426
- box-shadow: 4px 0px 2px -2px #aaa ;
427
- box-shadow: 0px -2px 2px #ccc;
428
- /*
429
- border-top: 1px solid #fff;
430
- border-left: 1px solid #fff;
431
- border-right: 1px solid #ddd;
432
- border-bottom: none;
433
- */
434
- /*background: linear-gradient(#fff 2%, #f4f4f4 100%); */
435
462
  }
436
463
 
437
464
  .dc-odd {
@@ -443,27 +470,50 @@ padding: 0px;
443
470
  border-top: 2px solid #ccc;
444
471
  }
445
472
 
446
- #cmsedit-div {
473
+ #cmsedit-div a:link, #cmsedit-div a:active, #cmsedit-div a:visited {
474
+ color: #666;
475
+ font-weight: bold;
476
+ text-decoration: none;
477
+ background: transparent;
478
+ }
479
+
480
+ #cmsedit-div a:hover { color: #000; }
481
+
482
+ #cmsedit-div #record_select {
483
+ border: 2px solid #aaa;
484
+ border-radius: 2px;
485
+ font-size: 1.2em;
486
+ }
487
+
488
+ /* NOT WORKING
489
+ .cmsedit_iframe a:link, #iframe_cms a:active, #iframe_cms a:visited {
490
+ color: #888;
491
+ font-weight: bold;
492
+ text-decoration: none;
493
+ background: transparent;
447
494
  }
448
495
 
496
+ .cmsedit_iframe a:hover { color: #000; }
497
+ */
498
+
449
499
  .cmsedit-menu-plus {
450
500
  }
451
501
 
452
502
  .cmsedit-table {
453
- width: 100%;
454
- background-color: #fff;
455
- border-spacing: 0px;
456
- border-collapse: collapse;
503
+ width: 100%;
504
+ background-color: #fff;
505
+ border-spacing: 0px;
506
+ border-collapse: collapse;
457
507
  }
458
508
 
459
509
  .cmsedit-menu {
460
- background-color: #fff;
461
- padding: 4px;
462
- border-bottom: 3px solid #666;
463
- margin-bottom: 10px;
510
+ background-color: #fff;
511
+ padding: 4px;
512
+ border-bottom: 3px solid #666;
513
+ margin-bottom: 10px;
464
514
  }
465
515
  .cmsedit-menu a {
466
- margin-right: 5px;
516
+ margin-right: 5px;
467
517
  }
468
518
 
469
519
  .cmsedit-menu select#record_select {
@@ -472,8 +522,75 @@ max-width: 300px;
472
522
  height: 26px;
473
523
  }
474
524
 
525
+ .cmsedit-menu ul {
526
+ display: inline-block;
527
+ color: #666;
528
+ margin-right: 4px;
529
+ font-size: 14px;
530
+ }
531
+ .cmsedit-menu .fa {width: 20px;}
532
+
533
+ .cmsedit-menu li a:link, #cmsedit-div li a:visited {
534
+ font-weight: normal;
535
+ color: #fff;
536
+ }
537
+ .cmsedit-menu ul li ul {
538
+ display: none;
539
+ position: absolute;
540
+ z-index: 1000;
541
+ color: #222;
542
+ background-color: #fff;
543
+ border: 1px solid #888;
544
+ box-shadow: 2px 2px 4px #ccc;
545
+ }
546
+
547
+ .cmsedit-menu ul li ul li:hover > ul li ul {
548
+ display:block;
549
+ }
550
+
551
+ #cmsedit-div li a:link, #cmsedit-div li a:visited {
552
+ font-weight: normal;
553
+ color: #222;
554
+ }
555
+
556
+ #cmsedit-div li a:hover {
557
+ color: #222;
558
+ }
559
+
560
+ .cmsedit-menu ul li ul li {
561
+ padding: 5px;
562
+ }
563
+ .cmsedit-menu ul li ul li:hover {
564
+ background-color: #ddd;
565
+ color: #222;
566
+ }
567
+
568
+ .cmsedit-menu ul li ul li ul {
569
+ z-index: 1000;
570
+ left: 100%;
571
+ position: absolute;
572
+ margin-top: -20px;
573
+ display: none;
574
+ color: #fff;
575
+ background-color: #fff;
576
+ border: 1px solid #888;
577
+ box-shadow: 2px 2px 4px #ccc;
578
+ min-width:300px;
579
+ }
580
+
581
+ .cmsedit-menu ul li ul a { color: white; }
582
+
583
+ .cmsedit-menu ul li:hover > ul {
584
+ display:block;
585
+ }
586
+ .cmsedit-menu ul li li {
587
+ position:relative;
588
+ display:block;
589
+ float:none;
590
+ }
591
+
475
592
  #result {
476
- background-color: #eee;
593
+ background-color: #eee;
477
594
  }
478
595
 
479
596
  /*********************/
@@ -509,12 +626,26 @@ color: #222;
509
626
  background-color: lightyellow;
510
627
  }
511
628
 
512
- /* testing */
513
- .dc-login {
629
+ #dc-login {
630
+ /*
514
631
  position: relative;
515
632
  text-align: left;
516
633
  bottom: 0px;
517
634
  right: 0px;
635
+ */
636
+ display: inline-block;
637
+ position: fixed;
638
+ top: 0;
639
+ bottom: 0;
640
+ left: 0;
641
+ right: 0;
642
+ width: 250px;
643
+ height: 100px;
644
+ padding: 10px;
645
+ margin: auto;
646
+ background-color: #fff;
647
+ border: 1px solid #888;
648
+ box-shadow: 1px 1px 4px #888;
518
649
  }
519
650
 
520
651
  .div-hidden {
@@ -522,8 +653,6 @@ display: none;
522
653
  }
523
654
 
524
655
  .drgcms_popmenu_class {
525
- list-style:none;
526
- margin-left:-40px;
527
656
  padding:4px;
528
657
  position:absolute;
529
658
  background-color: #eee;
@@ -532,14 +661,14 @@ border-radius: 4px;
532
661
  z-index: 100;
533
662
  }
534
663
 
535
- .drgcms_popmenu_class a:hover {
536
- background-color: yellow;
537
- color: red;
538
- text-decoration: none;
664
+ .drgcms_popmenu_item {
665
+ padding: 6px;
666
+ border: 1px solid #eee;
539
667
  }
540
-
541
668
  .drgcms_popmenu_item:hover {
542
669
  background-color: white;
670
+ border: 1px solid #ddd;
671
+ border-radius: 2px;
543
672
  }
544
673
 
545
674
  .drgcms_sort {
@@ -663,7 +792,7 @@ color: #fff;
663
792
  /************************** info popup *************************/
664
793
  #dc-document-info {
665
794
  float: right;
666
- color: #c43;
795
+ color: #888;
667
796
  font-size: 11px;
668
797
  }
669
798