Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 15 commits
  • 112 files changed
  • 0 commit comments
  • 1 contributor
Showing with 19,346 additions and 3 deletions.
  1. +37 −1 .gitignore
  2. +23 −0 .powenv
  3. +1 −0 .rspec
  4. +1 −0 .ruby-version
  5. +50 −0 Gemfile
  6. +167 −0 Gemfile.lock
  7. +2 −2 README.md
  8. +28 −0 README.rdoc
  9. +6 −0 Rakefile
  10. 0 app/assets/images/.keep
  11. BIN app/assets/images/header-logo.png
  12. +27 −0 app/assets/javascripts/application.js
  13. +1 −0 app/assets/javascripts/comfortable_mexican_sofa/admin/application.js
  14. +13 −0 app/assets/stylesheets/application.css
  15. +1 −0 app/assets/stylesheets/comfortable_mexican_sofa/admin/application.css
  16. +5 −0 app/controllers/application_controller.rb
  17. 0 app/controllers/concerns/.keep
  18. +2 −0 app/helpers/application_helper.rb
  19. +5 −0 app/helpers/cms_helper.rb
  20. 0 app/mailers/.keep
  21. 0 app/models/.keep
  22. 0 app/models/concerns/.keep
  23. +21 −0 app/views/layouts/application.html.haml
  24. +99 −0 app/views/shared/_footer.html.haml
  25. +16 −0 app/views/shared/_navbar.html.haml
  26. +3 −0 bin/bundle
  27. +4 −0 bin/rails
  28. +4 −0 bin/rake
  29. +4 −0 config.ru
  30. +23 −0 config/application.rb
  31. +4 −0 config/boot.rb
  32. +60 −0 config/database.yml.sample
  33. +5 −0 config/environment.rb
  34. +29 −0 config/environments/development.rb
  35. +80 −0 config/environments/production.rb
  36. +36 −0 config/environments/test.rb
  37. +7 −0 config/initializers/backtrace_silencers.rb
  38. +108 −0 config/initializers/comfortable_mexican_sofa.rb
  39. +4 −0 config/initializers/filter_parameter_logging.rb
  40. +16 −0 config/initializers/inflections.rb
  41. +5 −0 config/initializers/mime_types.rb
  42. +12 −0 config/initializers/secret_token.rb
  43. +3 −0 config/initializers/session_store.rb
  44. +14 −0 config/initializers/wrap_parameters.rb
  45. +23 −0 config/locales/en.yml
  46. +6 −0 config/routes.rb
  47. +1 −0 db/cms_fixtures/sample-site/categories/files.yml
  48. +1 −0 db/cms_fixtures/sample-site/categories/pages.yml
  49. +1 −0 db/cms_fixtures/sample-site/categories/snippets.yml
  50. +5 −0 db/cms_fixtures/sample-site/files/_sample.jpg.yml
  51. BIN db/cms_fixtures/sample-site/files/sample.jpg
  52. +1 −0 db/cms_fixtures/sample-site/layouts/default/attributes.yml
  53. +5 −0 db/cms_fixtures/sample-site/layouts/default/content.html
  54. +1 −0 db/cms_fixtures/sample-site/layouts/default/javascript.js
  55. +2 −0 db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml
  56. +2 −0 db/cms_fixtures/sample-site/layouts/default/nested/content.html
  57. +1 −0 db/cms_fixtures/sample-site/layouts/default/nested/javascript.js
  58. +1 −0 db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css
  59. +1 −0 db/cms_fixtures/sample-site/layouts/default/stylesheet.css
  60. +6 −0 db/cms_fixtures/sample-site/pages/index/attributes.yml
  61. +3 −0 db/cms_fixtures/sample-site/pages/index/child/attributes.yml
  62. +1 −0 db/cms_fixtures/sample-site/pages/index/child/left.html
  63. +1 −0 db/cms_fixtures/sample-site/pages/index/child/right.html
  64. +2 −0 db/cms_fixtures/sample-site/pages/index/content.html
  65. +4 −0 db/cms_fixtures/sample-site/snippets/default/attributes.yml
  66. +1 −0 db/cms_fixtures/sample-site/snippets/default/content.html
  67. +138 −0 db/migrate/20140127124740_create_cms.rb
  68. +136 −0 db/schema.rb
  69. +7 −0 db/seeds.rb
  70. 0 lib/assets/.keep
  71. 0 lib/tasks/.keep
  72. 0 log/.keep
  73. +58 −0 public/404.html
  74. +58 −0 public/422.html
  75. +57 −0 public/500.html
  76. 0 public/favicon.ico
  77. +5 −0 public/robots.txt
  78. BIN vendor/assets/fonts/FontAwesome.otf
  79. BIN vendor/assets/fonts/fontawesome-webfont.eot
  80. +399 −0 vendor/assets/fonts/fontawesome-webfont.svg
  81. BIN vendor/assets/fonts/fontawesome-webfont.ttf
  82. BIN vendor/assets/fonts/fontawesome-webfont.woff
  83. 0 vendor/assets/javascripts/.keep
  84. +2,280 −0 vendor/assets/javascripts/bootstrap.js
  85. +6 −0 vendor/assets/javascripts/bootstrap.min.js
  86. +7 −0 vendor/assets/javascripts/jquery.colorbox-min.js
  87. +818 −0 vendor/assets/javascripts/jquery.imagesloaded.js
  88. +12 −0 vendor/assets/javascripts/jquery.wookmark.min.js
  89. +88 −0 vendor/assets/javascripts/main.js
  90. +183 −0 vendor/assets/javascripts/placeholder.js
  91. +24 −0 vendor/assets/javascripts/plugins.js
  92. +6 −0 vendor/assets/javascripts/respond.min.js
  93. +6 −0 vendor/assets/javascripts/vendor/jquery-1.10.2.min.js
  94. +4 −0 vendor/assets/javascripts/vendor/modernizr-2.6.2.min.js
  95. 0 vendor/assets/stylesheets/.keep
  96. +786 −0 vendor/assets/stylesheets/bootstrap-responsive.min.sass
  97. +786 −0 vendor/assets/stylesheets/bootstrap-responsive.sass
  98. +4,620 −0 vendor/assets/stylesheets/bootstrap.min.sass
  99. +4,633 −0 vendor/assets/stylesheets/bootstrap.sass
  100. +165 −0 vendor/assets/stylesheets/colorbox.sass
  101. +14 −0 vendor/assets/stylesheets/colors.sass
  102. +80 −0 vendor/assets/stylesheets/filter.sass
  103. +1,370 −0 vendor/assets/stylesheets/font-awesome.min.sass
  104. BIN vendor/assets/stylesheets/img/bg-overlay.png
  105. BIN vendor/assets/stylesheets/img/browser-header.png
  106. BIN vendor/assets/stylesheets/img/controls.png
  107. BIN vendor/assets/stylesheets/img/featured.png
  108. BIN vendor/assets/stylesheets/img/glyphicons-halflings-white.png
  109. BIN vendor/assets/stylesheets/img/glyphicons-halflings.png
  110. BIN vendor/assets/stylesheets/img/ie-black-bg.png
  111. BIN vendor/assets/stylesheets/img/loading.gif
  112. +1,605 −0 vendor/assets/stylesheets/main.sass
View
38 .gitignore
@@ -1,3 +1,40 @@
+# App-generated stuff
+.bundle
+.sass-cache/
+config/database.yml
+db/*.sqlite3
+log/
+tmp/
+solr/data/
+solr/pids/
+logfile
+public/system
+config/initializers/secret_token.rb
+
+# Doc generated stuff
+.yardoc
+doc/app/
+doc/apipie_examples.yml
+doc/apidoc*
+
+# Test generated stuff
+coverage/
+rails_best_practices_output.html
+spec/reports/
+
+# Vagrant stuff
+.vagrant
+Vagrantfile
+
+# OS stuff
+.DS_Store
+.env
+.envrc
+
+# IDE stuff
+.project
+
+# Automatically generated by Github
*.rbc
*.sassc
.sass-cache
@@ -16,4 +53,3 @@ capybara-*.html
rerun.txt
pickle-email-*.html
.project
-config/initializers/secret_token.rb
View
23 .powenv
@@ -0,0 +1,23 @@
+# detect `$rvm_path`
+if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ]
+ then rvm_path="${HOME:-}/.rvm"
+fi
+if [ -z "${rvm_path:-}" ] && [ -x "/usr/local/rvm/bin/rvm" ]
+ then rvm_path="/usr/local/rvm"
+fi
+
+# load environment of current project ruby
+if
+ [ -n "${rvm_path:-}" ] &&
+ [ -x "${rvm_path:-}/bin/rvm" ] &&
+ rvm_project_environment=`"${rvm_path:-}/bin/rvm" . do rvm env --path 2>/dev/null` &&
+ [ -n "${rvm_project_environment:-}" ] &&
+ [ -s "${rvm_project_environment:-}" ]
+then
+ echo "RVM loading: ${rvm_project_environment:-}"
+ \. "${rvm_project_environment:-}"
+else
+ echo "RVM project not found at: $PWD"
+fi
+
+export $(cat .env)
View
1 .rspec
@@ -0,0 +1 @@
+--color
View
1 .ruby-version
@@ -0,0 +1 @@
+2.0.0-p247
View
50 Gemfile
@@ -0,0 +1,50 @@
+source 'https://rubygems.org'
+
+# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
+gem 'rails', '4.0.0'
+
+# Use postgresql as the database for Active Record
+gem 'pg'
+
+# Use SCSS for stylesheets
+gem 'sass-rails', '~> 4.0.0'
+
+# Use Uglifier as compressor for JavaScript assets
+gem 'uglifier', '>= 1.3.0'
+
+# Use CoffeeScript for .js.coffee assets and views
+gem 'coffee-rails', '~> 4.0.0'
+
+# See https://github.com/sstephenson/execjs#readme for more supported runtimes
+# gem 'therubyracer', platforms: :ruby
+
+# Use jquery as the JavaScript library
+gem 'jquery-rails'
+
+# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
+gem 'turbolinks'
+gem 'jquery-turbolinks'
+
+# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
+gem 'jbuilder', '~> 1.2'
+
+gem 'git'
+
+gem 'comfortable_mexican_sofa'
+
+group :doc do
+ # bundle exec rake doc:rails generates the API under doc/api.
+ gem 'sdoc', require: false
+end
+
+# Use ActiveModel has_secure_password
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
+# Use unicorn as the app server
+# gem 'unicorn'
+
+# Use Capistrano for deployment
+# gem 'capistrano', group: :development
+
+# Use debugger
+# gem 'debugger', group: [:development, :test]
View
167 Gemfile.lock
@@ -0,0 +1,167 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (4.0.0)
+ actionpack (= 4.0.0)
+ mail (~> 2.5.3)
+ actionpack (4.0.0)
+ activesupport (= 4.0.0)
+ builder (~> 3.1.0)
+ erubis (~> 2.7.0)
+ rack (~> 1.5.2)
+ rack-test (~> 0.6.2)
+ active_link_to (1.0.1)
+ actionpack
+ activemodel (4.0.0)
+ activesupport (= 4.0.0)
+ builder (~> 3.1.0)
+ activerecord (4.0.0)
+ activemodel (= 4.0.0)
+ activerecord-deprecated_finders (~> 1.0.2)
+ activesupport (= 4.0.0)
+ arel (~> 4.0.0)
+ activerecord-deprecated_finders (1.0.3)
+ activesupport (4.0.0)
+ i18n (~> 0.6, >= 0.6.4)
+ minitest (~> 4.2)
+ multi_json (~> 1.3)
+ thread_safe (~> 0.1)
+ tzinfo (~> 0.3.37)
+ arel (4.0.1)
+ atomic (1.1.14)
+ builder (3.1.4)
+ climate_control (0.0.3)
+ activesupport (>= 3.0)
+ cocaine (0.5.3)
+ climate_control (>= 0.0.3, < 1.0)
+ codemirror-rails (3.16)
+ railties (>= 3.0, < 5)
+ coffee-rails (4.0.1)
+ coffee-script (>= 2.2.0)
+ railties (>= 4.0.0, < 5.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.6.3)
+ comfortable_mexican_sofa (1.11.1)
+ active_link_to (>= 1.0.0)
+ codemirror-rails (>= 3.0.0)
+ coffee-rails (>= 3.1.0)
+ formatted_form (>= 2.1.0)
+ haml-rails (>= 0.3.0)
+ jquery-rails (>= 3.0.0)
+ jquery-ui-rails (>= 4.0.0)
+ kaminari (>= 0.14.0)
+ kramdown (>= 1.0.0)
+ paperclip (>= 3.4.0)
+ rails (~> 4.0)
+ sass-rails (>= 3.1.0)
+ erubis (2.7.0)
+ execjs (2.0.2)
+ formatted_form (2.1.2)
+ rails (>= 3.1)
+ git (1.2.6)
+ haml (4.0.4)
+ tilt
+ haml-rails (0.5.1)
+ actionpack (~> 4.0.0)
+ activesupport (~> 4.0.0)
+ haml (>= 3.1, < 5.0)
+ railties (~> 4.0.0)
+ hike (1.2.3)
+ i18n (0.6.9)
+ jbuilder (1.5.2)
+ activesupport (>= 3.0.0)
+ multi_json (>= 1.2.0)
+ jquery-rails (3.0.4)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ jquery-turbolinks (2.0.1)
+ railties (>= 3.1.0)
+ turbolinks
+ jquery-ui-rails (4.1.1)
+ railties (>= 3.1.0)
+ json (1.8.1)
+ kaminari (0.15.0)
+ actionpack (>= 3.0.0)
+ activesupport (>= 3.0.0)
+ kramdown (1.3.0)
+ mail (2.5.4)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.25)
+ minitest (4.7.5)
+ multi_json (1.8.2)
+ paperclip (3.5.2)
+ activemodel (>= 3.0.0)
+ activesupport (>= 3.0.0)
+ cocaine (~> 0.5.3)
+ mime-types
+ pg (0.17.0)
+ polyglot (0.3.3)
+ rack (1.5.2)
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rails (4.0.0)
+ actionmailer (= 4.0.0)
+ actionpack (= 4.0.0)
+ activerecord (= 4.0.0)
+ activesupport (= 4.0.0)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.0.0)
+ sprockets-rails (~> 2.0.0)
+ railties (4.0.0)
+ actionpack (= 4.0.0)
+ activesupport (= 4.0.0)
+ rake (>= 0.8.7)
+ thor (>= 0.18.1, < 2.0)
+ rake (10.1.0)
+ rdoc (3.12.2)
+ json (~> 1.4)
+ sass (3.2.13)
+ sass-rails (4.0.1)
+ railties (>= 4.0.0, < 5.0)
+ sass (>= 3.1.10)
+ sprockets-rails (~> 2.0.0)
+ sdoc (0.3.20)
+ json (>= 1.1.3)
+ rdoc (~> 3.10)
+ sprockets (2.10.1)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sprockets-rails (2.0.1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (~> 2.8)
+ thor (0.18.1)
+ thread_safe (0.1.3)
+ atomic
+ tilt (1.4.1)
+ treetop (1.4.15)
+ polyglot
+ polyglot (>= 0.3.1)
+ turbolinks (2.1.0)
+ coffee-rails
+ tzinfo (0.3.38)
+ uglifier (2.4.0)
+ execjs (>= 0.3.0)
+ json (>= 1.8.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ coffee-rails (~> 4.0.0)
+ comfortable_mexican_sofa
+ git
+ jbuilder (~> 1.2)
+ jquery-rails
+ jquery-turbolinks
+ pg
+ rails (= 4.0.0)
+ sass-rails (~> 4.0.0)
+ sdoc
+ turbolinks
+ uglifier (>= 1.3.0)
View
4 README.md
@@ -1,4 +1,4 @@
-makespace
+Makespace.io
=========
-Website for the Make Space
+This is a website for the Make Space. We're using Comfortable Mexican Sofa on top of Rails 4 and Postgres. The documentation for those projects will be more than enough to get this project running locally.
View
28 README.rdoc
@@ -0,0 +1,28 @@
+== README
+
+This README would normally document whatever steps are necessary to get the
+application up and running.
+
+Things you may want to cover:
+
+* Ruby version
+
+* System dependencies
+
+* Configuration
+
+* Database creation
+
+* Database initialization
+
+* How to run the test suite
+
+* Services (job queues, cache servers, search engines, etc.)
+
+* Deployment instructions
+
+* ...
+
+
+Please feel free to use a different markup language if you do not plan to run
+<tt>rake doc:app</tt>.
View
6 Rakefile
@@ -0,0 +1,6 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Makespace::Application.load_tasks
View
0 app/assets/images/.keep
No changes.
View
BIN app/assets/images/header-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
27 app/assets/javascripts/application.js
@@ -0,0 +1,27 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// compiled file.
+//
+// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
+// about supported directives.
+//
+//= require jquery
+//= require jquery.turbolinks
+//= require jquery_ujs
+//= require bootstrap.min
+//= require jquery.colorbox-min
+//= require jquery.imagesloaded
+//= require jquery.wookmark.min
+//= require placeholder
+//= require plugins
+//= require respond.min
+//= require main
+//
+//= require turbolinks
+
+//= require_tree .
View
1 app/assets/javascripts/comfortable_mexican_sofa/admin/application.js
@@ -0,0 +1 @@
+// Overwrite this file in your application /app/assets/javascripts/comfortable_mexican_sofa/admin/application.js
View
13 app/assets/stylesheets/application.css
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+ */
View
1 app/assets/stylesheets/comfortable_mexican_sofa/admin/application.css
@@ -0,0 +1 @@
+/* Overwrite this file in your application /app/assets/stylesheets/comfortable_mexican_sofa/admin/application.css */
View
5 app/controllers/application_controller.rb
@@ -0,0 +1,5 @@
+class ApplicationController < ActionController::Base
+ # Prevent CSRF attacks by raising an exception.
+ # For APIs, you may want to use :null_session instead.
+ protect_from_forgery with: :exception
+end
View
0 app/controllers/concerns/.keep
No changes.
View
2 app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
View
5 app/helpers/cms_helper.rb
@@ -0,0 +1,5 @@
+module CmsHelper
+ def current_page?(page)
+ @cms_page == page
+ end
+end
View
0 app/mailers/.keep
No changes.
View
0 app/models/.keep
No changes.
View
0 app/models/concerns/.keep
No changes.
View
21 app/views/layouts/application.html.haml
@@ -0,0 +1,21 @@
+!!!
+%html.no-js
+ %head
+ %title MAKEspace
+ %meta{charset: "utf-8"}/
+ %meta{content: "IE=edge", "http-equiv" => "X-UA-Compatible"}/
+ %meta{content: "A hackerspace/makerspace located in State College, PA.", name: "description"}/
+ %meta{content: "width=device-width, initial-scale=1", name: "viewport"}/
+ = stylesheet_link_tag "bootstrap.min", media: "screen", "data-turbolinks-track" => true
+ = stylesheet_link_tag "bootstrap-responsive.min", media: "screen", "data-turbolinks-track" => true
+ = stylesheet_link_tag "colorbox", media: "all", "data-turbolinks-track" => true
+ = stylesheet_link_tag "http://fonts.googleapis.com/css?family=Open+Sans:400,800,700,300,600,400italic&subset=latin,cyrillic"
+ = stylesheet_link_tag "main", media: "all", "data-turbolinks-track" => true
+ = stylesheet_link_tag "font-awesome.min", media: "all", "data-turbolinks-track" => true
+ = stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
+ = csrf_meta_tags
+ %body
+ = render "shared/navbar"
+ = yield
+ = render "shared/footer"
+ = javascript_include_tag "application", "data-turbolinks-track" => true
View
99 app/views/shared/_footer.html.haml
@@ -0,0 +1,99 @@
+%footer
+ .light-bg
+ .container
+ .row-fluid
+ .span3
+ %h4 Get in touch
+ .info-block
+ %article.clearfix
+ %i.icon-globe
+ %address
+ 141 South Fraser St.
+ %br/
+ State College, Pennsylvania
+ %br/
+ 16801
+ %article.clearfix
+ %i.icon-phone
+ %p 814.689.3103
+ %article.clearfix
+ %i.icon-envelope
+ %p
+ %a{href: "mailto:root@makespace.io"} root@makespace.io
+ .span3
+ %h4 Follow us
+ .social
+ %ul.unstyled.clearfix
+ %li
+ %a{href: "https://twitter.com/TheMakeSpaceSC", target: "_blank", title: ""}
+ %i.icon-twitter
+ %li
+ %a{href: "https://www.facebook.com/hackvalley", target: "_blank", title: ""}
+ %i.icon-facebook
+ -# %li
+ -# %a{href: "#", target: "_blank", title: ""}
+ -# %i.icon-github
+ -# %li
+ -# %a{href: "#", target: "_blank", title: ""}
+ -# %i.icon-linkedin
+ -# %li
+ -# %a{href: "#", target: "_blank", title: ""}
+ -# %i.icon-pinterest
+ %li
+ %a{href: "https://plus.google.com/116879917434169348901/about?gl=US&hl=en-US", target: "_blank", title: ""}
+ %i.icon-google-plus
+ %li
+ %a{href: "http://hackerspaces.org/wiki/The_Make_Space", target: "_blank", title: "Our location on hackerspaces.org"}
+ %i.icon-gear
+ -# %li
+ -# %a{href: "#", target: "_blank", title: ""}
+ -# %i.icon-rss
+ .span3
+ %h4 Notable events
+ %ul.link-list
+ %li
+ %a{href: "#"} Dynamically created list of events coming soonish!
+ .span3
+ %h4 Photostream
+ %p We&rsquo;re trying to remember to take pictures more frequently. We'll have stuff here at some point&hellip;
+ -# %ul.footer-thumbnails.unstyled.clearfix
+ -# %li.stream
+ -# %a{href: "#"}
+ -# %img{alt: "", src: "http://dummyimage.com/45x45/243135/fff"}/
+ -# %li.stream
+ -# %a{href: "#"}
+ -# %img{alt: "", src: "http://dummyimage.com/45x45/243135/fff"}/
+ -# %li.stream
+ -# %a{href: "#"}
+ -# %img{alt: "", src: "http://dummyimage.com/45x45/243135/fff"}/
+ -# %li.stream
+ -# %a{href: "#"}
+ -# %img{alt: "", src: "http://dummyimage.com/45x45/243135/fff"}/
+ -# %li.stream
+ -# %a{href: "#"}
+ -# %img{alt: "", src: "http://dummyimage.com/45x45/243135/fff"}/
+ -# %li.stream
+ -# %a{href: "#"}
+ -# %img{alt: "", src: "http://dummyimage.com/45x45/243135/fff"}/
+ -# %li.stream
+ -# %a{href: "#"}
+ -# %img{alt: "", src: "http://dummyimage.com/45x45/243135/fff"}/
+ -# %li.stream
+ -# %a{href: "#"}
+ -# %img{alt: "", src: "http://dummyimage.com/45x45/243135/fff"}/
+ .copyright-block.dark-bg.clearfix
+ .container
+ .row
+ .span1
+ %a{href: "http://creativecommons.org/licenses/by-sa/4.0/", rel: "license"}
+ %img{alt: "Creative Commons License", src: "http://i.creativecommons.org/l/by-sa/4.0/88x31.png", style: "border-width:0"}/
+ .span8
+ %p.pull-left
+ This work is licensed under a
+ %a{href: "http://creativecommons.org/licenses/by-sa/4.0/", rel: "license"} Creative Commons Attribution-ShareAlike 4.0 International License.
+ Except where we stole content without permission. Which we might have done by accident. Copyright is tricky. ;p
+
+
+ .span3
+ .pull-right
+ %p
View
16 app/views/shared/_navbar.html.haml
@@ -0,0 +1,16 @@
+.navbar.navbar-fixed-top
+ .navbar-inner
+ .container
+ %a.btn.btn-navbar{"data-target" => ".nav-collapse", "data-toggle" => "collapse"}
+ %span.icon-bar
+ %span.icon-bar
+ %span.icon-bar
+ = link_to @cms_site.pages.root.full_path, class: "brand goTop" do
+ = image_tag "header-logo.png"
+ .nav-collapse.pull-right
+ %ul.nav
+ %li{class: ("active" if current_page?(@cms_site.pages.root))}
+ = link_to @cms_site.pages.root.label.upcase, @cms_site.pages.root.full_path
+ - @cms_site.pages.root.children.published.each do |page|
+ %li{class: ("active" if current_page?(page))}
+ = link_to page.label.upcase, page.full_path
View
3 bin/bundle
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+load Gem.bin_path('bundler', 'bundle')
View
4 bin/rails
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require_relative '../config/boot'
+require 'rails/commands'
View
4 bin/rake
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require_relative '../config/boot'
+require 'rake'
+Rake.application.run
View
4 config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Rails.application
View
23 config/application.rb
@@ -0,0 +1,23 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+# Require the gems listed in Gemfile, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env)
+
+module Makespace
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+ end
+end
View
4 config/boot.rb
@@ -0,0 +1,4 @@
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
View
60 config/database.yml.sample
@@ -0,0 +1,60 @@
+# PostgreSQL. Versions 8.2 and up are supported.
+#
+# Install the pg driver:
+# gem install pg
+# On OS X with Homebrew:
+# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
+# On OS X with MacPorts:
+# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
+# On Windows:
+# gem install pg
+# Choose the win32 build.
+# Install PostgreSQL and put its /bin directory on your path.
+#
+# Configure Using Gemfile
+# gem 'pg'
+#
+development:
+ adapter: postgresql
+ encoding: unicode
+ database: makespace_development
+ pool: 5
+ username: makespace
+ password:
+
+ # Connect on a TCP socket. Omitted by default since the client uses a
+ # domain socket that doesn't need configuration. Windows does not have
+ # domain sockets, so uncomment these lines.
+ #host: localhost
+
+ # The TCP port the server listens on. Defaults to 5432.
+ # If your server runs on a different port number, change accordingly.
+ #port: 5432
+
+ # Schema search path. The server defaults to $user,public
+ #schema_search_path: myapp,sharedapp,public
+
+ # Minimum log levels, in increasing order:
+ # debug5, debug4, debug3, debug2, debug1,
+ # log, notice, warning, error, fatal, and panic
+ # Defaults to warning.
+ #min_messages: notice
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ adapter: postgresql
+ encoding: unicode
+ database: makespace_test
+ pool: 5
+ username: makespace
+ password:
+
+production:
+ adapter: postgresql
+ encoding: unicode
+ database: makespace_production
+ pool: 5
+ username: makespace
+ password:
View
5 config/environment.rb
@@ -0,0 +1,5 @@
+# Load the Rails application.
+require File.expand_path('../application', __FILE__)
+
+# Initialize the Rails application.
+Makespace::Application.initialize!
View
29 config/environments/development.rb
@@ -0,0 +1,29 @@
+Makespace::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
+ config.cache_classes = false
+
+ # Do not eager load code on boot.
+ config.eager_load = false
+
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Don't care if the mailer can't send.
+ config.action_mailer.raise_delivery_errors = false
+
+ # Print deprecation notices to the Rails logger.
+ config.active_support.deprecation = :log
+
+ # Raise an error on page load if there are pending migrations
+ config.active_record.migration_error = :page_load
+
+ # Debug mode disables concatenation and preprocessing of assets.
+ # This option may cause significant delays in view rendering with a large
+ # number of complex assets.
+ config.assets.debug = true
+end
View
80 config/environments/production.rb
@@ -0,0 +1,80 @@
+Makespace::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # Code is not reloaded between requests.
+ config.cache_classes = true
+
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both thread web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
+ config.eager_load = true
+
+ # Full error reports are disabled and caching is turned on.
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
+ # Add `rack-cache` to your Gemfile before enabling this.
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
+ # config.action_dispatch.rack_cache = true
+
+ # Disable Rails's static asset server (Apache or nginx will already do this).
+ config.serve_static_assets = false
+
+ # Compress JavaScripts and CSS.
+ config.assets.js_compressor = :uglifier
+ # config.assets.css_compressor = :sass
+
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
+ config.assets.compile = false
+
+ # Generate digests for assets URLs.
+ config.assets.digest = true
+
+ # Version of your assets, change this if you want to expire all your assets.
+ config.assets.version = '1.0'
+
+ # Specifies the header that your server uses for sending files.
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # Set to :debug to see everything in the log.
+ config.log_level = :info
+
+ # Prepend all log lines with the following tags.
+ # config.log_tags = [ :subdomain, :uuid ]
+
+ # Use a different logger for distributed setups.
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
+
+ # Use a different cache store in production.
+ # config.cache_store = :mem_cache_store
+
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Precompile additional assets.
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+ # config.assets.precompile += %w( search.js )
+
+ # Ignore bad email addresses and do not raise email delivery errors.
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found).
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners.
+ config.active_support.deprecation = :notify
+
+ # Disable automatic flushing of the log to improve performance.
+ # config.autoflush_log = false
+
+ # Use default logging formatter so that PID and timestamp are not suppressed.
+ config.log_formatter = ::Logger::Formatter.new
+end
View
36 config/environments/test.rb
@@ -0,0 +1,36 @@
+Makespace::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Do not eager load code on boot. This avoids loading your whole application
+ # just for the purpose of running a single test. If you are using a tool that
+ # preloads Rails for running tests, you may have to set it to true.
+ config.eager_load = false
+
+ # Configure static asset server for tests with Cache-Control for performance.
+ config.serve_static_assets = true
+ config.static_cache_control = "public, max-age=3600"
+
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates.
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment.
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Print deprecation notices to the stderr.
+ config.active_support.deprecation = :stderr
+end
View
7 config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
View
108 config/initializers/comfortable_mexican_sofa.rb
@@ -0,0 +1,108 @@
+# 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 = 'ComfortableMexicanSofa::HttpAuth'
+
+ # 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 = 'ComfortableMexicanSofa::DummyAuth'
+
+ # 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
+
+ # If you want to keep your CMS tables in a location other than the default database
+ # add a database_config. For example, setting it to 'cms' will look for a cms_#{Rails.env}
+ # definition in your database.yml file
+ # config.database_config = 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::HttpAuth
+# YOU REALLY WANT TO CHANGE THIS BEFORE PUTTING YOUR SITE LIVE
+ComfortableMexicanSofa::HttpAuth.username = 'username'
+ComfortableMexicanSofa::HttpAuth.password = 'password'
+
+# You can use bcrypt (gem 'bcrypt-ruby') if you want to:
+# require 'bcrypt'
+# ComfortableMexicanSofa::HttpAuth.username = 'username'
+# ComfortableMexicanSofa::HttpAuth.password = BCrypt::Password.new '... bcrypt hash ...'
+#
+# To create a bcrypt hash:
+# BCrypt::Password.create('password').to_s
View
4 config/initializers/filter_parameter_logging.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure sensitive parameters which will be filtered from the log file.
+Rails.application.config.filter_parameters += [:password]
View
16 config/initializers/inflections.rb
@@ -0,0 +1,16 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
+
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.acronym 'RESTful'
+# end
View
5 config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
View
12 config/initializers/secret_token.rb
@@ -0,0 +1,12 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key is used for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+# You can use `rake secret` to generate a secure secret key.
+
+# Make sure your secret_key_base is kept private
+# if you're sharing your code publicly.
+Makespace::Application.config.secret_key_base = '3cf3e2c92cbc7d847ffd4ea7d58a6d1690529d54a87ce8bf5bdd82027b847b2073369527eb8c2b43b531cafc120ca5f259542e54ed16b9f364abcbf39e59ba3f'
View
3 config/initializers/session_store.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Makespace::Application.config.session_store :cookie_store, key: '_makespace_session'
View
14 config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
+end
+
+# To enable root element in JSON for ActiveRecord objects.
+# ActiveSupport.on_load(:active_record) do
+# self.include_root_in_json = true
+# end
View
23 config/locales/en.yml
@@ -0,0 +1,23 @@
+# Files in the config/locales directory are used for internationalization
+# and are automatically loaded by Rails. If you want to use locales other
+# than English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+# I18n.t 'hello'
+#
+# In views, this is aliased to just `t`:
+#
+# <%= t('hello') %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+# I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# To learn more, please read the Rails Internationalization guide
+# available at http://guides.rubyonrails.org/i18n.html.
+
+en:
+ hello: "Hello world"
View
6 config/routes.rb
@@ -0,0 +1,6 @@
+Makespace::Application.routes.draw do
+ comfy_route :cms_admin, :path => '/admin'
+
+ # Make sure this routeset is defined last
+ comfy_route :cms, :path => '/', :sitemap => false
+end
View
1 db/cms_fixtures/sample-site/categories/files.yml
@@ -0,0 +1 @@
+- File Category
View
1 db/cms_fixtures/sample-site/categories/pages.yml
@@ -0,0 +1 @@
+- Page Category
View
1 db/cms_fixtures/sample-site/categories/snippets.yml
@@ -0,0 +1 @@
+- Snippet Category
View
5 db/cms_fixtures/sample-site/files/_sample.jpg.yml
@@ -0,0 +1,5 @@
+label: Fixture File
+description: Fixture Description
+categories:
+ - category_a
+ - category_b
View
BIN db/cms_fixtures/sample-site/files/sample.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1 db/cms_fixtures/sample-site/layouts/default/attributes.yml
@@ -0,0 +1 @@
+label: Default Fixture Layout
View
5 db/cms_fixtures/sample-site/layouts/default/content.html
@@ -0,0 +1,5 @@
+<html>
+ <body>
+ {{ cms:page:content }}
+ </body>
+</html>
View
1 db/cms_fixtures/sample-site/layouts/default/javascript.js
@@ -0,0 +1 @@
+// default js
View
2 db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml
@@ -0,0 +1,2 @@
+label: Default Fixture Nested Layout
+position: 42
View
2 db/cms_fixtures/sample-site/layouts/default/nested/content.html
@@ -0,0 +1,2 @@
+<div class='left'> {{ cms:page:left }} </div>
+<div class='right'> {{ cms:page:right }} </div>
View
1 db/cms_fixtures/sample-site/layouts/default/nested/javascript.js
@@ -0,0 +1 @@
+// nested js
View
1 db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css
@@ -0,0 +1 @@
+div{float:left}
View
1 db/cms_fixtures/sample-site/layouts/default/stylesheet.css
@@ -0,0 +1 @@
+body{color: red}
View
6 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
View
3 db/cms_fixtures/sample-site/pages/index/child/attributes.yml
@@ -0,0 +1,3 @@
+label: Child Fixture Page
+layout: nested
+position: 42
View
1 db/cms_fixtures/sample-site/pages/index/child/left.html
@@ -0,0 +1 @@
+Child Page Left Fixture Content
View
1 db/cms_fixtures/sample-site/pages/index/child/right.html
@@ -0,0 +1 @@
+Child Page Right Fixture Content
View
2 db/cms_fixtures/sample-site/pages/index/content.html
@@ -0,0 +1,2 @@
+Home Page Fixture Contént
+{{ cms:snippet:default }}
View
4 db/cms_fixtures/sample-site/snippets/default/attributes.yml
@@ -0,0 +1,4 @@
+label: Default Fixture Snippet
+categories:
+ - category_a
+ - category_b
View
1 db/cms_fixtures/sample-site/snippets/default/content.html
@@ -0,0 +1 @@
+Fixture Content for Default Snippet
View
138 db/migrate/20140127124740_create_cms.rb
@@ -0,0 +1,138 @@
+class CreateCms < ActiveRecord::Migration
+
+ def self.up
+
+ text_limit = case ActiveRecord::Base.connection.adapter_name
+ when 'PostgreSQL'
+ { }
+ else
+ { :limit => 16777215 }
+ end
+
+ # -- Sites --------------------------------------------------------------
+ create_table :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 :cms_sites, :hostname
+ add_index :cms_sites, :is_mirrored
+
+ # -- Layouts ------------------------------------------------------------
+ create_table :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 :cms_layouts, [:parent_id, :position]
+ add_index :cms_layouts, [:site_id, :identifier], :unique => true
+
+ # -- Pages --------------------------------------------------------------
+ create_table :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, 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 :cms_pages, [:site_id, :full_path]
+ add_index :cms_pages, [:parent_id, :position]
+
+ # -- Page Blocks --------------------------------------------------------
+ create_table :cms_blocks do |t|
+ t.integer :page_id, :null => false
+ t.string :identifier, :null => false
+ t.text :content, text_limit
+ t.timestamps
+ end
+ add_index :cms_blocks, [:page_id, :identifier]
+
+ # -- Snippets -----------------------------------------------------------
+ create_table :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 :cms_snippets, [:site_id, :identifier], :unique => true
+ add_index :cms_snippets, [:site_id, :position]
+
+ # -- Files --------------------------------------------------------------
+ create_table :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 :cms_files, [:site_id, :label]
+ add_index :cms_files, [:site_id, :file_file_name]
+ add_index :cms_files, [:site_id, :position]
+ add_index :cms_files, [:site_id, :block_id]
+
+ # -- Revisions -----------------------------------------------------------
+ create_table :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 :cms_revisions, [:record_type, :record_id, :created_at],
+ :name => 'index_cms_revisions_on_rtype_and_rid_and_created_at'
+
+ # -- Categories ---------------------------------------------------------
+ create_table :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 :cms_categories, [:site_id, :categorized_type, :label], :unique => true
+
+ create_table :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 :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 :cms_sites
+ drop_table :cms_layouts
+ drop_table :cms_pages
+ drop_table :cms_snippets
+ drop_table :cms_blocks
+ drop_table :cms_files
+ drop_table :cms_revisions
+ drop_table :cms_categories
+ drop_table :cms_categorizations
+ end
+end
+
View
136 db/schema.rb
@@ -0,0 +1,136 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended that you check this file into your version control system.
+
+ActiveRecord::Schema.define(version: 20140127124740) do
+
+ # These are extensions that must be enabled in order to support this database
+ enable_extension "plpgsql"
+
+ create_table "cms_blocks", force: true do |t|
+ t.integer "page_id", null: false
+ t.string "identifier", null: false
+ t.text "content"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "cms_blocks", ["page_id", "identifier"], name: "index_cms_blocks_on_page_id_and_identifier", using: :btree
+
+ create_table "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 "cms_categories", ["site_id", "categorized_type", "label"], name: "index_cms_categories_on_site_id_and_categorized_type_and_label", unique: true, using: :btree
+
+ create_table "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 "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 "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 "cms_files", ["site_id", "block_id"], name: "index_cms_files_on_site_id_and_block_id", using: :btree
+ add_index "cms_files", ["site_id", "file_file_name"], name: "index_cms_files_on_site_id_and_file_file_name", using: :btree
+ add_index "cms_files", ["site_id", "label"], name: "index_cms_files_on_site_id_and_label", using: :btree
+ add_index "cms_files", ["site_id", "position"], name: "index_cms_files_on_site_id_and_position", using: :btree
+
+ create_table "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 "cms_layouts", ["parent_id", "position"], name: "index_cms_layouts_on_parent_id_and_position", using: :btree
+ add_index "cms_layouts", ["site_id", "identifier"], name: "index_cms_layouts_on_site_id_and_identifier", unique: true, using: :btree
+
+ create_table "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"
+ 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 "cms_pages", ["parent_id", "position"], name: "index_cms_pages_on_parent_id_and_position", using: :btree
+ add_index "cms_pages", ["site_id", "full_path"], name: "index_cms_pages_on_site_id_and_full_path", using: :btree
+
+ create_table "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 "cms_revisions", ["record_type", "record_id", "created_at"], name: "index_cms_revisions_on_rtype_and_rid_and_created_at", using: :btree
+
+ create_table "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 "cms_sites", ["hostname"], name: "index_cms_sites_on_hostname", using: :btree
+ add_index "cms_sites", ["is_mirrored"], name: "index_cms_sites_on_is_mirrored", using: :btree
+
+ create_table "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 "cms_snippets", ["site_id", "identifier"], name: "index_cms_snippets_on_site_id_and_identifier", unique: true, using: :btree
+ add_index "cms_snippets", ["site_id", "position"], name: "index_cms_snippets_on_site_id_and_position", using: :btree
+
+end
View
7 db/seeds.rb
@@ -0,0 +1,7 @@
+# This file should contain all the record creation needed to seed the database with its default values.
+# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
+#
+# Examples:
+#
+# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
+# Mayor.create(name: 'Emanuel', city: cities.first)
View
0 lib/assets/.keep
No changes.
View
0 lib/tasks/.keep
No changes.
View
0 log/.keep
No changes.
View
58 public/404.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The page you were looking for doesn't exist (404)</title>
+ <style>
+ body {
+ background-color: #EFEFEF;
+ color: #2E2F30;
+ text-align: center;
+ font-family: arial, sans-serif;
+ }
+
+ div.dialog {
+ width: 25em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-left-color: #999;
+ border-bottom-color: #BBB;
+ border-top: #B00100 solid 4px;
+ border-top-left-radius: 9px;
+ border-top-right-radius: 9px;
+ background-color: white;
+ padding: 7px 4em 0 4em;
+ }
+
+ h1 {
+ font-size: 100%;
+ color: #730E15;
+ line-height: 1.5em;
+ }
+
+ body > p {
+ width: 33em;
+ margin: 0 auto 1em;
+ padding: 1em 0;
+ background-color: #F7F7F7;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ border-top-color: #DADADA;
+ color: #666;
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
+ }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/404.html -->
+ <div class="dialog">
+ <h1>The page you were looking for doesn't exist.</h1>
+ <p>You may have mistyped the address or the page may have moved.</p>
+ </div>
+ <p>If you are the application owner check the logs for more information.</p>
+</body>
+</html>
View
58 public/422.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The change you wanted was rejected (422)</title>
+ <style>
+ body {
+ background-color: #EFEFEF;
+ color: #2E2F30;
+ text-align: center;
+ font-family: arial, sans-serif;
+ }
+
+ div.dialog {
+ width: 25em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-left-color: #999;
+ border-bottom-color: #BBB;
+ border-top: #B00100 solid 4px;
+ border-top-left-radius: 9px;
+ border-top-right-radius: 9px;
+ background-color: white;
+ padding: 7px 4em 0 4em;
+ }
+
+ h1 {
+ font-size: 100%;
+ color: #730E15;
+ line-height: 1.5em;
+ }
+
+ body > p {
+ width: 33em;
+ margin: 0 auto 1em;
+ padding: 1em 0;
+ background-color: #F7F7F7;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ border-top-color: #DADADA;
+ color: #666;
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
+ }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/422.html -->
+ <div class="dialog">
+ <h1>The change you wanted was rejected.</h1>
+ <p>Maybe you tried to change something you didn't have access to.</p>
+ </div>
+ <p>If you are the application owner check the logs for more information.</p>
+</body>
+</html>
View
57 public/500.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>We're sorry, but something went wrong (500)</title>
+ <style>
+ body {
+ background-color: #EFEFEF;
+ color: #2E2F30;
+ text-align: center;
+ font-family: arial, sans-serif;
+ }
+
+ div.dialog {
+ width: 25em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-left-color: #999;
+ border-bottom-color: #BBB;
+ border-top: #B00100 solid 4px;
+ border-top-left-radius: 9px;
+ border-top-right-radius: 9px;
+ background-color: white;
+ padding: 7px 4em 0 4em;
+ }
+
+ h1 {
+ font-size: 100%;
+ color: #730E15;
+ line-height: 1.5em;
+ }
+
+ body > p {
+ width: 33em;
+ margin: 0 auto 1em;
+ padding: 1em 0;
+ background-color: #F7F7F7;
+ border: 1px solid #CCC;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ border-top-color: #DADADA;
+ color: #666;
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
+ }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/500.html -->
+ <div class="dialog">
+ <h1>We're sorry, but something went wrong.</h1>
+ </div>
+ <p>If you are the application owner check the logs for more information.</p>
+</body>
+</html>
View
0 public/favicon.ico
No changes.
View
5 public/robots.txt
@@ -0,0 +1,5 @@
+# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
+#
+# To ban all spiders from the entire site uncomment the next two lines:
+# User-agent: *
+# Disallow: /
View
BIN vendor/assets/fonts/FontAwesome.otf
Binary file not shown.
View
BIN vendor/assets/fonts/fontawesome-webfont.eot
Binary file not shown.
View
399 vendor/assets/fonts/fontawesome-webfont.svg
399 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
BIN vendor/assets/fonts/fontawesome-webfont.ttf
Binary file not shown.
View
BIN vendor/assets/fonts/fontawesome-webfont.woff
Binary file not shown.
View
0 vendor/assets/javascripts/.keep
No changes.
View
2,280 vendor/assets/javascripts/bootstrap.js
2,280 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
6 vendor/assets/javascripts/bootstrap.min.js
@@ -0,0 +1,6 @@
+/*!
+* Bootstrap.js by @fat & @mdo
+* Copyright 2013 Twitter, Inc.
+* http://www.apache.org/licenses/LICENSE-2.0.txt
+*/
+!function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(".dropdown-backdrop").remove(),e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||("ontouchstart"in document.documentElement&&e('<div class="dropdown-backdrop"/>').insertBefore(e(this)).on("click",r),s.toggleClass("open")),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f<s.length-1&&f++,~f||(f=0),s.eq(f).focus()}};var s=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.dropdown.data-api",r).on("click.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle).on("keydown.dropdown.data-api",t+", [role=menu]",n.prototype.keydown)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e.fn[this.type].defaults,r={},i;this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)},this),i=e(t.currentTarget)[this.type](r).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(n=e.isFunction(this.source)?this.source(this.query,e.proxy(this.process,this)):this.source,n?this.process(n):this)},process:function(t){var n=this;return t=e.grep(t,function(e){return n.matcher(e)}),t=this.sorter(t),t.length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return"<strong>"+t+"</strong>"})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery);
View
7 vendor/assets/javascripts/jquery.colorbox-min.js
@@ -0,0 +1,7 @@
+/*!
+ Colorbox v1.4.33 - 2013-10-31
+ jQuery lightbox and modal window plugin
+ (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox
+ license: http://www.opensource.org/licenses/mit-license.php
+*/
+(function(e,t,i){function o(i,o,n){var r=t.createElement(i);return o&&(r.id=Z+o),n&&(r.style.cssText=n),e(r)}function n(){return i.innerHeight?i.innerHeight:e(i).height()}function r(e){var t=k.length,i=(z+e)%t;return 0>i?t+i:i}function h(e,t){return Math.round((/%/.test(e)?("x"===t?E.width():n())/100:1)*parseInt(e,10))}function l(e,t){return e.photo||e.photoRegex.test(t)}function s(e,t){return e.retinaUrl&&i.devicePixelRatio>1?t.replace(e.photoRegex,e.retinaSuffix):t}function a(e){"contains"in g[0]&&!g[0].contains(e.target)&&(e.stopPropagation(),g.focus())}function d(){var t,i=e.data(N,Y);null==i?(B=e.extend({},X),console&&console.log&&console.log("Error: cboxElement missing settings object")):B=e.extend({},i);for(t in B)e.isFunction(B[t])&&"on"!==t.slice(0,2)&&(B[t]=B[t].call(N));B.rel=B.rel||N.rel||e(N).data("rel")||"nofollow",B.href=B.href||e(N).attr("href"),B.title=B.title||N.title,"string"==typeof B.href&&(B.href=e.trim(B.href))}function c(i,o){e(t).trigger(i),lt.triggerHandler(i),e.isFunction(o)&&o.call(N)}function u(i){q||(N=i,d(),k=e(N),z=0,"nofollow"!==B.rel&&(k=e("."+et).filter(function(){var t,i=e.data(this,Y);return i&&(t=e(this).data("rel")||i.rel||this.rel),t===B.rel}),z=k.index(N),-1===z&&(k=k.add(N),z=k.length-1)),w.css({opacity:parseFloat(B.opacity),cursor:B.overlayClose?"pointer":"auto",visibility:"visible"}).show(),J&&g.add(w).removeClass(J),B.className&&g.add(w).addClass(B.className),J=B.className,B.closeButton?K.html(B.close).appendTo(y):K.appendTo("<div/>"),U||(U=$=!0,g.css({visibility:"hidden",display:"block"}),H=o(st,"LoadedContent","width:0; height:0; overflow:hidden"),y.css({width:"",height:""}).append(H),O=x.height()+C.height()+y.outerHeight(!0)-y.height(),_=b.width()+T.width()+y.outerWidth(!0)-y.width(),D=H.outerHeight(!0),A=H.outerWidth(!0),B.w=h(B.initialWidth,"x"),B.h=h(B.initialHeight,"y"),H.css({width:"",height:B.h}),Q.position(),c(tt,B.onOpen),P.add(L).hide(),g.focus(),B.trapFocus&&t.addEventListener&&(t.addEventListener("focus",a,!0),lt.one(rt,function(){t.removeEventListener("focus",a,!0)})),B.returnFocus&&lt.one(rt,function(){e(N).focus()})),m())}function f(){!g&&t.body&&(V=!1,E=e(i),g=o(st).attr({id:Y,"class":e.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),w=o(st,"Overlay").hide(),F=e([o(st,"LoadingOverlay")[0],o(st,"LoadingGraphic")[0]]),v=o(st,"Wrapper"),y=o(st,"Content").append(L=o(st,"Title"),S=o(st,"Current"),I=e('<button type="button"/>').attr({id:Z+"Previous"}),R=e('<button type="button"/>').attr({id:Z+"Next"}),M=o("button","Slideshow"),F),K=e('<button type="button"/>').attr({id:Z+"Close"}),v.append(o(st).append(o(st,"TopLeft"),x=o(st,"TopCenter"),o(st,"TopRight")),o(st,!1,"clear:left").append(b=o(st,"MiddleLeft"),y,T=o(st,"MiddleRight")),o(st,!1,"clear:left").append(o(st,"BottomLeft"),C=o(st,"BottomCenter"),o(st,"BottomRight"))).find("div div").css({"float":"left"}),W=o(st,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),P=R.add(I).add(S).add(M),e(t.body).append(w,g.append(v,W)))}function p(){function i(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||e.ctrlKey||(e.preventDefault(),u(this))}return g?(V||(V=!0,R.click(function(){Q.next()}),I.click(function(){Q.prev()}),K.click(function(){Q.close()}),w.click(function(){B.overlayClose&&Q.close()}),e(t).bind("keydown."+Z,function(e){var t=e.keyCode;U&&B.escKey&&27===t&&(e.preventDefault(),Q.close()),U&&B.arrowKey&&k[1]&&!e.altKey&&(37===t?(e.preventDefault(),I.click()):39===t&&(e.preventDefault(),R.click()))}),e.isFunction(e.fn.on)?e(t).on("click."+Z,"."+et,i):e("."+et).live("click."+Z,i)),!0):!1}function m(){var n,r,a,u=Q.prep,f=++at;$=!0,j=!1,N=k[z],d(),c(ht),c(it,B.onLoad),B.h=B.height?h(B.height,"y")-D-O:B.innerHeight&&h(B.innerHeight,"y"),B.w=B.width?h(B.width,"x")-A-_:B.innerWidth&&h(B.innerWidth,"x"),B.mw=B.w,B.mh=B.h,B.maxWidth&&(B.mw=h(B.maxWidth,"x")-A-_,B.mw=B.w&&B.w<B.mw?B.w:B.mw),B.maxHeight&&(B.mh=h(B.maxHeight,"y")-D-O,B.mh=B.h&&B.h<B.mh?B.h:B.mh),n=B.href,G=setTimeout(function(){F.show()},100),B.inline?(a=o(st).hide().insertBefore(e(n)[0]),lt.one(ht,function(){a.replaceWith(H.children())}),u(e(n))):B.iframe?u(" "):B.html?u(B.html):l(B,n)?(n=s(B,n),j=t.createElement("img"),e(j).addClass(Z+"Photo").bind("error",function(){B.title=!1,u(o(st,"Error").html(B.imgError))}).one("load",function(){var t;f===at&&(e.each(["alt","longdesc","aria-describedby"],function(t,i){var o=e(N).attr(i)||e(N).attr("data-"+i);o&&j.setAttribute(i,o)}),B.retinaImage&&i.devicePixelRatio>1&&(j.height=j.height/i.devicePixelRatio,j.width=j.width/i.devicePixelRatio),B.scalePhotos&&(r=function(){j.height-=j.height*t,j.width-=j.width*t},B.mw&&j.width>B.mw&&(t=(j.width-B.mw)/j.width,r()),B.mh&&j.height>B.mh&&(t=(j.height-B.mh)/j.height,r())),B.h&&(j.style.marginTop=Math.max(B.mh-j.height,0)/2+"px"),k[1]&&(B.loop||k[z+1])&&(j.style.cursor="pointer",j.onclick=function(){Q.next()}),j.style.width=j.width+"px",j.style.height=j.height+"px",setTimeout(function(){u(j)},1))}),setTimeout(function(){j.src=n},1)):n&&W.load(n,B.data,function(t,i){f===at&&u("error"===i?o(st,"Error").html(B.xhrError):e(this).contents())})}var w,g,v,y,x,b,T,C,k,E,H,W,F,L,S,M,R,I,K,P,B,O,_,D,A,N,z,j,U,$,q,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1},Y="colorbox",Z="cbox",et=Z+"Element",tt=Z+"_open",it=Z+"_load",ot=Z+"_complete",nt=Z+"_cleanup",rt=Z+"_closed",ht=Z+"_purge",lt=e("<a/>"),st="div",at=0,dt={},ct=function(){function e(){clearTimeout(h)}function t(){(B.loop||k[z+1])&&(e(),h=setTimeout(Q.next,B.slideshowSpeed))}function i(){M.html(B.slideshowStop).unbind(s).one(s,o),lt.bind(ot,t).bind(it,e),g.removeClass(l+"off").addClass(l+"on")}function o(){e(),lt.unbind(ot,t).unbind(it,e),M.html(B.slideshowStart).unbind(s).one(s,function(){Q.next(),i()}),g.removeClass(l+"on").addClass(l+"off")}function n(){r=!1,M.hide(),e(),lt.unbind(ot,t).unbind(it,e),g.removeClass(l+"off "+l+"on")}var r,h,l=Z+"Slideshow_",s="click."+Z;return function(){r?B.slideshow||(lt.unbind(nt,n),n()):B.slideshow&&k[1]&&(r=!0,lt.one(nt,n),B.slideshowAuto?i():o(),M.show())}}();e.colorbox||(e(f),Q=e.fn[Y]=e[Y]=function(t,i){var o=this;if(t=t||{},f(),p()){if(e.isFunction(o))o=e("<a/>"),t.open=!0;else if(!o[0])return o;i&&(t.onComplete=i),o.each(function(){e.data(this,Y,e.extend({},e.data(this,Y)||X,t))}).addClass(et),(e.isFunction(t.open)&&t.open.call(o)||t.open)&&u(o[0])}return o},Q.position=function(t,i){function o(){x[0].style.width=C[0].style.width=y[0].style.width=parseInt(g[0].style.width,10)-_+"px",y[0].style.height=b[0].style.height=T[0].style.height=parseInt(g[0].style.height,10)-O+"px"}var r,l,s,a=0,d=0,c=g.offset();if(E.unbind("resize."+Z),g.css({top:-9e4,left:-9e4}),l=E.scrollTop(),s=E.scrollLeft(),B.fixed?(c.top-=l,c.left-=s,g.css({position:"fixed"})):(a=l,d=s,g.css({position:"absolute"})),d+=B.right!==!1?Math.max(E.width()-B.w-A-_-h(B.right,"x"),0):B.left!==!1?h(B.left,"x"):Math.round(Math.max(E.width()-B.w-A-_,0)/2),a+=B.bottom!==!1?Math.max(n()-B.h-D-O-h(B.bottom,"y"),0):B.top!==!1?h(B.top,"y"):Math.round(Math.max(n()-B.h-D-O,0)/2),g.css({top:c.top,left:c.left,visibility:"visible"}),v[0].style.width=v[0].style.height="9999px",r={width:B.w+A+_,height:B.h+D+O,top:a,left:d},t){var u=0;e.each(r,function(e){return r[e]!==dt[e]?(u=t,void 0):void 0}),t=u}dt=r,t||g.css(r),g.dequeue().animate(r,{duration:t||0,complete:function(){o(),$=!1,v[0].style.width=B.w+A+_+"px",v[0].style.height=B.h+D+O+"px",B.reposition&&setTimeout(function(){E.bind("resize."+Z,Q.position)},1),i&&i()},step:o})},Q.resize=function(e){var t;U&&(e=e||{},e.width&&(B.w=h(e.width,"x")-A-_),e.innerWidth&&(B.w=h(e.innerWidth,"x")),H.css({width:B.w}),e.height&&(B.h=h(e.height,"y")-D-O),e.innerHeight&&(B.h=h(e.innerHeight,"y")),e.innerHeight||e.height||(t=H.scrollTop(),H.css({height:"auto"}),B.h=H.height()),H.css({height:B.h}),t&&H.scrollTop(t),Q.position("none"===B.transition?0:B.speed))},Q.prep=function(i){function n(){return B.w=B.w||H.width(),B.w=B.mw&&B.mw<B.w?B.mw:B.w,B.w}function h(){return B.h=B.h||H.height(),B.h=B.mh&&B.mh<B.h?B.mh:B.h,B.h}if(U){var a,d="none"===B.transition?0:B.speed;H.empty().remove(),H=o(st,"LoadedContent").append(i),H.hide().appendTo(W.show()).css({width:n(),overflow:B.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(y),W.hide(),e(j).css({"float":"none"}),a=function(){function i(){e.support.opacity===!1&&g[0].style.removeAttribute("filter")}var n,h,a=k.length,u="frameBorder",f="allowTransparency";U&&(h=function(){clearTimeout(G),F.hide(),c(ot,B.onComplete)},L.html(B.title).add(H).show(),a>1?("string"==typeof B.current&&S.html(B.current.replace("{current}",z+1).replace("{total}",a)).show(),R[B.loop||a-1>z?"show":"hide"]().html(B.next),I[B.loop||z?"show":"hide"]().html(B.previous),ct(),B.preloading&&e.each([r(-1),r(1)],function(){var i,o,n=k[this],r=e.data(n,Y);r&&r.href?(i=r.href,e.isFunction(i)&&(i=i.call(n))):i=e(n).attr("href"),i&&l(r,i)&&(i=s(r,i),o=t.createElement("img"),o.src=i)})):P.hide(),B.iframe?(n=o("iframe")[0],u in n&&(n[u]=0),f in n&&(n[f]="true"),B.scrolling||(n.scrolling="no"),e(n).attr({src:B.href,name:(new Date).getTime(),"class":Z+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",h).appendTo(H),lt.one(ht,function(){n.src="//about:blank"}),B.fastIframe&&e(n).trigger("load")):h(),"fade"===B.transition?g.fadeTo(d,1,i):i())},"fade"===B.transition?g.fadeTo(d,0,function(){Q.position(0,a)}):Q.position(d,a)}},Q.next=function(){!$&&k[1]&&(B.loop||k[z+1])&&(z=r(1),u(k[z]))},Q.prev=function(){!$&&k[1]&&(B.loop||z)&&(z=r(-1),u(k[z]))},Q.close=function(){U&&!q&&(q=!0,U=!1,c(nt,B.onCleanup),E.unbind("."+Z),w.fadeTo(B.fadeOut||0,0),g.stop().fadeTo(B.fadeOut||0,0,function(){g.add(w).css({opacity:1,cursor:"auto"}).hide(),c(ht),H.empty().remove(),setTimeout(function(){q=!1,c(rt,B.onClosed)},1)}))},Q.remove=function(){g&&(g.stop(),e.colorbox.close(),g.stop().remove(),w.remove(),q=!1,g=null,e("."+et).removeData(Y).removeClass(et),e(t).unbind("click."+Z))},Q.element=function(){return e(N)},Q.settings=X)})(jQuery,document,window);
View
818 vendor/assets/javascripts/jquery.imagesloaded.js
@@ -0,0 +1,818 @@
+/*!
+ * imagesLoaded PACKAGED v3.0.4
+ * JavaScript is all like "You images are done yet or what?"
+ */
+
+/*!
+ * EventEmitter v4.2.0 - git.io/ee
+ * Oliver Caldwell
+ * MIT license
+ * @preserve
+ */
+
+(function () {
+ // Place the script in strict mode
+ 'use strict';
+
+ /**
+ * Class for managing events.
+ * Can be extended to provide event functionality in other classes.
+ *
+ * @class EventEmitter Manages event registering and emitting.
+ */
+ function EventEmitter() {}
+
+ // Shortcuts to improve speed and size
+
+ // Easy access to the prototype
+ var proto = EventEmitter.prototype;
+
+ /**
+ * Finds the index of the listener for the event in it's storage array.
+ *
+ * @param {Function[]} listeners Array of listeners to search through.
+ * @param {Function} listener Method to look for.
+ * @return {Number} Index of the specified listener, -1 if not found
+ * @api private
+ */
+ function indexOfListener(listeners, listener) {
+ var i = listeners.length;
+ while (i--) {
+ if (listeners[i].listener === listener) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ /**
+ * Returns the listener array for the specified event.
+ * Will initialise the event object and listener arrays if required.
+ * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
+ * Each property in the object response is an array of listener functions.
+ *
+ * @param {String|RegExp} evt Name of the event to return the listeners from.
+ * @return {Function[]|Object} All listener functions for the event.
+ */
+ proto.getListeners = function getListeners(evt) {
+ var events = this._getEvents();
+ var response;
+ var key;
+
+ // Return a concatenated array of all matching events if
+ // the selector is a regular expression.
+ if (typeof evt === 'object') {
+ response = {};
+ for (key in events) {
+ if (events.hasOwnProperty(key) && evt.test(key)) {
+ response[key] = events[key];
+ }
+ }
+ }
+ else {
+ response = events[evt] || (events[evt] = []);
+ }
+
+ return response;
+ };
+
+ /**
+ * Takes a list of listener objects and flattens it into a list of listener functions.
+ *
+ * @param {Object[]} listeners Raw listener objects.
+ * @return {Function[]} Just the listener functions.
+ */
+ proto.flattenListeners = function flattenListeners(listeners) {
+ var flatListeners = [];