databrowser 0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README +23 -0
- data/Rakefile +22 -0
- data/install.rb +3 -0
- data/lib/data_browser.rb +6 -0
- data/lib/data_browser/data_browser.rb +40 -0
- data/lib/data_browser/data_browser_controller.rb +93 -0
- data/lib/data_browser/routing.rb +14 -0
- data/lib/data_browser/views/data_browser/data_browser/_form.html.erb +25 -0
- data/lib/data_browser/views/data_browser/data_browser/_obj.rhtml +7 -0
- data/lib/data_browser/views/data_browser/data_browser/about.html.erb +7 -0
- data/lib/data_browser/views/data_browser/data_browser/browse.html.erb +31 -0
- data/lib/data_browser/views/data_browser/data_browser/browse.js.rjs +1 -0
- data/lib/data_browser/views/data_browser/data_browser/edit.html.erb +6 -0
- data/lib/data_browser/views/data_browser/data_browser/index.html.erb +8 -0
- data/lib/data_browser/views/data_browser/data_browser/new.html.erb +6 -0
- data/lib/data_browser/views/layouts/data_browser.html.erb +237 -0
- data/test/databrowser_test.rb +7 -0
- data/uninstall.rb +3 -0
- metadata +85 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 Carlos Henrique Palhares Moreira
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
DataBrowser
|
2
|
+
===========
|
3
|
+
|
4
|
+
To start using Rails DataBrowser, put `map.databrowser` in the your routes.rb file.
|
5
|
+
Please, don't forget to require 'data_browser' att he begining of your routes.rb
|
6
|
+
|
7
|
+
Example
|
8
|
+
=======
|
9
|
+
|
10
|
+
require 'data_browser'
|
11
|
+
ActionController::Routing::Routes.draw do |map|
|
12
|
+
# your routes
|
13
|
+
map.databrowser
|
14
|
+
end
|
15
|
+
|
16
|
+
or use:
|
17
|
+
map.databrowser if RAILS_ENV.eql?("development")
|
18
|
+
|
19
|
+
for development mode only.
|
20
|
+
|
21
|
+
See http://trac.milk-it.net/open/wiki/DataBrowser for further information.
|
22
|
+
|
23
|
+
Copyright (c) 2008 Milk-it Software House, released under the MIT license
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
require 'rake/rdoctask'
|
4
|
+
|
5
|
+
desc 'Default: run unit tests.'
|
6
|
+
task :default => :test
|
7
|
+
|
8
|
+
desc 'Test the databrowser plugin.'
|
9
|
+
Rake::TestTask.new(:test) do |t|
|
10
|
+
t.libs << 'lib'
|
11
|
+
t.pattern = 'test/**/*_test.rb'
|
12
|
+
t.verbose = true
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'Generate documentation for the databrowser plugin.'
|
16
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
17
|
+
rdoc.rdoc_dir = 'rdoc'
|
18
|
+
rdoc.title = 'Databrowser'
|
19
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
20
|
+
rdoc.rdoc_files.include('README')
|
21
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
22
|
+
end
|
data/install.rb
ADDED
data/lib/data_browser.rb
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
require 'data_browser/data_browser'
|
2
|
+
require 'data_browser/data_browser_controller'
|
3
|
+
require 'data_browser/routing'
|
4
|
+
|
5
|
+
::ActionController::Routing::RouteSet::Mapper.send(:include, DataBrowser::Routing)
|
6
|
+
DataBrowser::DataBrowserController.prepend_view_path(File.join(File.dirname(File.expand_path(__FILE__)), "data_browser", "views"))
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# DataBrowser
|
2
|
+
require 'digest/sha1'
|
3
|
+
|
4
|
+
module DataBrowser
|
5
|
+
@@user_digest = nil
|
6
|
+
@@models = []
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def should_auth
|
10
|
+
@@user_digest
|
11
|
+
end
|
12
|
+
|
13
|
+
def digest(user, pass)
|
14
|
+
Digest::SHA1.hexdigest(user.to_s + pass.to_s)
|
15
|
+
end
|
16
|
+
|
17
|
+
def protect(user, pass)
|
18
|
+
@@user_digest = digest(user, pass)
|
19
|
+
end
|
20
|
+
|
21
|
+
def auth(user, pass)
|
22
|
+
return @@user_digest if digest(user, pass) == @@user_digest
|
23
|
+
false
|
24
|
+
end
|
25
|
+
|
26
|
+
def check_digest(digest)
|
27
|
+
@@user_digest == digest
|
28
|
+
end
|
29
|
+
|
30
|
+
# models configuration
|
31
|
+
|
32
|
+
def models
|
33
|
+
@@models
|
34
|
+
end
|
35
|
+
|
36
|
+
def models=(models)
|
37
|
+
@@models = models if models.is_a?(Array)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
module DataBrowser
|
2
|
+
class DataBrowserController < ::ActionController::Base
|
3
|
+
layout "data_browser"
|
4
|
+
protect_from_forgery :secret => Time.now.to_i.to_s
|
5
|
+
before_filter :load_models, :authenticate
|
6
|
+
before_filter :load_current_model, :except => [:index]
|
7
|
+
|
8
|
+
@@models = nil
|
9
|
+
|
10
|
+
# all the work here is being done by :load_models
|
11
|
+
def index; end
|
12
|
+
|
13
|
+
def browse
|
14
|
+
params[:select] ||= @model.column_names
|
15
|
+
@objects = @model.find(:all,
|
16
|
+
:conditions => params[:conditions],
|
17
|
+
:select => params[:select] ? params[:select].join(", ") : nil
|
18
|
+
)
|
19
|
+
|
20
|
+
respond_to do |format|
|
21
|
+
format.html
|
22
|
+
format.js
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def empty
|
27
|
+
@model.delete_all
|
28
|
+
flash[:notice] = "#{@model.to_s} model was emptied"
|
29
|
+
redirect_to :action => "index"
|
30
|
+
end
|
31
|
+
|
32
|
+
def new
|
33
|
+
@obj = @model.new
|
34
|
+
end
|
35
|
+
|
36
|
+
def edit
|
37
|
+
@obj = @model.find(params[:id])
|
38
|
+
end
|
39
|
+
|
40
|
+
def destroy
|
41
|
+
@obj = @model.find(params[:id])
|
42
|
+
@obj.destroy()
|
43
|
+
flash[:notice] = "#{@model.to_s} #{@obj.to_param} successfuly deleted!"
|
44
|
+
redirect_to :action => "browse", :model => @model.to_s
|
45
|
+
end
|
46
|
+
|
47
|
+
def update
|
48
|
+
@obj = @model.find(params[:id])
|
49
|
+
@obj.attributes = params[@model.to_s.underscore]
|
50
|
+
|
51
|
+
@obj.save(false)
|
52
|
+
flash[:notice] = "#{@model.to_s} #{@obj.to_param} successfuly saved!"
|
53
|
+
redirect_to :action => "browse", :model => @model.to_s
|
54
|
+
end
|
55
|
+
|
56
|
+
def create
|
57
|
+
@obj = @model.new(params[@model.to_s.underscore])
|
58
|
+
|
59
|
+
@obj.save(false)
|
60
|
+
flash[:notice] = "#{@model.to_s} #{@obj.to_param} successfuly saved!"
|
61
|
+
redirect_to :action => "browse", :model => @model.to_s
|
62
|
+
end
|
63
|
+
|
64
|
+
protected
|
65
|
+
|
66
|
+
def load_models
|
67
|
+
# this will make that the models won't be fetched in every request
|
68
|
+
if DataBrowser.models.size == 0
|
69
|
+
models_root = File.join(RAILS_ROOT, "app", "models", "*.rb")
|
70
|
+
models = Dir.glob(models_root).collect do |c|
|
71
|
+
c = File.basename(c).gsub(/\.rb/, "").classify
|
72
|
+
c = Kernel.const_get(c)
|
73
|
+
c if c < ActiveRecord::Base
|
74
|
+
end
|
75
|
+
DataBrowser.models = models.compact.sort { |a, b| a.to_s <=> b.to_s }
|
76
|
+
end
|
77
|
+
|
78
|
+
@models = DataBrowser.models
|
79
|
+
end
|
80
|
+
|
81
|
+
def load_current_model
|
82
|
+
@model = Kernel.const_get(params[:model]) if params[:model]
|
83
|
+
end
|
84
|
+
|
85
|
+
def authenticate
|
86
|
+
if DataBrowser::should_auth && !DataBrowser::check_digest(session[:databrowser])
|
87
|
+
authenticate_or_request_with_http_basic("DataBrowser") do |user, pass|
|
88
|
+
session[:databrowser] = DataBrowser::auth(user, pass)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module DataBrowser
|
2
|
+
module Routing
|
3
|
+
def databrowser(opts={})
|
4
|
+
root = opts[:root] || "databrowser"
|
5
|
+
with_options :controller => "data_browser/data_browser" do |db|
|
6
|
+
db.connect "/#{root}"
|
7
|
+
db.connect "/#{root}/about", :action => "about"
|
8
|
+
db.connect "/#{root}/:model", :action => "browse"
|
9
|
+
db.connect "/#{root}/:model/:action"
|
10
|
+
db.connect "/#{root}/:model/:id/:action"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<ul>
|
2
|
+
<%
|
3
|
+
@model.columns_hash.each do |name, column|
|
4
|
+
next if name.eql?("id")
|
5
|
+
%>
|
6
|
+
<li>
|
7
|
+
<label><%= column.human_name %></label>
|
8
|
+
<div>
|
9
|
+
<%= case column.type
|
10
|
+
when :date
|
11
|
+
form.date_select(name)
|
12
|
+
when :datetime
|
13
|
+
form.datetime_select(name)
|
14
|
+
when :text
|
15
|
+
form.text_area(name)
|
16
|
+
when :boolean
|
17
|
+
form.check_box(name)
|
18
|
+
else
|
19
|
+
form.text_field(name)
|
20
|
+
end
|
21
|
+
%>
|
22
|
+
</div>
|
23
|
+
</li>
|
24
|
+
<% end %>
|
25
|
+
</ul>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<tr class="<%= cycle("odd", "") %>">
|
2
|
+
<td><%= link_to("Edit", :action => "edit", :id => obj.to_param, :model => @model.to_s) %></td>
|
3
|
+
<td><%= link_to("Delete", :action => "destroy", :id => obj.to_param, :model => @model.to_s) %></td>
|
4
|
+
<% for column in params[:select] %>
|
5
|
+
<td><%= obj.attributes[column] %></td>
|
6
|
+
<% end %>
|
7
|
+
</tr>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<h2>About Rails DataBrowser</h2>
|
2
|
+
|
3
|
+
<p>Rails DataBrowser is a data browser based on the idea of <a href="http://www.djangoproject.com/documentation/databrowse/">Django's Databrowser</a>.</p>
|
4
|
+
<p>Using Rails DataBrowser you can browse, view, edit, crate and delete data through your model classes. It's not a replacement to your DBMS or to your CMS, it's just a helper for developers and WebMasters to manage data without.</p>
|
5
|
+
<p>If you find a bug, please report it <a href="http://trac.milk-it.net/open/newticket">here</a></p>
|
6
|
+
<p />
|
7
|
+
<p>Rails DataBrowser plugin is sponsored by <a href="http://milk-it.net">Milk-it Brasil Software House</a> and maintained by <%= mail_to "carlos@milk-it.net", "Carlos Júnior", :encode => "hex", :replace_at => " at ", :replace_dot => "dot" %>.</p>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<% form_tag({:model => @model.to_s}, {:id => "search_form"}) do %>
|
2
|
+
<div id="search-box" style="display:none">
|
3
|
+
<p>
|
4
|
+
<label>Select</label><br />
|
5
|
+
<% for column in @model.column_names %>
|
6
|
+
<label><%= check_box_tag("select[]", column, params[:select].include?(column)) %><%= column %></label>
|
7
|
+
<% end %>
|
8
|
+
</p>
|
9
|
+
<p>
|
10
|
+
<label for="conditions">Conditions:</label><br />
|
11
|
+
<%= text_area_tag("conditions", params[:conditions], :style => "width:100%", :rows => "4") %>
|
12
|
+
</p>
|
13
|
+
<input type="submit" value="Buscar" />
|
14
|
+
<% end %>
|
15
|
+
</div>
|
16
|
+
<a href="javascript:showSearchBox()" id="show-search">Search</a>
|
17
|
+
<br />
|
18
|
+
<table id="data-table">
|
19
|
+
<thead>
|
20
|
+
<th colspan="2"></th>
|
21
|
+
<% for column in params[:select] %>
|
22
|
+
<th><%= column %></th>
|
23
|
+
<% end %>
|
24
|
+
</thead>
|
25
|
+
<tbody sid="objects_body">
|
26
|
+
<%= render :partial => "obj", :collection => @objects %>
|
27
|
+
<% if @objects.size == 0 %>
|
28
|
+
<td class="empty" colspan="<%=params[:select].size + 2%>">Empty model</td>
|
29
|
+
<% end %>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
@@ -0,0 +1 @@
|
|
1
|
+
page[:objects_body].innerHTML = render(:partial => "obj", :collection => @objects)
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<% form_for(@obj, :url => {:action => "update", :id => @obj.id, :model => @model.to_s}) do |f| %>
|
2
|
+
<%= render :partial => "form", :locals => {:form => f} %>
|
3
|
+
<div class="button">
|
4
|
+
<%= submit_tag("Save") %> or <%= link_to("cancel", :action => "browse", :model => @model.to_s) %>
|
5
|
+
</div>
|
6
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<ul>
|
2
|
+
<% @models.each do |model| %>
|
3
|
+
<li>
|
4
|
+
<%= link_to(model.to_s, :action => "browse", :model => model.to_s) %> (<%=model.count%> records)
|
5
|
+
<%= link_to("empty", {:action => "empty", :model => model.to_s}, :confirm => "Are you sure?") %>
|
6
|
+
</li>
|
7
|
+
<% end %>
|
8
|
+
</ul>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<% form_for(@obj, :url => {:action => "create", :model => @model.to_s}) do |f| %>
|
2
|
+
<%= render :partial => "form", :locals => {:form => f} %>
|
3
|
+
<div class="button">
|
4
|
+
<%= submit_tag("Create") %> or <%= link_to("cancel", :action => "browse", :model => @model.to_s) %>
|
5
|
+
</div>
|
6
|
+
<% end %>
|
@@ -0,0 +1,237 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
|
+
<title>Rails DataBrowser</title>
|
6
|
+
<style type="text/css">
|
7
|
+
/* --------------------------------------------------------------
|
8
|
+
|
9
|
+
reset.css
|
10
|
+
* Resets default browser CSS.
|
11
|
+
|
12
|
+
Based on work by Eric Meyer:
|
13
|
+
* meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
|
14
|
+
|
15
|
+
- Part of Blueprint CSS Framework
|
16
|
+
|
17
|
+
-------------------------------------------------------------- */
|
18
|
+
|
19
|
+
html, body, div, span, object, iframe,
|
20
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
21
|
+
a, abbr, acronym, address, code,
|
22
|
+
del, dfn, em, img, q, dl, dt, dd, ol, ul, li,
|
23
|
+
fieldset, form, label, legend,
|
24
|
+
table, caption, tbody, tfoot, thead, tr, th, td {
|
25
|
+
margin: 0;
|
26
|
+
padding: 0;
|
27
|
+
border: 0;
|
28
|
+
font-weight: inherit;
|
29
|
+
font-style: inherit;
|
30
|
+
font-size: 100%;
|
31
|
+
font-family: inherit;
|
32
|
+
vertical-align: baseline;
|
33
|
+
}
|
34
|
+
|
35
|
+
|
36
|
+
body { line-height: 1.5; background: #fff; margin:1.5em 0; }
|
37
|
+
|
38
|
+
/* Tables still need 'cellspacing="0"' in the markup. */
|
39
|
+
table { border-collapse: separate; border-spacing: 0; }
|
40
|
+
caption, th, td { text-align: left; font-weight:400; }
|
41
|
+
|
42
|
+
/* Remove possible quote marks (") from <q>, <blockquote>. */
|
43
|
+
blockquote:before, blockquote:after, q:before, q:after { content: ""; }
|
44
|
+
blockquote, q { quotes: "" ""; }
|
45
|
+
|
46
|
+
a img { border: none; }
|
47
|
+
|
48
|
+
/* ====== Databrowser ====== */
|
49
|
+
|
50
|
+
body {font-family:Arial, Helvetica, sans-serif; font-size:80%; padding:1%; margin:0; border-top:2px solid #e6646c; }
|
51
|
+
|
52
|
+
a:link, a:visited { color:#09C; text-decoration:underline; }
|
53
|
+
a:hover { text-decoration: none; color: #007EA8; }
|
54
|
+
a:active { color:orange; }
|
55
|
+
|
56
|
+
h1 {
|
57
|
+
font-family:Georgia, "Times New Roman", Times, serif;
|
58
|
+
color:#B6343C;
|
59
|
+
font-size:150%;
|
60
|
+
text-align:right;
|
61
|
+
}
|
62
|
+
|
63
|
+
h1 a b { color:#E6646C; }
|
64
|
+
|
65
|
+
h1 a {color:#B6343C !important; text-decoration:none !important;}
|
66
|
+
h1 a:hover { color: #8B272D }
|
67
|
+
|
68
|
+
h2 {
|
69
|
+
font-family:Georgia, "Times New Roman", Times, serif;
|
70
|
+
font-size:140%;
|
71
|
+
color:#444;
|
72
|
+
}
|
73
|
+
|
74
|
+
h3 {
|
75
|
+
font-size:100%;
|
76
|
+
color:#666;
|
77
|
+
}
|
78
|
+
|
79
|
+
table {
|
80
|
+
width:100%;
|
81
|
+
margin:1% auto;
|
82
|
+
font-size:90%;
|
83
|
+
border-collapse:collapse;
|
84
|
+
}
|
85
|
+
|
86
|
+
table th, table td {
|
87
|
+
padding:1px 0 1px 3px;
|
88
|
+
}
|
89
|
+
|
90
|
+
table th {
|
91
|
+
background-color:#EEF8FB;
|
92
|
+
color:#B6343C;
|
93
|
+
border:1px solid #DEF1F8;
|
94
|
+
border-width:1px 0 1px 1px;
|
95
|
+
font-weight:bold;
|
96
|
+
padding:1px 4px 1px 4px;
|
97
|
+
}
|
98
|
+
|
99
|
+
table td {
|
100
|
+
border-bottom:1px dotted #E5E5E5;
|
101
|
+
}
|
102
|
+
|
103
|
+
table td.empty {text-align:center}
|
104
|
+
|
105
|
+
table tr.odd td {
|
106
|
+
background-color:#F9F9FF;
|
107
|
+
}
|
108
|
+
|
109
|
+
div#content ul {
|
110
|
+
list-style:circle inside;
|
111
|
+
font-size:80%;
|
112
|
+
color:#999;
|
113
|
+
}
|
114
|
+
|
115
|
+
div#content {
|
116
|
+
padding-left:13%;
|
117
|
+
}
|
118
|
+
|
119
|
+
div#content ul a {
|
120
|
+
font-size:125%;
|
121
|
+
}
|
122
|
+
|
123
|
+
ul#models {
|
124
|
+
float:left;
|
125
|
+
border:1px solid #ddd;
|
126
|
+
-moz-border-radius:6px;
|
127
|
+
padding:1%;
|
128
|
+
margin-right:15px;
|
129
|
+
list-style:circle inside;
|
130
|
+
line-height: 1.6;
|
131
|
+
background:#fff;
|
132
|
+
width:10%;
|
133
|
+
}
|
134
|
+
|
135
|
+
li {
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
/* Forms */
|
140
|
+
|
141
|
+
input, textarea, select {
|
142
|
+
color:#333;
|
143
|
+
border:1px solid #BBB;
|
144
|
+
}
|
145
|
+
|
146
|
+
select { padding:0 0 0 1px;}
|
147
|
+
|
148
|
+
form ul {
|
149
|
+
list-style:none;
|
150
|
+
margin:6px 0 10px 0;
|
151
|
+
clear:none;
|
152
|
+
float:left;
|
153
|
+
list-style:none !important;
|
154
|
+
text-align:left;
|
155
|
+
}
|
156
|
+
|
157
|
+
form li {
|
158
|
+
clear:both;
|
159
|
+
float:left;
|
160
|
+
padding: 5px 0 5px 0;
|
161
|
+
width:100%;
|
162
|
+
background:none;
|
163
|
+
line-height:normal;
|
164
|
+
margin:0;
|
165
|
+
}
|
166
|
+
|
167
|
+
form li div li {float:none;border:none;}
|
168
|
+
form li div ul {float:none;margin:none;border:0;}
|
169
|
+
form label {
|
170
|
+
float:left;
|
171
|
+
display:block;
|
172
|
+
width:190px;
|
173
|
+
}
|
174
|
+
|
175
|
+
form label.inline {
|
176
|
+
display:inline !important;
|
177
|
+
float:none !important;
|
178
|
+
margin-top:-2px;
|
179
|
+
width:auto;
|
180
|
+
}
|
181
|
+
|
182
|
+
form li div {
|
183
|
+
margin-left:10px;
|
184
|
+
float:left;
|
185
|
+
}
|
186
|
+
|
187
|
+
form li div div { margin-left:0 !important; float:none !important; }
|
188
|
+
|
189
|
+
div.button {margin-top:6px; padding-left:200px;clear:both}
|
190
|
+
div.button input { color:#069; font-weight:bold; background: #F9F0C4; border:2px solid #F6E69F; padding-left:10px; padding-right:10px; }
|
191
|
+
div.button input.imagem { background:none !important; border:0 !important;}
|
192
|
+
|
193
|
+
div#footer {border-top:1px solid;
|
194
|
+
clear:both;
|
195
|
+
color:#BBBBBB;
|
196
|
+
font-size:10px;
|
197
|
+
height:31px;
|
198
|
+
padding:0.25em 0pt;}
|
199
|
+
div#footer p.left {float:left;}
|
200
|
+
div#footer p.right {float:right;text-align:right;}
|
201
|
+
p {margin:4px 0 0 0}
|
202
|
+
</style>
|
203
|
+
<script>
|
204
|
+
function showSearchBox()
|
205
|
+
{
|
206
|
+
document.getElementById("search-box").style.display = "block";
|
207
|
+
document.getElementById("show-search").style.display = "none";
|
208
|
+
}
|
209
|
+
</script>
|
210
|
+
</head>
|
211
|
+
<body id="home">
|
212
|
+
<h1><%= link_to("<b>Rails</b>DataBrowser", :action => "index") %></h1>
|
213
|
+
<ul id="models">
|
214
|
+
<% for model in @models %>
|
215
|
+
<li><%= link_to(model.to_s, :action => "browse", :model => model.to_s) %></li>
|
216
|
+
<% end %>
|
217
|
+
</ul>
|
218
|
+
<div id="content">
|
219
|
+
<% if @model %>
|
220
|
+
<h2><%= @model.to_s %> (<%=@model.table_name%> table) <%= link_to("new", :action => "new", :model => @model.to_s) %></h2>
|
221
|
+
<% end %>
|
222
|
+
<%= content_tag(:h3, flash[:notice], :class => "notice") if flash[:notice] %>
|
223
|
+
<%= yield %>
|
224
|
+
</div>
|
225
|
+
<div style="clear:both"> </div>
|
226
|
+
<div id="footer">
|
227
|
+
<p class="left">
|
228
|
+
Powered by <%= link_to "DataBrowser", :action => "about" %><br />
|
229
|
+
by <a href="http://milk-it.net">Milk-it</a>
|
230
|
+
</p>
|
231
|
+
<p class="right">
|
232
|
+
Visit Rails DataBrowser Official WebSite.<br />
|
233
|
+
<a href="http://trac.milk-it.net/open/wiki/DataBrowser">trac.milk-it.net/open</a>
|
234
|
+
</p>
|
235
|
+
</div>
|
236
|
+
</body>
|
237
|
+
</html>
|
data/uninstall.rb
ADDED
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: databrowser
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: "0.8"
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Carlos Junior
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-06-07 00:00:00 -03:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rails
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "2.0"
|
24
|
+
version:
|
25
|
+
description: Rails DataBrowser helps you in development providing an easy to use interface to access your database. This can be also used in production mode, as an interface to your data.
|
26
|
+
email:
|
27
|
+
- carlos@milk-it.net
|
28
|
+
executables: []
|
29
|
+
|
30
|
+
extensions: []
|
31
|
+
|
32
|
+
extra_rdoc_files:
|
33
|
+
- README
|
34
|
+
- MIT-LICENSE
|
35
|
+
files:
|
36
|
+
- README
|
37
|
+
- Rakefile
|
38
|
+
- MIT-LICENSE
|
39
|
+
- install.rb
|
40
|
+
- uninstall.rb
|
41
|
+
- lib/data_browser.rb
|
42
|
+
- lib/data_browser/data_browser.rb
|
43
|
+
- lib/data_browser/data_browser_controller.rb
|
44
|
+
- lib/data_browser/routing.rb
|
45
|
+
- lib/data_browser/views/data_browser/data_browser/about.html.erb
|
46
|
+
- lib/data_browser/views/data_browser/data_browser/browse.html.erb
|
47
|
+
- lib/data_browser/views/data_browser/data_browser/browse.js.rjs
|
48
|
+
- lib/data_browser/views/data_browser/data_browser/edit.html.erb
|
49
|
+
- lib/data_browser/views/data_browser/data_browser/_form.html.erb
|
50
|
+
- lib/data_browser/views/data_browser/data_browser/index.html.erb
|
51
|
+
- lib/data_browser/views/data_browser/data_browser/new.html.erb
|
52
|
+
- lib/data_browser/views/data_browser/data_browser/_obj.rhtml
|
53
|
+
- lib/data_browser/views/layouts/data_browser.html.erb
|
54
|
+
has_rdoc: false
|
55
|
+
homepage: http://redmine.milk-it.net/projects
|
56
|
+
post_install_message: |
|
57
|
+
|
58
|
+
Access http://redmine.milk-it.net/projects to learn how to use DataBrowser.
|
59
|
+
It's simple as add 2 lines in your routes.rb!
|
60
|
+
|
61
|
+
rdoc_options: []
|
62
|
+
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
version:
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: "0"
|
76
|
+
version:
|
77
|
+
requirements: []
|
78
|
+
|
79
|
+
rubyforge_project: databrowser
|
80
|
+
rubygems_version: 1.2.0
|
81
|
+
signing_key:
|
82
|
+
specification_version: 2
|
83
|
+
summary: Rails DataBrowser helps you in development providing an easy to use interface to access your database. This can be also used in production mode, as an interface to your data.
|
84
|
+
test_files:
|
85
|
+
- test/databrowser_test.rb
|