mongo3 0.0.2 → 0.0.3

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 (53) hide show
  1. data/HISTORY +7 -1
  2. data/data/populate +20 -0
  3. data/lib/controllers/collections.rb +54 -13
  4. data/lib/controllers/databases.rb +2 -2
  5. data/lib/controllers/explore.rb +8 -13
  6. data/lib/helpers/flash_helper.rb +9 -0
  7. data/lib/helpers/main_helper.rb +33 -21
  8. data/lib/mongo3/connection.rb +40 -4
  9. data/lib/mongo3.rb +1 -1
  10. data/lib/public/images/button_act.png +0 -0
  11. data/lib/public/images/button_act.psd +0 -0
  12. data/lib/public/images/clear.png +0 -0
  13. data/lib/public/images/clear.psd +0 -0
  14. data/lib/public/images/delete_big.png +0 -0
  15. data/lib/public/images/delete_big.psd +0 -0
  16. data/lib/public/images/loading.gif +0 -0
  17. data/lib/public/javascripts/jquery.confirm.js +132 -0
  18. data/lib/public/javascripts/jquery.example.js +160 -0
  19. data/lib/public/stylesheets/mongo3.css +37 -1
  20. data/lib/views/{_fields_form.erb → collections/_fields_form.erb} +7 -6
  21. data/lib/views/collections/_results.erb +12 -0
  22. data/lib/views/collections/_rows.erb +53 -0
  23. data/lib/views/collections/_search_form.erb +27 -0
  24. data/lib/views/collections/list.erb +52 -0
  25. data/lib/views/collections/results.js.erb +2 -0
  26. data/lib/views/collections/update.js.erb +1 -0
  27. data/lib/views/{db_list.erb → databases/list.erb} +3 -3
  28. data/lib/views/explore/center_js.erb +3 -0
  29. data/lib/views/{explore.erb → explore/explore.erb} +1 -4
  30. data/lib/views/explore/more_data_js.erb +3 -0
  31. data/lib/views/explore/update_crumb_js.erb +1 -0
  32. data/lib/views/layout.erb +2 -0
  33. data/lib/views/shared/_flash.erb +3 -0
  34. data/lib/views/shared/flash.js.erb +8 -0
  35. metadata +49 -44
  36. data/lib/views/_cltn.erb +0 -25
  37. data/lib/views/_cltn_info.erb +0 -95
  38. data/lib/views/_collection.erb +0 -5
  39. data/lib/views/_search_form.erb +0 -30
  40. data/lib/views/center_js.erb +0 -3
  41. data/lib/views/cltn_list.erb +0 -16
  42. data/lib/views/cltn_show.erb +0 -1
  43. data/lib/views/cltn_update_js.erb +0 -1
  44. data/lib/views/collection.erb +0 -44
  45. data/lib/views/database.erb +0 -37
  46. data/lib/views/db_show.erb +0 -1
  47. data/lib/views/more_data_js.erb +0 -3
  48. data/lib/views/show_cltn.erb +0 -1
  49. data/lib/views/update_crumb_js.erb +0 -1
  50. /data/lib/views/{_crumbs.erb → explore/_crumbs.erb} +0 -0
  51. /data/lib/views/{_dump_array.erb → explore/_dump_array.erb} +0 -0
  52. /data/lib/views/{_dump_hash.erb → explore/_dump_hash.erb} +0 -0
  53. /data/lib/views/{_info.erb → explore/_info.erb} +0 -0
data/lib/views/_cltn.erb DELETED
@@ -1,25 +0,0 @@
1
- <div id="summary" style="clear:both">
2
- <%= page_entries_info @cltn, :entry_name => 'item' %>
3
- </div>
4
-
5
- <table id="cltn" class="cltn" border="0" cellpadding="10" cellspacing="20">
6
- <thead>
7
- <% @selected_cols.each do |col| %>
8
- <th><%=col%></th>
9
- <% end %>
10
- </thead>
11
- <tbody>
12
- <% @cltn.each do |cltn| %>
13
- <tr valign="top">
14
- <% @selected_cols.each do |k| %>
15
- <td><%= cltn[k] %></td>
16
- <% end %>
17
- </tr>
18
- <% end %>
19
- </tbody>
20
- </table>
21
-
22
- <div id="links">
23
- <%= will_paginate @cltn, :params => { :url => '/cltn' } %>
24
- </div>
25
-
@@ -1,95 +0,0 @@
1
- <style>
2
-
3
- table.info {
4
- border-spacing: 0;
5
- color: #fff;
6
- font-size: 1em;
7
- text-align: left;
8
- }
9
- table.info tr td.label {
10
- color: #3664a7;
11
- font-size: 1.2em;
12
- }
13
- table.info tr td {
14
- -moz-background-clip: border;
15
- -moz-background-inline-policy: continuous;
16
- -moz-background-origin: padding;
17
- /* padding: 2px 10px;*/
18
- }
19
-
20
- table.index {
21
- /* width: 98%;*/
22
- border-color: #afdb5a #afdb5a -moz-use-text-color -moz-use-text-color;
23
- border-spacing: 5;
24
- border-style: solid solid none none;
25
- border-width: 1px 1px 0 0;
26
- color: #666666;
27
- font-size: 0.8em;
28
- border: 0;
29
- }
30
- table.index thead {
31
- text-align: left;
32
- background: #6c7a52 none repeat scroll 0 0;
33
- }
34
- table.index tr td.label {
35
- color: #962920;
36
- font-size: 1.2em;
37
- }
38
- table.index th {
39
- color: #fff;
40
- font-weight: bold;
41
- padding: 2px 10px;
42
- }
43
- table.index tr td {
44
- -moz-background-clip: border;
45
- -moz-background-inline-policy: continuous;
46
- -moz-background-origin: padding;
47
- border-bottom: 1px solid #afdb5a;
48
- border-left: 1px solid #afdb5a;
49
- padding: 2px 10px;
50
- }
51
-
52
- div#indexes {
53
- margin: 10px 10px;
54
- font-size: 0.6em;
55
- }
56
-
57
- p.dialog {
58
- color: #afdb5a;
59
- text-align: center;
60
- }
61
- </style>
62
-
63
-
64
- <p class="dialog"><%= @cltn.name %>(<%=@cltn.count%> items)</p>
65
-
66
- <div id="indexes">
67
- <h2>Indexes</h2>
68
- <table class="info">
69
- <thead>
70
- <th>Name</th>
71
- <th>Details</th>
72
- <th>&nbsp;</td>
73
- </thead>
74
- <tbody>
75
- <% @cltn.index_information.each_pair do |index_name, details| %>
76
- <tr>
77
- <td valign="top"><%=index_name%></td>
78
- <td>
79
- <table class="index">
80
- <% details.each do |pair| %>
81
- <tr>
82
- <td><%=pair.first%></td>
83
- <td><%=pair.last%></td>
84
- </tr>
85
- <% end %>
86
- </table>
87
- </td>
88
- <td valign="top">
89
- <img src="/images/delete.png"/>
90
- </td>
91
- </tr>
92
- <% end %>
93
- </tbody>
94
- </table>
95
- </div>
@@ -1,5 +0,0 @@
1
- <ul>
2
- <% @db.collection_names.sort{ |a,b| a <=> b }.each do |cltn|%>
3
- <li><%=cltn%> [<%=@db[cltn].count%> rows]</li>
4
- <% end %>
5
- </ul>
@@ -1,30 +0,0 @@
1
- <div id="tooltip">&nbsp;</div>
2
-
3
- <% tip = "Enter query|sort<br/>{<b>'fred'</b>:20} | [[<b>'count'</b>:-1]]" %>
4
-
5
- <form id="search" onsubmit="search_submit();return false;" action="/cltn_search" method="post" style="text-align:center;margin:10px">
6
- <fieldset>
7
- <input id="search" type="text" name="search" class="search" title="<%=tip%>" value="<%=@query%>"/>
8
- <button type="submit" id="submit_button" class="button search" style="display:none">search</button>
9
- </fieldset>
10
- <fieldset style="">
11
- </fieldset>
12
- </form>
13
-
14
- <script>
15
- $( function() {
16
- $( 'form#search input[title]').tooltip( {
17
- tip: '#tooltip',
18
- events: { input: "mouseover,mouseout" } } );
19
- });
20
-
21
- function search_submit()
22
- {
23
- $.ajax({
24
- data: $.param( $("form#search").serializeArray() ),
25
- dataType: 'script',
26
- type: 'post',
27
- url: '/cltn_search'
28
- });
29
- }
30
- </script>
@@ -1,3 +0,0 @@
1
- $('div#crumbs').html( "<%=escape_javascript(partial(:crumbs))%>" );
2
-
3
- center( '<%=@node_id%>' );
@@ -1,16 +0,0 @@
1
- <div class="cltn">
2
- <div class="title"><%=@title%></div>
3
- <a class="back" href="<%=@back_url%>">&laquo;&nbsp;back</a>
4
- <% unless @cltn.empty? %>
5
- <div id="fields">
6
- <%= partial :fields_form %>
7
- </div>
8
- <%= partial :search_form %>
9
-
10
- <div class="table">
11
- <%= partial :cltn %>
12
- </div>
13
- <% else %>
14
- <span>No items found!</span>
15
- <% end %>
16
- <div>
@@ -1 +0,0 @@
1
- $('div#details').html( "<h1> Hello CLTN</h1" );
@@ -1 +0,0 @@
1
- $('div.table').html( "<%=escape_javascript(partial(:cltn))%>" );
@@ -1,44 +0,0 @@
1
- <%= partial :crumbs %>
2
-
3
- <div id="actions">
4
- <a class="prevPage">&laquo; back</a>
5
- <a class="nextPage">more &raquo;</a>
6
- </div>
7
-
8
- <div class="scrollable vertical">
9
- <div class="items">
10
- <% @db.collection_names.sort{ |a,b| a <=> b }.each do |cltn|%>
11
- <div class="item" rel="#details" href="/show_cltn/<%=cltn%>">
12
- <img class="tag" src="/images/mongo.png"/>
13
- <p><%= cltn %></p>
14
- <span><%= @db[cltn].count%> rows</span>
15
- </div>
16
- <% end %>
17
- </div>
18
- </div>
19
-
20
- <div class="overlay" id="details">
21
- <div class="content"></div>
22
- </div>
23
-
24
- <script>
25
- $( function() {
26
-
27
- $("div.item[rel]").overlay( {
28
- expose: '#434343',
29
- onBeforeLoad: function() {
30
- $.ajax( { url: this.getTrigger().attr( 'href' ), dataType:'script', type:'GET' } );
31
- }
32
- })
33
-
34
- $("div.scrollable").scrollable({
35
- vertical:true,
36
- size: 5
37
- }).mousewheel();
38
-
39
- $("div.item").hover(
40
- function() { $(this).addClass( "selected" ) },
41
- function() { $(this).removeClass( "selected" ) }
42
- );
43
- })
44
- </script>
@@ -1,37 +0,0 @@
1
- <%= partial :crumbs %>
2
-
3
- <div id="actions">
4
- <a class="prevPage">&laquo; back</a>
5
- <a class="nextPage">more &raquo;</a>
6
- </div>
7
-
8
- <div class="scrollable vertical">
9
- <div class="items">
10
- <% db_info = @connection.database_info; db_info.keys.sort.each do |db_name| %>
11
- <% next if skip_db?( db_name )%>
12
- <div id="<%=db_name%>" class="item">
13
- <img class="tag" src="/images/mongo3_db.png"/>
14
- <p><%= db_name %></p>
15
- <span><%= to_mb(db_info[db_name]) %></span>
16
- </div>
17
- <% end %>
18
- </div>
19
- </div>
20
-
21
- <script>
22
- $( function() {
23
- $("div.item").click( function() {
24
- window.location.href = "/cltn/" + this.id;
25
- });
26
-
27
- $("div.scrollable").scrollable({
28
- vertical:true,
29
- size: 5
30
- }).mousewheel();
31
-
32
- $("div.item").hover(
33
- function() { $(this).addClass( "selected" ) },
34
- function() { $(this).removeClass( "selected" ) }
35
- );
36
- })
37
- </script>
@@ -1 +0,0 @@
1
- $('div#details').html( "<h1> Hello DB</h1" );
@@ -1,3 +0,0 @@
1
- $('div#crumbs').html( "<%=escape_javascript(partial(:crumbs))%>" );
2
-
3
- morphit( '<%=@node_id%>', '<%=escape_javascript( @sub_tree.to_json )%>' );
@@ -1 +0,0 @@
1
- $('div.content').html( "<%= escape_javascript( partial :cltn_info )%>")
@@ -1 +0,0 @@
1
- $('div#crumbs').html( "<%=escape_javascript(partial(:crumbs))%>" );
File without changes
File without changes