rules_view 0.0.1
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/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.textile +129 -0
- data/Rakefile +47 -0
- data/VERSION +1 -0
- data/app/views/layouts/rules_view.html.erb +43 -0
- data/app/views/re_view/template.html.erb +196 -0
- data/autotest/discover.rb +2 -0
- data/generators/install_generator.rb +41 -0
- data/generators/layout_generator.rb +41 -0
- data/generators/manifests/application.rb +116 -0
- data/generators/manifests/application.yml +8 -0
- data/generators/manifests/layout.rb +17 -0
- data/generators/manifests/layout.yml +5 -0
- data/generators/manifests/templates/app/views/layouts/rules_view_layout.html.erb +47 -0
- data/generators/manifests/templates/config/initializers/rules_view.rb +1 -0
- data/generators/manifests/templates/doc/README.rules_view +97 -0
- data/generators/manifests/templates/public/javascripts/rules_view/jquery-1.4.2.min.js +154 -0
- data/generators/manifests/templates/public/javascripts/rules_view/jquery.autocomplete.pack.js +13 -0
- data/generators/manifests/templates/public/javascripts/rules_view/jquery.blockUI.js +486 -0
- data/generators/manifests/templates/public/javascripts/rules_view/jquery.fancybox-1.3.1.js +1077 -0
- data/generators/manifests/templates/public/javascripts/rules_view/re_view.js +148 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/ie.css +35 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/cross.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/key.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/tick.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/readme.txt +32 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/screen.css +97 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/fancy-type/readme.txt +14 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/fancy-type/screen.css +71 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/doc.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/email.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/external.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/feed.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/im.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/pdf.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/visited.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/xls.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/readme.txt +18 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/screen.css +40 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/rtl/readme.txt +10 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/rtl/screen.css +110 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/print.css +29 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/screen.css +258 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/forms.css +65 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/grid.css +280 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/grid.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/ie.css +76 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/print.css +85 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/reset.css +45 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/typography.css +106 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/blank.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_close.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_loading.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_nav_left.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_nav_right.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_e.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_n.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_ne.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_nw.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_s.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_se.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_sw.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_w.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_left.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_main.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_over.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_right.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox-x.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox-y.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/jquery.fancybox-1.3.1.css +363 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_box/shadowbox.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_box/whitebox.jpg +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/checked-off.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/checked-on.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/icon-add.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/icon-delete.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/list-add.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/list-remove.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/list-select.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-blue-left.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-blue-right.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-gray-left.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-gray-right.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-green-left.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-green-right.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-orange-left.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-orange-right.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-red-left.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-red-right.gif +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_error/re-alert-close.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_navigate/breadcrumb.png +0 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/jquery.autocomplete.css +53 -0
- data/generators/manifests/templates/public/stylesheets/rules_view/rules_view.css +738 -0
- data/init.rb +1 -0
- data/lib/rules_view/alerts.rb +51 -0
- data/lib/rules_view/boxes.rb +25 -0
- data/lib/rules_view/buttons.rb +113 -0
- data/lib/rules_view/config.rb +21 -0
- data/lib/rules_view/defer.rb +30 -0
- data/lib/rules_view/engine.rb +28 -0
- data/lib/rules_view/form_builder.rb +62 -0
- data/lib/rules_view/form_fields.rb +41 -0
- data/lib/rules_view/form_styles.rb +112 -0
- data/lib/rules_view/model_loader.rb +64 -0
- data/lib/rules_view/navigate.rb +40 -0
- data/lib/rules_view.rb +20 -0
- data/rules_view.gemspec +239 -0
- data/spec/lib/rules_view/alerts_spec.rb +145 -0
- data/spec/lib/rules_view/boxes_spec.rb +49 -0
- data/spec/lib/rules_view/buttons_spec.rb +184 -0
- data/spec/lib/rules_view/defer_spec.rb +90 -0
- data/spec/lib/rules_view/form_builder_fields_spec.rb +184 -0
- data/spec/lib/rules_view/form_builder_spec.rb +19 -0
- data/spec/lib/rules_view/form_fields_spec.rb +219 -0
- data/spec/lib/rules_view/form_styles_spec.rb +290 -0
- data/spec/lib/rules_view/model_loader_spec.rb +202 -0
- data/spec/lib/rules_view/navigate_spec.rb +61 -0
- data/spec/rails_3_0_0_root/.gitignore +4 -0
- data/spec/rails_3_0_0_root/.rspec +1 -0
- data/spec/rails_3_0_0_root/Gemfile +13 -0
- data/spec/rails_3_0_0_root/Gemfile.lock +101 -0
- data/spec/rails_3_0_0_root/README +256 -0
- data/spec/rails_3_0_0_root/Rakefile +7 -0
- data/spec/rails_3_0_0_root/app/controllers/application_controller.rb +3 -0
- data/spec/rails_3_0_0_root/app/helpers/application_helper.rb +2 -0
- data/spec/rails_3_0_0_root/app/views/layouts/application.html.erb +14 -0
- data/spec/rails_3_0_0_root/autotest/discover.rb +2 -0
- data/spec/rails_3_0_0_root/config/application.rb +42 -0
- data/spec/rails_3_0_0_root/config/boot.rb +13 -0
- data/spec/rails_3_0_0_root/config/database.yml +22 -0
- data/spec/rails_3_0_0_root/config/environment.rb +5 -0
- data/spec/rails_3_0_0_root/config/environments/development.rb +26 -0
- data/spec/rails_3_0_0_root/config/environments/production.rb +49 -0
- data/spec/rails_3_0_0_root/config/environments/test.rb +35 -0
- data/spec/rails_3_0_0_root/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_3_0_0_root/config/initializers/inflections.rb +10 -0
- data/spec/rails_3_0_0_root/config/initializers/mime_types.rb +5 -0
- data/spec/rails_3_0_0_root/config/initializers/secret_token.rb +7 -0
- data/spec/rails_3_0_0_root/config/initializers/session_store.rb +8 -0
- data/spec/rails_3_0_0_root/config/locales/en.yml +5 -0
- data/spec/rails_3_0_0_root/config/routes.rb +58 -0
- data/spec/rails_3_0_0_root/config.ru +4 -0
- data/spec/rails_3_0_0_root/db/seeds.rb +7 -0
- data/spec/rails_3_0_0_root/doc/README_FOR_APP +2 -0
- data/spec/rails_3_0_0_root/lib/tasks/.gitkeep +0 -0
- data/spec/rails_3_0_0_root/public/404.html +26 -0
- data/spec/rails_3_0_0_root/public/422.html +26 -0
- data/spec/rails_3_0_0_root/public/500.html +26 -0
- data/spec/rails_3_0_0_root/public/favicon.ico +0 -0
- data/spec/rails_3_0_0_root/public/images/rails.png +0 -0
- data/spec/rails_3_0_0_root/public/index.html +239 -0
- data/spec/rails_3_0_0_root/public/javascripts/application.js +2 -0
- data/spec/rails_3_0_0_root/public/javascripts/controls.js +965 -0
- data/spec/rails_3_0_0_root/public/javascripts/dragdrop.js +974 -0
- data/spec/rails_3_0_0_root/public/javascripts/effects.js +1123 -0
- data/spec/rails_3_0_0_root/public/javascripts/prototype.js +6001 -0
- data/spec/rails_3_0_0_root/public/javascripts/rails.js +175 -0
- data/spec/rails_3_0_0_root/public/robots.txt +5 -0
- data/spec/rails_3_0_0_root/public/stylesheets/.gitkeep +0 -0
- data/spec/rails_3_0_0_root/script/rails +6 -0
- data/spec/rails_3_0_0_root/spec/spec_helper.rb +27 -0
- data/spec/rails_3_0_0_root/vendor/plugins/.gitkeep +0 -0
- data/spec/spec_helper.rb +29 -0
- data/spec/support/create_memory_db.rb +2 -0
- data/tasks/rspec.rake +46 -0
- metadata +278 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2009 Chris Douglas
|
|
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.textile
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
= rules_view
|
|
2
|
+
|
|
3
|
+
To add the rules view to you application
|
|
4
|
+
> script/rails generate rules_view:install
|
|
5
|
+
|
|
6
|
+
Then set the layout to use in the controller
|
|
7
|
+
class MyCoolController < ApplicationController
|
|
8
|
+
layout 'rules_view'
|
|
9
|
+
...
|
|
10
|
+
|
|
11
|
+
To install and modify the rules_view layout
|
|
12
|
+
> script/rails generate rules_view:layout [layout_name]
|
|
13
|
+
|
|
14
|
+
Then set the layout to use in the controller
|
|
15
|
+
class MyCoolController < ApplicationController
|
|
16
|
+
layout '[layout_name]'
|
|
17
|
+
...
|
|
18
|
+
|
|
19
|
+
##########################################################
|
|
20
|
+
= form_styles
|
|
21
|
+
|
|
22
|
+
- re_build_form_field (value options) # options :class, :id, :disabled, :span
|
|
23
|
+
- re_build_form_label (value options) # options :class, :id, :disabled, :span, :error, :required
|
|
24
|
+
- re_build_form_data (value options) # options :class, :id, :disabled, :span, :error, :required, :hint, :text
|
|
25
|
+
|
|
26
|
+
##########################################################
|
|
27
|
+
= form_builder
|
|
28
|
+
|
|
29
|
+
- re_form_for (record_or_name_or_array, *args, &proc)
|
|
30
|
+
- re_fields_for (record_or_name_or_array, *args, &proc)
|
|
31
|
+
- re_form_remote_for (record_or_name_or_array, *args, &proc)
|
|
32
|
+
- re_remote_form_for (record_or_name_or_array, *args, &proc)
|
|
33
|
+
|
|
34
|
+
- text_field (name, value, *args)
|
|
35
|
+
- password_field (name, value, *args)
|
|
36
|
+
- file_field (name, value, *args)
|
|
37
|
+
- text_area (name, value, *args)
|
|
38
|
+
- select (name, value, *args)
|
|
39
|
+
- date_select (name, value, *args)
|
|
40
|
+
- datetime_select (name, value, *args)
|
|
41
|
+
- time_select (name, value, *args)
|
|
42
|
+
- time_zone_select (name, value, *args)
|
|
43
|
+
- check_box (name, value = "1", checked = false, options = {})
|
|
44
|
+
|
|
45
|
+
##########################################################
|
|
46
|
+
= form_fields
|
|
47
|
+
|
|
48
|
+
- re_text_field (label, name, value, *args)
|
|
49
|
+
- re_password_field (label, name, value, *args)
|
|
50
|
+
- re_file_field (label, name, value, *args)
|
|
51
|
+
- re_text_area (label, name, value, *args)
|
|
52
|
+
- re_select (label, name, value, *args)
|
|
53
|
+
- re_date_select (label, name, value, *args)
|
|
54
|
+
- re_datetime_select (label, name, value, *args)
|
|
55
|
+
- re_time_select (label, name, value, *args)
|
|
56
|
+
- re_time_zone_select (label, name, value, *args)
|
|
57
|
+
- re_check_box (label, name, value = "1", checked = false, options = {})
|
|
58
|
+
- re_form_text (label, text = "", options = {})
|
|
59
|
+
- re_form_blank (options = {})
|
|
60
|
+
|
|
61
|
+
##########################################################
|
|
62
|
+
= alert
|
|
63
|
+
|
|
64
|
+
- re_alert
|
|
65
|
+
- re_alert_js
|
|
66
|
+
|
|
67
|
+
##########################################################
|
|
68
|
+
= boxes
|
|
69
|
+
|
|
70
|
+
- re_whitebox(&block)
|
|
71
|
+
- re_shadowbox(&block)
|
|
72
|
+
|
|
73
|
+
##########################################################
|
|
74
|
+
= buttons
|
|
75
|
+
|
|
76
|
+
- re_button_submit(title, color, options ={})
|
|
77
|
+
|
|
78
|
+
- re_button_submit_gray(title, options = {})
|
|
79
|
+
- re_button_submit_blue(title, options = {})
|
|
80
|
+
- re_button_submit_green(title, options = {})
|
|
81
|
+
- re_button_submit_orange(title, options = {})
|
|
82
|
+
- re_button_submit_red(title, options = {})
|
|
83
|
+
|
|
84
|
+
- re_button_link(title, url, color, options = {})
|
|
85
|
+
|
|
86
|
+
- re_button_link_gray(title, url, options = {})
|
|
87
|
+
- re_button_link_blue(title, url, options = {})
|
|
88
|
+
- re_button_link_green(title, url, options = {})
|
|
89
|
+
- re_button_link_orange(title, url, options = {})
|
|
90
|
+
- re_button_link_red(title, url, options = {})
|
|
91
|
+
|
|
92
|
+
- re_add_link(title, id)
|
|
93
|
+
- re_remove_link(title, object_name, id)
|
|
94
|
+
- re_remove_field(object_name, id)
|
|
95
|
+
|
|
96
|
+
- re_button_add(url, options = {})
|
|
97
|
+
- re_button_remove(url, options = {})
|
|
98
|
+
- re_button_select(url, options = {})
|
|
99
|
+
- re_button_checked(url, options = {})
|
|
100
|
+
- re_button_unchecked(url, options = {})
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
##########################################################
|
|
104
|
+
= navigate
|
|
105
|
+
|
|
106
|
+
- re_breadcrumbs (*links)
|
|
107
|
+
- re_breadcrumbs_right (*links)
|
|
108
|
+
|
|
109
|
+
##########################################################
|
|
110
|
+
= defer
|
|
111
|
+
|
|
112
|
+
- set_re_javascript_include (javascript_include_or_array)
|
|
113
|
+
- set_re_breadcrumbs (*links)
|
|
114
|
+
- set_re_breadcrumbs_right (*links)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
== Note on Patches/Pull Requests
|
|
118
|
+
|
|
119
|
+
* Fork the project.
|
|
120
|
+
* Make your feature addition or bug fix.
|
|
121
|
+
* Add tests for it. This is important so I don't break it in a
|
|
122
|
+
future version unintentionally.
|
|
123
|
+
* Commit, do not mess with rakefile, version, or history.
|
|
124
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
|
125
|
+
* Send me a pull request. Bonus points for topic branches.
|
|
126
|
+
|
|
127
|
+
== Copyright
|
|
128
|
+
|
|
129
|
+
Copyright (c) 2010 Chris Douglas. See LICENSE for details.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'rake'
|
|
3
|
+
|
|
4
|
+
begin
|
|
5
|
+
require 'jeweler'
|
|
6
|
+
Jeweler::Tasks.new do |gem|
|
|
7
|
+
gem.name = "rules_view"
|
|
8
|
+
gem.summary = %Q{views and styles used in my rules engine and other projects}
|
|
9
|
+
gem.description = %Q{Ruby Rails Rules Engine Framework Views}
|
|
10
|
+
gem.email = "dougo.chris@gmail.com"
|
|
11
|
+
gem.homepage = "http://github.com/dougochris/rules_view"
|
|
12
|
+
gem.authors = ["Chris Douglas"]
|
|
13
|
+
gem.add_development_dependency "rspec", ">= 1.2.9"
|
|
14
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
|
15
|
+
end
|
|
16
|
+
Jeweler::GemcutterTasks.new
|
|
17
|
+
rescue LoadError
|
|
18
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
|
22
|
+
|
|
23
|
+
# require 'spec/rake/spectask'
|
|
24
|
+
# Spec::Rake::SpecTask.new(:spec) do |spec|
|
|
25
|
+
# spec.libs << 'lib' << 'spec'
|
|
26
|
+
# spec.spec_files = FileList['spec/**/*_spec.rb']
|
|
27
|
+
# end
|
|
28
|
+
#
|
|
29
|
+
# Spec::Rake::SpecTask.new(:rcov) do |spec|
|
|
30
|
+
# spec.libs << 'lib' << 'spec'
|
|
31
|
+
# spec.pattern = 'spec/**/*_spec.rb'
|
|
32
|
+
# spec.rcov = true
|
|
33
|
+
# end
|
|
34
|
+
#
|
|
35
|
+
# task :spec => :check_dependencies
|
|
36
|
+
#
|
|
37
|
+
# task :default => :spec
|
|
38
|
+
#
|
|
39
|
+
# require 'rake/rdoctask'
|
|
40
|
+
# Rake::RDocTask.new do |rdoc|
|
|
41
|
+
# version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
|
42
|
+
#
|
|
43
|
+
# rdoc.rdoc_dir = 'rdoc'
|
|
44
|
+
# rdoc.title = "rules_view #{version}"
|
|
45
|
+
# rdoc.rdoc_files.include('README*')
|
|
46
|
+
# rdoc.rdoc_files.include('lib/**/*.rb')
|
|
47
|
+
# end
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.1
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
|
+
<title> <%%= (page_title = yield :defer_page_title) ? page_title : controller.controller_name.humanize %> </title>
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="/stylesheets/rules_view/blueprint/screen.css" type="text/css" media="screen, projection">
|
|
8
|
+
<link rel="stylesheet" href="/stylesheets/rules_view/blueprint/print.css" type="text/css" media="print">
|
|
9
|
+
<!--[if lt IE 8]>
|
|
10
|
+
<link rel="stylesheet" href="/stylesheets/rules_view/blueprint/ie.css" type="text/css" media="screen, projection">
|
|
11
|
+
<![endif]-->
|
|
12
|
+
|
|
13
|
+
<%= javascript_include_tag 'rules_view/jquery-1.4.2.min',
|
|
14
|
+
'rules_view/jquery.blockUI',
|
|
15
|
+
'rules_view/jquery.autocomplete.pack',
|
|
16
|
+
'rules_view/jquery.fancybox-1.3.1',
|
|
17
|
+
'rules_view/rules_view',
|
|
18
|
+
'application',
|
|
19
|
+
:cache => true %>
|
|
20
|
+
|
|
21
|
+
<%= stylesheet_link_tag 'rules_view/rules_view',
|
|
22
|
+
'rules_view/jquery.autocomplete',
|
|
23
|
+
'rules_view/fancybox/jquery.fancybox-1.3.1',
|
|
24
|
+
# 'application',
|
|
25
|
+
:cache => true %>
|
|
26
|
+
|
|
27
|
+
<%= yield :defer_re_javascript_include %>
|
|
28
|
+
|
|
29
|
+
<%= csrf_meta_tag %>
|
|
30
|
+
</head>
|
|
31
|
+
<body>
|
|
32
|
+
<div class="container re_container">
|
|
33
|
+
<%#= render '/layouts/header' %>
|
|
34
|
+
|
|
35
|
+
<%= yield :defer_re_breadcrumbs %>
|
|
36
|
+
<%= re_alert %>
|
|
37
|
+
|
|
38
|
+
<%= yield %>
|
|
39
|
+
<div class="clear top-10"></div>
|
|
40
|
+
<%#= render '/layouts/footer' %>
|
|
41
|
+
</div>
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<div class="span-24">
|
|
2
|
+
<% %w(h1 h2 h3 h4 h5 h6).each do |type| %>
|
|
3
|
+
<hr/>
|
|
4
|
+
<<%= type %>><%= type %></<%= type %>>
|
|
5
|
+
<% end %>
|
|
6
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, </p>
|
|
7
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, </p>
|
|
8
|
+
|
|
9
|
+
<% %w(warning boldblack black white grey red dkreg blue lightblue green dkgreen brown).each do |type| %>
|
|
10
|
+
<p class="<%= type %>"><%= type %></p>
|
|
11
|
+
<% end %>
|
|
12
|
+
</div>
|
|
13
|
+
<hr>
|
|
14
|
+
|
|
15
|
+
<div class="span-24">
|
|
16
|
+
<h1>Navigate</h1>
|
|
17
|
+
<%= re_breadcrumbs link_to("level one", "#"), link_to("level two", "#"), "level three" %>
|
|
18
|
+
<%= re_breadcrumbs_right link_to("level one", "#"), link_to("level two", "#"), "level three", link_to("link_right", "#") %>
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
<hr>
|
|
22
|
+
|
|
23
|
+
<h1>Boxes</h1>
|
|
24
|
+
<div class="span-12">
|
|
25
|
+
<h3>Whitebox</h3>
|
|
26
|
+
<%= re_whitebox do %>
|
|
27
|
+
<div class="span-11 last">
|
|
28
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, </p>
|
|
29
|
+
</div>
|
|
30
|
+
<% end %>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="span-12 last">
|
|
34
|
+
<h3>Shadowbox</h3>
|
|
35
|
+
<%= re_shadowbox do %>
|
|
36
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, </p>
|
|
37
|
+
<% end %>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<% %w(error notice success).each do |type| %>
|
|
41
|
+
<div class="span-6 prepend-1 <%= type == 'success' ? 'last' : ''%>">
|
|
42
|
+
<h3><%= type %></h3>
|
|
43
|
+
<div class="span-5 <%= type %>">
|
|
44
|
+
<p>Ut enim ad minim veniam </p>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<% end %>
|
|
48
|
+
<div class="clear top-10"></div>
|
|
49
|
+
|
|
50
|
+
<% %w(bluebox greenbox redbox dkgreenbox brownbox yellowbox).each do |type| %>
|
|
51
|
+
<div class="span-4 <%= type == 'yellowbox' ? 'last' : ''%>">
|
|
52
|
+
<div class="re-<%= type %>-header">re-<%= type %> header</div>
|
|
53
|
+
<div class="re-<%= type %>">
|
|
54
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, </p>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<% end %>
|
|
58
|
+
<div class="clear"></div>
|
|
59
|
+
|
|
60
|
+
<div class="span-8 prepend-5">
|
|
61
|
+
<h3>re-infobox</h3>
|
|
62
|
+
<div class="re-infobox">
|
|
63
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, </p>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
<div class="clear"></div>
|
|
67
|
+
|
|
68
|
+
<hr>
|
|
69
|
+
|
|
70
|
+
<h1>Button Links</h1>
|
|
71
|
+
<div class="span-24 showgrid">
|
|
72
|
+
<% %w(3 4 5 6 ).each do |action| %>
|
|
73
|
+
<%= re_button_link_red("Button " + action, "#", :span => action) %>
|
|
74
|
+
<% end %>
|
|
75
|
+
<div class="clear"></div>
|
|
76
|
+
<% %w(red gray blue green orange).each do |color| %>
|
|
77
|
+
<%= re_button_link(color, "#", color) %>
|
|
78
|
+
<% end %>
|
|
79
|
+
</div>
|
|
80
|
+
<hr>
|
|
81
|
+
|
|
82
|
+
<h1>Button Submit</h1>
|
|
83
|
+
<div class="span-24 showgrid">
|
|
84
|
+
<% %w(3 4 5 6 ).each do |action| %>
|
|
85
|
+
<%= re_button_submit_red("Button " + action, :span => action) %>
|
|
86
|
+
<% end %>
|
|
87
|
+
<div class="clear"></div>
|
|
88
|
+
<% %w(red gray blue green orange).each do |color| %>
|
|
89
|
+
<%= re_button_submit(color, color) %>
|
|
90
|
+
<% end %>
|
|
91
|
+
</div>
|
|
92
|
+
<hr>
|
|
93
|
+
|
|
94
|
+
<div class="span-23 prepend-1 last showgrid">
|
|
95
|
+
<h1>Build Forms</h1>
|
|
96
|
+
<%= re_form_text "TEXT FIELD LABEL", "TEXT FIELD VALUE" %>
|
|
97
|
+
<%= re_text_field("TEXT FIELD", "text_field_1", "text_field_1")%>
|
|
98
|
+
<%= re_password_field("PASSWORD FIELD", "text_field_1", "text_field_1")%>
|
|
99
|
+
<%= re_check_box "CHECKBOX FIELD", 'accept'%>
|
|
100
|
+
<%= re_check_box "CHECKBOX FIELD", 'accept', "1", "1", :required => true %>
|
|
101
|
+
<%= re_select "SELECT FIELD", "people", "<option>David</option><option>John</option><option>Mary</option>" %>
|
|
102
|
+
<%= re_text_area "TEXT AREA FIELD", "text_area", "", :size => "30x10" %>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
<%= re_text_field("TEXT FIELD 5x16", "text_field_1", "text_field_1", :span => '5x16', :class => "showgrid")%>
|
|
106
|
+
<%= re_text_field("TEXT FIELD 5", "text_field_1", "text_field_1", :span => '5', :class => "showgrid")%>
|
|
107
|
+
<%= re_text_field("TEXT FIELD", "text_field_1", "text_field_1", :error => "error message")%>
|
|
108
|
+
<%= re_text_field("TEXT FIELD", "text_field_1", "text_field_1", :hint => "hint message")%>
|
|
109
|
+
<%= re_text_field("TEXT FIELD", "text_field_1", "text_field_1", :span => '4x16', :text => "TEXT MESSAGE")%>
|
|
110
|
+
<%= re_text_field("REQUIRED", "text_field_1", "text_field_1", :required => true)%>
|
|
111
|
+
<%= re_text_field("DISABLED", "text_field_1", "text_field_1", :disabled => true)%>
|
|
112
|
+
<div class="clear"></div>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div class="span-23 prepend-1 last showgrid">
|
|
116
|
+
<h3>2 column</h3>
|
|
117
|
+
<div class="span-11">
|
|
118
|
+
<%= re_text_field("LEFT", "text_field_1", "text_field_1", :span => "2x9")%>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="span-11 last">
|
|
121
|
+
<%= re_text_field("RIGHT", "text_field_1", "text_field_1", :span => "2x9", :class => "last")%>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="clear"></div>
|
|
124
|
+
|
|
125
|
+
<h3>3 column</h3>
|
|
126
|
+
<div class="span-6">
|
|
127
|
+
<%= re_text_field("LEFT", "text_field_1", "text_field_1", :span => "2x4", :size => 15)%>
|
|
128
|
+
</div>
|
|
129
|
+
<div class="span-6 prepend-1">
|
|
130
|
+
<%= re_text_field("CENTER", "text_field_1", "text_field_1", :span => "2x4", :size => 15)%>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="span-6 prepend-1 last">
|
|
133
|
+
<%= re_text_field("RIGHT", "text_field_1", "text_field_1", :span => "2x4", :size => 15)%>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="clear"></div>
|
|
136
|
+
|
|
137
|
+
<h3>4 column</h3>
|
|
138
|
+
<div class="span-4">
|
|
139
|
+
<%= re_text_field("AAA", "text_field_1", "text_field_1", :span => "1x3", :size => 10)%>
|
|
140
|
+
</div>
|
|
141
|
+
<div class="span-4 prepend-1">
|
|
142
|
+
<%= re_text_field("BBB", "text_field_1", "text_field_1", :span => "1x3", :size => 10)%>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="span-4 prepend-1">
|
|
145
|
+
<%= re_text_field("CCC", "text_field_1", "text_field_1", :span => "1x3", :size => 10)%>
|
|
146
|
+
</div>
|
|
147
|
+
<div class="span-4 prepend-1 last">
|
|
148
|
+
<%= re_text_field("DDD", "text_field_1", "text_field_1", :span => "1x3", :size => 10)%>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
<div class="span-23 prepend-1 last showgrid">
|
|
154
|
+
<h1>re_form_for</h1>
|
|
155
|
+
<%= re_form_for(:demo_form) do |f| %>
|
|
156
|
+
<%= f.text_field("default_4x8")%>
|
|
157
|
+
<% end %>
|
|
158
|
+
|
|
159
|
+
<%= re_form_for(:demo_form, :span => "6x8") do |f| %>
|
|
160
|
+
<%= f.text_field("default_6x8")%>
|
|
161
|
+
<%= f.text_field("override_5x9", :span => "5x9")%>
|
|
162
|
+
<% end %>
|
|
163
|
+
<hr>
|
|
164
|
+
|
|
165
|
+
<h1>re_build_form_field</h1>
|
|
166
|
+
<%= re_build_form_field("FORM FIELD (12)", {:class => "showgrid clear"})%>
|
|
167
|
+
<%= re_build_form_field("FORM FIELD 11", {:span => "11", :class => "showgrid clear"})%>
|
|
168
|
+
<%= re_build_form_field("FORM FIELD 10", {:span => "10", :class => "showgrid clear"})%>
|
|
169
|
+
<%= re_build_form_field("FORM FIELD 9", {:span => "9", :class => "showgrid clear"})%>
|
|
170
|
+
<%= re_build_form_field("FORM FIELD", {:class => "showgrid"})%>
|
|
171
|
+
<%= re_build_form_field("FORM FIELD DISABLED", {:class => "showgrid", :disabled => true})%>
|
|
172
|
+
<hr>
|
|
173
|
+
|
|
174
|
+
<h1>re_build_form_label</h1>
|
|
175
|
+
<%= re_build_form_label("LABEL DEFAULT (4)", {:class => "showgrid clear"})%>
|
|
176
|
+
<%= re_build_form_label("LABEL SPAN 5", {:span => "5", :class => "showgrid clear"})%>
|
|
177
|
+
<%= re_build_form_label("LABEL SPAN 4", {:span => "4", :class => "showgrid clear"})%>
|
|
178
|
+
<%= re_build_form_label("LABEL SPAN 3", {:span => "3", :class => "showgrid clear"})%>
|
|
179
|
+
|
|
180
|
+
<%= re_build_form_label("LABEL ERROR", {:error => "error message", :class => "clear"})%>
|
|
181
|
+
<%= re_build_form_label("LABEL DISABLED", {:disabled => true, :class => "clear"})%>
|
|
182
|
+
<%= re_build_form_label("LABEL REQUIRED", {:required => true, :class => "clear"})%>
|
|
183
|
+
<%= re_build_form_label("LABEL REQUIRED EX", {:required => true, :disabled => true, :class => "clear"})%>
|
|
184
|
+
<hr>
|
|
185
|
+
|
|
186
|
+
<h1>re_build_form_data</h1>
|
|
187
|
+
<%= re_build_form_data("DATA DEFAULT (8)", {:class => "showgrid clear"})%>
|
|
188
|
+
<%= re_build_form_data("DATA SPAN 7", {:span => "7", :class => "showgrid clear"})%>
|
|
189
|
+
<%= re_build_form_data("DATA SPAN 6", {:span => "6", :class => "showgrid clear"})%>
|
|
190
|
+
<%= re_build_form_data("DATA SPAN 5", {:span => "5", :class => "showgrid clear"})%>
|
|
191
|
+
<%= re_build_form_data("DATA ERROR SPAN 10", {:class => "clear", :error => "error message"})%>
|
|
192
|
+
<%= re_build_form_data("DATA HINT SPAN 10", {:class => "clear", :hint => "hint message"})%>
|
|
193
|
+
<%= re_build_form_data("DATA TEXT SPAN 10", {:class => "clear", :label => "FORM LABEL"})%>
|
|
194
|
+
<%= re_build_form_data("DATA DISABLED", {:class => "clear", :disabled => true})%>
|
|
195
|
+
<hr>
|
|
196
|
+
</div>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require "#{File.dirname(__FILE__)}/manifests/application.rb"
|
|
2
|
+
|
|
3
|
+
module RulesView
|
|
4
|
+
module Generators
|
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
|
6
|
+
|
|
7
|
+
source_root File.expand_path(File.dirname(__FILE__) + "/manifests/templates")
|
|
8
|
+
|
|
9
|
+
def initialize(runtime_args, *runtime_options)
|
|
10
|
+
super
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def install
|
|
14
|
+
ApplicationManifest.populate_record(self, "rules_view")
|
|
15
|
+
puts InstallGenerator.description_all
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.description_all
|
|
19
|
+
<<-DESCRIPTION
|
|
20
|
+
*******************************************************************
|
|
21
|
+
To add the rules view to you application
|
|
22
|
+
> script/rails generate rules_view:install
|
|
23
|
+
|
|
24
|
+
Then set the layout to use in the controller
|
|
25
|
+
class MyCoolController < ApplicationController
|
|
26
|
+
layout 'rules_view'
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
To install and modify the rules_view layout
|
|
30
|
+
> script/rails generate rules_view:layout [layout_name]
|
|
31
|
+
|
|
32
|
+
See doc/README.rules_view for usage and instructions
|
|
33
|
+
|
|
34
|
+
*******************************************************************
|
|
35
|
+
DESCRIPTION
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
desc(description_all)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require "#{File.dirname(__FILE__)}/manifests/layout.rb"
|
|
2
|
+
|
|
3
|
+
module RulesView
|
|
4
|
+
module Generators
|
|
5
|
+
class LayoutGenerator < Rails::Generators::Base
|
|
6
|
+
|
|
7
|
+
source_root File.expand_path(File.dirname(__FILE__) + "/manifests/templates")
|
|
8
|
+
|
|
9
|
+
def initialize(runtime_args, *runtime_options)
|
|
10
|
+
super
|
|
11
|
+
@layout_name = runtime_args[0] unless runtime_args.length < 1
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def install
|
|
15
|
+
if @layout_name.blank?
|
|
16
|
+
puts " ***************** layout_name required ***************** "
|
|
17
|
+
else
|
|
18
|
+
LayoutManifest.populate_record(self, @layout_name)
|
|
19
|
+
end
|
|
20
|
+
puts LayoutGenerator.description
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.description
|
|
24
|
+
<<-DESCRIPTION
|
|
25
|
+
*******************************************************************
|
|
26
|
+
To install and modify the rules_view layout
|
|
27
|
+
> script/rails generate rules_view:layout [layout_name]
|
|
28
|
+
|
|
29
|
+
Then set the layout to use in the controller
|
|
30
|
+
class MyCoolController < ApplicationController
|
|
31
|
+
layout '[layout_name]'
|
|
32
|
+
...
|
|
33
|
+
|
|
34
|
+
*******************************************************************
|
|
35
|
+
DESCRIPTION
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
desc(description)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|