admin_fu 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/.document +11 -0
  2. data/.metrics +5 -0
  3. data/.rspec +3 -0
  4. data/Gemfile +13 -0
  5. data/Gemfile.lock +133 -0
  6. data/LICENSE +20 -0
  7. data/LICENSE_ADMIN_TEMPLATE +10 -0
  8. data/README.rdoc +3 -0
  9. data/Rakefile +44 -0
  10. data/VERSION +1 -0
  11. data/app/controllers/admin_fu/application_controller.rb +4 -0
  12. data/app/controllers/admin_fu/dashboards_controller.rb +4 -0
  13. data/app/controllers/admin_fu/samples_controller.rb +7 -0
  14. data/app/helpers/admin_fu_helper.rb +20 -0
  15. data/app/stylesheets/_colors.sass +73 -0
  16. data/app/stylesheets/_template.sass +71 -0
  17. data/app/stylesheets/_typography.sass +60 -0
  18. data/app/stylesheets/_utils.sass +7 -0
  19. data/app/stylesheets/styles.sass +51 -0
  20. data/app/views/admin_fu/dashboards/show.html.haml +35 -0
  21. data/app/views/admin_fu/samples/form.html.haml +25 -0
  22. data/app/views/admin_fu/samples/list.html.haml +33 -0
  23. data/app/views/admin_fu/samples/text.html.haml +12 -0
  24. data/app/views/layouts/_flash.html.haml +4 -0
  25. data/app/views/layouts/admin_fu.html.haml +27 -0
  26. data/config/compass.rb +7 -0
  27. data/config/routes.rb +9 -0
  28. data/lib/admin_fu.rb +4 -0
  29. data/lib/admin_fu/config.rb +41 -0
  30. data/lib/admin_fu/engine.rb +11 -0
  31. data/lib/admin_fu/rails/routes.rb +8 -0
  32. data/public/images/admin_fu/body.png +0 -0
  33. data/public/images/admin_fu/box-h2.png +0 -0
  34. data/public/images/admin_fu/edit.png +0 -0
  35. data/public/images/admin_fu/error.png +0 -0
  36. data/public/images/admin_fu/gradient.png +0 -0
  37. data/public/images/admin_fu/trash.png +0 -0
  38. data/public/javascripts/admin_fu/html5.js +2 -0
  39. data/public/stylesheets/admin_fu/styles.css +1005 -0
  40. data/spec/dummy/Rakefile +7 -0
  41. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  42. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  43. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  44. data/spec/dummy/config.ru +4 -0
  45. data/spec/dummy/config/application.rb +44 -0
  46. data/spec/dummy/config/boot.rb +10 -0
  47. data/spec/dummy/config/environment.rb +5 -0
  48. data/spec/dummy/config/environments/development.rb +26 -0
  49. data/spec/dummy/config/environments/production.rb +49 -0
  50. data/spec/dummy/config/environments/test.rb +35 -0
  51. data/spec/dummy/config/initializers/admin_fu.rb +7 -0
  52. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  53. data/spec/dummy/config/initializers/inflections.rb +10 -0
  54. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  55. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  56. data/spec/dummy/config/initializers/session_store.rb +8 -0
  57. data/spec/dummy/config/locales/en.yml +10 -0
  58. data/spec/dummy/config/routes.rb +6 -0
  59. data/spec/dummy/public/404.html +26 -0
  60. data/spec/dummy/public/422.html +26 -0
  61. data/spec/dummy/public/500.html +26 -0
  62. data/spec/dummy/public/favicon.ico +0 -0
  63. data/spec/dummy/public/javascripts/application.js +2 -0
  64. data/spec/dummy/public/javascripts/controls.js +965 -0
  65. data/spec/dummy/public/javascripts/dragdrop.js +974 -0
  66. data/spec/dummy/public/javascripts/effects.js +1123 -0
  67. data/spec/dummy/public/javascripts/prototype.js +6001 -0
  68. data/spec/dummy/public/javascripts/rails.js +175 -0
  69. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  70. data/spec/dummy/script/rails +6 -0
  71. data/spec/requests/menu_spec.rb +25 -0
  72. data/spec/requests/routes_spec.rb +21 -0
  73. data/spec/requests/samples_spec.rb +23 -0
  74. data/spec/spec_helper.rb +32 -0
  75. metadata +239 -0
@@ -0,0 +1,11 @@
1
+ # .document is used by rdoc and yard to know how to generate documentation
2
+ # for example, it can be used to control how rdoc gets built when you do `gem install foo`
3
+
4
+ README.rdoc
5
+ lib/**/*.rb
6
+ bin/*
7
+
8
+ # Files below this - are treated as 'extra files', and aren't parsed for ruby code
9
+ -
10
+ features/**/*.feature
11
+ LICENSE
@@ -0,0 +1,5 @@
1
+ # Metrical configuration - https://github.com/iain/metrical
2
+ MetricFu::Configuration.run do |config|
3
+ config.metrics = [:churn, :flog, :flay, :reek, :roodi, :hotspots, :rails_best_practices]
4
+ config.graphs = []
5
+ end
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format=nested
3
+ --profile
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "rails", "3.0.3"
4
+ gem "haml-rails"
5
+
6
+ group :development do
7
+ gem "bundler", "~> 1.0.7"
8
+ gem 'simplecov', '>= 0.3.8', :require => false
9
+ gem "rspec-rails", "~> 2.0.1"
10
+ gem "sqlite3-ruby", :require => "sqlite3"
11
+ gem "capybara", ">= 0.4.0"
12
+ gem "jeweler", "~> 1.5.2"
13
+ end
@@ -0,0 +1,133 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ abstract (1.0.0)
5
+ actionmailer (3.0.3)
6
+ actionpack (= 3.0.3)
7
+ mail (~> 2.2.9)
8
+ actionpack (3.0.3)
9
+ activemodel (= 3.0.3)
10
+ activesupport (= 3.0.3)
11
+ builder (~> 2.1.2)
12
+ erubis (~> 2.6.6)
13
+ i18n (~> 0.4)
14
+ rack (~> 1.2.1)
15
+ rack-mount (~> 0.6.13)
16
+ rack-test (~> 0.5.6)
17
+ tzinfo (~> 0.3.23)
18
+ activemodel (3.0.3)
19
+ activesupport (= 3.0.3)
20
+ builder (~> 2.1.2)
21
+ i18n (~> 0.4)
22
+ activerecord (3.0.3)
23
+ activemodel (= 3.0.3)
24
+ activesupport (= 3.0.3)
25
+ arel (~> 2.0.2)
26
+ tzinfo (~> 0.3.23)
27
+ activeresource (3.0.3)
28
+ activemodel (= 3.0.3)
29
+ activesupport (= 3.0.3)
30
+ activesupport (3.0.3)
31
+ arel (2.0.7)
32
+ builder (2.1.2)
33
+ capybara (0.4.0)
34
+ celerity (>= 0.7.9)
35
+ culerity (>= 0.2.4)
36
+ mime-types (>= 1.16)
37
+ nokogiri (>= 1.3.3)
38
+ rack (>= 1.0.0)
39
+ rack-test (>= 0.5.4)
40
+ selenium-webdriver (>= 0.0.27)
41
+ xpath (~> 0.1.2)
42
+ celerity (0.8.7)
43
+ childprocess (0.1.6)
44
+ ffi (~> 0.6.3)
45
+ culerity (0.2.14)
46
+ diff-lcs (1.1.2)
47
+ erubis (2.6.6)
48
+ abstract (>= 1.0.0)
49
+ ffi (0.6.3)
50
+ rake (>= 0.8.7)
51
+ git (1.2.5)
52
+ haml (3.0.25)
53
+ haml-rails (0.3.4)
54
+ actionpack (~> 3.0)
55
+ activesupport (~> 3.0)
56
+ haml (~> 3.0)
57
+ railties (~> 3.0)
58
+ i18n (0.5.0)
59
+ jeweler (1.5.2)
60
+ bundler (~> 1.0.0)
61
+ git (>= 1.2.5)
62
+ rake
63
+ json_pure (1.4.6)
64
+ mail (2.2.14)
65
+ activesupport (>= 2.3.6)
66
+ i18n (>= 0.4.0)
67
+ mime-types (~> 1.16)
68
+ treetop (~> 1.4.8)
69
+ mime-types (1.16)
70
+ nokogiri (1.4.4)
71
+ polyglot (0.3.1)
72
+ rack (1.2.1)
73
+ rack-mount (0.6.13)
74
+ rack (>= 1.0.0)
75
+ rack-test (0.5.7)
76
+ rack (>= 1.0)
77
+ rails (3.0.3)
78
+ actionmailer (= 3.0.3)
79
+ actionpack (= 3.0.3)
80
+ activerecord (= 3.0.3)
81
+ activeresource (= 3.0.3)
82
+ activesupport (= 3.0.3)
83
+ bundler (~> 1.0)
84
+ railties (= 3.0.3)
85
+ railties (3.0.3)
86
+ actionpack (= 3.0.3)
87
+ activesupport (= 3.0.3)
88
+ rake (>= 0.8.7)
89
+ thor (~> 0.14.4)
90
+ rake (0.8.7)
91
+ rspec (2.0.1)
92
+ rspec-core (~> 2.0.1)
93
+ rspec-expectations (~> 2.0.1)
94
+ rspec-mocks (~> 2.0.1)
95
+ rspec-core (2.0.1)
96
+ rspec-expectations (2.0.1)
97
+ diff-lcs (>= 1.1.2)
98
+ rspec-mocks (2.0.1)
99
+ rspec-core (~> 2.0.1)
100
+ rspec-expectations (~> 2.0.1)
101
+ rspec-rails (2.0.1)
102
+ rspec (~> 2.0.0)
103
+ rubyzip (0.9.4)
104
+ selenium-webdriver (0.1.2)
105
+ childprocess (~> 0.1.5)
106
+ ffi (~> 0.6.3)
107
+ json_pure
108
+ rubyzip
109
+ simplecov (0.3.9)
110
+ simplecov-html (>= 0.3.7)
111
+ simplecov-html (0.3.9)
112
+ sqlite3 (1.3.3)
113
+ sqlite3-ruby (1.3.3)
114
+ sqlite3 (>= 1.3.3)
115
+ thor (0.14.6)
116
+ treetop (1.4.9)
117
+ polyglot (>= 0.3.1)
118
+ tzinfo (0.3.24)
119
+ xpath (0.1.3)
120
+ nokogiri (~> 1.3)
121
+
122
+ PLATFORMS
123
+ ruby
124
+
125
+ DEPENDENCIES
126
+ bundler (~> 1.0.7)
127
+ capybara (>= 0.4.0)
128
+ haml-rails
129
+ jeweler (~> 1.5.2)
130
+ rails (= 3.0.3)
131
+ rspec-rails (~> 2.0.1)
132
+ simplecov (>= 0.3.8)
133
+ sqlite3-ruby
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2011 Fabio Kreusch
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.
@@ -0,0 +1,10 @@
1
+ License
2
+
3
+ Copyright (c) 2010, Mathew Davies All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
+
7
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
+ Neither the name of the Mathew Davies nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,3 @@
1
+ = AdminFu
2
+
3
+ This project rocks and uses MIT-LICENSE.
@@ -0,0 +1,44 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'rake'
11
+
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "admin_fu"
16
+ gem.summary = %Q{Basic administration interface for Rails3 apps}
17
+ gem.description = %Q{Provides a basic administration interface for Rails3 applications}
18
+ gem.email = "fabio@kreusch.com.br"
19
+ gem.homepage = ""
20
+ gem.authors = ["Fabio Kreusch"]
21
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
22
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
23
+ # spec.add_runtime_dependency 'jabber4r', '> 0.1'
24
+ # spec.add_development_dependency 'rspec', '> 1.2.3'
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList['spec/**/*_spec.rb']
32
+ end
33
+
34
+ task :default => :spec
35
+
36
+ require 'rake/rdoctask'
37
+ Rake::RDocTask.new do |rdoc|
38
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
39
+
40
+ rdoc.rdoc_dir = 'rdoc'
41
+ rdoc.title = "admin_fu #{version}"
42
+ rdoc.rdoc_files.include('README*')
43
+ rdoc.rdoc_files.include('lib/**/*.rb')
44
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,4 @@
1
+ class AdminFu::ApplicationController < ApplicationController
2
+ helper AdminFuHelper
3
+ layout 'admin_fu'
4
+ end
@@ -0,0 +1,4 @@
1
+ class AdminFu::DashboardsController < AdminFu::ApplicationController
2
+ def show
3
+ end
4
+ end
@@ -0,0 +1,7 @@
1
+ class AdminFu::SamplesController < AdminFu::ApplicationController
2
+ def show
3
+ flash[:error] = 'This is an error'
4
+ flash[:success] = 'This is a success'
5
+ render params[:id].to_sym
6
+ end
7
+ end
@@ -0,0 +1,20 @@
1
+ module AdminFuHelper
2
+
3
+ def evaluate_path(path)
4
+ if path.nil?
5
+ '#'
6
+ elsif self.respond_to?(path)
7
+ self.send(path)
8
+ else path
9
+ path
10
+ end
11
+ end
12
+
13
+ def button_tag(text, options = {})
14
+ icon = options.include?(:icon) ? image_tag("/images/admin/iconic/#{options.delete(:icon)}_16x16.png", :alt => nil) : ''
15
+ text = content_tag(:span, text)
16
+
17
+ content_tag(:button, icon.html_safe + text.html_safe, options)
18
+ end
19
+
20
+ end
@@ -0,0 +1,73 @@
1
+ @mixin light1-background
2
+ background: white
3
+
4
+ @mixin light2-background
5
+ background: #F7F4E9
6
+
7
+ @mixin dark1-background
8
+ background: #687370
9
+
10
+ @mixin dark2-background
11
+ background: #434A48
12
+
13
+ @mixin dark3-background
14
+ background: #383E3C
15
+
16
+ @mixin dark4-background
17
+ background: #313230
18
+
19
+ @mixin light-color
20
+ color: white
21
+
22
+ @mixin light-anchor
23
+ @include light-color
24
+ text-decoration: none
25
+
26
+ @mixin error-color
27
+ background: #901830
28
+
29
+ @mixin success-color
30
+ background: #C2EFC2
31
+
32
+ @mixin light-border
33
+ border-color: #DDD
34
+
35
+ body, textarea
36
+ color: #333
37
+
38
+ hr
39
+ border-color: #ccc
40
+
41
+ h1, h2, h3, h4, h5, h6, select, textarea
42
+ @include light-border
43
+
44
+ form
45
+ input, input[type="text"], input[type="email"], input[type="url"], select, textarea
46
+ @include light-border
47
+ input[type=submit]
48
+ @include light-color
49
+
50
+ small
51
+ color: #888
52
+
53
+ select, textarea, input, td, article, footer
54
+ background: #fff url(../../images/admin_fu/gradient.png) repeat-x 0 -28px
55
+
56
+ th, input[type=submit], .pagination a:hover
57
+ @include dark2-background
58
+ @include light-color
59
+
60
+ .pagination a:hover
61
+ @include curved
62
+
63
+ article
64
+ background-position: 0 1px
65
+
66
+ .error, .success
67
+ @include light-color
68
+
69
+ .error
70
+ @include error-color
71
+
72
+ .success
73
+ @include success-color
@@ -0,0 +1,71 @@
1
+ .center
2
+ text-align: center
3
+
4
+ ol
5
+ padding: 10px
6
+ margin: 0
7
+
8
+ caption
9
+ padding: 4px
10
+
11
+ table
12
+ width: 100%
13
+
14
+ th, td
15
+ padding: 7px 15px
16
+ text-align: left
17
+
18
+ //Forms
19
+ form
20
+ label
21
+ display: block
22
+ font-size: 17px
23
+ margin: 0 0 5px
24
+ position: relative
25
+
26
+ small
27
+ font-size: 12px
28
+ font-weight: normal
29
+ padding-left: 10px
30
+
31
+ input, input[type="text"], input[type="email"], input[type="url"], textarea
32
+ @include border-radius(0)
33
+ @include curved-alt
34
+ border: 1px solid
35
+ font-family: inherit
36
+ font-size: inherit
37
+ padding: 4px
38
+
39
+ select
40
+ @include curved-alt
41
+ border: 1px solid
42
+ font-family: inherit
43
+ font-size: inherit
44
+ padding: 4px
45
+ padding-top: 3px
46
+ padding-bottom: 3px
47
+
48
+ input
49
+ &[type="submit"], &[type="reset"]
50
+ cursor: pointer
51
+ width: auto !important
52
+
53
+ @for $i from 1 through $max-columns
54
+ .col_#{$i}
55
+ input, select, textarea
56
+ width: ($column-width + ($gutter-width * 2)) * ($i - 1) + $column-width - 10px
57
+
58
+ /* Error and Success messages
59
+
60
+ .error, .success
61
+ @include curved
62
+ padding: 4px 8px
63
+
64
+ /* Pagination
65
+
66
+ .pagination
67
+ text-align: right
68
+ a, span
69
+ display: inline-block
70
+ margin: 0 2px
71
+ padding: 2px 6px