mongo3 0.0.9 → 0.1.0

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 (95) hide show
  1. data/.bnignore +3 -0
  2. data/.bnsignore +16 -0
  3. data/.gitignore +1 -0
  4. data/HISTORY +11 -1
  5. data/README.rdoc +2 -0
  6. data/bin/mongo3 +7 -6
  7. data/config/mongo3.yml +33 -0
  8. data/data/populate +37 -0
  9. data/lib/controllers/collections.rb +2 -10
  10. data/lib/controllers/databases.rb +12 -1
  11. data/lib/controllers/explore.rb +20 -6
  12. data/lib/helpers/collection_helper.rb +34 -2
  13. data/lib/helpers/explore_helper.rb +0 -5
  14. data/lib/helpers/main_helper.rb +5 -0
  15. data/lib/helpers/paths_helper.rb +15 -0
  16. data/lib/mongo3/connection.rb +39 -24
  17. data/lib/mongo3/user.rb +10 -4
  18. data/lib/mongo3/zone.rb +24 -8
  19. data/lib/mongo3.rb +4 -7
  20. data/lib/public/.DS_Store +0 -0
  21. data/lib/public/images/favicon.png +0 -0
  22. data/lib/public/images/information.png +0 -0
  23. data/lib/public/images/tree/Thumbs.db +0 -0
  24. data/lib/public/images/tree/array.png +0 -0
  25. data/lib/public/images/tree/arrow_refresh.png +0 -0
  26. data/lib/public/images/tree/collapsable-last.gif +0 -0
  27. data/lib/public/images/tree/collapsable.gif +0 -0
  28. data/lib/public/images/tree/collection.png +0 -0
  29. data/lib/public/images/tree/cross.png +0 -0
  30. data/lib/public/images/tree/disk.png +0 -0
  31. data/lib/public/images/tree/expandable-last.gif +0 -0
  32. data/lib/public/images/tree/expandable-last.png +0 -0
  33. data/lib/public/images/tree/expandable.gif +0 -0
  34. data/lib/public/images/tree/expandable.png +0 -0
  35. data/lib/public/images/tree/folder_add.png +0 -0
  36. data/lib/public/images/tree/folder_delete.png +0 -0
  37. data/lib/public/images/tree/folder_edit.png +0 -0
  38. data/lib/public/images/tree/icons.png +0 -0
  39. data/lib/public/images/tree/leaf-last.gif +0 -0
  40. data/lib/public/images/tree/leaf-last.png +0 -0
  41. data/lib/public/images/tree/leaf.gif +0 -0
  42. data/lib/public/images/tree/leaf.png +0 -0
  43. data/lib/public/images/tree/line_bg.gif +0 -0
  44. data/lib/public/images/tree/line_bg_over.gif +0 -0
  45. data/lib/public/images/tree/line_bg_over_last.gif +0 -0
  46. data/lib/public/images/tree/minus.gif +0 -0
  47. data/lib/public/images/tree/page_add.png +0 -0
  48. data/lib/public/images/tree/page_delete.png +0 -0
  49. data/lib/public/images/tree/page_edit.png +0 -0
  50. data/lib/public/images/tree/plus.gif +0 -0
  51. data/lib/public/images/tree/root.gif +0 -0
  52. data/lib/public/images/tree/spacer.gif +0 -0
  53. data/lib/public/images/tree/spinner.gif +0 -0
  54. data/lib/public/images/tree/tree_line.gif +0 -0
  55. data/lib/public/javascripts/.DS_Store +0 -0
  56. data/lib/public/javascripts/jquery.simple.tree.js +451 -0
  57. data/lib/public/javascripts/jquery.tiptip.min.js +6 -0
  58. data/lib/public/javascripts/jquery.tree.min.js +1 -0
  59. data/lib/public/javascripts/jstree/jquery.tree.js +2058 -0
  60. data/lib/public/javascripts/themes/mongo3/bg.jpg +0 -0
  61. data/lib/public/javascripts/themes/mongo3/dot_for_ie.gif +0 -0
  62. data/lib/public/javascripts/themes/mongo3/icons.png +0 -0
  63. data/lib/public/javascripts/themes/mongo3/style.css +39 -0
  64. data/lib/public/javascripts/themes/mongo3/throbber.gif +0 -0
  65. data/lib/public/stylesheets/mongo3.css +201 -65
  66. data/lib/views/collections/_fields_form.erb +1 -1
  67. data/lib/views/collections/_index_form.erb +1 -1
  68. data/lib/views/collections/_index_rows.erb +40 -15
  69. data/lib/views/collections/_nodes.erb +0 -0
  70. data/lib/views/collections/_results.erb +4 -4
  71. data/lib/views/collections/{_rows.erb → _rows_table.erb} +11 -9
  72. data/lib/views/collections/_rows_tree.erb +81 -0
  73. data/lib/views/collections/_search_form.erb +1 -1
  74. data/lib/views/collections/blee.erb +20 -0
  75. data/lib/views/collections/list.erb +1 -1
  76. data/lib/views/collections/update.js.erb +1 -1
  77. data/lib/views/databases/_results.erb +9 -7
  78. data/lib/views/explore/_node_info.erb +21 -4
  79. data/lib/views/explore/explore.erb +11 -1
  80. data/lib/views/explore/load_collection.js.erb +1 -0
  81. data/lib/views/explore/load_database.js.erb +1 -0
  82. data/lib/views/layout.erb +13 -7
  83. data/lib/views/users/_results.erb +2 -2
  84. data/spec/configs/crap.yml +20 -0
  85. data/spec/configs/hosed.yml +4 -0
  86. data/spec/configs/landscape.yml +9 -0
  87. data/spec/mongo3/connection_spec.rb +105 -12
  88. data/spec/mongo3/node_spec.rb +38 -0
  89. data/spec/mongo3/user_spec.rb +72 -0
  90. data/spec/mongo3/zone_spec.rb +69 -0
  91. data/spec/mongo3_spec.rb +20 -0
  92. data/spec/spec_helper.rb +13 -0
  93. data/tasks/setup.rb +1 -1
  94. metadata +71 -6
  95. data/spec/landscape.yml +0 -3
@@ -0,0 +1,39 @@
1
+ .tree li {
2
+ width: 875px;
3
+ float: left;
4
+ }
5
+
6
+ /* BACKGROUND */
7
+ .tree-mongo3 .ltr, .tree-mongo3 .rtl { background:transparent; min-width:100%; _width:100%; margin-left:0; margin-right:0; display:table; }
8
+ .tree-mongo3 .ltr > li.leaf, .tree-mongo3 .rtl > li.leaf { background-image:none; }
9
+
10
+ /* LOCKED */
11
+ .tree-mongo3 .locked li a { color:gray; }
12
+ /* DOTS */
13
+ .tree-mongo3 ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); }
14
+ .tree-mongo3 li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); }
15
+ /* NO DOTS */
16
+ .tree-mongo3 .no_dots, .tree-mongo3 .no_dots ul { background:transparent; }
17
+ .tree-mongo3 .no_dots li.leaf { background-image:none; background-color:transparent; }
18
+ /* OPEN or CLOSED */
19
+ .tree-mongo3 li.open { background:url("icons.png") -32px -48px no-repeat; }
20
+ .tree-mongo3 li.closed, #jstree-dragged.tree-mongo3 li li.open { background:url("icons.png") -48px -32px no-repeat; }
21
+ #jstree-marker { background-image:url("icons.png"); }
22
+ /* DEFAULT, HOVER, CLICKED, LOADING STATES */
23
+ .tree-mongo3 li a, .tree-mongo3 li span { color:#fff; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; }
24
+ .tree-mongo3 li a:hover, .tree-mongo3 li a.hover, .tree-mongo3 li span:hover { color: #92b948; }
25
+ .tree-mongo3 li a.clicked, .tree-mongo3 li a.clicked:hover, .tree-mongo3 li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; }
26
+ /* ICONS */
27
+ .tree-mongo3 ins { vertical-align:text-bottom; background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; }
28
+ .tree-mongo3 ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */
29
+ .tree-mongo3 li a ins.forbidden { background-position:-16px -16px; }
30
+ .tree-mongo3 .locked li a ins { background-position:0 -48px; }
31
+ .tree-mongo3 li span ins { background-position:-16px 0; }
32
+ #jstree-dragged.tree-mongo3 ins { background:url("icons.png") -16px -32px no-repeat; }
33
+ #jstree-dragged.tree-mongo3 ins.forbidden { background:url("icons.png") -16px -16px no-repeat; }
34
+
35
+ /* CONTEXT MENU */
36
+ .tree-mongo3-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; }
37
+ .tree-mongo3-context a ins.create { background-position:0 -16px; }
38
+ .tree-mongo3-context a ins.rename { background-position:-16px 0px; }
39
+ .tree-mongo3-context a ins.remove { background-position:0 -32px; }
@@ -20,13 +20,6 @@ body {
20
20
  margin: 0;
21
21
  }
22
22
 
23
- span#version {
24
- color: #4d7bff;
25
- font-size: .4em;
26
- vertical-align: bottom;
27
- margin: 88px 0px 0px -57px;
28
- }
29
-
30
23
  img {
31
24
  border: none;
32
25
  vertical-align: text-top;
@@ -34,17 +27,18 @@ img {
34
27
 
35
28
  /* Flash */
36
29
  div.flash {
37
- display: none;
38
- width: 95%;
39
- padding: 10px;
40
- margin: 20px 0 0px 300px;
41
- font-size: .5em;
42
- color: #fff;
43
- border: 1px #92b948 solid;
44
- -moz-border-radius-bottomleft: 20px;
45
- -moz-border-radius-topleft: 0px;
46
- -moz-border-radius-bottomright: 0px;
47
- -moz-border-radius-topright: 20px;
30
+ display: none;
31
+ width: 95%;
32
+ padding: 10px;
33
+ margin: 20px 0 0px 300px;
34
+ font-size: .5em;
35
+ color: #fff;
36
+ border: 1px #92b948 solid;
37
+ -moz-border-radius: 20px 0px 20px 0px;
38
+ -webkit-border-top-right-radius: 20px;
39
+ -webkit-border-top-left-radius: 0px;
40
+ -webkit-border-bottom-left-radius: 20px;
41
+ -webkit-border-bottom-right-radius: 0px;
48
42
  }
49
43
  div.flash_error {
50
44
  color: #f00;
@@ -67,13 +61,25 @@ div#logo {
67
61
  margin: 10px 0px 25px 20px;
68
62
  }
69
63
 
64
+ div#version {
65
+ color: #4d7bff;
66
+ font-size: .4em;
67
+ margin: 64px 0px 0px 255px;
68
+ }
69
+
70
+ img#logo {
71
+ display: inline;
72
+ float: left;
73
+ }
74
+
75
+
70
76
  #main {
71
77
  clear: left;
72
78
  margin: 20px 10px 10px 20px;
73
79
  overflow: none;
74
80
  }
75
81
 
76
- ul {
82
+ ul.list {
77
83
  list-style-image: none;
78
84
  list-style-position: outside;
79
85
  list-style-type: none;
@@ -221,15 +227,9 @@ div.scrollable div.items {
221
227
 
222
228
  /* Commons */
223
229
  div.borders {
224
- -moz-border-radius-bottomleft: 7px;
225
- -moz-border-radius-topleft: 7px;
226
- -moz-border-radius-bottomright: 7px;
227
- -moz-border-radius-topright: 7px;
228
- -webkit-border-top-left-radius: 7px;
229
- -webkit-border-top-right-radius: 7px;
230
- -webkit-border-bottom-right-radius: 7px;
231
- -webkit-border-bottom-left-radius: 7px;
232
- border: 1px #92b948 solid;
230
+ -moz-border-radius: 7px;
231
+ -webkit-border-radius: 7px;
232
+ border: 1px #92b948 solid;
233
233
  }
234
234
 
235
235
  /* Explorer css */
@@ -291,10 +291,8 @@ div#fields {
291
291
  margin: 20px 10px;
292
292
  padding: 10px 10px;
293
293
  overflow: hidden;
294
- -moz-border-radius-bottomleft: 7px;
295
- -moz-border-radius-topleft: 7px;
296
- -moz-border-radius-bottomright: 7px;
297
- -moz-border-radius-topright: 7px;
294
+ -moz-border-radius: 7px;
295
+ -webkit-border-radius: 7px;
298
296
  border: 1px #92b948 solid;
299
297
  }
300
298
  div.title {
@@ -311,7 +309,7 @@ fieldset {
311
309
  }
312
310
  fieldset.check {
313
311
  float: left;
314
- width: 20%;
312
+ width: 25%;
315
313
  }
316
314
 
317
315
  p.ctx {
@@ -335,10 +333,13 @@ table.cltn {
335
333
  table.cltn thead {
336
334
  font-weight: bold;
337
335
  border-bottom: 1px #c1c1c1 solid;
338
- color: #c1c1c1;
336
+ color: #ff8f00;
337
+ }
338
+ table.cltn tbody td {
339
+ padding: 0px 5px 0px 0px;
339
340
  }
340
- table.cltn tr {
341
- color: #fff;
341
+ table.cltn tbody tr {
342
+ color: #c1c1c1;
342
343
  }
343
344
  table.cltn tr.highlight {
344
345
  color: #92b948;
@@ -375,31 +376,28 @@ img.del_index {
375
376
  }
376
377
 
377
378
  input.search {
378
- background: transparent url(/images/search.png) no-repeat 2px 6px;
379
- width: 96%;
380
- border: 2px #434343 solid;
381
- -moz-border-radius-bottomleft: 0px;
382
- -moz-border-radius-bottomright: 10px;
383
- -moz-border-radius-topleft: 10px;
384
- -moz-border-radius-topright: 0px;
385
- height: 25px;
386
- font-size: 1.2em;
387
- color: #92b948;
388
- padding: 5px 0px 0px 20px;
389
- margin: 5px 5px;
379
+ background: transparent url(/images/search.png) no-repeat 2px 6px;
380
+ width: 96%;
381
+ border: 2px #434343 solid;
382
+ -moz-border-radius: 40px/10px;
383
+ -webkit-border-radius: 40px 10px;
384
+ height: 25px;
385
+ font-size: 1.2em;
386
+ color: #92b948;
387
+ padding: 5px 0px 0px 20px;
388
+ margin: 5px 5px;
390
389
  }
391
390
 
392
391
  button {
393
- -moz-border-radius-bottomleft: 14px;
394
- -moz-border-radius-bottomright: 14px;
395
- -moz-border-radius-topleft: 14px;
396
- -moz-border-radius-topright: 14px;
397
- -moz-box-shadow: 2px 2px 6px #232323;
398
- background: transparent url(/images/button.png) repeat-x center bottom;
399
- height: 20px;
400
- width: 100px;
401
- margin-right: 10px;
402
- color: #c1c1c1;
392
+ -moz-border-radius: 14px;
393
+ -moz-box-shadow: 2px 2px 6px #232323;
394
+ -webkit-border-radius: 14px;
395
+ -webkit-box-shadow: 2px 2px 6px #232323;
396
+ background: transparent url(/images/button.png) repeat-x center bottom;
397
+ height: 20px;
398
+ width: 100px;
399
+ margin-right: 10px;
400
+ color: #c1c1c1;
403
401
  }
404
402
 
405
403
  button.show:hover {
@@ -445,7 +443,7 @@ button.drop:hover {
445
443
  img.delete {
446
444
  cursor: pointer;
447
445
  border: 0;
448
- display:none;
446
+ /* display:none;*/
449
447
  }
450
448
  img.wait {
451
449
  width: 16px;
@@ -464,8 +462,8 @@ img.wait {
464
462
  border: 2px solid #333;
465
463
  opacity: 0.8;
466
464
  -moz-border-radius: 6px;
465
+ -moz-box-shadow: 0 0 20px #92b948;
467
466
  -webkit-border-radius: 6px;
468
- -moz-box-shadow: 0 0 20px #92b948;
469
467
  -webkit-box-shadow: 0 0 20px #92b948;
470
468
  }
471
469
 
@@ -485,13 +483,25 @@ div#info {
485
483
  }
486
484
 
487
485
  /* Node information */
488
- div.item img {
486
+ div.item img.drop {
489
487
  z-index: 100;
490
488
  display: none;
491
489
  float: left;
492
490
  margin-right: 10px;
493
491
  }
494
492
 
493
+ p.info {
494
+ float:left;
495
+ }
496
+
497
+ p.show {
498
+ float: left;
499
+ }
500
+ img.info {
501
+ display: block;
502
+ float: right;
503
+ }
504
+
495
505
  div#legend {
496
506
  border-bottom: 1px #434343 solid;
497
507
  font-size: 0.5em;
@@ -525,10 +535,8 @@ div.selected {
525
535
 
526
536
  /* Users */
527
537
  input.field_border {
528
- -moz-border-radius-bottomleft: 0px;
529
- -moz-border-radius-bottomright: 10px;
530
- -moz-border-radius-topleft: 10px;
531
- -moz-border-radius-topright: 0px;
538
+ -moz-border-radius: 40px/10px;
539
+ -webkit-border-radius: 40px 10px;
532
540
  }
533
541
 
534
542
  input.user {
@@ -545,3 +553,131 @@ input.user {
545
553
  button.user:hover {
546
554
  background-color: #ad1ecb;
547
555
  }
556
+
557
+ /* ------------------------------------------------------------------------- */
558
+ /* Tooltips */
559
+ #tiptip_holder {
560
+ display: none;
561
+ position: absolute;
562
+ top: 0;
563
+ left: 0;
564
+ z-index: 99999;
565
+ }
566
+
567
+ #tiptip_holder.tip_top {
568
+ padding-bottom: 5px;
569
+ }
570
+
571
+ #tiptip_holder.tip_bottom {
572
+ padding-top: 5px;
573
+ }
574
+
575
+ #tiptip_holder.tip_right {
576
+ padding-left: 5px;
577
+ }
578
+
579
+ #tiptip_holder.tip_left {
580
+ padding-right: 5px;
581
+ }
582
+
583
+ #tiptip_content {
584
+ font-size: 11px;
585
+ color: #fff;
586
+ text-shadow: 0 0 2px #000;
587
+ padding: 4px 8px;
588
+ border: 1px solid rgba(255,255,255,0.25);
589
+ background-color: rgb(45,45,45);
590
+ background-color: rgba(45,45,45,0.92);
591
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000));
592
+ border-radius: 3px;
593
+ -webkit-border-radius: 3px;
594
+ -moz-border-radius: 3px;
595
+ box-shadow: 0 0 3px #555;
596
+ -webkit-box-shadow: 0 0 3px #555;
597
+ -moz-box-shadow: 0 0 3px #555;
598
+ }
599
+
600
+ #tiptip_arrow, #tiptip_arrow_inner {
601
+ position: absolute;
602
+ border-color: transparent;
603
+ border-style: solid;
604
+ border-width: 6px;
605
+ height: 0;
606
+ width: 0;
607
+ }
608
+
609
+ #tiptip_holder.tip_top #tiptip_arrow {
610
+ border-top-color: #fff;
611
+ border-top-color: rgba(255,255,255,0.35);
612
+ }
613
+
614
+ #tiptip_holder.tip_bottom #tiptip_arrow {
615
+ border-bottom-color: #fff;
616
+ border-bottom-color: rgba(255,255,255,0.35);
617
+ }
618
+
619
+ #tiptip_holder.tip_right #tiptip_arrow {
620
+ border-right-color: #fff;
621
+ border-right-color: rgba(255,255,255,0.35);
622
+ }
623
+
624
+ #tiptip_holder.tip_left #tiptip_arrow {
625
+ border-left-color: #fff;
626
+ border-left-color: rgba(255,255,255,0.35);
627
+ }
628
+
629
+ #tiptip_holder.tip_top #tiptip_arrow_inner {
630
+ margin-top: -7px;
631
+ margin-left: -6px;
632
+ border-top-color: rgb(45,45,45);
633
+ border-top-color: rgba(45,45,45,0.92);
634
+ }
635
+
636
+ #tiptip_holder.tip_bottom #tiptip_arrow_inner {
637
+ margin-top: -5px;
638
+ margin-left: -6px;
639
+ border-bottom-color: rgb(45,45,45);
640
+ border-bottom-color: rgba(45,45,45,0.92);
641
+ }
642
+
643
+ #tiptip_holder.tip_right #tiptip_arrow_inner {
644
+ margin-top: -6px;
645
+ margin-left: -5px;
646
+ border-right-color: rgb(45,45,45);
647
+ border-right-color: rgba(45,45,45,0.92);
648
+ }
649
+
650
+ #tiptip_holder.tip_left #tiptip_arrow_inner {
651
+ margin-top: -6px;
652
+ margin-left: -7px;
653
+ border-left-color: rgb(45,45,45);
654
+ border-left-color: rgba(45,45,45,0.92);
655
+ }
656
+
657
+ /* Webkit Hacks */
658
+ @media screen and (-webkit-min-device-pixel-ratio:0) {
659
+ #tiptip_content {
660
+ padding: 4px 8px 5px 8px;
661
+ background-color: rgba(45,45,45,0.88);
662
+ }
663
+ #tiptip_holder.tip_bottom #tiptip_arrow_inner {
664
+ border-bottom-color: rgba(45,45,45,0.88);
665
+ }
666
+ #tiptip_holder.tip_top #tiptip_arrow_inner {
667
+ border-top-color: rgba(20,20,20,0.92);
668
+ }
669
+ }
670
+
671
+ /* ------------------------------------------------------------------------- */
672
+ /* Document Tree */
673
+ span span.meta {
674
+ font-style: italic;
675
+ color: #c1c1c1;
676
+ }
677
+
678
+ div.delete {
679
+ display: inline;
680
+ float: right;
681
+ width: 5%;
682
+ }
683
+
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
  <fieldset style="float:right;">
11
11
  <button type="submit" id="submit_button" class="button show">show</button>
12
- <img id="show_load" src="/images/loading.gif" style="width:20px;height:20px;vertical-align:top;display:none"></img>
12
+ <img id="show_load" src="/images/loading.gif" style="width:20px;height:20px;vertical-align:top;display:none"/>
13
13
  </fieldset>
14
14
  </form>
15
15
 
@@ -4,7 +4,7 @@
4
4
  <fieldset>
5
5
  <input id="index" type="text" name="index" class="search" value=""/>
6
6
  <button type="submit" id="submit_button" class="button search" style="display:none">create</button>
7
- <img id="create_load" src="/images/loading.gif" style="width:25px;height:25px;vertical-align:sub;display:none"></img>
7
+ <img id="create_load" src="/images/loading.gif" style="width:25px;height:25px;vertical-align:sub;display:none"/>
8
8
  </fieldset>
9
9
  </form>
10
10
 
@@ -3,16 +3,18 @@
3
3
  <div class="borders" style="padding:10px">
4
4
  <table id="indexes" class="cltn" border="0" cellpadding="10" cellspacing="20">
5
5
  <thead>
6
- <th width="2%">&nbsp;</td>
7
- <th>Name</th>
8
- <th>Settings</th>
6
+ <tr>
7
+ <th width="3%">&nbsp;</th>
8
+ <th>Name</th>
9
+ <th>Settings</th>
10
+ </tr>
9
11
  </thead>
10
12
  <tbody>
11
13
  <% @indexes.keys.sort.each do |name| %>
12
14
  <tr id="<%=name%>" valign="top">
13
15
  <td id="<%=name%>">
14
- <img class="del_index" id="<%=name%>" src="/images/delete.png" title="delete this index"/>
15
- <img class="wait" id="wait_<%=name%>" src="/images/loading.gif"></img>
16
+ <img rel="div#confirm_drop" class="drop" style="display:none" id="<%=name%>" src="/images/delete.png" title="delete this index"/>
17
+ <img class="wait" id="wait_<%=name%>" src="/images/loading.gif"/>
16
18
  </td>
17
19
  <td><%=name%></td>
18
20
  <% buff = [];@indexes[name].each do |pair| %>
@@ -25,30 +27,53 @@
25
27
  </table>
26
28
  </div>
27
29
 
30
+ <div class="modal" id="confirm_drop" style="font-size:1em">
31
+ <p>Dropping index. Are you sure?</p>
32
+ <p style="margin:10px">
33
+ <button class="close yes">Yes</button>
34
+ <button class="close">No</button>
35
+ </p>
36
+ </div>
37
+
28
38
  <script>
29
39
  $( function() {
30
- $("table#indexes tr" ).hover(
40
+ $("table#indexes tbody tr" ).hover(
31
41
  function() {
32
42
  $(this).addClass( 'highlight' );
33
- $("td#" + $(this).attr('id') + " img.del_index" ).show();
43
+ $("td#" + $(this).attr('id') + " img.drop" ).show();
34
44
  },
35
45
  function() {
36
46
  $(this).removeClass( 'highlight' );
37
- $("td#" + $(this).attr('id') + " img.del_index" ).hide();
47
+ $("td#" + $(this).attr('id') + " img.drop" ).hide();
38
48
  });
39
- $( "img.del_index" ).click( function() {
40
- var id = $(this).attr('id');
49
+
50
+ $('img.drop' ).overlay( {
51
+ expose: {
52
+ color: '#212021',
53
+ loadSpeed: 200,
54
+ opacity: 0.9
55
+ },
56
+ onBeforeLoad: function() {
57
+ $("button.yes").attr( 'id', this.getTrigger().attr('id') );
58
+ },
59
+ closeOnClick: false
60
+ });
61
+
62
+ $( 'button.yes' ).click( function() {
63
+ var self = $(this);
41
64
  $.ajax({
42
- data: {id: id},
65
+ data: {id:self.attr('id')},
43
66
  dataType: 'script',
44
67
  type: 'post',
45
68
  url: '/collections/drop_index/',
46
- beforeSend: function() { $('img#_wait_' + id ).show(); },
69
+ beforeSend: function() {
70
+ $('img#_wait_' + self.attr('id') ).show();
71
+ },
47
72
  complete: function() {
48
- $('img#_wait_' + id ).hide();
49
- $('tr#' + id ).fadeOut();
73
+ $('img#_wait_' + self.attr('id') ).hide();
74
+ $('tr#' + self.attr('id') ).fadeOut();
50
75
  }
51
76
  });
52
- });
77
+ });
53
78
  });
54
79
  </script>
File without changes
@@ -1,10 +1,10 @@
1
1
  <% unless @cltn.empty? %>
2
- <div id="fields">
3
- <%= partial :'collections/fields_form' %>
4
- </div>
2
+ <!-- <div id="fields">
3
+ <= partial :'collections/fields_form' %>
4
+ </div> -->
5
5
 
6
6
  <div class="table">
7
- <%= partial :'collections/rows' %>
7
+ <%= partial :'collections/rows_tree' %>
8
8
  </div>
9
9
  <% else %>
10
10
  <div class="no_items">Oh snap! No items found...</span>
@@ -5,23 +5,25 @@
5
5
  <%= partial :'collections/search_form' %>
6
6
 
7
7
  <div class="borders" style="padding:10px;">
8
- <table id="cltn" class="cltn" border="0" cellpadding="10" cellspacing="20">
8
+ <table id="cltn" class="cltn" border="0" cellspacing="10">
9
9
  <thead>
10
- <th width="2%">&nbsp;</td>
11
- <% @selected_cols.each do |col| %>
12
- <th><%=col%></th>
13
- <% end %>
10
+ <tr>
11
+ <th width="5%">&nbsp;</td>
12
+ <% @selected_cols.each do |col| %>
13
+ <th width="20%" align="<%=align_for( @cltn[0][col] )%>"><%=col%></th>
14
+ <% end %>
15
+ </tr>
14
16
  </thead>
15
17
  <tbody>
16
18
  <% @cltn.each do |cltn| %>
17
19
  <% id = cltn['_id'] %>
18
20
  <tr id="<%=id%>" valign="top">
19
- <td id="<%=id%>">
21
+ <td id="<%=id%>" style="margin:0px;padding:0px">
20
22
  <img class="delete" id="<%=id%>" src="/images/delete.png" title="delete this record"/>
21
23
  <img class="wait" id="wait_<%=id%>" src="/images/loading.gif"></img>
22
24
  </td>
23
25
  <% @selected_cols.each do |k| %>
24
- <td><%= format_value(cltn[k]) %></td>
26
+ <td align="<%=align_for( cltn[k] ) %>"><%= format_value(cltn[k]) %></td>
25
27
  <% end %>
26
28
  </tr>
27
29
  <% end %>
@@ -35,7 +37,7 @@
35
37
 
36
38
  <script>
37
39
  $( function() {
38
- $("table#cltn tr" ).hover(
40
+ $("table#cltn tbody tr" ).hover(
39
41
  function() {
40
42
  $(this).addClass( 'highlight' );
41
43
  $("td#" + $(this).attr('id') + " img.delete" ).show();
@@ -53,7 +55,7 @@
53
55
  url: '/collections/delete/',
54
56
  beforeSend: function() { $('img#_wait_' + id ).show(); },
55
57
  complete: function() { $('img#_wait_' + id ).hide(); }
56
- });
58
+ });
57
59
  });
58
60
  });
59
61
  </script>
@@ -0,0 +1,81 @@
1
+ <div id="summary" style="clear:both">
2
+ <%= page_entries_info @cltn, :entry_name => 'item' %>
3
+ </div>
4
+
5
+ <%= partial :'collections/search_form' %>
6
+
7
+ <div class="borders" style="padding:10px;">
8
+ <div id="tree">
9
+ <ul>
10
+ <% count=0;@cltn.each do |cltn| %>
11
+ <% id = cltn['_id'] %>
12
+ <li><span><ins></ins><%=id%></span>
13
+ <div class="delete">
14
+ <img rel="div#confirm_drop" class="delete" style="float:left;" id="<%=id%>" src="/images/delete.png" title="delete this record"/>
15
+ <img class="wait" id="wait_<%=id%>" src="/images/loading.gif"/>
16
+ </div>
17
+ <ul>
18
+ <% cltn.keys.sort.each do |k| %>
19
+ <% next if k == '_id' %>
20
+ <%= format_nodes( cltn[k], k ) %>
21
+ <% count+=1;end %>
22
+ </ul>
23
+ </li>
24
+ <% end %>
25
+ </ul>
26
+ </div>
27
+ </div>
28
+
29
+ <div id="links">
30
+ <%= will_paginate @cltn, :params => { :url => '/collections' } %>
31
+ </div>
32
+
33
+ <div class="modal" id="confirm_drop" style="font-size:1em">
34
+ <p>Dropping document. Are you sure?</p>
35
+ <p style="margin:10px">
36
+ <button class="close yes">Yes</button>
37
+ <button class="close">No</button>
38
+ </p>
39
+ </div>
40
+
41
+ <script>
42
+ $( function() {
43
+ $('div#tree').tree( {
44
+ ui: { theme_name: 'mongo3', theme_path: '/javascripts/themes/mongo3/style.css'},
45
+ "default" : {
46
+ renameable: false,
47
+ deletable: false,
48
+ draggable: false,
49
+ creatable: false
50
+ }
51
+ });
52
+
53
+ $('img.delete' ).overlay( {
54
+ expose: {
55
+ color: '#212021',
56
+ loadSpeed: 200,
57
+ opacity: 0.9
58
+ },
59
+ onBeforeLoad: function() {
60
+ $("button.yes").attr( 'id', this.getTrigger().attr('id') );
61
+ },
62
+ closeOnClick: false
63
+ });
64
+
65
+ $( 'button.yes' ).click( function() {
66
+ var self = $(this);
67
+ $.ajax({
68
+ data: {id:self.attr('id')},
69
+ dataType: 'script',
70
+ type: 'post',
71
+ url: '/collections/delete/',
72
+ beforeSend: function() {
73
+ $('img#wait_' + self.attr('id') ).show();
74
+ },
75
+ complete: function() {
76
+ $('img#wait_' + self.attr('id') ).hide();
77
+ }
78
+ });
79
+ });
80
+ });
81
+ </script>