polepin 0.0.2
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.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +25 -0
- data/app/controllers/polepin/home_controller.rb +11 -0
- data/app/controllers/polepin/records_controller.rb +51 -0
- data/app/helpers/polepin_helper.rb +31 -0
- data/app/views/layouts/polepin.html.erb +21 -0
- data/app/views/polepin/home/show.html.erb +16 -0
- data/app/views/polepin/records/boolean.html.erb +26 -0
- data/app/views/polepin/records/collection.html.erb +24 -0
- data/app/views/polepin/records/index.html.erb +41 -0
- data/app/views/polepin/records/show.html.erb +54 -0
- data/config/routes.rb +22 -0
- data/lib/polepin/engine.rb +16 -0
- data/lib/polepin/utility.rb +39 -0
- data/lib/polepin.rb +5 -0
- data/public/polepin/stylesheets/all.css +75 -0
- data/public/polepin/stylesheets/flutie.css +458 -0
- data/public/polepin/stylesheets/screen.css +27 -0
- metadata +82 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2011 YOURNAME
|
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.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'rubygems'
|
3
|
+
begin
|
4
|
+
require 'bundler/setup'
|
5
|
+
rescue LoadError
|
6
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'rake'
|
10
|
+
require 'rake/rdoctask'
|
11
|
+
|
12
|
+
require 'rspec/core'
|
13
|
+
require 'rspec/core/rake_task'
|
14
|
+
|
15
|
+
RSpec::Core::RakeTask.new(:spec)
|
16
|
+
|
17
|
+
task :default => :spec
|
18
|
+
|
19
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
20
|
+
rdoc.rdoc_dir = 'rdoc'
|
21
|
+
rdoc.title = 'Polepin'
|
22
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
23
|
+
rdoc.rdoc_files.include('README.rdoc')
|
24
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
25
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
class Polepin::RecordsController < ActionController::Base
|
2
|
+
|
3
|
+
layout 'polepin'
|
4
|
+
|
5
|
+
helper :polepin
|
6
|
+
|
7
|
+
def index
|
8
|
+
@records = record_class.paginate :page => params[:page]
|
9
|
+
end
|
10
|
+
|
11
|
+
def boolean
|
12
|
+
@records = record_class.paginate :conditions => ["#{record_class.table_name}.#{boolean_column} = ?", boolean_value], :page => params[:page]
|
13
|
+
end
|
14
|
+
|
15
|
+
def show
|
16
|
+
@record = record_class.find params[:id]
|
17
|
+
end
|
18
|
+
|
19
|
+
def collection
|
20
|
+
@record = record_class.find params[:id]
|
21
|
+
@records = @record.send(record_collection)
|
22
|
+
end
|
23
|
+
|
24
|
+
protected
|
25
|
+
|
26
|
+
helper_method :record_class
|
27
|
+
def record_class
|
28
|
+
params[:record_class].constantize
|
29
|
+
end
|
30
|
+
|
31
|
+
helper_method :record_collection
|
32
|
+
def record_collection
|
33
|
+
params[:collection].to_s
|
34
|
+
end
|
35
|
+
|
36
|
+
helper_method :collection_class
|
37
|
+
def collection_class
|
38
|
+
params[:collection_class].constantize
|
39
|
+
end
|
40
|
+
|
41
|
+
helper_method :boolean_column
|
42
|
+
def boolean_column
|
43
|
+
params[:boolean_column]
|
44
|
+
end
|
45
|
+
|
46
|
+
helper_method :boolean_value
|
47
|
+
def boolean_value
|
48
|
+
params[:boolean_value]
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module PolepinHelper
|
2
|
+
|
3
|
+
def timestamp_columns(model_class)
|
4
|
+
Polepin::Utility.timestamp_columns(model_class)
|
5
|
+
end
|
6
|
+
|
7
|
+
def record_name(record)
|
8
|
+
Polepin::Utility.record_name(record)
|
9
|
+
end
|
10
|
+
|
11
|
+
def collection_name(association)
|
12
|
+
association.name.to_s.humanize
|
13
|
+
end
|
14
|
+
|
15
|
+
def link_to_record(record)
|
16
|
+
link_to record_name(record), send("polepin_#{record.class.table_name.singularize}_url", record.id)
|
17
|
+
end
|
18
|
+
|
19
|
+
def link_to_collection(record, association)
|
20
|
+
link_to collection_name(association), send("#{association.name}_polepin_#{record.class.table_name.singularize}_url", record.id)
|
21
|
+
end
|
22
|
+
|
23
|
+
def belongs_to_associations(record_class)
|
24
|
+
Polepin::Utility.class_belongs_to_associations(record_class)
|
25
|
+
end
|
26
|
+
|
27
|
+
def has_many_associations(record_class)
|
28
|
+
Polepin::Utility.class_has_many_associations(record_class)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<title><%= yield(:pagetitle) %></title>
|
6
|
+
<link rel="stylesheet" href="/polepin/stylesheets/flutie.css" />
|
7
|
+
<link rel="stylesheet" href="/polepin/stylesheets/screen.css" />
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div id="container">
|
11
|
+
<header>
|
12
|
+
<h1><%= link_to 'Records', polepin_root_url %></h1>
|
13
|
+
</header>
|
14
|
+
<div id="main" role="main">
|
15
|
+
<%= yield %>
|
16
|
+
</div>
|
17
|
+
<footer>
|
18
|
+
</footer>
|
19
|
+
</div>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%= content_for :pagetitle, 'Records' %>
|
2
|
+
|
3
|
+
<h2>Summary</h2>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<tr>
|
7
|
+
<th>Class</th>
|
8
|
+
<th>Count</th>
|
9
|
+
</tr>
|
10
|
+
<% @classes.each do |record_class| %>
|
11
|
+
<tr>
|
12
|
+
<td><%= link_to record_class, send("polepin_#{record_class.table_name}_url") %></td>
|
13
|
+
<td><%= record_class.count %></td>
|
14
|
+
</tr>
|
15
|
+
<% end %>
|
16
|
+
</table>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%= content_for :pagetitle, ['Records', record_class, boolean_column, boolean_value].join(' : ') %>
|
2
|
+
|
3
|
+
<h2><%= record_class %></h2>
|
4
|
+
|
5
|
+
<h3><%= pluralize @records.count, 'total record' %> where <%= boolean_column %> is <%= boolean_value %></h3>
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<tr>
|
9
|
+
<th>ID</th>
|
10
|
+
<th>Record Name</th>
|
11
|
+
<% timestamp_columns(record_class).each do |column| %>
|
12
|
+
<th><%= column.humanize %></th>
|
13
|
+
<% end -%>
|
14
|
+
</tr>
|
15
|
+
<% @records.each do |record| %>
|
16
|
+
<tr>
|
17
|
+
<td><%= record.id %></td>
|
18
|
+
<td><%= link_to_record record %></td>
|
19
|
+
<% timestamp_columns(record_class).each do |column| %>
|
20
|
+
<td><%= record.send column %></td>
|
21
|
+
<% end -%>
|
22
|
+
</tr>
|
23
|
+
<% end -%>
|
24
|
+
</table>
|
25
|
+
|
26
|
+
<%= will_paginate @records %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= content_for :pagetitle, ['Records', record_class.name.pluralize, @record.to_param, record_collection.humanize].join(' : ') %>
|
2
|
+
|
3
|
+
<h2><%= record_class %> <%= link_to_record @record %></h2>
|
4
|
+
|
5
|
+
<h3><%= record_collection.humanize %></h3>
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<tr>
|
9
|
+
<th>ID</th>
|
10
|
+
<th>Record Name</th>
|
11
|
+
<% timestamp_columns(collection_class).each do |column| %>
|
12
|
+
<th><%= column.humanize %></th>
|
13
|
+
<% end -%>
|
14
|
+
</tr>
|
15
|
+
<% @records.each do |record| %>
|
16
|
+
<tr>
|
17
|
+
<td><%= record.id %></td>
|
18
|
+
<td><%= link_to_record record %></td>
|
19
|
+
<% timestamp_columns(collection_class).each do |column| %>
|
20
|
+
<td><%= record.send column %></td>
|
21
|
+
<% end -%>
|
22
|
+
</tr>
|
23
|
+
<% end -%>
|
24
|
+
</table>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<%= content_for :pagetitle, ['Records', record_class].join(' : ') %>
|
2
|
+
|
3
|
+
<h2><%= record_class %></h2>
|
4
|
+
|
5
|
+
<h3>Reports</h3>
|
6
|
+
<table>
|
7
|
+
<tr>
|
8
|
+
<th>Report</th>
|
9
|
+
<th colspan="2">Options</th>
|
10
|
+
</tr>
|
11
|
+
<% Polepin::Utility.boolean_columns(record_class).each do |report| %>
|
12
|
+
<tr>
|
13
|
+
<td><%= report.humanize %></td>
|
14
|
+
<td><%= link_to 'True', send("boolean_#{report}_polepin_#{record_class.table_name}_url") %></td>
|
15
|
+
<td><%= link_to 'False', send("boolean_not_#{report}_polepin_#{record_class.table_name}_url") %></td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
</table>
|
19
|
+
|
20
|
+
<h3><%= pluralize record_class.count, 'total record' %></h3>
|
21
|
+
|
22
|
+
<table>
|
23
|
+
<tr>
|
24
|
+
<th>ID</th>
|
25
|
+
<th>Record Name</th>
|
26
|
+
<% timestamp_columns(record_class).each do |column| %>
|
27
|
+
<th><%= column.humanize %></th>
|
28
|
+
<% end -%>
|
29
|
+
</tr>
|
30
|
+
<% @records.each do |record| %>
|
31
|
+
<tr>
|
32
|
+
<td><%= record.id %></td>
|
33
|
+
<td><%= link_to_record record %></td>
|
34
|
+
<% timestamp_columns(record_class).each do |column| %>
|
35
|
+
<td><%= record.send column %></td>
|
36
|
+
<% end -%>
|
37
|
+
</tr>
|
38
|
+
<% end -%>
|
39
|
+
</table>
|
40
|
+
|
41
|
+
<%= will_paginate @records %>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<%= content_for :pagetitle, ['Records', record_class.name.pluralize, record_name(@record)].join(' : ') %>
|
2
|
+
|
3
|
+
<h2><%= record_class %></h2>
|
4
|
+
|
5
|
+
<h3>Summary</h3>
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<tr>
|
9
|
+
<th>Attribute</th>
|
10
|
+
<th>Value</th>
|
11
|
+
</tr>
|
12
|
+
<% @record.attribute_names.each do |attribute| %>
|
13
|
+
<tr>
|
14
|
+
<td><%= attribute.humanize %></td>
|
15
|
+
<td><%= @record.send(attribute.to_sym) || '-' %></td>
|
16
|
+
</tr>
|
17
|
+
<% end -%>
|
18
|
+
</table>
|
19
|
+
|
20
|
+
<h3>Belongs to…</h3>
|
21
|
+
<% unless belongs_to_associations(record_class).empty? %>
|
22
|
+
<table>
|
23
|
+
<tr>
|
24
|
+
<th>Association</th>
|
25
|
+
<th>Records</th>
|
26
|
+
</tr>
|
27
|
+
<% belongs_to_associations(record_class).each do |association| %>
|
28
|
+
<tr>
|
29
|
+
<td><%= collection_name association %></td>
|
30
|
+
<td><%= @record.send(association.name).nil? ? '-' : link_to_record(@record.send(association.name)) %></td>
|
31
|
+
</tr>
|
32
|
+
<% end -%>
|
33
|
+
</table>
|
34
|
+
<% else -%>
|
35
|
+
<p>No belongs to associations</p>
|
36
|
+
<% end -%>
|
37
|
+
|
38
|
+
<h3>Has Many…</h3>
|
39
|
+
<% unless has_many_associations(record_class).empty? %>
|
40
|
+
<table>
|
41
|
+
<tr>
|
42
|
+
<th>Association</th>
|
43
|
+
<th>Records</th>
|
44
|
+
</tr>
|
45
|
+
<% has_many_associations(record_class).each do |association| %>
|
46
|
+
<tr>
|
47
|
+
<td><%= link_to_collection @record, association %></td>
|
48
|
+
<td><%= @record.send(association.name).count %></td>
|
49
|
+
</tr>
|
50
|
+
<% end %>
|
51
|
+
</table>
|
52
|
+
<% else %>
|
53
|
+
<p>No has many associations</p>
|
54
|
+
<% end %>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
|
3
|
+
scope 'admin/records', :as => :polepin do
|
4
|
+
root :to => 'polepin/home#show'
|
5
|
+
Polepin::Utility.model_classes.each do |record_class|
|
6
|
+
resources record_class.table_name.to_sym, :controller => 'polepin/records', :only => [:index, :show], :record_class => record_class.name do
|
7
|
+
member do
|
8
|
+
Polepin::Utility.class_has_many_associations(record_class).each do |association|
|
9
|
+
get association.name, :controller => 'polepin/records', :action => 'collection', :collection => association.name, :collection_class => association.class_name
|
10
|
+
end
|
11
|
+
end
|
12
|
+
collection do
|
13
|
+
Polepin::Utility.boolean_columns(record_class).each do |report|
|
14
|
+
get "boolean/#{report}", :controller => 'polepin/records', :action => 'boolean', :boolean_column => report, :boolean_value => true
|
15
|
+
get "boolean/not_#{report}", :controller => 'polepin/records', :action => 'boolean', :boolean_column => report, :boolean_value => false
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Polepin
|
2
|
+
|
3
|
+
class Engine < Rails::Engine
|
4
|
+
initializer "polepin.load_models" do |app|
|
5
|
+
Dir.glob("#{app.root}/app/models/**/*.rb").each do |file|
|
6
|
+
silence_warnings do
|
7
|
+
require file
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
initializer "static assets" do |app|
|
12
|
+
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Polepin
|
2
|
+
class Utility
|
3
|
+
|
4
|
+
def self.model_classes
|
5
|
+
ActiveRecord::Base.descendants.select { |klass| klass.table_exists? }.uniq.sort_by(&:name)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.timestamp_columns(model_class)
|
9
|
+
%w(created_at updated_at) & model_class.column_names
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.boolean_columns(model_class)
|
13
|
+
model_class.columns.select { |c| c.type == :boolean }.collect(&:name)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.record_name(record)
|
17
|
+
if record.class.instance_methods(false).include?(:to_s)
|
18
|
+
record.to_s
|
19
|
+
else
|
20
|
+
record.send %w(name title subject keyword email to_s).select { |method| record.respond_to?(method) }.first.to_sym
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.class_has_many_associations(model_class)
|
25
|
+
associations_of_type model_class, :has_many
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.class_belongs_to_associations(model_class)
|
29
|
+
associations_of_type model_class, :belongs_to
|
30
|
+
end
|
31
|
+
|
32
|
+
protected
|
33
|
+
|
34
|
+
def self.associations_of_type(model_class, association_type)
|
35
|
+
model_class.reflect_on_all_associations.select { |association| association.macro == association_type.to_sym }
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
data/lib/polepin.rb
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
/* SETUP */
|
2
|
+
* {
|
3
|
+
margin: 0;
|
4
|
+
padding: 0;
|
5
|
+
list-style-type: none;
|
6
|
+
}
|
7
|
+
body {
|
8
|
+
font-family: Helvetica, Arial, sans-serif;
|
9
|
+
color: #333;
|
10
|
+
}
|
11
|
+
a {
|
12
|
+
color: #2D7BB2;
|
13
|
+
text-decoration: none;
|
14
|
+
font-weight: bold;
|
15
|
+
}
|
16
|
+
a:hover {
|
17
|
+
color: #333;
|
18
|
+
}
|
19
|
+
h2, h3, h4 {
|
20
|
+
clear: both;
|
21
|
+
margin: 0 0 0.6em 0;
|
22
|
+
}
|
23
|
+
h3 {
|
24
|
+
color: #666;
|
25
|
+
}
|
26
|
+
.section {
|
27
|
+
float: left;
|
28
|
+
clear: left;
|
29
|
+
padding: 1em 2em;
|
30
|
+
}
|
31
|
+
|
32
|
+
/* TIMELINE CHARTS */
|
33
|
+
.timeline {
|
34
|
+
font-size: 0.75em;
|
35
|
+
height: 10em;
|
36
|
+
}
|
37
|
+
.timeline li {
|
38
|
+
position: relative;
|
39
|
+
float: left;
|
40
|
+
width: 1.5em;
|
41
|
+
margin: 0 0.1em;
|
42
|
+
height: 8em;
|
43
|
+
}
|
44
|
+
.timeline li a {
|
45
|
+
display: block;
|
46
|
+
height: 100%;
|
47
|
+
}
|
48
|
+
.timeline li .label {
|
49
|
+
display: block;
|
50
|
+
position: absolute;
|
51
|
+
bottom: -2em;
|
52
|
+
left: 0;
|
53
|
+
background: #fff;
|
54
|
+
width: 100%;
|
55
|
+
height: 2em;
|
56
|
+
line-height: 2em;
|
57
|
+
text-align: center;
|
58
|
+
}
|
59
|
+
.timeline li a .count {
|
60
|
+
display: block;
|
61
|
+
position: absolute;
|
62
|
+
bottom: 0;
|
63
|
+
left: 0;
|
64
|
+
height: 0;
|
65
|
+
width: 100%;
|
66
|
+
background: #AAA;
|
67
|
+
text-indent: -9999px;
|
68
|
+
overflow: hidden;
|
69
|
+
}
|
70
|
+
.timeline li:hover {
|
71
|
+
background: #EFEFEF;
|
72
|
+
}
|
73
|
+
.timeline li a:hover .count {
|
74
|
+
background: #2D7BB2;
|
75
|
+
}
|
@@ -0,0 +1,458 @@
|
|
1
|
+
/* http://meyerweb.com/eric/tools/css/reset/ */
|
2
|
+
/* v1.0 | 20080212 */
|
3
|
+
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,
|
4
|
+
blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em,
|
5
|
+
font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var,
|
6
|
+
b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table,
|
7
|
+
caption, tbody, tfoot, thead, tr, th, td {
|
8
|
+
margin: 0;
|
9
|
+
padding: 0;
|
10
|
+
border: 0;
|
11
|
+
outline: 0;
|
12
|
+
font-size: 100%;
|
13
|
+
vertical-align: baseline;
|
14
|
+
background: transparent; }
|
15
|
+
|
16
|
+
body {
|
17
|
+
line-height: 1; }
|
18
|
+
|
19
|
+
ol, ul {
|
20
|
+
list-style: none; }
|
21
|
+
|
22
|
+
blockquote, q {
|
23
|
+
quotes: none; }
|
24
|
+
|
25
|
+
blockquote:before, blockquote:after,
|
26
|
+
q:before, q:after {
|
27
|
+
content: '';
|
28
|
+
content: none; }
|
29
|
+
|
30
|
+
/* remember to define focus styles! */
|
31
|
+
:focus {
|
32
|
+
outline: 0; }
|
33
|
+
|
34
|
+
/* remember to highlight inserts somehow! */
|
35
|
+
ins {
|
36
|
+
text-decoration: none; }
|
37
|
+
|
38
|
+
del {
|
39
|
+
text-decoration: line-through; }
|
40
|
+
|
41
|
+
/* tables still need 'cellspacing="0"' in the markup */
|
42
|
+
table {
|
43
|
+
border-collapse: collapse;
|
44
|
+
border-spacing: 0; }
|
45
|
+
|
46
|
+
body {
|
47
|
+
color: #222;
|
48
|
+
font-size: 13px;
|
49
|
+
font-family: arial, "helvetica neue", helvetica, "lucida grande", sans-serif; }
|
50
|
+
|
51
|
+
h1, h2, h3, h4, h5, h6 {
|
52
|
+
color: #111;
|
53
|
+
font-family: "helvetica neue", Helvetica, arial, sans-serif; }
|
54
|
+
|
55
|
+
/* Success, error & notice boxes for messages and errors. */
|
56
|
+
div.error, div.notice, div.success,
|
57
|
+
#flash_failure, #flash_success, #flash_notice {
|
58
|
+
border: 1px solid #ddd;
|
59
|
+
-moz-border-radius: 8px;
|
60
|
+
-webkit-border-radius: 8px;
|
61
|
+
margin-bottom: 0;
|
62
|
+
padding: 0.8em; }
|
63
|
+
|
64
|
+
div.error,
|
65
|
+
#flash_failure {
|
66
|
+
background: #FBE3E4;
|
67
|
+
border-color: #FBC2C4;
|
68
|
+
color: #D12F19; }
|
69
|
+
|
70
|
+
div.error a,
|
71
|
+
#flash_failure a {
|
72
|
+
color: #D12F19; }
|
73
|
+
|
74
|
+
div.notice,
|
75
|
+
#flash_notice {
|
76
|
+
background: #FFF6BF;
|
77
|
+
border-color: #FFD324;
|
78
|
+
color: #817134; }
|
79
|
+
|
80
|
+
div.notice a,
|
81
|
+
#flash_notice a {
|
82
|
+
color: #817134; }
|
83
|
+
|
84
|
+
div.success,
|
85
|
+
#flash_success {
|
86
|
+
background: #E6EFC2;
|
87
|
+
border-color: #C6D880;
|
88
|
+
color: #529214; }
|
89
|
+
|
90
|
+
div.success a,
|
91
|
+
#flash_success a {
|
92
|
+
color: #529214; }
|
93
|
+
|
94
|
+
/* Misc classes and elements */
|
95
|
+
/* Use a .box to create a padded box inside a column. */
|
96
|
+
.box {
|
97
|
+
background: #eee;
|
98
|
+
margin-bottom: 1.5em;
|
99
|
+
padding: 1.5em; }
|
100
|
+
|
101
|
+
/* Use this to create a horizontal ruler across a column. */
|
102
|
+
hr {
|
103
|
+
background: #ddd;
|
104
|
+
border: none;
|
105
|
+
clear: both;
|
106
|
+
color: #ddd;
|
107
|
+
float: none;
|
108
|
+
height: 1px;
|
109
|
+
margin: 0 0 1.4em;
|
110
|
+
width: 100%; }
|
111
|
+
|
112
|
+
hr.space {
|
113
|
+
background: #fff;
|
114
|
+
color: #fff; }
|
115
|
+
|
116
|
+
/* Clearfix hack I love you */
|
117
|
+
.clearfix:after {
|
118
|
+
content: ".";
|
119
|
+
display: block;
|
120
|
+
height: 0;
|
121
|
+
clear: both;
|
122
|
+
visibility: hidden; }
|
123
|
+
|
124
|
+
.clearfix {
|
125
|
+
display: inline-block; }
|
126
|
+
|
127
|
+
/* Hide from IE Mac \*/
|
128
|
+
.clearfix {
|
129
|
+
display: block; }
|
130
|
+
|
131
|
+
/* End hide from IE Mac */
|
132
|
+
/* Headings */
|
133
|
+
h1, h2, h3, h4, h5, h6 {
|
134
|
+
font-weight: normal; }
|
135
|
+
|
136
|
+
h1 {
|
137
|
+
font-size: 2.2em;
|
138
|
+
line-height: 1;
|
139
|
+
margin-bottom: 0.25em; }
|
140
|
+
|
141
|
+
h2 {
|
142
|
+
font-size: 1.6em;
|
143
|
+
line-height: 1.1;
|
144
|
+
margin-bottom: 0.25em; }
|
145
|
+
|
146
|
+
h3 {
|
147
|
+
font-size: 1.3em;
|
148
|
+
line-height: 1;
|
149
|
+
margin-bottom: 0.25em; }
|
150
|
+
|
151
|
+
h4 {
|
152
|
+
font-size: 1.1em;
|
153
|
+
line-height: 1.25;
|
154
|
+
margin-bottom: 0.25em; }
|
155
|
+
|
156
|
+
h5 {
|
157
|
+
font-size: 1em;
|
158
|
+
margin-bottom: 0.25em; }
|
159
|
+
|
160
|
+
h6 {
|
161
|
+
font-size: 1em;
|
162
|
+
margin-bottom: 0.25em; }
|
163
|
+
|
164
|
+
/* Text elements */
|
165
|
+
p {
|
166
|
+
margin-bottom: 0.5em; }
|
167
|
+
|
168
|
+
p.last {
|
169
|
+
margin-bottom: 0; }
|
170
|
+
|
171
|
+
p img {
|
172
|
+
float: left;
|
173
|
+
margin: 1.5em 1.5em 1.5em 0;
|
174
|
+
padding: 0; }
|
175
|
+
|
176
|
+
/* Use this if the image is at the top of the <p>. */
|
177
|
+
p img.top {
|
178
|
+
margin-top: 0; }
|
179
|
+
|
180
|
+
img {
|
181
|
+
margin: 0 0 1.5em; }
|
182
|
+
|
183
|
+
abbr, acronym {
|
184
|
+
border-bottom: 1px dotted #666;
|
185
|
+
cursor: help; }
|
186
|
+
|
187
|
+
address {
|
188
|
+
font-style: italic;
|
189
|
+
margin-top: 1.5em; }
|
190
|
+
|
191
|
+
del {
|
192
|
+
color: #666; }
|
193
|
+
|
194
|
+
a, a:link {
|
195
|
+
color: #1a4882;
|
196
|
+
text-decoration: underline; }
|
197
|
+
|
198
|
+
a:visited {
|
199
|
+
color: #1a4882; }
|
200
|
+
|
201
|
+
a:hover {
|
202
|
+
color: #052246; }
|
203
|
+
|
204
|
+
a:active,
|
205
|
+
a:focus {
|
206
|
+
color: #1a4882; }
|
207
|
+
|
208
|
+
blockquote {
|
209
|
+
border-left: 4px solid #d1d1d1;
|
210
|
+
color: #666;
|
211
|
+
font-style: italic;
|
212
|
+
margin: 1.5em 0;
|
213
|
+
padding-left: 1em; }
|
214
|
+
|
215
|
+
strong {
|
216
|
+
font-weight: bold; }
|
217
|
+
|
218
|
+
em,
|
219
|
+
dfn {
|
220
|
+
font-style: italic; }
|
221
|
+
|
222
|
+
dfn {
|
223
|
+
font-weight: normal; }
|
224
|
+
|
225
|
+
pre, code {
|
226
|
+
margin: 1.5em 0;
|
227
|
+
white-space: pre; }
|
228
|
+
|
229
|
+
pre, code, tt {
|
230
|
+
font: 1em 'andale mono', 'monotype.com', 'lucida console', monospace;
|
231
|
+
line-height: 1.5; }
|
232
|
+
|
233
|
+
pre.code {
|
234
|
+
background: #000;
|
235
|
+
color: #fff;
|
236
|
+
padding: 20px; }
|
237
|
+
|
238
|
+
tt {
|
239
|
+
display: block;
|
240
|
+
line-height: 1.5;
|
241
|
+
margin: 1.5em 0; }
|
242
|
+
|
243
|
+
/* Forms */
|
244
|
+
/*removes dotted outline on submit buttons when clicking in firefox */
|
245
|
+
input[type="submit"]::-moz-focus-inner {
|
246
|
+
border: none; }
|
247
|
+
|
248
|
+
form ol {
|
249
|
+
list-style: none;
|
250
|
+
margin: 0 0 1em 0; }
|
251
|
+
|
252
|
+
form ol ol {
|
253
|
+
margin-left: 0; }
|
254
|
+
|
255
|
+
form ol li {
|
256
|
+
list-style-position: outside;
|
257
|
+
margin: 0 0 1em 0; }
|
258
|
+
|
259
|
+
/*list-style-position fixes IE label margin bug*/
|
260
|
+
form ol ol li {
|
261
|
+
list-style-position: outside;
|
262
|
+
margin: 0 0 .25em 0; }
|
263
|
+
|
264
|
+
form ol li.error input {
|
265
|
+
background: #FBE3E4; }
|
266
|
+
|
267
|
+
p.inline-errors {
|
268
|
+
color: #D12F19; }
|
269
|
+
|
270
|
+
form ol li.file {
|
271
|
+
background: #e1e1e1;
|
272
|
+
border: 1px solid #c8c8c8;
|
273
|
+
padding: 10px; }
|
274
|
+
|
275
|
+
form abbr {
|
276
|
+
border-bottom: 0; }
|
277
|
+
|
278
|
+
label {
|
279
|
+
display: block; }
|
280
|
+
|
281
|
+
.required label {
|
282
|
+
font-weight: normal; }
|
283
|
+
|
284
|
+
.checkbox_field label,
|
285
|
+
.radio_field label {
|
286
|
+
font-weight: normal; }
|
287
|
+
|
288
|
+
a.cancel {
|
289
|
+
color: #7d0d0d; }
|
290
|
+
|
291
|
+
.inline-hints {
|
292
|
+
color: #666;
|
293
|
+
font-size: 0.8em;
|
294
|
+
margin-bottom: 0.25em; }
|
295
|
+
|
296
|
+
/* Fieldsets */
|
297
|
+
fieldset {
|
298
|
+
background: #f1f1f1;
|
299
|
+
border: 1px solid #e3e3e3;
|
300
|
+
margin: 0 0 1.5em 0;
|
301
|
+
padding: 1.5em 1.5em 1em 1.5em; }
|
302
|
+
|
303
|
+
fieldset fieldset,
|
304
|
+
fieldset fieldset fieldset {
|
305
|
+
border: 0;
|
306
|
+
padding: 0; }
|
307
|
+
|
308
|
+
legend {
|
309
|
+
font-weight: normal; }
|
310
|
+
|
311
|
+
fieldset.buttons {
|
312
|
+
background: inherit;
|
313
|
+
border: 0;
|
314
|
+
padding: 0; }
|
315
|
+
|
316
|
+
fieldset.buttons li {
|
317
|
+
display: inline; }
|
318
|
+
|
319
|
+
.radio fieldset {
|
320
|
+
margin: 0;
|
321
|
+
padding: 0; }
|
322
|
+
|
323
|
+
/* Text fields */
|
324
|
+
input[type="color"],
|
325
|
+
input[type="date"],
|
326
|
+
input[type="datetime"],
|
327
|
+
input[type="datetime-local"],
|
328
|
+
input[type="email"],
|
329
|
+
input[type="month"],
|
330
|
+
input[type="number"],
|
331
|
+
input[type="password"]
|
332
|
+
input[type="range"],
|
333
|
+
input[type="search"],
|
334
|
+
input[type="tel"],
|
335
|
+
input[type="text"],
|
336
|
+
input[type="time"],
|
337
|
+
input[type="url"],
|
338
|
+
input[type="week"] {
|
339
|
+
font-size: inherit;
|
340
|
+
padding: 3px 2px;
|
341
|
+
width: 300px; }
|
342
|
+
|
343
|
+
input[disabled='disabled'] {
|
344
|
+
background-color: #fcfcfc;
|
345
|
+
cursor: default; }
|
346
|
+
|
347
|
+
input[type="checkbox"] {
|
348
|
+
margin: 0 3px 0 0;
|
349
|
+
position: relative;
|
350
|
+
top: -2px;
|
351
|
+
vertical-align: middle; }
|
352
|
+
|
353
|
+
input[type="radio"] {
|
354
|
+
margin: 0 3px 0 0;
|
355
|
+
position: relative;
|
356
|
+
top: -2px;
|
357
|
+
vertical-align: middle; }
|
358
|
+
|
359
|
+
.check_boxes label {
|
360
|
+
display: inline;
|
361
|
+
padding: 0;
|
362
|
+
vertical-align: middle; }
|
363
|
+
|
364
|
+
.radio label {
|
365
|
+
padding: 0; }
|
366
|
+
|
367
|
+
/* Textareas */
|
368
|
+
textarea {
|
369
|
+
font-size: inherit;
|
370
|
+
height: 200px;
|
371
|
+
margin: 0 0.5em 0.5em 0;
|
372
|
+
padding: 5px;
|
373
|
+
width: 440px; }
|
374
|
+
|
375
|
+
/* Select fields */
|
376
|
+
fieldset .select select {
|
377
|
+
width: 200px;
|
378
|
+
font-size: 0.9em; }
|
379
|
+
|
380
|
+
optgroup {
|
381
|
+
margin: 0 0 .5em 0; }
|
382
|
+
|
383
|
+
/* Date & Time */
|
384
|
+
form ol li.date ol li,
|
385
|
+
form ol li.time ol li {
|
386
|
+
display: inline; }
|
387
|
+
|
388
|
+
form ol li.datetime ol li {
|
389
|
+
display: inline-block; }
|
390
|
+
|
391
|
+
form ol li.datetime select,
|
392
|
+
form ol li.date select,
|
393
|
+
form ol li.time select {
|
394
|
+
display: inline;
|
395
|
+
width: auto; }
|
396
|
+
|
397
|
+
form ol li.date label,
|
398
|
+
form ol li.time label {
|
399
|
+
display: none; }
|
400
|
+
|
401
|
+
/* Tables */
|
402
|
+
table {
|
403
|
+
margin-bottom: 2em;
|
404
|
+
width: 100%; }
|
405
|
+
|
406
|
+
th {
|
407
|
+
border-bottom: 2px solid #ccc;
|
408
|
+
font-weight: normal;
|
409
|
+
text-align: left; }
|
410
|
+
|
411
|
+
td {
|
412
|
+
border-bottom: 1px solid #ddd; }
|
413
|
+
|
414
|
+
caption, th, td {
|
415
|
+
padding: 4px 10px 4px 0; }
|
416
|
+
|
417
|
+
caption {
|
418
|
+
background: #f1f1f1;
|
419
|
+
margin-bottom: 1em;
|
420
|
+
padding: 10px 0; }
|
421
|
+
|
422
|
+
tr, td, th {
|
423
|
+
vertical-align: middle; }
|
424
|
+
|
425
|
+
/* Use this if you use span-x classes on th/td. */
|
426
|
+
table .last {
|
427
|
+
padding-right: 0; }
|
428
|
+
|
429
|
+
/* Lists */
|
430
|
+
ul, ol {
|
431
|
+
list-style-position: inside;
|
432
|
+
margin-bottom: 1.5em; }
|
433
|
+
|
434
|
+
ul {
|
435
|
+
list-style-type: disc; }
|
436
|
+
|
437
|
+
ol {
|
438
|
+
list-style-type: decimal; }
|
439
|
+
|
440
|
+
dl {
|
441
|
+
line-height: 1.4;
|
442
|
+
margin-bottom: 1.5em; }
|
443
|
+
|
444
|
+
dl dt {
|
445
|
+
font-weight: normal;
|
446
|
+
margin-top: 0.5em; }
|
447
|
+
|
448
|
+
dl dd {
|
449
|
+
margin-bottom: 0em; }
|
450
|
+
|
451
|
+
dd {
|
452
|
+
margin-left: 0.5em; }
|
453
|
+
|
454
|
+
li {
|
455
|
+
line-height: 1.4; }
|
456
|
+
|
457
|
+
ol ol, ol ul, ul ul, ul ol {
|
458
|
+
margin-left: 1em; }
|
@@ -0,0 +1,27 @@
|
|
1
|
+
body {
|
2
|
+
font-family: Helvetica, Arial, sans-serif;
|
3
|
+
color: #333;
|
4
|
+
background-color: #fff;
|
5
|
+
}
|
6
|
+
|
7
|
+
#container header {
|
8
|
+
padding: 10px 20px;
|
9
|
+
background-color: #333;
|
10
|
+
border-bottom: 1px solid #000;
|
11
|
+
margin-bottom: 15px;
|
12
|
+
}
|
13
|
+
|
14
|
+
#container header a {
|
15
|
+
color: #fff;
|
16
|
+
text-decoration: none;
|
17
|
+
}
|
18
|
+
|
19
|
+
#container header h1 {
|
20
|
+
font-size: 1.6em;
|
21
|
+
}
|
22
|
+
|
23
|
+
#container #main {
|
24
|
+
margin: 0 20px;
|
25
|
+
width: auto;
|
26
|
+
background-color: #fff;
|
27
|
+
}
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: polepin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Matt Jankowski
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-01-19 00:00:00 -05:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: I represent queens she was raised out in brooklyn
|
22
|
+
email: mjankowski@thoughtbot.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
29
|
+
files:
|
30
|
+
- MIT-LICENSE
|
31
|
+
- README.rdoc
|
32
|
+
- Rakefile
|
33
|
+
- app/controllers/polepin/home_controller.rb
|
34
|
+
- app/controllers/polepin/records_controller.rb
|
35
|
+
- app/helpers/polepin_helper.rb
|
36
|
+
- app/views/layouts/polepin.html.erb
|
37
|
+
- app/views/polepin/home/show.html.erb
|
38
|
+
- app/views/polepin/records/boolean.html.erb
|
39
|
+
- app/views/polepin/records/collection.html.erb
|
40
|
+
- app/views/polepin/records/index.html.erb
|
41
|
+
- app/views/polepin/records/show.html.erb
|
42
|
+
- config/routes.rb
|
43
|
+
- lib/polepin/engine.rb
|
44
|
+
- lib/polepin/utility.rb
|
45
|
+
- lib/polepin.rb
|
46
|
+
- public/polepin/stylesheets/all.css
|
47
|
+
- public/polepin/stylesheets/flutie.css
|
48
|
+
- public/polepin/stylesheets/screen.css
|
49
|
+
has_rdoc: true
|
50
|
+
homepage: http://github.com/mjankowski/polepin
|
51
|
+
licenses: []
|
52
|
+
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
|
56
|
+
require_paths:
|
57
|
+
- lib
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
version: "0"
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
requirements: []
|
75
|
+
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 1.3.7
|
78
|
+
signing_key:
|
79
|
+
specification_version: 3
|
80
|
+
summary: Simple reporting for simple people
|
81
|
+
test_files: []
|
82
|
+
|