caboose-store 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/README.md +113 -0
- data/Rakefile +38 -0
- data/app/assets/images/caboose_store/caboose_logo_small.png +0 -0
- data/app/assets/images/caboose_store/caboose_nav.png +0 -0
- data/app/assets/images/caboose_store/caboose_nav_black.png +0 -0
- data/app/assets/images/caboose_store/default_user_pic.png +0 -0
- data/app/assets/images/caboose_store/loading_green.gif +0 -0
- data/app/assets/images/caboose_store/loading_small_white_on_black.gif +0 -0
- data/app/assets/images/caboose_store/loading_white_on_black.gif +0 -0
- data/app/assets/javascripts/caboose_store/admin.js +20 -0
- data/app/assets/javascripts/caboose_store/application.js +17 -0
- data/app/assets/javascripts/caboose_store/modal.js +52 -0
- data/app/assets/javascripts/caboose_store/modal_integration.js +25 -0
- data/app/assets/javascripts/caboose_store/model.form.page.js +30 -0
- data/app/assets/javascripts/caboose_store/model.form.user.js +36 -0
- data/app/assets/javascripts/caboose_store/shortcut.js +11 -0
- data/app/assets/javascripts/caboose_store/station.js +60 -0
- data/app/assets/stylesheets/caboose_store/admin.css +100 -0
- data/app/assets/stylesheets/caboose_store/application.css +19 -0
- data/app/assets/stylesheets/caboose_store/bound_input.css +1 -0
- data/app/assets/stylesheets/caboose_store/caboose.css +4 -0
- data/app/assets/stylesheets/caboose_store/fonts/big_noodle_titling.ttf +0 -0
- data/app/assets/stylesheets/caboose_store/fonts/big_noodle_titling_oblique.ttf +0 -0
- data/app/assets/stylesheets/caboose_store/fonts.css +5 -0
- data/app/assets/stylesheets/caboose_store/login.css +23 -0
- data/app/assets/stylesheets/caboose_store/modal.css +240 -0
- data/app/assets/stylesheets/caboose_store/page_bar_generator.css +34 -0
- data/app/assets/stylesheets/caboose_store/register.css +25 -0
- data/app/assets/stylesheets/caboose_store/station_modal.css +104 -0
- data/app/assets/stylesheets/caboose_store/station_sidebar.css +232 -0
- data/app/assets/stylesheets/caboose_store/tinymce.css +25 -0
- data/app/controllers/caboose_store/application_controller.rb +18 -0
- data/app/controllers/caboose_store/cart_controller.rb +59 -0
- data/app/controllers/caboose_store/categories_controller.rb +128 -0
- data/app/controllers/caboose_store/checkout_controller.rb +164 -0
- data/app/controllers/caboose_store/orders_controller.rb +264 -0
- data/app/controllers/caboose_store/product_images_controller.rb +38 -0
- data/app/controllers/caboose_store/products_controller.rb +387 -0
- data/app/controllers/caboose_store/reviews_controller.rb +15 -0
- data/app/controllers/caboose_store/variants_controller.rb +152 -0
- data/app/helpers/caboose_store/application_helper.rb +46 -0
- data/app/helpers/caboose_store/cart_helper.rb +28 -0
- data/app/helpers/caboose_store/categories_helper.rb +38 -0
- data/app/helpers/caboose_store/products_helper.rb +87 -0
- data/app/mailers/caboose_store/orders_mailer.rb +36 -0
- data/app/models/caboose_store/address.rb +30 -0
- data/app/models/caboose_store/caboose_store_plugin.rb +22 -0
- data/app/models/caboose_store/category.rb +63 -0
- data/app/models/caboose_store/category_membership.rb +11 -0
- data/app/models/caboose_store/discount.rb +14 -0
- data/app/models/caboose_store/message.rb +22 -0
- data/app/models/caboose_store/order.rb +97 -0
- data/app/models/caboose_store/order_discount.rb +11 -0
- data/app/models/caboose_store/order_line_item.rb +13 -0
- data/app/models/caboose_store/order_pdf.rb +82 -0
- data/app/models/caboose_store/product.rb +78 -0
- data/app/models/caboose_store/product_image.rb +25 -0
- data/app/models/caboose_store/product_image_variant.rb +10 -0
- data/app/models/caboose_store/review.rb +13 -0
- data/app/models/caboose_store/schema.rb +146 -0
- data/app/models/caboose_store/shipping_calculator.rb +79 -0
- data/app/models/caboose_store/states.rb +60 -0
- data/app/models/caboose_store/tax_calculator.rb +26 -0
- data/app/models/caboose_store/tax_line.rb +12 -0
- data/app/models/caboose_store/variant.rb +42 -0
- data/app/models/caboose_store/vendor.rb +7 -0
- data/app/views/caboose_store/application/_category_thumb.html.erb +6 -0
- data/app/views/caboose_store/application/_product_thumb.html.erb +13 -0
- data/app/views/caboose_store/cart/index.html.erb +19 -0
- data/app/views/caboose_store/categories/admin_edit.html.erb +82 -0
- data/app/views/caboose_store/categories/admin_index.html.erb +13 -0
- data/app/views/caboose_store/categories/admin_new.html.erb +45 -0
- data/app/views/caboose_store/checkout/billing.html.erb +168 -0
- data/app/views/caboose_store/checkout/discount.html.erb +166 -0
- data/app/views/caboose_store/checkout/index.html.erb +113 -0
- data/app/views/caboose_store/checkout/quantity_box.html.erb +39 -0
- data/app/views/caboose_store/checkout/shipping.html.erb +90 -0
- data/app/views/caboose_store/checkout/thank_you.html.erb +36 -0
- data/app/views/caboose_store/layouts/_banner.html.erb +10 -0
- data/app/views/caboose_store/layouts/_banner2.html.erb +10 -0
- data/app/views/caboose_store/layouts/_footer.html.erb +55 -0
- data/app/views/caboose_store/layouts/_header.html.erb +69 -0
- data/app/views/caboose_store/layouts/_sidebar.html.erb +27 -0
- data/app/views/caboose_store/layouts/application.html.erb +33 -0
- data/app/views/caboose_store/layouts/authorize_net.erb +18 -0
- data/app/views/caboose_store/layouts/layout_about.html.erb +42 -0
- data/app/views/caboose_store/layouts/layout_blog.html.erb +159 -0
- data/app/views/caboose_store/layouts/layout_confirm.html.erb +85 -0
- data/app/views/caboose_store/layouts/layout_contact.html.erb +38 -0
- data/app/views/caboose_store/layouts/layout_default.html.erb +10 -0
- data/app/views/caboose_store/layouts/layout_detail.html.erb +114 -0
- data/app/views/caboose_store/layouts/layout_order.html.erb +77 -0
- data/app/views/caboose_store/layouts/layout_pricing.html.erb +182 -0
- data/app/views/caboose_store/layouts/layout_product.html.erb +110 -0
- data/app/views/caboose_store/layouts/layout_profile.html.erb +55 -0
- data/app/views/caboose_store/layouts/layout_single.html.erb +3 -0
- data/app/views/caboose_store/layouts/layout_testimonial.html.erb +110 -0
- data/app/views/caboose_store/layouts/layout_testing.html.erb +4 -0
- data/app/views/caboose_store/orders/_admin_footer.html.erb +2 -0
- data/app/views/caboose_store/orders/_admin_header.html.erb +31 -0
- data/app/views/caboose_store/orders/_quickbooks_order.html.erb +0 -0
- data/app/views/caboose_store/orders/admin_delete_form.html.erb +21 -0
- data/app/views/caboose_store/orders/admin_edit.html.erb +173 -0
- data/app/views/caboose_store/orders/admin_index.html.erb +79 -0
- data/app/views/caboose_store/orders/admin_new.html.erb +42 -0
- data/app/views/caboose_store/orders/admin_print.html.erb +72 -0
- data/app/views/caboose_store/orders_mailer/customer_new_order.html.erb +47 -0
- data/app/views/caboose_store/orders_mailer/customer_status_updated.html.erb +49 -0
- data/app/views/caboose_store/orders_mailer/fulfillment_new_order.html.erb +43 -0
- data/app/views/caboose_store/orders_mailer/shipping_order_ready.html.erb +46 -0
- data/app/views/caboose_store/products/_admin_footer.html.erb +2 -0
- data/app/views/caboose_store/products/_admin_header.html.erb +31 -0
- data/app/views/caboose_store/products/admin_delete_form.html.erb +21 -0
- data/app/views/caboose_store/products/admin_edit_categories.html.erb +73 -0
- data/app/views/caboose_store/products/admin_edit_category_images.html.erb +233 -0
- data/app/views/caboose_store/products/admin_edit_description.html.erb +41 -0
- data/app/views/caboose_store/products/admin_edit_general.html.erb +47 -0
- data/app/views/caboose_store/products/admin_edit_images.html.erb +234 -0
- data/app/views/caboose_store/products/admin_edit_options.html.erb +51 -0
- data/app/views/caboose_store/products/admin_edit_seo.html.erb +37 -0
- data/app/views/caboose_store/products/admin_edit_variant_columns.html.erb +75 -0
- data/app/views/caboose_store/products/admin_edit_variants.html.erb +101 -0
- data/app/views/caboose_store/products/admin_edit_variants_single.html.erb +68 -0
- data/app/views/caboose_store/products/admin_index.html.erb +47 -0
- data/app/views/caboose_store/products/admin_new.html.erb +41 -0
- data/app/views/caboose_store/products/details.html.erb +437 -0
- data/app/views/caboose_store/products/index.html.erb +46 -0
- data/app/views/caboose_store/products/not_available.html.erb +35 -0
- data/app/views/caboose_store/variants/admin_edit.html.erb +80 -0
- data/app/views/caboose_store/variants/admin_new.html.erb +59 -0
- data/config/routes.rb +95 -0
- data/lib/caboose-store/caboose_store_helper.rb +35 -0
- data/lib/caboose-store/engine.rb +8 -0
- data/lib/caboose-store/version.rb +3 -0
- data/lib/caboose-store.rb +9 -0
- data/lib/tasks/caboose-store.rake +17 -0
- data/test/caboose_test.rb +7 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +25 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- metadata +260 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YmMzMGVlYzM3NDM3OTk3M2YzOTliMzZmMDkzYjM3ZmU1OTE1MzA2Yw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
M2JiOThjNmFiMjVlOGYwMDcyMWU4ZjBlNGYzNjgyNjU5MGEzMWZlOA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MGVlMzYzYzhlNjlmZDliNWQ5OWFmZmQ5OGJlOWQ4YWU2NjNjYzc5YjY5ZWUx
|
10
|
+
ZTAzM2UyMDUyNTBlYzA5MWU3ZjgxOTQ0NDE4NTY3Yzg0NGZlZTg4NWMxOTBj
|
11
|
+
MGJkY2VmN2MwM2U5MTJlYWNhMDI4MzIxNGUxOGExMWJlYzNjMDU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTFiOTZhN2E3ODRiOTc1ZmIxZTE0NWQ0MzlmYTg5NDJkNzVmOWQzY2I5YzAw
|
14
|
+
ZDAxNGM0Y2VhNjhjNmM5YzVmMGFiNTUxYWQ5NTA4N2IwNzY5ZWNjMDY3MDU5
|
15
|
+
Y2MzYTFmMzJkZjk1YzM4NGI2ODc3NDRjNTM5YjQ4MDcxYzY5NmY=
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2013 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.md
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
<h1>Caboose CMS</h1>
|
2
|
+
<p>Caboose is a simple yet flexible and powerful content management system that runs
|
3
|
+
on top of ruby on rails. It handles users, roles, permissions, and the login process.
|
4
|
+
In addition, it handles content pages and their URLs. It has a layout system that
|
5
|
+
allows a developer to easily customize the look and feel of each page.</p>
|
6
|
+
|
7
|
+
<ul>
|
8
|
+
<li><a href='#installation'>Installation</a></li>
|
9
|
+
<li><a href='#layouts'>Layouts</a></li>
|
10
|
+
<li><a href='#plugins'>Plugins</a></li>
|
11
|
+
</ul>
|
12
|
+
|
13
|
+
<a name='installation'></a><h2>Installation</h2>
|
14
|
+
<p>Install the caboose-cms gem:</p>
|
15
|
+
<pre>
|
16
|
+
$ gem install caboose-cms
|
17
|
+
</pre>
|
18
|
+
<p>Create a new rails app configured to use Caboose:</p>
|
19
|
+
<pre>
|
20
|
+
$ caboose new my_caboose_app
|
21
|
+
</pre>
|
22
|
+
<p>Now go create a local MySQL database called <code>my_caboose_app_development</code>. Then let Caboose install the database:</p>
|
23
|
+
<pre>
|
24
|
+
$ cd my_caboose_app
|
25
|
+
$ rake caboose:db
|
26
|
+
</pre>
|
27
|
+
<p>That's it! To test it out, start your rails server:</p>
|
28
|
+
<pre>
|
29
|
+
$ rails server
|
30
|
+
</pre>
|
31
|
+
<p>And go check out http://localhost:3000</p>
|
32
|
+
|
33
|
+
<a name='layouts'></a><h2>Layouts</h2>
|
34
|
+
<p>Caboose already handles the page editing process, but you need to be able to
|
35
|
+
control the layout for each of those pages. You do that with layouts. Caboose
|
36
|
+
has a simple layout system. You control which layout each page uses. There are three options:
|
37
|
+
<dl>
|
38
|
+
<dt>Default layout:</dt>
|
39
|
+
<dd><p>The layout that any page by default will use if any other layout options are not set. This layout resides in the <code>layout_default.html.erb</code> file.</p></dd>
|
40
|
+
<dt>Per page layout:</dt>
|
41
|
+
<dd>
|
42
|
+
<p>Just create a new layout called <code>layout_<page_id>.html.erb</code>.</p>
|
43
|
+
<p>Example: <code>layout_37.html.erb</code></p>
|
44
|
+
</dd>
|
45
|
+
<dt>Per type layout:</dt>
|
46
|
+
<dd>
|
47
|
+
<p>If you need multiple pages to use a common layout, just create a layout with a name.</p>
|
48
|
+
<p>Examples: <code>layout_about.html.erb</code>, <code>layout_listing.html.erb</code></p>
|
49
|
+
</dd>
|
50
|
+
</dl>
|
51
|
+
<p>For each layout, a few things must exist in the layout for it to work properly with Caboose.
|
52
|
+
You must include the following:</p>
|
53
|
+
<ul>
|
54
|
+
<li>
|
55
|
+
<p>CSS and CSRF in the head:</p>
|
56
|
+
<pre>
|
57
|
+
<%= yield :css %>
|
58
|
+
<%= csrf_meta_tags %>
|
59
|
+
</pre>
|
60
|
+
</li>
|
61
|
+
<li>
|
62
|
+
<p>The top nav login/control panel link:</p>
|
63
|
+
<pre>
|
64
|
+
<%= render :partial => 'layouts/caboose/top_nav' %>
|
65
|
+
</pre>
|
66
|
+
</li>
|
67
|
+
<li>
|
68
|
+
<p>The top nav login/control panel link:</p>
|
69
|
+
<pre>
|
70
|
+
<%= render :partial => 'layouts/caboose/top_nav' %>
|
71
|
+
</pre>
|
72
|
+
</li>
|
73
|
+
<li>
|
74
|
+
<p>The station and javascript in the footer:</p>
|
75
|
+
<pre>
|
76
|
+
<%= render :partial => 'layouts/caboose/station' %>
|
77
|
+
<%= yield :js %>
|
78
|
+
</pre>
|
79
|
+
</li>
|
80
|
+
</ul>
|
81
|
+
<p>You have access to the <code>@page</code> object in the layout. Here's a bare-bones example of all the elements:
|
82
|
+
|
83
|
+
<pre>
|
84
|
+
<!DOCTYPE html>
|
85
|
+
<html>
|
86
|
+
<head>
|
87
|
+
<title>My App</title>
|
88
|
+
<%= yield :css %>
|
89
|
+
<%= csrf_meta_tags %>
|
90
|
+
</head>
|
91
|
+
<body;>
|
92
|
+
<%= render :partial => 'layouts/caboose/top_nav' %>
|
93
|
+
|
94
|
+
<h1><%= raw @page.title %></h1>
|
95
|
+
<%= raw @page.content %>
|
96
|
+
|
97
|
+
<%= render :partial => 'layouts/caboose/station' %>
|
98
|
+
<%= yield :js %>
|
99
|
+
</body>
|
100
|
+
</html>
|
101
|
+
</pre>
|
102
|
+
|
103
|
+
<a name='plugins'><h2>Plugins</h2>
|
104
|
+
<p>To add new functionality to the Caboose station, extend the Caboose::CaboosePlugin
|
105
|
+
object and override the methods you'd like to implement. The existing hooks
|
106
|
+
are the following:</p>
|
107
|
+
|
108
|
+
<dl>
|
109
|
+
<dt><code>String page_content(String str)</code></dt>
|
110
|
+
<dd>Manipulate the page content before it's shown on the screen.</dd>
|
111
|
+
<dt><code>Array admin_nav(Array arr)</code></dt>
|
112
|
+
<dd>Add items to the navigation that appears in the Caboose station.</dd>
|
113
|
+
</dl>
|
data/Rakefile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
14
|
+
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'Caboose'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
24
|
+
load 'rails/tasks/engine.rake'
|
25
|
+
|
26
|
+
Bundler::GemHelper.install_tasks
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
|
30
|
+
Rake::TestTask.new(:test) do |t|
|
31
|
+
t.libs << 'lib'
|
32
|
+
t.libs << 'test'
|
33
|
+
t.pattern = 'test/**/*_test.rb'
|
34
|
+
t.verbose = false
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
task :default => :test
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require colorbox-rails
|
16
|
+
//= require caboose/modal_integration
|
17
|
+
/* require jquery.ui.all */
|
18
|
+
/* require tinymce-jquery */
|
19
|
+
/* require modeljs.all */
|
20
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require colorbox-rails
|
16
|
+
//= require caboose/modal_integration
|
17
|
+
//= require application
|
@@ -0,0 +1,52 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
|
16
|
+
var CabooseModal = function(w, h) {
|
17
|
+
if (!h)
|
18
|
+
{
|
19
|
+
$('#modal_content').css('width', w);
|
20
|
+
h = $('#modal_content').outerHeight(true);
|
21
|
+
}
|
22
|
+
if (parent.$.fn.colorbox)
|
23
|
+
this.resize(w, h);
|
24
|
+
};
|
25
|
+
|
26
|
+
CabooseModal.prototype = {
|
27
|
+
|
28
|
+
width: 0,
|
29
|
+
height: 0,
|
30
|
+
set_width: function(w) { this.width = w; this.colorbox(); },
|
31
|
+
set_height: function(h) { this.height = h; this.colorbox(); },
|
32
|
+
resize: function(w, h) { this.width = w; this.height = h; this.colorbox(); },
|
33
|
+
|
34
|
+
// Resizes the height of the modal based on the content height
|
35
|
+
autosize: function(msg) {
|
36
|
+
if (msg)
|
37
|
+
$('#message').html(msg);
|
38
|
+
this.height = $('#modal_content').outerHeight(true);
|
39
|
+
this.colorbox();
|
40
|
+
},
|
41
|
+
|
42
|
+
colorbox: function() {
|
43
|
+
parent.$.fn.colorbox.resize({
|
44
|
+
innerWidth: '' + this.width + 'px',
|
45
|
+
innerHeight: '' + this.height + 'px'
|
46
|
+
});
|
47
|
+
},
|
48
|
+
|
49
|
+
close: function() {
|
50
|
+
parent.$.fn.colorbox.close();
|
51
|
+
}
|
52
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
$(document).ready(function() {
|
3
|
+
$('#caboose_login' ).colorbox({ iframe: true, initialWidth: 400, initialHeight: 200, innerWidth: 400, innerHeight: 200, scrolling: false, transition: 'fade', closeButton: false, onComplete: fix_colorbox, opacity: 0.50 });
|
4
|
+
$('#caboose_register' ).colorbox({ iframe: true, initialWidth: 400, initialHeight: 324, innerWidth: 400, innerHeight: 324, scrolling: false, transition: 'fade', closeButton: false, onComplete: fix_colorbox, opacity: 0.50 });
|
5
|
+
$('#caboose_station' ).colorbox({ iframe: true, initialWidth: 200, initialHeight: 50, innerWidth: 200, innerHeight: 50, scrolling: false, transition: 'fade', closeButton: false, onComplete: fix_colorbox, opacity: 0.50 });
|
6
|
+
});
|
7
|
+
|
8
|
+
function fix_colorbox() {
|
9
|
+
var padding = 21; // 21 is default
|
10
|
+
$("#cboxTopLeft" ).css('background', '#111');
|
11
|
+
$("#cboxTopRight" ).css('background', '#111');
|
12
|
+
$("#cboxBottomLeft" ).css('background', '#111');
|
13
|
+
$("#cboxBottomRight" ).css('background', '#111');
|
14
|
+
$("#cboxMiddleLeft" ).css('background', '#111');
|
15
|
+
$("#cboxMiddleRight" ).css('background', '#111');
|
16
|
+
$("#cboxTopCenter" ).css('background', '#111');
|
17
|
+
$("#cboxBottomCenter" ).css('background', '#111');
|
18
|
+
$("#cboxClose" ).hide();
|
19
|
+
|
20
|
+
//var p = (padding-21)*2;
|
21
|
+
//$("#cboxWrapper" ).css('padding', '0 ' + p + ' ' + p + ' 0');
|
22
|
+
//$('#cboxLoadedContent').css('margin-bottom', 0);
|
23
|
+
//h = $('#cboxLoadedContent').height();
|
24
|
+
//$('#cboxLoadedContent').css('height', ''+(h+28)+'px');
|
25
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
Model.Form.Page = Model.Form.extend({
|
3
|
+
|
4
|
+
class_name: 'Model.Form.Page',
|
5
|
+
|
6
|
+
// Returns the form for editing a model or false for an embedded form.
|
7
|
+
edit: function()
|
8
|
+
{
|
9
|
+
var m = this.model;
|
10
|
+
|
11
|
+
var this2 = this;
|
12
|
+
var div = $('<div/>');
|
13
|
+
$(m.attributes).each(function(i, a) {
|
14
|
+
if (a.type == 'hidden')
|
15
|
+
return;
|
16
|
+
div.append(
|
17
|
+
$('<div/>').attr('id', m.name + '_' + m.id + '_' + a.name + '_container')
|
18
|
+
);
|
19
|
+
});
|
20
|
+
|
21
|
+
div.append($('<div/>').attr('id', this.message))
|
22
|
+
.append($('<p/>')
|
23
|
+
.append($('<input/>').attr('type', 'button').val('Back').click(function() { caboose_station.close_url('/pages/'+m.id+'/redirect'); }))
|
24
|
+
.append(' ')
|
25
|
+
.append($('<input/>').attr('type', 'button').val('Delete ' + m.name).click(function() { m.ajax_delete(); }))
|
26
|
+
);
|
27
|
+
return div;
|
28
|
+
}
|
29
|
+
|
30
|
+
});
|
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
Model.Form.User = Model.Form.extend({
|
3
|
+
|
4
|
+
class_name: 'Model.Form.User',
|
5
|
+
|
6
|
+
// Returns the form for editing a model or false for an embedded form.
|
7
|
+
edit: function()
|
8
|
+
{
|
9
|
+
var m = this.model;
|
10
|
+
|
11
|
+
var this2 = this;
|
12
|
+
var div = $('<div/>');
|
13
|
+
$(m.attributes).each(function(i, a) {
|
14
|
+
if (a.type == 'hidden')
|
15
|
+
return;
|
16
|
+
div.append(
|
17
|
+
$('<div/>')
|
18
|
+
.attr('id', m.name + '_' + m.id + '_' + a.name + '_container')
|
19
|
+
.click(function() { m.edit_attribute(a.name); })
|
20
|
+
.append($('<input/>')
|
21
|
+
.attr('placeholder', a.nice_name)
|
22
|
+
.val(a.value)
|
23
|
+
)
|
24
|
+
);
|
25
|
+
});
|
26
|
+
|
27
|
+
div.append($('<div/>').attr('id', this.message))
|
28
|
+
.append($('<p/>')
|
29
|
+
.append($('<input/>').attr('type', 'button').val('Back').click(function() { caboose_station.close_url('/pages/'+m.id+'/redirect'); }))
|
30
|
+
.append(' ')
|
31
|
+
.append($('<input/>').attr('type', 'button').val('Delete ' + m.name).click(function() { m.ajax_delete(); }))
|
32
|
+
);
|
33
|
+
return div;
|
34
|
+
}
|
35
|
+
|
36
|
+
});
|
@@ -0,0 +1,60 @@
|
|
1
|
+
|
2
|
+
var CabooseStation = function(m, initial_tab) {
|
3
|
+
this.init(m, initial_tab);
|
4
|
+
};
|
5
|
+
|
6
|
+
CabooseStation.prototype = {
|
7
|
+
|
8
|
+
modal: false,
|
9
|
+
|
10
|
+
init: function(m, initial_tab)
|
11
|
+
{
|
12
|
+
this.modal = m;
|
13
|
+
var this2 = this;
|
14
|
+
// Handle main nav items with subnav
|
15
|
+
$('#station > ul > li > a').click(function(event) {
|
16
|
+
li = $(this).parent();
|
17
|
+
if ($('ul', li).length > 0)
|
18
|
+
{
|
19
|
+
event.preventDefault();
|
20
|
+
id = li.attr('id').replace('nav_item_', '');
|
21
|
+
href = $(this).attr('href');
|
22
|
+
this2.subnav(id, href);
|
23
|
+
}
|
24
|
+
else if ($(this).attr('rel') != 'modal')
|
25
|
+
{
|
26
|
+
event.preventDefault();
|
27
|
+
parent.window.location = $(this).attr('href');
|
28
|
+
}
|
29
|
+
});
|
30
|
+
$('#station ul li ul li a').click(function(event) {
|
31
|
+
if ($(this).attr('rel') != 'modal')
|
32
|
+
{
|
33
|
+
event.preventDefault();
|
34
|
+
parent.window.location = $(this).attr('href');
|
35
|
+
}
|
36
|
+
});
|
37
|
+
if (initial_tab)
|
38
|
+
$('#station > ul > li#nav_item_' + initial_tab + ' > a').trigger('click');
|
39
|
+
},
|
40
|
+
|
41
|
+
subnav: function(id, href)
|
42
|
+
{
|
43
|
+
this.modal.set_width(400);
|
44
|
+
|
45
|
+
$('#station > ul > li').each(function(i, li) {
|
46
|
+
id2 = $(li).attr('id').replace('nav_item_', '');
|
47
|
+
if (id == id2)
|
48
|
+
$(li).addClass('selected');
|
49
|
+
else
|
50
|
+
$(li).removeClass('selected');
|
51
|
+
});
|
52
|
+
// Show only the selected subnav
|
53
|
+
$('#station ul li ul').hide();
|
54
|
+
$('#station ul li#nav_item_' + id + ' ul').show();
|
55
|
+
|
56
|
+
// Set the height of the selected subnav
|
57
|
+
var height = $('#station > ul').height();
|
58
|
+
$('#station ul li#nav_item_' + id + ' ul').height(height);
|
59
|
+
}
|
60
|
+
};
|
@@ -0,0 +1,100 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require colorbox-rails
|
12
|
+
*= require modeljs
|
13
|
+
*= require caboose/fonts
|
14
|
+
*= require caboose/caboose
|
15
|
+
*/
|
16
|
+
|
17
|
+
#cboxLoadedContent { margin-bottom: 0; }
|
18
|
+
|
19
|
+
body {
|
20
|
+
margin: 0;
|
21
|
+
padding: 0;
|
22
|
+
}
|
23
|
+
|
24
|
+
#top_nav {
|
25
|
+
background: #000;
|
26
|
+
border-bottom: #333 1px solid;
|
27
|
+
height: 50px;
|
28
|
+
position: relative;
|
29
|
+
}
|
30
|
+
|
31
|
+
#top_nav .caboose_logo {
|
32
|
+
position: absolute;
|
33
|
+
top: 0;
|
34
|
+
left: 0;
|
35
|
+
width: 50px;
|
36
|
+
height: 50px;
|
37
|
+
background: url(/assets/caboose/caboose_logo_small.png);
|
38
|
+
}
|
39
|
+
|
40
|
+
#top_nav ul {
|
41
|
+
margin: 0;
|
42
|
+
padding: 0 8px 0 0;
|
43
|
+
list-style: none;
|
44
|
+
text-align: right;
|
45
|
+
}
|
46
|
+
|
47
|
+
#top_nav ul li {
|
48
|
+
margin: 0;
|
49
|
+
padding: 0;
|
50
|
+
list-style: none;
|
51
|
+
display: inline-block;
|
52
|
+
}
|
53
|
+
|
54
|
+
#top_nav ul li a {
|
55
|
+
display: block;
|
56
|
+
margin: 8px 4px;
|
57
|
+
padding: 8px 16px;
|
58
|
+
border: #333 1px solid;
|
59
|
+
text-decoration: none;
|
60
|
+
height: 16px;
|
61
|
+
}
|
62
|
+
|
63
|
+
#top_nav ul li a { color: #ccc; border: #333 1px solid; background: #000; }
|
64
|
+
#top_nav ul li a:hover { color: #fff; border: #444 1px solid; background: #000; }
|
65
|
+
#top_nav ul li a:active { color: #fff; border: #666 1px solid; background: #333; }
|
66
|
+
|
67
|
+
#content_wrapper {
|
68
|
+
position: relative;
|
69
|
+
}
|
70
|
+
|
71
|
+
#content {
|
72
|
+
padding: 0 0 0 30px;
|
73
|
+
}
|
74
|
+
|
75
|
+
#content h1 {
|
76
|
+
margin: 0 0 20px -30px;
|
77
|
+
padding: 40px 0 0 30px;
|
78
|
+
height: 80px;
|
79
|
+
background: #e1e1e1;
|
80
|
+
border-bottom: #aaa 1px solid;
|
81
|
+
font-size: 36pt;
|
82
|
+
}
|
83
|
+
|
84
|
+
#content h1.model_attribute_h1 {
|
85
|
+
margin: inherit;
|
86
|
+
padding: inherit;
|
87
|
+
height: auto;
|
88
|
+
background: transparent;
|
89
|
+
border-bottom: none;
|
90
|
+
font-size: 36pt;
|
91
|
+
}
|
92
|
+
|
93
|
+
p.current_page_editing {
|
94
|
+
position: absolute;
|
95
|
+
top: 84px;
|
96
|
+
left: 4px;
|
97
|
+
|
98
|
+
margin: 0;
|
99
|
+
padding: 10px 10px 10px 30px;
|
100
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require colorbox-rails
|
12
|
+
*= require modeljs
|
13
|
+
*= require caboose/fonts
|
14
|
+
*= require caboose/page_bar_generator
|
15
|
+
*= require caboose/caboose
|
16
|
+
*= require application
|
17
|
+
*/
|
18
|
+
|
19
|
+
#cboxLoadedContent { margin-bottom: 0; }
|
@@ -0,0 +1 @@
|
|
1
|
+
|
Binary file
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
#login_form .other_options {
|
3
|
+
position: absolute;
|
4
|
+
top: -4px;
|
5
|
+
right: 0;
|
6
|
+
}
|
7
|
+
|
8
|
+
input#username,
|
9
|
+
input#password {
|
10
|
+
font-size: 18px;
|
11
|
+
width: 95%;
|
12
|
+
margin: 0 0 8px 0;
|
13
|
+
padding: 7px;
|
14
|
+
}
|
15
|
+
|
16
|
+
input#btn_login {
|
17
|
+
font-size: 18px;
|
18
|
+
}
|
19
|
+
|
20
|
+
input#btn_cancel {
|
21
|
+
font-size: 18px;
|
22
|
+
}
|
23
|
+
|