From 6aa37e6e269a49e1b01c3bd2cc5424c6bbde5dae Mon Sep 17 00:00:00 2001 From: Mackenzie Morgan Date: Sun, 1 Feb 2015 00:27:04 -0500 Subject: [PATCH] adding CMS via comfortable mexican sofa gem --- Gemfile | 2 + Gemfile.lock | 42 ++++++ .../comfy/admin/cms/custom.js.coffee | 1 + .../stylesheets/comfy/admin/cms/custom.sass | 1 + .../initializers/comfortable_mexican_sofa.rb | 121 +++++++++++++++ config/routes.rb | 5 + .../sample-site/categories/files.yml | 1 + .../sample-site/categories/pages.yml | 1 + .../sample-site/categories/snippets.yml | 1 + .../sample-site/files/_sample.jpg.yml | 5 + db/cms_fixtures/sample-site/files/sample.jpg | Bin 0 -> 6400 bytes .../layouts/default/attributes.yml | 1 + .../sample-site/layouts/default/content.html | 5 + .../sample-site/layouts/default/javascript.js | 1 + .../layouts/default/nested/attributes.yml | 2 + .../layouts/default/nested/content.haml | 3 + .../layouts/default/nested/javascript.js | 1 + .../layouts/default/nested/stylesheet.css | 1 + .../layouts/default/stylesheet.css | 1 + .../sample-site/pages/index/attributes.yml | 6 + .../pages/index/child/attributes.yml | 3 + .../sample-site/pages/index/child/left.haml | 1 + .../sample-site/pages/index/child/right.html | 1 + .../pages/index/child/thumbnail.png | Bin 0 -> 6600 bytes .../sample-site/pages/index/content.html | 2 + .../snippets/default/attributes.yml | 4 + .../sample-site/snippets/default/content.html | 1 + db/migrate/20150201052245_create_cms.rb | 140 ++++++++++++++++++ db/schema.rb | 122 ++++++++++++++- 29 files changed, 474 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/comfy/admin/cms/custom.js.coffee create mode 100644 app/assets/stylesheets/comfy/admin/cms/custom.sass create mode 100644 config/initializers/comfortable_mexican_sofa.rb create mode 100644 db/cms_fixtures/sample-site/categories/files.yml create mode 100644 db/cms_fixtures/sample-site/categories/pages.yml create mode 100644 db/cms_fixtures/sample-site/categories/snippets.yml create mode 100644 db/cms_fixtures/sample-site/files/_sample.jpg.yml create mode 100644 db/cms_fixtures/sample-site/files/sample.jpg create mode 100644 db/cms_fixtures/sample-site/layouts/default/attributes.yml create mode 100644 db/cms_fixtures/sample-site/layouts/default/content.html create mode 100644 db/cms_fixtures/sample-site/layouts/default/javascript.js create mode 100644 db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml create mode 100644 db/cms_fixtures/sample-site/layouts/default/nested/content.haml create mode 100644 db/cms_fixtures/sample-site/layouts/default/nested/javascript.js create mode 100644 db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css create mode 100644 db/cms_fixtures/sample-site/layouts/default/stylesheet.css create mode 100644 db/cms_fixtures/sample-site/pages/index/attributes.yml create mode 100644 db/cms_fixtures/sample-site/pages/index/child/attributes.yml create mode 100644 db/cms_fixtures/sample-site/pages/index/child/left.haml create mode 100644 db/cms_fixtures/sample-site/pages/index/child/right.html create mode 100644 db/cms_fixtures/sample-site/pages/index/child/thumbnail.png create mode 100644 db/cms_fixtures/sample-site/pages/index/content.html create mode 100644 db/cms_fixtures/sample-site/snippets/default/attributes.yml create mode 100644 db/cms_fixtures/sample-site/snippets/default/content.html create mode 100644 db/migrate/20150201052245_create_cms.rb diff --git a/Gemfile b/Gemfile index fcf7b39d4..d6278d87c 100644 --- a/Gemfile +++ b/Gemfile @@ -32,6 +32,8 @@ gem 'cancancan', '~> 1.9' # for checking member privileges gem 'gibbon' # for Mailchimp newsletter subscriptions gem 'csv_shaper' # CSV export +gem 'comfortable_mexican_sofa', '~> 1.12.0' # content management system + # vendored activemerchant for testing- needed for bogus paypal # gateway monkeypatch gem 'activemerchant', '1.33.0', diff --git a/Gemfile.lock b/Gemfile.lock index d54873d81..48afdd1da 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -33,6 +33,8 @@ GEM activesupport (= 4.1.9) builder (~> 3.1) erubis (~> 2.7.0) + active_link_to (1.0.2) + actionpack activemodel (4.1.9) activesupport (= 4.1.9) builder (~> 3.1) @@ -48,6 +50,9 @@ GEM tzinfo (~> 1.1) addressable (2.3.6) arel (5.0.1.20140414130214) + autoprefixer-rails (5.1.1) + execjs + json bcrypt (3.1.9) better_errors (2.0.0) coderay (>= 1.0.0) @@ -58,6 +63,10 @@ GEM bluecloth (2.2.0) bootstrap-datepicker-rails (1.3.0.2) railties (>= 3.0) + bootstrap-sass (3.3.3) + autoprefixer-rails (>= 5.0.0.1) + sass (>= 3.2.19) + bootstrap_form (2.2.0) builder (3.2.2) byebug (3.5.1) columnize (~> 0.8) @@ -73,7 +82,13 @@ GEM capybara-email (2.4.0) capybara (~> 2.4) mail + climate_control (0.0.3) + activesupport (>= 3.0) cliver (0.3.2) + cocaine (0.5.5) + climate_control (>= 0.0.3, < 1.0) + codemirror-rails (4.8) + railties (>= 3.0, < 5) coderay (1.1.0) coffee-rails (4.1.0) coffee-script (>= 2.2.0) @@ -83,6 +98,21 @@ GEM execjs coffee-script-source (1.8.0) columnize (0.9.0) + comfortable_mexican_sofa (1.12.7) + active_link_to (>= 1.0.0) + bootstrap-sass (>= 3.2.0) + bootstrap_form (>= 2.2.0) + codemirror-rails (>= 3.0.0) + coffee-rails (>= 3.1.0) + haml-rails (>= 0.3.0) + jquery-rails (>= 3.0.0) + jquery-ui-rails (>= 5.0.0) + kramdown (>= 1.0.0) + paperclip (>= 4.0.0) + plupload-rails (>= 1.2.1) + rails (>= 4.0.0, < 5) + rails-i18n (>= 4.0.0) + sass-rails (>= 4.0.3) commonjs (0.2.7) coveralls (0.7.1) multi_json (~> 1.3) @@ -171,6 +201,7 @@ GEM sprockets-rails json (1.8.2) kgio (2.9.2) + kramdown (1.5.0) launchy (2.4.3) addressable (~> 2.3) leaflet-markercluster-rails (0.7.0) @@ -212,7 +243,14 @@ GEM multi_json (~> 1.3) omniauth-oauth (~> 1.0) orm_adapter (0.5.0) + paperclip (4.2.1) + activemodel (>= 3.0.0) + activesupport (>= 3.0.0) + cocaine (~> 0.5.3) + mime-types pg (0.17.1) + plupload-rails (1.2.1) + rails (>= 3.1) poltergeist (1.5.1) capybara (~> 2.1) cliver (~> 0.3.1) @@ -237,6 +275,9 @@ GEM bundler (>= 1.3.0, < 2.0) railties (= 4.1.9) sprockets-rails (~> 2.0) + rails-i18n (4.0.3) + i18n (~> 0.6) + railties (~> 4.0) rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging @@ -348,6 +389,7 @@ DEPENDENCIES capybara capybara-email coffee-rails (~> 4.1.0) + comfortable_mexican_sofa (~> 1.12.0) coveralls csv_shaper dalli diff --git a/app/assets/javascripts/comfy/admin/cms/custom.js.coffee b/app/assets/javascripts/comfy/admin/cms/custom.js.coffee new file mode 100644 index 000000000..d40d4c9c3 --- /dev/null +++ b/app/assets/javascripts/comfy/admin/cms/custom.js.coffee @@ -0,0 +1 @@ +# Custom JS for the admin area \ No newline at end of file diff --git a/app/assets/stylesheets/comfy/admin/cms/custom.sass b/app/assets/stylesheets/comfy/admin/cms/custom.sass new file mode 100644 index 000000000..328d897f1 --- /dev/null +++ b/app/assets/stylesheets/comfy/admin/cms/custom.sass @@ -0,0 +1 @@ +// custom CSS for admin area \ No newline at end of file diff --git a/config/initializers/comfortable_mexican_sofa.rb b/config/initializers/comfortable_mexican_sofa.rb new file mode 100644 index 000000000..e8f8dfa35 --- /dev/null +++ b/config/initializers/comfortable_mexican_sofa.rb @@ -0,0 +1,121 @@ +# encoding: utf-8 + +ComfortableMexicanSofa.configure do |config| + # Title of the admin area + # config.cms_title = 'ComfortableMexicanSofa CMS Engine' + + # Controller that is inherited from CmsAdmin::BaseController + # config.base_controller = 'ApplicationController' + + # Module responsible for authentication. You can replace it with your own. + # It simply needs to have #authenticate method. See http_auth.rb for reference. + # config.admin_auth = 'ComfyAdminAuthentication' + + # Module responsible for authorization on admin side. It should have #authorize + # method that returns true or false based on params and loaded instance + # variables available for a given controller. + # config.admin_authorization = 'ComfyAdminAuthorization' + + # Module responsible for public authentication. Similar to the above. You also + # will have access to @cms_site, @cms_layout, @cms_page so you can use them in + # your logic. Default module doesn't do anything. + # config.public_auth = 'ComfyPublicAuthentication' + + # When arriving at /cms-admin you may chose to redirect to arbirtary path, + # for example '/cms-admin/users' + # config.admin_route_redirect = '' + + # File uploads use Paperclip and can support filesystem or s3 uploads. Override + # the upload method and appropriate settings based on Paperclip. For S3 see: + # http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/S3, and for + # filesystem see: http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/Filesystem + # If you are using S3 and HTTPS, pass :s3_protocol => '' to have URLs that use the protocol of the page + # config.upload_file_options = {:url => '/system/:class/:id/:attachment/:style/:filename'} + + # Sofa allows you to setup entire site from files. Database is updated with each + # request (if necessary). Please note that database entries are destroyed if there's + # no corresponding file. Fixtures are disabled by default. + # config.enable_fixtures = false + + # Path where fixtures can be located. + # config.fixtures_path = File.expand_path('db/cms_fixtures', Rails.root) + + # Importing fixtures into Database + # To load fixtures into the database just run this rake task: + # local: $ rake comfortable_mexican_sofa:fixtures:import FROM=example.local TO=localhost + # Heroku: $ heroku run rake comfortable_mexican_sofa:fixtures:import FROM=example.local TO=yourapp.herokuapp.com + # From indicates folder the fixtures are in and to is the Site hostname you have defined in the database. + + # Exporting fixtures into Files + # If you need to dump database contents into fixture files run: + # local: $ rake comfortable_mexican_sofa:fixtures:export FROM=localhost TO=example.local + # Heroku: $ heroku run rake comfortable_mexican_sofa:fixtures:export FROM=yourapp.herokuapp.com TO=example.local + # This will create example.local folder and dump all content from example.com Site. + + # Content for Layouts, Pages and Snippets has a revision history. You can revert + # a previous version using this system. You can control how many revisions per + # object you want to keep. Set it to 0 if you wish to turn this feature off. + # config.revisions_limit = 25 + + # Locale definitions. If you want to define your own locale merge + # {:locale => 'Locale Title'} with this. + # config.locales = {:en => 'English', :es => 'Español'} + + # Admin interface will respect the locale of the site being managed. However you can + # force it to English by setting this to `:en` + # config.admin_locale = nil + + # A class that is included as a sweeper to admin base controller if it's set + # config.admin_cache_sweeper = nil + + # By default you cannot have irb code inside your layouts/pages/snippets. + # Generally this is to prevent putting something like this: + # <% User.delete_all %> but if you really want to allow it... + # config.allow_irb = false + + # Whitelist of all helper methods that can be used via {{cms:helper}} tag. By default + # all helpers are allowed except `eval`, `send`, `call` and few others. Empty array + # will prevent rendering of all helpers. + # config.allowed_helpers = nil + + # Whitelist of partials paths that can be used via {{cms:partial}} tag. All partials + # are accessible by default. Empty array will prevent rendering of all partials. + # config.allowed_partials = nil + + # Site aliases, if you want to have aliases for your site. Good for harmonizing + # production env with dev/testing envs. + # e.g. config.hostname_aliases = {'host.com' => 'host.inv', 'host_a.com' => ['host.lvh.me', 'host.dev']} + # Default is nil (not used) + # config.hostname_aliases = nil + + # Reveal partials that can be overwritten in the admin area. + # Default is false. + # config.reveal_cms_partials = false + +end + +# Default credentials for ComfortableMexicanSofa::AccessControl::AdminAuthentication +# YOU REALLY WANT TO CHANGE THIS BEFORE PUTTING YOUR SITE LIVE +ComfortableMexicanSofa::AccessControl::AdminAuthentication.username = 'username' +ComfortableMexicanSofa::AccessControl::AdminAuthentication.password = 'password' + +# Uncomment this module and `config.admin_auth` above to use custom admin authentication +# module ComfyAdminAuthentication +# def authenticate +# return true +# end +# end + +# Uncomment this module and `config.admin_authorization` above to use custom admin authorization +# module ComfyAdminAuthorization +# def authorize +# return true +# end +# end + +# Uncomment this module and `config.public_auth` above to use custom public authentication +# module ComfyPublicAuthentication +# def authenticate +# return true +# end +# end diff --git a/config/routes.rb b/config/routes.rb index ceca68687..a6d29bc9d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,10 @@ Growstuff::Application.routes.draw do + comfy_route :cms_admin, :path => '/admin' + + # Make sure this routeset is defined last + comfy_route :cms, :path => '/', :sitemap => false + resources :plant_parts devise_for :members, :controllers => { :registrations => "registrations", :passwords => "passwords" } diff --git a/db/cms_fixtures/sample-site/categories/files.yml b/db/cms_fixtures/sample-site/categories/files.yml new file mode 100644 index 000000000..2e59d3264 --- /dev/null +++ b/db/cms_fixtures/sample-site/categories/files.yml @@ -0,0 +1 @@ +- File Category \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/categories/pages.yml b/db/cms_fixtures/sample-site/categories/pages.yml new file mode 100644 index 000000000..fec395558 --- /dev/null +++ b/db/cms_fixtures/sample-site/categories/pages.yml @@ -0,0 +1 @@ +- Page Category \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/categories/snippets.yml b/db/cms_fixtures/sample-site/categories/snippets.yml new file mode 100644 index 000000000..a7d06fda6 --- /dev/null +++ b/db/cms_fixtures/sample-site/categories/snippets.yml @@ -0,0 +1 @@ +- Snippet Category \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/files/_sample.jpg.yml b/db/cms_fixtures/sample-site/files/_sample.jpg.yml new file mode 100644 index 000000000..b978f0651 --- /dev/null +++ b/db/cms_fixtures/sample-site/files/_sample.jpg.yml @@ -0,0 +1,5 @@ +label: Fixture File +description: Fixture Description +categories: + - category_a + - category_b \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/files/sample.jpg b/db/cms_fixtures/sample-site/files/sample.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2b3a42b36a5c084bf1f701487a26aa533b6041e2 GIT binary patch literal 6400 zcmbW52{_bU+rZE4W{hRVlCh3`C)tVY49Sw6itPJNltQ-bOOz$DW*3DhvX%8A64{C* z$&waZlyAJxd-Xi;cU|xME%#j4J-@lPbN=@^|Noqs!`FxNfL2$Fqy-=l2+$$Fz~MWr z1xa1~f}yd27U{Gm*#Q7n=d`PrH1*3ZOPoy;czpujr+ zjW7O<0~{}r=Lvwiw@-+ltFuc0QNUi1C?PK|N7Qi)_HYac5H+;3cenF%AgX(N`q+7e z0PyEEA7ugjQE!RlCd)|3%gBhH5F@w$xBN%v@2LL_M{E0M#5bdVtQmxH=r7w}xqsQb zivW<@BKIcsFWbdz0Ggu#V4D8R#&Z_{nkWF8M*em^j7R&$B_O~@L0mjII9SZp(O&GR zp}*yS4EP=S@8NIbi5-piyLUtlM<=^Lj{xFPQ|-MyyaWA+{yuj0jzrP_zKQ?eiGQ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ures/sample-site/layouts/default/attributes.yml b/db/cms_fixtures/sample-site/layouts/default/attributes.yml new file mode 100644 index 000000000..6f1626b7c --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/attributes.yml @@ -0,0 +1 @@ +label: Default Fixture Layout \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/content.html b/db/cms_fixtures/sample-site/layouts/default/content.html new file mode 100644 index 000000000..f2707392b --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/content.html @@ -0,0 +1,5 @@ + + + {{ cms:page:content }} + + \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/javascript.js b/db/cms_fixtures/sample-site/layouts/default/javascript.js new file mode 100644 index 000000000..6959d8bfc --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/javascript.js @@ -0,0 +1 @@ +// default js \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml b/db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml new file mode 100644 index 000000000..754f082c4 --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml @@ -0,0 +1,2 @@ +label: Default Fixture Nested Layout +position: 42 \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/nested/content.haml b/db/cms_fixtures/sample-site/layouts/default/nested/content.haml new file mode 100644 index 000000000..2f09fd402 --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/nested/content.haml @@ -0,0 +1,3 @@ +{{ cms:page_file:thumbnail:url }} +.left {{ cms:page:left }} +.right {{ cms:page:right }} \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/nested/javascript.js b/db/cms_fixtures/sample-site/layouts/default/nested/javascript.js new file mode 100644 index 000000000..2508c22ed --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/nested/javascript.js @@ -0,0 +1 @@ +// nested js \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css b/db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css new file mode 100644 index 000000000..034f6fb9c --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css @@ -0,0 +1 @@ +div{float:left} \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/stylesheet.css b/db/cms_fixtures/sample-site/layouts/default/stylesheet.css new file mode 100644 index 000000000..cd8b4f19d --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/stylesheet.css @@ -0,0 +1 @@ +body{color: red} \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/pages/index/attributes.yml b/db/cms_fixtures/sample-site/pages/index/attributes.yml new file mode 100644 index 000000000..56616f972 --- /dev/null +++ b/db/cms_fixtures/sample-site/pages/index/attributes.yml @@ -0,0 +1,6 @@ +label: Home Fixture Page +layout: default +target_page: '/child' +categories: + - category_a + - category_b \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/pages/index/child/attributes.yml b/db/cms_fixtures/sample-site/pages/index/child/attributes.yml new file mode 100644 index 000000000..d8602e148 --- /dev/null +++ b/db/cms_fixtures/sample-site/pages/index/child/attributes.yml @@ -0,0 +1,3 @@ +label: Child Fixture Page +layout: nested +position: 42 diff --git a/db/cms_fixtures/sample-site/pages/index/child/left.haml b/db/cms_fixtures/sample-site/pages/index/child/left.haml new file mode 100644 index 000000000..756907e5e --- /dev/null +++ b/db/cms_fixtures/sample-site/pages/index/child/left.haml @@ -0,0 +1 @@ += "Child Page Left Fixture Content" \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/pages/index/child/right.html b/db/cms_fixtures/sample-site/pages/index/child/right.html new file mode 100644 index 000000000..3ac08e9ab --- /dev/null +++ b/db/cms_fixtures/sample-site/pages/index/child/right.html @@ -0,0 +1 @@ +Child Page Right Fixture Content \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/pages/index/child/thumbnail.png b/db/cms_fixtures/sample-site/pages/index/child/thumbnail.png new file mode 100644 index 0000000000000000000000000000000000000000..89cf33f55ee298e089b39c4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wm!dK>i!Yl^ zo=&Qde#bGx*-FzedO7Rv8!db`GxH4bEP?ZU(a!54&x1{(n)5{+=3M^E_93lgvYA_S zXn)huQ3y$iIS|N@rRC*mOVY0GE$1Pn?6bhc;UlDKuJdK$@s3zdv0_DJN_e(=O<`dN ztcZ!NMxRHszH&VzxObZT>goW^9}O09$rF=k0L5{2mRM zvG4YN)Ti|B7YtmkyqwN;qMsA1V)?Iu#n_QHeOG1HzKk|sxxyZPTc)QeBvJe+S|SlD ztHB*tOnEF!I5{b$!MqSA_xelGrv(Y7t}yRDW1swxD+qitPOv)(ChfYEc`CxuY(wkN zQCsr}X_qDSRKwD9dSt^mM4^f4w4ak;<>?t%!}*Mq=+5U2yB{nAu+RKx3&ICKir)o* zjonK%uT%HB&Kbz$nWAn}isC*n$mX$r73fBeY>0V1RwZ0(> zEup4DzcmyV3U8hL9)y9N-Jh747|_0shF$K9EjS7T7(-_@P$ODSOuXpqdFi;NriOg* zb#wDgXxC7gHO(Dl%M!v8n3a_U0)b*#LHwu}0pU{o1-hdCz8bEGWKP3vlGm{pwO{v{N4Ma}Zk5L9t^v&WA z3w{K(P}R=gQJ`yU8JD91T+&zUhvJGzr4U=8g(YVr5AHz+EWT7}uhiqs)7&RIPWK*0 z3I?BzuG?4dFTv>7tVDWW;Ns@tNdswGB_As)DJQijKExX5KYFWrGn^U49X5fVR~#WH z!T1HwZ0!){M|49UyO%Z!YSTU%Q|O)U0T=GHebINX_x7dFIyQm7dsS~~cQ8W|bQqU(V|OM;EM z8*|NZumPgwJ3y6zu%sN7Q{Tf91=KEOWP9$t?fmse$N$;u#lm4W-ATG+Np02-af?pB O#sSwd)GUM9h5rvhyEdc% literal 0 HcmV?d00001 diff --git a/db/cms_fixtures/sample-site/pages/index/content.html b/db/cms_fixtures/sample-site/pages/index/content.html new file mode 100644 index 000000000..fb97a42a7 --- /dev/null +++ b/db/cms_fixtures/sample-site/pages/index/content.html @@ -0,0 +1,2 @@ +Home Page Fixture Contént +{{ cms:snippet:default }} \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/snippets/default/attributes.yml b/db/cms_fixtures/sample-site/snippets/default/attributes.yml new file mode 100644 index 000000000..2113c3ce6 --- /dev/null +++ b/db/cms_fixtures/sample-site/snippets/default/attributes.yml @@ -0,0 +1,4 @@ +label: Default Fixture Snippet +categories: + - category_a + - category_b \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/snippets/default/content.html b/db/cms_fixtures/sample-site/snippets/default/content.html new file mode 100644 index 000000000..48a4995fa --- /dev/null +++ b/db/cms_fixtures/sample-site/snippets/default/content.html @@ -0,0 +1 @@ +Fixture Content for Default Snippet \ No newline at end of file diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb new file mode 100644 index 000000000..9e999488f --- /dev/null +++ b/db/migrate/20150201052245_create_cms.rb @@ -0,0 +1,140 @@ +class CreateCms < ActiveRecord::Migration + + def self.up + + text_limit = case ActiveRecord::Base.connection.adapter_name + when 'PostgreSQL' + { } + else + { :limit => 16777215 } + end + + # -- Sites -------------------------------------------------------------- + create_table :comfy_cms_sites do |t| + t.string :label, :null => false + t.string :identifier, :null => false + t.string :hostname, :null => false + t.string :path + t.string :locale, :null => false, :default => 'en' + t.boolean :is_mirrored, :null => false, :default => false + end + add_index :comfy_cms_sites, :hostname + add_index :comfy_cms_sites, :is_mirrored + + # -- Layouts ------------------------------------------------------------ + create_table :comfy_cms_layouts do |t| + t.integer :site_id, :null => false + t.integer :parent_id + t.string :app_layout + t.string :label, :null => false + t.string :identifier, :null => false + t.text :content, text_limit + t.text :css, text_limit + t.text :js, text_limit + t.integer :position, :null => false, :default => 0 + t.boolean :is_shared, :null => false, :default => false + t.timestamps + end + add_index :comfy_cms_layouts, [:parent_id, :position] + add_index :comfy_cms_layouts, [:site_id, :identifier], :unique => true + + # -- Pages -------------------------------------------------------------- + create_table :comfy_cms_pages do |t| + t.integer :site_id, :null => false + t.integer :layout_id + t.integer :parent_id + t.integer :target_page_id + t.string :label, :null => false + t.string :slug + t.string :full_path, :null => false + t.text :content_cache, text_limit + t.integer :position, :null => false, :default => 0 + t.integer :children_count, :null => false, :default => 0 + t.boolean :is_published, :null => false, :default => true + t.boolean :is_shared, :null => false, :default => false + t.timestamps + end + add_index :comfy_cms_pages, [:site_id, :full_path] + add_index :comfy_cms_pages, [:parent_id, :position] + + # -- Page Blocks -------------------------------------------------------- + create_table :comfy_cms_blocks do |t| + t.string :identifier, :null => false + t.text :content, text_limit + t.references :blockable, :polymorphic => true + t.timestamps + end + add_index :comfy_cms_blocks, [:identifier] + add_index :comfy_cms_blocks, [:blockable_id, :blockable_type] + + # -- Snippets ----------------------------------------------------------- + create_table :comfy_cms_snippets do |t| + t.integer :site_id, :null => false + t.string :label, :null => false + t.string :identifier, :null => false + t.text :content, text_limit + t.integer :position, :null => false, :default => 0 + t.boolean :is_shared, :null => false, :default => false + t.timestamps + end + add_index :comfy_cms_snippets, [:site_id, :identifier], :unique => true + add_index :comfy_cms_snippets, [:site_id, :position] + + # -- Files -------------------------------------------------------------- + create_table :comfy_cms_files do |t| + t.integer :site_id, :null => false + t.integer :block_id + t.string :label, :null => false + t.string :file_file_name, :null => false + t.string :file_content_type, :null => false + t.integer :file_file_size, :null => false + t.string :description, :limit => 2048 + t.integer :position, :null => false, :default => 0 + t.timestamps + end + add_index :comfy_cms_files, [:site_id, :label] + add_index :comfy_cms_files, [:site_id, :file_file_name] + add_index :comfy_cms_files, [:site_id, :position] + add_index :comfy_cms_files, [:site_id, :block_id] + + # -- Revisions ----------------------------------------------------------- + create_table :comfy_cms_revisions, :force => true do |t| + t.string :record_type, :null => false + t.integer :record_id, :null => false + t.text :data, text_limit + t.datetime :created_at + end + add_index :comfy_cms_revisions, [:record_type, :record_id, :created_at], + :name => 'index_cms_revisions_on_rtype_and_rid_and_created_at' + + # -- Categories --------------------------------------------------------- + create_table :comfy_cms_categories, :force => true do |t| + t.integer :site_id, :null => false + t.string :label, :null => false + t.string :categorized_type, :null => false + end + add_index :comfy_cms_categories, [:site_id, :categorized_type, :label], :unique => true, + :name => 'index_cms_categories_on_site_id_and_cat_type_and_label' + + create_table :comfy_cms_categorizations, :force => true do |t| + t.integer :category_id, :null => false + t.string :categorized_type, :null => false + t.integer :categorized_id, :null => false + end + add_index :comfy_cms_categorizations, [:category_id, :categorized_type, :categorized_id], :unique => true, + :name => 'index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id' + end + + def self.down + drop_table :comfy_cms_sites + drop_table :comfy_cms_layouts + drop_table :comfy_cms_pages + drop_table :comfy_cms_snippets + drop_table :comfy_cms_blocks + drop_table :comfy_cms_files + drop_table :comfy_cms_revisions + drop_table :comfy_cms_categories + drop_table :comfy_cms_categorizations + end +end + diff --git a/db/schema.rb b/db/schema.rb index 9e593a422..91a3b597a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150127043022) do +ActiveRecord::Schema.define(version: 20150201052245) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -53,6 +53,125 @@ ActiveRecord::Schema.define(version: 20150127043022) do add_index "authentications", ["member_id"], name: "index_authentications_on_member_id", using: :btree + create_table "comfy_cms_blocks", force: true do |t| + t.string "identifier", null: false + t.text "content" + t.integer "blockable_id" + t.string "blockable_type" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comfy_cms_blocks", ["blockable_id", "blockable_type"], name: "index_comfy_cms_blocks_on_blockable_id_and_blockable_type", using: :btree + add_index "comfy_cms_blocks", ["identifier"], name: "index_comfy_cms_blocks_on_identifier", using: :btree + + create_table "comfy_cms_categories", force: true do |t| + t.integer "site_id", null: false + t.string "label", null: false + t.string "categorized_type", null: false + end + + add_index "comfy_cms_categories", ["site_id", "categorized_type", "label"], name: "index_cms_categories_on_site_id_and_cat_type_and_label", unique: true, using: :btree + + create_table "comfy_cms_categorizations", force: true do |t| + t.integer "category_id", null: false + t.string "categorized_type", null: false + t.integer "categorized_id", null: false + end + + add_index "comfy_cms_categorizations", ["category_id", "categorized_type", "categorized_id"], name: "index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id", unique: true, using: :btree + + create_table "comfy_cms_files", force: true do |t| + t.integer "site_id", null: false + t.integer "block_id" + t.string "label", null: false + t.string "file_file_name", null: false + t.string "file_content_type", null: false + t.integer "file_file_size", null: false + t.string "description", limit: 2048 + t.integer "position", default: 0, null: false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comfy_cms_files", ["site_id", "block_id"], name: "index_comfy_cms_files_on_site_id_and_block_id", using: :btree + add_index "comfy_cms_files", ["site_id", "file_file_name"], name: "index_comfy_cms_files_on_site_id_and_file_file_name", using: :btree + add_index "comfy_cms_files", ["site_id", "label"], name: "index_comfy_cms_files_on_site_id_and_label", using: :btree + add_index "comfy_cms_files", ["site_id", "position"], name: "index_comfy_cms_files_on_site_id_and_position", using: :btree + + create_table "comfy_cms_layouts", force: true do |t| + t.integer "site_id", null: false + t.integer "parent_id" + t.string "app_layout" + t.string "label", null: false + t.string "identifier", null: false + t.text "content" + t.text "css" + t.text "js" + t.integer "position", default: 0, null: false + t.boolean "is_shared", default: false, null: false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comfy_cms_layouts", ["parent_id", "position"], name: "index_comfy_cms_layouts_on_parent_id_and_position", using: :btree + add_index "comfy_cms_layouts", ["site_id", "identifier"], name: "index_comfy_cms_layouts_on_site_id_and_identifier", unique: true, using: :btree + + create_table "comfy_cms_pages", force: true do |t| + t.integer "site_id", null: false + t.integer "layout_id" + t.integer "parent_id" + t.integer "target_page_id" + t.string "label", null: false + t.string "slug" + t.string "full_path", null: false + t.text "content_cache" + t.integer "position", default: 0, null: false + t.integer "children_count", default: 0, null: false + t.boolean "is_published", default: true, null: false + t.boolean "is_shared", default: false, null: false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comfy_cms_pages", ["parent_id", "position"], name: "index_comfy_cms_pages_on_parent_id_and_position", using: :btree + add_index "comfy_cms_pages", ["site_id", "full_path"], name: "index_comfy_cms_pages_on_site_id_and_full_path", using: :btree + + create_table "comfy_cms_revisions", force: true do |t| + t.string "record_type", null: false + t.integer "record_id", null: false + t.text "data" + t.datetime "created_at" + end + + add_index "comfy_cms_revisions", ["record_type", "record_id", "created_at"], name: "index_cms_revisions_on_rtype_and_rid_and_created_at", using: :btree + + create_table "comfy_cms_sites", force: true do |t| + t.string "label", null: false + t.string "identifier", null: false + t.string "hostname", null: false + t.string "path" + t.string "locale", default: "en", null: false + t.boolean "is_mirrored", default: false, null: false + end + + add_index "comfy_cms_sites", ["hostname"], name: "index_comfy_cms_sites_on_hostname", using: :btree + add_index "comfy_cms_sites", ["is_mirrored"], name: "index_comfy_cms_sites_on_is_mirrored", using: :btree + + create_table "comfy_cms_snippets", force: true do |t| + t.integer "site_id", null: false + t.string "label", null: false + t.string "identifier", null: false + t.text "content" + t.integer "position", default: 0, null: false + t.boolean "is_shared", default: false, null: false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comfy_cms_snippets", ["site_id", "identifier"], name: "index_comfy_cms_snippets_on_site_id_and_identifier", unique: true, using: :btree + add_index "comfy_cms_snippets", ["site_id", "position"], name: "index_comfy_cms_snippets_on_site_id_and_position", using: :btree + create_table "comments", force: true do |t| t.integer "post_id", null: false t.integer "author_id", null: false @@ -139,6 +258,7 @@ ActiveRecord::Schema.define(version: 20150127043022) do t.decimal "weight_quantity" t.string "weight_unit" t.integer "plant_part_id" + t.float "si_weight" end create_table "harvests_photos", id: false, force: true do |t|