diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..e94f814 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1 @@ +defaults diff --git a/.gitignore b/.gitignore index c108a84..21919a2 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,11 @@ */**/.keep /public/assets + +/public/packs +/public/packs-test +/node_modules +/yarn-error.log +yarn-debug.log* +.yarn-integrity +.byebug_history diff --git a/.ruby-version b/.ruby-version index b503b50..2eb2fe9 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.4.3 +ruby-2.7.2 diff --git a/.travis.yml b/.travis.yml index 445c46f..791a5c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby rvm: - - 2.4.3 + - 2.7.2 before_install: - which qmake # to see where it links - ls -la `which qmake` diff --git a/Gemfile b/Gemfile index 298c784..4e908b5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,42 +1,63 @@ source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } -gem 'rails', '~> 4.2.11' +ruby '2.7.2' + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 6.0.3', '>= 6.0.3.4' +# Use sqlite3 as the database for Active Record +gem 'sqlite3', '~> 1.4' +# Use Puma as the app server +gem 'puma', '~> 4.1' +# Use SCSS for stylesheets +gem 'sass-rails', '>= 6' +# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker +gem 'webpacker', '~> 4.0' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.7' -gem 'sass-rails', '~> 5.0' -gem 'uglifier', '>= 1.3.0' gem 'jquery-rails' gem 'font-awesome-rails' -gem 'foundation-rails', '~> 5.5.3.2' +gem 'foundation-rails' gem 'simple_form' gem 'cocoon' gem 'kaminari' gem 'rest-client' gem 'libxml-ruby' -gem 'sqlite3' + gem 'pg', '~> 0.15' gem 'mysql2' -gem 'puma' + +gem 'liquid' + +# Reduces boot times through caching; required in config/boot.rb +gem 'bootsnap', '>= 1.4.2', require: false group :development, :test do - gem 'byebug' - gem 'rspec-rails', '~> 3.6' + gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] + gem 'rspec-rails', '4.0.0.beta3' end group :development do - gem 'web-console', '~> 2.0' - gem 'spring' + # Access an interactive console on exception pages or by calling 'console' anywhere in the code. + gem 'web-console', '>= 3.3.0' + gem 'listen', '~> 3.2' end group :test do - gem 'shoulda-matchers' + gem 'shoulda-matchers', '4.4.1' gem 'factory_bot_rails' gem 'database_cleaner' - gem 'rspec-matchers-controller_filters' gem 'capybara' gem 'capybara-screenshot' - gem 'capybara-webkit', '1.14.0' - gem 'cucumber-rails', '1.4.3', :require => false - gem 'cucumber-core', '1.4.0' - gem 'selenium-webdriver', '2.53.0' + gem 'cucumber-rails', :require => false + gem 'cucumber-core' + gem 'selenium-webdriver' gem 'table_flipper' + # Easy installation and use of web drivers to run system tests with browsers + gem 'webdrivers' + gem 'rails-controller-testing' end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/Gemfile.lock b/Gemfile.lock index d90b1a2..21fcdd0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,279 +1,382 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.11.1) - actionpack (= 4.2.11.1) - actionview (= 4.2.11.1) - activejob (= 4.2.11.1) + actioncable (6.0.4.1) + actionpack (= 6.0.4.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.4.1) + actionpack (= 6.0.4.1) + activejob (= 6.0.4.1) + activerecord (= 6.0.4.1) + activestorage (= 6.0.4.1) + activesupport (= 6.0.4.1) + mail (>= 2.7.1) + actionmailer (6.0.4.1) + actionpack (= 6.0.4.1) + actionview (= 6.0.4.1) + activejob (= 6.0.4.1) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.11.1) - actionview (= 4.2.11.1) - activesupport (= 4.2.11.1) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.11.1) - activesupport (= 4.2.11.1) + rails-dom-testing (~> 2.0) + actionpack (6.0.4.1) + actionview (= 6.0.4.1) + activesupport (= 6.0.4.1) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.4.1) + actionpack (= 6.0.4.1) + activerecord (= 6.0.4.1) + activestorage (= 6.0.4.1) + activesupport (= 6.0.4.1) + nokogiri (>= 1.8.5) + actionview (6.0.4.1) + activesupport (= 6.0.4.1) builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (4.2.11.1) - activesupport (= 4.2.11.1) - globalid (>= 0.3.0) - activemodel (4.2.11.1) - activesupport (= 4.2.11.1) - builder (~> 3.1) - activerecord (4.2.11.1) - activemodel (= 4.2.11.1) - activesupport (= 4.2.11.1) - arel (~> 6.0) - activesupport (4.2.11.1) - i18n (~> 0.7) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.4.1) + activesupport (= 6.0.4.1) + globalid (>= 0.3.6) + activemodel (6.0.4.1) + activesupport (= 6.0.4.1) + activerecord (6.0.4.1) + activemodel (= 6.0.4.1) + activesupport (= 6.0.4.1) + activestorage (6.0.4.1) + actionpack (= 6.0.4.1) + activejob (= 6.0.4.1) + activerecord (= 6.0.4.1) + marcel (~> 1.0.0) + activesupport (6.0.4.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - arel (6.0.4) - binding_of_caller (0.8.0) - debug_inspector (>= 0.0.1) - builder (3.2.3) - byebug (10.0.2) - capybara (2.13.0) + zeitwerk (~> 2.2, >= 2.2.2) + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + babel-source (5.8.35) + babel-transpiler (0.7.0) + babel-source (>= 4.0, < 6) + execjs (~> 2.0) + bindex (0.8.1) + bootsnap (1.9.1) + msgpack (~> 1.0) + builder (3.2.4) + byebug (11.1.3) + capybara (3.36.0) addressable - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - capybara-screenshot (1.0.22) + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + capybara-screenshot (1.0.25) capybara (>= 1.0, < 4) launchy - capybara-webkit (1.14.0) - capybara (>= 2.3.0, < 2.14.0) - json - childprocess (0.9.0) - ffi (~> 1.0, >= 1.0.11) - cocoon (1.2.12) - concurrent-ruby (1.1.5) - crass (1.0.5) - cucumber (2.3.3) - builder (>= 2.1.2) - cucumber-core (~> 1.4.0) - cucumber-wire (~> 0.0.1) - diff-lcs (>= 1.1.3) - gherkin (~> 3.2.0) - multi_json (>= 1.7.5, < 2.0) - multi_test (>= 0.1.2) - cucumber-core (1.4.0) - gherkin (~> 3.2.0) - cucumber-rails (1.4.3) - capybara (>= 1.1.2, < 3) - cucumber (>= 1.3.8, < 3) - mime-types (>= 1.16, < 4) - nokogiri (~> 1.5) - railties (>= 3, < 5) - cucumber-wire (0.0.1) - database_cleaner (1.7.0) - debug_inspector (0.0.3) - diff-lcs (1.3) - domain_name (0.5.20180417) + childprocess (4.1.0) + cocoon (1.2.15) + concurrent-ruby (1.1.9) + crass (1.0.6) + cucumber (7.1.0) + builder (~> 3.2, >= 3.2.4) + cucumber-core (~> 10.1, >= 10.1.0) + cucumber-create-meta (~> 6.0, >= 6.0.1) + cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) + cucumber-gherkin (~> 22.0, >= 22.0.0) + cucumber-html-formatter (~> 17.0, >= 17.0.0) + cucumber-messages (~> 17.1, >= 17.1.1) + cucumber-wire (~> 6.2, >= 6.2.0) + diff-lcs (~> 1.4, >= 1.4.4) + mime-types (~> 3.3, >= 3.3.1) + multi_test (~> 0.1, >= 0.1.2) + sys-uname (~> 1.2, >= 1.2.2) + cucumber-core (10.1.0) + cucumber-gherkin (~> 22.0, >= 22.0.0) + cucumber-messages (~> 17.1, >= 17.1.1) + cucumber-tag-expressions (~> 4.0, >= 4.0.2) + cucumber-create-meta (6.0.2) + cucumber-messages (~> 17.1, >= 17.1.1) + sys-uname (~> 1.2, >= 1.2.2) + cucumber-cucumber-expressions (14.0.0) + cucumber-gherkin (22.0.0) + cucumber-messages (~> 17.1, >= 17.1.1) + cucumber-html-formatter (17.0.0) + cucumber-messages (~> 17.1, >= 17.1.0) + cucumber-messages (17.1.1) + cucumber-rails (2.4.0) + capybara (>= 2.18, < 4) + cucumber (>= 3.2, < 8) + mime-types (~> 3.3) + nokogiri (~> 1.10) + railties (>= 5.0, < 7) + rexml (~> 3.0) + webrick (~> 1.7) + cucumber-tag-expressions (4.1.0) + cucumber-wire (6.2.0) + cucumber-core (~> 10.1, >= 10.1.0) + cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) + cucumber-messages (~> 17.1, >= 17.1.1) + database_cleaner (2.0.1) + database_cleaner-active_record (~> 2.0.0) + database_cleaner-active_record (2.0.1) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) + diff-lcs (1.4.4) + domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - erubis (2.7.0) - execjs (2.7.0) - factory_bot (4.11.1) - activesupport (>= 3.0.0) - factory_bot_rails (4.11.1) - factory_bot (~> 4.11.1) - railties (>= 3.0.0) - ffi (1.10.0) - font-awesome-rails (4.7.0.4) - railties (>= 3.2, < 6.0) - foundation-rails (5.5.3.2) + erubi (1.10.0) + execjs (2.8.1) + factory_bot (6.2.0) + activesupport (>= 5.0.0) + factory_bot_rails (6.2.0) + factory_bot (~> 6.2.0) + railties (>= 5.0.0) + ffi (1.15.4) + font-awesome-rails (4.7.0.7) + railties (>= 3.2, < 7) + foundation-rails (6.6.2.0) railties (>= 3.1.0) - sass (>= 3.3.0, < 3.5) - gherkin (3.2.0) - globalid (0.4.2) - activesupport (>= 4.2.0) - http-cookie (1.0.3) + sass (>= 3.3.0) + sprockets-es6 (>= 0.9.0) + globalid (0.5.2) + activesupport (>= 5.0) + http-accept (1.7.0) + http-cookie (1.0.4) domain_name (~> 0.5) - i18n (0.9.5) + i18n (1.8.11) concurrent-ruby (~> 1.0) - jquery-rails (4.3.3) + jbuilder (2.11.2) + activesupport (>= 5.0.0) + jquery-rails (4.4.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.1.0) - kaminari (1.1.1) + kaminari (1.2.1) activesupport (>= 4.1.0) - kaminari-actionview (= 1.1.1) - kaminari-activerecord (= 1.1.1) - kaminari-core (= 1.1.1) - kaminari-actionview (1.1.1) + kaminari-actionview (= 1.2.1) + kaminari-activerecord (= 1.2.1) + kaminari-core (= 1.2.1) + kaminari-actionview (1.2.1) actionview - kaminari-core (= 1.1.1) - kaminari-activerecord (1.1.1) + kaminari-core (= 1.2.1) + kaminari-activerecord (1.2.1) activerecord - kaminari-core (= 1.1.1) - kaminari-core (1.1.1) - launchy (2.4.3) - addressable (~> 2.3) - libxml-ruby (3.1.0) - loofah (2.3.1) + kaminari-core (= 1.2.1) + kaminari-core (1.2.1) + launchy (2.5.0) + addressable (~> 2.7) + libxml-ruby (3.2.1) + liquid (5.1.0) + listen (3.7.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + loofah (2.12.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - mime-types (3.2.2) + marcel (1.0.2) + matrix (0.4.2) + method_source (1.0.0) + mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2018.0812) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - minitest (5.13.0) - multi_json (1.13.1) + mime-types-data (3.2021.0901) + mini_mime (1.1.2) + mini_portile2 (2.6.1) + minitest (5.14.4) + msgpack (1.4.2) multi_test (0.1.2) - mysql2 (0.5.2) + mysql2 (0.5.3) netrc (0.11.0) - nokogiri (1.10.5) - mini_portile2 (~> 2.4.0) + nio4r (2.5.8) + nokogiri (1.12.5) + mini_portile2 (~> 2.6.1) + racc (~> 1.4) pg (0.21.0) - public_suffix (3.0.3) - puma (3.12.0) - rack (1.6.11) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.2.11.1) - actionmailer (= 4.2.11.1) - actionpack (= 4.2.11.1) - actionview (= 4.2.11.1) - activejob (= 4.2.11.1) - activemodel (= 4.2.11.1) - activerecord (= 4.2.11.1) - activesupport (= 4.2.11.1) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.11.1) - sprockets-rails - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.9) - activesupport (>= 4.2.0, < 5.0) - nokogiri (~> 1.6) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.3.0) + public_suffix (4.0.6) + puma (4.3.10) + nio4r (~> 2.0) + racc (1.6.0) + rack (2.2.3) + rack-proxy (0.7.0) + rack + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.0.4.1) + actioncable (= 6.0.4.1) + actionmailbox (= 6.0.4.1) + actionmailer (= 6.0.4.1) + actionpack (= 6.0.4.1) + actiontext (= 6.0.4.1) + actionview (= 6.0.4.1) + activejob (= 6.0.4.1) + activemodel (= 6.0.4.1) + activerecord (= 6.0.4.1) + activestorage (= 6.0.4.1) + activesupport (= 6.0.4.1) + bundler (>= 1.3.0) + railties (= 6.0.4.1) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.5) + actionpack (>= 5.0.1.rc1) + actionview (>= 5.0.1.rc1) + activesupport (>= 5.0.1.rc1) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (4.2.11.1) - actionpack (= 4.2.11.1) - activesupport (= 4.2.11.1) + railties (6.0.4.1) + actionpack (= 6.0.4.1) + activesupport (= 6.0.4.1) + method_source rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (12.3.2) - rest-client (2.0.2) + thor (>= 0.20.3, < 2.0) + rake (13.0.6) + rb-fsevent (0.11.0) + rb-inotify (0.10.1) + ffi (~> 1.0) + regexp_parser (2.1.1) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.2) + rexml (3.2.5) + rspec-core (3.10.1) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-matchers-controller_filters (1.0.0) - rspec-rails (~> 3, >= 3.1) - rspec-mocks (3.8.0) + rspec-support (~> 3.10.0) + rspec-mocks (3.10.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-rails (3.8.1) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - rubyzip (1.3.0) - sass (3.4.25) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) - sass (~> 3.1) - sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) - selenium-webdriver (2.53.0) - childprocess (~> 0.5) - rubyzip (~> 1.0) - websocket (~> 1.0) - shoulda-matchers (3.1.2) - activesupport (>= 4.0.0) - simple_form (4.0.0) - actionpack (> 4) - activemodel (> 4) - spring (2.0.2) + rspec-support (~> 3.10.0) + rspec-rails (4.0.0.beta3) + actionpack (>= 4.2) activesupport (>= 4.2) - sprockets (3.7.2) + railties (>= 4.2) + rspec-core (~> 3.8) + rspec-expectations (~> 3.8) + rspec-mocks (~> 3.8) + rspec-support (~> 3.8) + rspec-support (3.10.3) + rubyzip (2.3.2) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.4.0) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + selenium-webdriver (4.0.3) + childprocess (>= 0.5, < 5.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2) + shoulda-matchers (4.4.1) + activesupport (>= 4.2.0) + simple_form (5.1.0) + actionpack (>= 5.2) + activemodel (>= 5.2) + sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.1) + sprockets-es6 (0.9.2) + babel-source (>= 5.8.11) + babel-transpiler + sprockets (>= 3.0.0) + sprockets-rails (3.2.2) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.3.13) + sqlite3 (1.4.2) + sys-uname (1.2.2) + ffi (~> 1.1) table_flipper (0.0.1) - thor (0.20.3) + thor (1.1.0) thread_safe (0.3.6) - tilt (2.0.9) - tzinfo (1.2.5) + tilt (2.0.10) + tzinfo (1.2.9) thread_safe (~> 0.1) - uglifier (4.1.20) - execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext - unf_ext (0.0.7.5) - web-console (2.3.0) - activemodel (>= 4.0) - binding_of_caller (>= 0.7.2) - railties (>= 4.0) - sprockets-rails (>= 2.0, < 4.0) - websocket (1.2.8) - xpath (2.1.0) - nokogiri (~> 1.3) + unf_ext (0.0.8) + web-console (4.1.0) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webdrivers (5.0.0) + nokogiri (~> 1.6) + rubyzip (>= 1.3.0) + selenium-webdriver (~> 4.0) + webpacker (4.3.0) + activesupport (>= 4.2) + rack-proxy (>= 0.6.1) + railties (>= 4.2) + webrick (1.7.0) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.5.1) PLATFORMS ruby DEPENDENCIES + bootsnap (>= 1.4.2) byebug capybara capybara-screenshot - capybara-webkit (= 1.14.0) cocoon - cucumber-core (= 1.4.0) - cucumber-rails (= 1.4.3) + cucumber-core + cucumber-rails database_cleaner factory_bot_rails font-awesome-rails - foundation-rails (~> 5.5.3.2) + foundation-rails + jbuilder (~> 2.7) jquery-rails kaminari libxml-ruby + liquid + listen (~> 3.2) mysql2 pg (~> 0.15) - puma - rails (~> 4.2.11) + puma (~> 4.1) + rails (~> 6.0.3, >= 6.0.3.4) + rails-controller-testing rest-client - rspec-matchers-controller_filters - rspec-rails (~> 3.6) - sass-rails (~> 5.0) - selenium-webdriver (= 2.53.0) - shoulda-matchers + rspec-rails (= 4.0.0.beta3) + sass-rails (>= 6) + selenium-webdriver + shoulda-matchers (= 4.4.1) simple_form - spring - sqlite3 + sqlite3 (~> 1.4) table_flipper - uglifier (>= 1.3.0) - web-console (~> 2.0) + tzinfo-data + web-console (>= 3.3.0) + webdrivers + webpacker (~> 4.0) + +RUBY VERSION + ruby 2.7.2p137 BUNDLED WITH - 1.17.3 + 2.1.4 diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000..5918193 --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css diff --git a/app/assets/images/duck-face-white.png b/app/assets/images/duck-face-white.png deleted file mode 100644 index ea06b54..0000000 Binary files a/app/assets/images/duck-face-white.png and /dev/null differ diff --git a/app/assets/images/duckrails.png b/app/assets/images/duckrails.png index 5fa1825..45a30f1 100644 Binary files a/app/assets/images/duckrails.png and b/app/assets/images/duckrails.png differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js deleted file mode 100644 index 3923f69..0000000 --- a/app/assets/javascripts/application.js +++ /dev/null @@ -1,6 +0,0 @@ -//= require jquery -//= require jquery_ujs -//= require foundation -//= require cocoon -//= require html.sortable.min -//= require_tree . diff --git a/app/assets/javascripts/base.js b/app/assets/javascripts/base.js deleted file mode 100644 index 21758df..0000000 --- a/app/assets/javascripts/base.js +++ /dev/null @@ -1,6 +0,0 @@ -$(function(){ - Foundation.global.namespace = ''; - $(document).foundation(); - - $('.sortable').sortable(); -}); diff --git a/app/assets/javascripts/home.js b/app/assets/javascripts/home.js deleted file mode 100644 index dee720f..0000000 --- a/app/assets/javascripts/home.js +++ /dev/null @@ -1,2 +0,0 @@ -// Place all the behaviors and hooks related to the matching controller here. -// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 3c0d85a..6d950f9 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -1,6 +1,6 @@ /* + *= require bootstrap *= require_tree ./common *= require_tree . *= require_self - //= require foundation_and_overrides */ diff --git a/app/assets/stylesheets/common/base.css.scss b/app/assets/stylesheets/common/base.css.scss index e7d8fc5..76c5e24 100644 --- a/app/assets/stylesheets/common/base.css.scss +++ b/app/assets/stylesheets/common/base.css.scss @@ -1,4 +1,3 @@ -@import 'foundation'; @import "font-awesome"; body { @@ -6,107 +5,27 @@ body { font-size: 15px; } -textarea { - resize: none; +.logo { + height: 100px; } -.body-content { - margin-top: 40px; -} - -.page-actions { - margin-top: 20px; -} - -span.version { - font-size: 10px !important; - color: #008CBA; -} - -ul.tabs { - .tab-title { - a { - outline: none; - color: #000; - - &.error { - color: #fff; - background: #FA5858; - text-decoration: underline; - } - } - - &.active { - a { - background: #CCC; - - &.error { - color: #fff; - background: #FF0000; - } - } - } +.navbar-brand { + .logo { + height: 25px; } } -.header-fields { - & + .header-fields { - padding-top: 10px; - margin-top: 10px; - border-top: 1px solid #ccc; +span { + &.version { + font-size: 10px; } } -.tabs dd > a, .tabs .tab-title > a{ - outline: none; +.subtitle { + font-weight: 14px; + color: #666; } -.field_with_hint { - margin-bottom: 10px; - - input, textarea, select { - margin-bottom: 0; - } - - small.error { - margin-bottom: 0; - } - - span.hint { - font-size: 12px; - float: right; - color: #777; - } -} - -pre { - font-family: inherit; -} - -div.footer { - margin-top: 80px; - border-top: 4px solid #f0f0f0; - color: #888; - padding: 20px 0; - text-align: center; - font-size: 14px; - - p { - margin-bottom: 5px; - font-size: 14px; - } -} - -.checkbox-wrapper { - padding-top: 8px; - - input { - margin-right: 10px; - } - - span { - &.hint { - margin-top: 8px; - } - } +.form-control.is-valid { + background-image: none; } diff --git a/app/assets/stylesheets/common/footer.css.scss b/app/assets/stylesheets/common/footer.css.scss new file mode 100644 index 0000000..6195cb3 --- /dev/null +++ b/app/assets/stylesheets/common/footer.css.scss @@ -0,0 +1,4 @@ +.footer { + margin-top: 100px; + color: #666; +} diff --git a/app/assets/stylesheets/foundation_and_overrides.scss b/app/assets/stylesheets/foundation_and_overrides.scss deleted file mode 100644 index c52ade3..0000000 --- a/app/assets/stylesheets/foundation_and_overrides.scss +++ /dev/null @@ -1,1491 +0,0 @@ -// Foundation by ZURB -// foundation.zurb.com -// Licensed under MIT Open Source - -// - -// Table of Contents -// Foundation Settings - -// a. Base -// b. Grid -// c. Global -// d. Media Query Ranges -// e. Typography -// 01. Accordion -// 02. Alert Boxes -// 03. Block Grid -// 04. Breadcrumbs -// 05. Buttons -// 06. Button Groups -// 07. Clearing -// 08. Dropdown -// 09. Dropdown Buttons -// 10. Flex Video -// 11. Forms -// 12. Icon Bar -// 13. Inline Lists -// 14. Joyride -// 15. Keystrokes -// 16. Labels -// 17. Magellan -// 18. Off-canvas -// 19. Orbit -// 20. Pagination -// 21. Panels -// 22. Pricing Tables -// 23. Progress Bar -// 24. Range Slider -// 25. Reveal -// 26. Side Nav -// 27. Split Buttons -// 28. Sub Nav -// 29. Switch -// 30. Tables -// 31. Tabs -// 32. Thumbnails -// 33. Tooltips -// 34. Top Bar -// 36. Visibility Classes - -// a. Base -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// This is the default html and body font-size for the base rem value. -// $rem-base: 16px; - -// Allows the use of rem-calc() or lower-bound() in your settings -@import 'foundation/functions'; - -// The default font-size is set to 100% of the browser style sheet (usually 16px) -// for compatibility with browser-based text zoom or user-set defaults. - -// Since the typical default browser font-size is 16px, that makes the calculation for grid size. -// If you want your base font-size to be different and not have it affect the grid breakpoints, -// set $rem-base to $base-font-size and make sure $base-font-size is a px value. -// $base-font-size: 100%; - -// The $base-font-size is 100% while $base-line-height is 150% -// $base-line-height: 150%; - -// We use this to control whether or not CSS classes come through in the gem files. -$include-html-classes: true; -// $include-print-styles: true; -$include-html-global-classes: $include-html-classes; - -// b. Grid -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-grid-classes: $include-html-classes; -// $include-xl-html-grid-classes: false; - -// $row-width: rem-calc(1000); -// $total-columns: 12; -// $column-gutter: rem-calc(30); - -// c. Global -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// We use these to define default font stacks -// $font-family-sans-serif: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; -// $font-family-serif: Georgia, Cambria, "Times New Roman", Times, serif; -// $font-family-monospace: Consolas, "Liberation Mono", Courier, monospace; - -// We use these to define default font weights -// $font-weight-normal: normal; -// $font-weight-bold: bold; - -// $white : #FFFFFF; -// $ghost : #FAFAFA; -// $snow : #F9F9F9; -// $vapor : #F6F6F6; -// $white-smoke : #F5F5F5; -// $silver : #EFEFEF; -// $smoke : #EEEEEE; -// $gainsboro : #DDDDDD; -// $iron : #CCCCCC; -// $base : #AAAAAA; -// $aluminum : #999999; -// $jumbo : #888888; -// $monsoon : #777777; -// $steel : #666666; -// $charcoal : #555555; -// $tuatara : #444444; -// $oil : #333333; -// $jet : #222222; -// $black : #000000; - -// We use these as default colors throughout -// $primary-color: #008CBA; -// $secondary-color: #e7e7e7; -// $alert-color: #f04124; -// $success-color: #43AC6A; -// $warning-color: #f08a24; -// $info-color: #a0d3e8; - -// We use these to control various global styles -// $body-bg: $white; -// $body-font-color: $jet; -// $body-font-family: $font-family-sans-serif; -// $body-font-weight: $font-weight-normal; -// $body-font-style: normal; - -// We use this to control font-smoothing -// $font-smoothing: antialiased; - -// We use these to control text direction settings -// $text-direction: ltr; -// $opposite-direction: right; -// $default-float: left; -// $last-child-float: $opposite-direction; - -// We use these to make sure border radius matches unless we want it different. -// $global-radius: 3px; -// $global-rounded: 1000px; - -// We use these to control inset shadow shiny edges and depressions. -// $shiny-edge-size: 0 1px 0; -// $shiny-edge-color: rgba($white, .5); -// $shiny-edge-active-color: rgba($black, .2); - -// d. Media Query Ranges -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $small-breakpoint: em-calc(640); -// $medium-breakpoint: em-calc(1024); -// $large-breakpoint: em-calc(1440); -// $xlarge-breakpoint: em-calc(1920); - -// $small-range: (0, $small-breakpoint); -// $medium-range: ($small-breakpoint + em-calc(1), $medium-breakpoint); -// $large-range: ($medium-breakpoint + em-calc(1), $large-breakpoint); -// $xlarge-range: ($large-breakpoint + em-calc(1), $xlarge-breakpoint); -// $xxlarge-range: ($xlarge-breakpoint + em-calc(1), em-calc(99999999)); - -// $screen: "only screen"; - -// $landscape: "#{$screen} and (orientation: landscape)"; -// $portrait: "#{$screen} and (orientation: portrait)"; - -// $small-up: $screen; -// $small-only: "#{$screen} and (max-width: #{upper-bound($small-range)})"; - -// $medium-up: "#{$screen} and (min-width:#{lower-bound($medium-range)})"; -// $medium-only: "#{$screen} and (min-width:#{lower-bound($medium-range)}) and (max-width:#{upper-bound($medium-range)})"; - -// $large-up: "#{$screen} and (min-width:#{lower-bound($large-range)})"; -// $large-only: "#{$screen} and (min-width:#{lower-bound($large-range)}) and (max-width:#{upper-bound($large-range)})"; - -// $xlarge-up: "#{$screen} and (min-width:#{lower-bound($xlarge-range)})"; -// $xlarge-only: "#{$screen} and (min-width:#{lower-bound($xlarge-range)}) and (max-width:#{upper-bound($xlarge-range)})"; - -// $xxlarge-up: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)})"; -// $xxlarge-only: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)}) and (max-width:#{upper-bound($xxlarge-range)})"; - -// $retina: ( -// "#{$screen} and (-webkit-min-device-pixel-ratio: 2)", -// "#{$screen} and (min--moz-device-pixel-ratio: 2)", -// "#{$screen} and (-o-min-device-pixel-ratio: 2/1)", -// "#{$screen} and (min-device-pixel-ratio: 2)", -// "#{$screen} and (min-resolution: 192dpi)", -// "#{$screen} and (min-resolution: 2dppx)" -// ); - -// Legacy -// $small: $medium-up; -// $medium: $medium-up; -// $large: $large-up; - -// We use this as cursors values for enabling the option of having custom cursors in the whole site's stylesheet -// $cursor-crosshair-value: crosshair; -// $cursor-default-value: default; -// $cursor-disabled-value: not-allowed; -// $cursor-pointer-value: pointer; -// $cursor-help-value: help; -// $cursor-text-value: text; - -// e. Typography -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-type-classes: $include-html-classes; - -// We use these to control header font styles -// $header-font-family: $body-font-family; -// $header-font-weight: $font-weight-normal; -// $header-font-style: normal; -// $header-font-color: $jet; -// $header-line-height: 1.4; -// $header-top-margin: .2rem; -// $header-bottom-margin: .5rem; -// $header-text-rendering: optimizeLegibility; - -// We use these to control header font sizes -// $h1-font-size: rem-calc(44); -// $h2-font-size: rem-calc(37); -// $h3-font-size: rem-calc(27); -// $h4-font-size: rem-calc(23); -// $h5-font-size: rem-calc(18); -// $h6-font-size: 1rem; - -// We use these to control header size reduction on small screens -// $h1-font-reduction: rem-calc(10); -// $h2-font-reduction: rem-calc(10); -// $h3-font-reduction: rem-calc(5); -// $h4-font-reduction: rem-calc(5); -// $h5-font-reduction: 0; -// $h6-font-reduction: 0; - -// These control how subheaders are styled. -// $subheader-line-height: 1.4; -// $subheader-font-color: scale-color($header-font-color, $lightness: 35%); -// $subheader-font-weight: $font-weight-normal; -// $subheader-top-margin: .2rem; -// $subheader-bottom-margin: .5rem; - -// A general styling -// $small-font-size: 60%; -// $small-font-color: scale-color($header-font-color, $lightness: 35%); - -// We use these to style paragraphs -// $paragraph-font-family: inherit; -// $paragraph-font-weight: $font-weight-normal; -// $paragraph-font-size: 1rem; -// $paragraph-line-height: 1.6; -// $paragraph-margin-bottom: rem-calc(20); -// $paragraph-aside-font-size: rem-calc(14); -// $paragraph-aside-line-height: 1.35; -// $paragraph-aside-font-style: italic; -// $paragraph-text-rendering: optimizeLegibility; - -// We use these to style tags -// $code-color: $oil; -// $code-font-family: $font-family-monospace; -// $code-font-weight: $font-weight-normal; -// $code-background-color: scale-color($secondary-color, $lightness: 70%); -// $code-border-size: 1px; -// $code-border-style: solid; -// $code-border-color: scale-color($code-background-color, $lightness: -10%); -// $code-padding: rem-calc(2) rem-calc(5) rem-calc(1); - -// We use these to style anchors -// $anchor-text-decoration: none; -// $anchor-text-decoration-hover: none; -// $anchor-font-color: $primary-color; -// $anchor-font-color-hover: scale-color($anchor-font-color, $lightness: -14%); - -// We use these to style the
element -// $hr-border-width: 1px; -// $hr-border-style: solid; -// $hr-border-color: $gainsboro; -// $hr-margin: rem-calc(20); - -// We use these to style lists -// $list-font-family: $paragraph-font-family; -// $list-font-size: $paragraph-font-size; -// $list-line-height: $paragraph-line-height; -// $list-margin-bottom: $paragraph-margin-bottom; -// $list-style-position: outside; -// $list-side-margin: 1.1rem; -// $list-ordered-side-margin: 1.4rem; -// $list-side-margin-no-bullet: 0; -// $list-nested-margin: rem-calc(20); -// $definition-list-header-weight: $font-weight-bold; -// $definition-list-header-margin-bottom: .3rem; -// $definition-list-margin-bottom: rem-calc(12); - -// We use these to style blockquotes -// $blockquote-font-color: scale-color($header-font-color, $lightness: 35%); -// $blockquote-padding: rem-calc(9 20 0 19); -// $blockquote-border: 1px solid $gainsboro; -// $blockquote-cite-font-size: rem-calc(13); -// $blockquote-cite-font-color: scale-color($header-font-color, $lightness: 23%); -// $blockquote-cite-link-color: $blockquote-cite-font-color; - -// Acronym styles -// $acronym-underline: 1px dotted $gainsboro; - -// We use these to control padding and margin -// $microformat-padding: rem-calc(10 12); -// $microformat-margin: rem-calc(0 0 20 0); - -// We use these to control the border styles -// $microformat-border-width: 1px; -// $microformat-border-style: solid; -// $microformat-border-color: $gainsboro; - -// We use these to control full name font styles -// $microformat-fullname-font-weight: $font-weight-bold; -// $microformat-fullname-font-size: rem-calc(15); - -// We use this to control the summary font styles -// $microformat-summary-font-weight: $font-weight-bold; - -// We use this to control abbr padding -// $microformat-abbr-padding: rem-calc(0 1); - -// We use this to control abbr font styles -// $microformat-abbr-font-weight: $font-weight-bold; -// $microformat-abbr-font-decoration: none; - -// 01. Accordion -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-accordion-classes: $include-html-classes; - -// $accordion-navigation-padding: rem-calc(16); -// $accordion-navigation-bg-color: $silver; -// $accordion-navigation-hover-bg-color: scale-color($accordion-navigation-bg-color, $lightness: -5%); -// $accordion-navigation-active-bg-color: scale-color($accordion-navigation-bg-color, $lightness: -3%); -// $accordion-navigation-active-font-color: $jet; -// $accordion-navigation-font-color: $jet; -// $accordion-navigation-font-size: rem-calc(16); -// $accordion-navigation-font-family: $body-font-family; - -// $accordion-content-padding: ($column-gutter/2); -// $accordion-content-active-bg-color: $white; - -// 02. Alert Boxes -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-alert-classes: $include-html-classes; - -// We use this to control alert padding. -// $alert-padding-top: rem-calc(14); -// $alert-padding-default-float: $alert-padding-top; -// $alert-padding-opposite-direction: $alert-padding-top + rem-calc(10); -// $alert-padding-bottom: $alert-padding-top; - -// We use these to control text style. -// $alert-font-weight: $font-weight-normal; -// $alert-font-size: rem-calc(13); -// $alert-font-color: $white; -// $alert-font-color-alt: scale-color($secondary-color, $lightness: -66%); - -// We use this for close hover effect. -// $alert-function-factor: -14%; - -// We use these to control border styles. -// $alert-border-style: solid; -// $alert-border-width: 1px; -// $alert-border-color: scale-color($primary-color, $lightness: $alert-function-factor); -// $alert-bottom-margin: rem-calc(20); - -// We use these to style the close buttons -// $alert-close-color: $oil; -// $alert-close-top: 50%; -// $alert-close-position: rem-calc(4); -// $alert-close-font-size: rem-calc(22); -// $alert-close-opacity: .3; -// $alert-close-opacity-hover: .5; -// $alert-close-padding: 9px 6px 4px; -// $alert-close-background: inherit; - -// We use this to control border radius -// $alert-radius: $global-radius; - -// $alert-transition-speed: 300ms; -// $alert-transition-ease: ease-out; - -// 03. Block Grid -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-block-grid-classes: $include-html-classes; -// $include-xl-html-block-grid-classes: false; - -// We use this to control the maximum number of block grid elements per row -// $block-grid-elements: 12; -// $block-grid-default-spacing: rem-calc(20); - -// $align-block-grid-to-grid: false; -// @if $align-block-grid-to-grid {$block-grid-default-spacing: $column-gutter;} - -// Enables media queries for block-grid classes. Set to false if writing semantic HTML. -// $block-grid-media-queries: true; - -// 04. Breadcrumbs -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-nav-classes: $include-html-classes; - -// We use this to set the background color for the breadcrumb container. -// $crumb-bg: scale-color($secondary-color, $lightness: 55%); - -// We use these to set the padding around the breadcrumbs. -// $crumb-padding: rem-calc(9 14 9); -// $crumb-side-padding: rem-calc(12); - -// We use these to control border styles. -// $crumb-function-factor: -10%; -// $crumb-border-size: 1px; -// $crumb-border-style: solid; -// $crumb-border-color: scale-color($crumb-bg, $lightness: $crumb-function-factor); -// $crumb-radius: $global-radius; - -// We use these to set various text styles for breadcrumbs. -// $crumb-font-size: rem-calc(11); -// $crumb-font-color: $primary-color; -// $crumb-font-color-current: $oil; -// $crumb-font-color-unavailable: $aluminum; -// $crumb-font-transform: uppercase; -// $crumb-link-decor: underline; - -// We use these to control the slash between breadcrumbs -// $crumb-slash-color: $base; -// $crumb-slash: "/"; -// $crumb-slash-position: 1px; - -// 05. Buttons -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-button-classes: $include-html-classes; - -// We use these to build padding for buttons. -// $button-tny: rem-calc(10); -// $button-sml: rem-calc(14); -// $button-med: rem-calc(16); -// $button-lrg: rem-calc(18); - -// We use this to control the display property. -// $button-display: inline-block; -// $button-margin-bottom: rem-calc(20); - -// We use these to control button text styles. -// $button-font-family: $body-font-family; -// $button-font-color: $white; -// $button-font-color-alt: $oil; -// $button-font-tny: rem-calc(11); -// $button-font-sml: rem-calc(13); -// $button-font-med: rem-calc(16); -// $button-font-lrg: rem-calc(20); -// $button-font-weight: $font-weight-normal; -// $button-font-align: center; - -// We use these to control various hover effects. -// $button-function-factor: -20%; - -// We use these to control button border styles. -// $button-border-width: 0; -// $button-border-style: solid; -// $button-bg-color: $primary-color; -// $button-bg-hover: scale-color($button-bg-color, $lightness: $button-function-factor); -// $button-border-color: $button-bg-hover; -// $secondary-button-bg-hover: scale-color($secondary-color, $lightness: $button-function-factor); -// $secondary-button-border-color: $secondary-button-bg-hover; -// $success-button-bg-hover: scale-color($success-color, $lightness: $button-function-factor); -// $success-button-border-color: $success-button-bg-hover; -// $alert-button-bg-hover: scale-color($alert-color, $lightness: $button-function-factor); -// $alert-button-border-color: $alert-button-bg-hover; -// $warning-button-bg-hover: scale-color($warning-color, $lightness: $button-function-factor); -// $warning-button-border-color: $warning-button-bg-hover; -// $info-button-bg-hover: scale-color($info-color, $lightness: $button-function-factor); -// $info-button-border-color: $info-button-bg-hover; - -// We use this to set the default radius used throughout the core. -// $button-radius: $global-radius; -// $button-round: $global-rounded; - -// We use this to set default opacity and cursor for disabled buttons. -// $button-disabled-opacity: .7; -// $button-disabled-cursor: $cursor-default-value; - -// 06. Button Groups -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-button-classes: $include-html-classes; - -// Sets the margin for the right side by default, and the left margin if right-to-left direction is used -// $button-bar-margin-opposite: rem-calc(10); -// $button-group-border-width: 1px; - -// 07. Clearing -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-clearing-classes: $include-html-classes; - -// We use these to set the background colors for parts of Clearing. -// $clearing-bg: $oil; -// $clearing-caption-bg: $clearing-bg; -// $clearing-carousel-bg: rgba(51,51,51,0.8); -// $clearing-img-bg: $clearing-bg; - -// We use these to style the close button -// $clearing-close-color: $iron; -// $clearing-close-size: 30px; - -// We use these to style the arrows -// $clearing-arrow-size: 12px; -// $clearing-arrow-color: $clearing-close-color; - -// We use these to style captions -// $clearing-caption-font-color: $iron; -// $clearing-caption-font-size: .875em; -// $clearing-caption-padding: 10px 30px 20px; - -// We use these to make the image and carousel height and style -// $clearing-active-img-height: 85%; -// $clearing-carousel-height: 120px; -// $clearing-carousel-thumb-width: 120px; -// $clearing-carousel-thumb-active-border: 1px solid rgb(255,255,255); - -// 08. Dropdown -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-dropdown-classes: $include-html-classes; - -// We use these to controls height and width styles. -// $f-dropdown-max-width: 200px; -// $f-dropdown-height: auto; -// $f-dropdown-max-height: none; - -// Used for bottom position -// $f-dropdown-margin-top: 2px; - -// Used for right position -// $f-dropdown-margin-left: $f-dropdown-margin-top; - -// Used for left position -// $f-dropdown-margin-right: $f-dropdown-margin-top; - -// Used for top position -// $f-dropdown-margin-bottom: $f-dropdown-margin-top; - -// We use this to control the background color -// $f-dropdown-bg: $white; - -// We use this to set the border styles for dropdowns. -// $f-dropdown-border-style: solid; -// $f-dropdown-border-width: 1px; -// $f-dropdown-border-color: scale-color($white, $lightness: -20%); - -// We use these to style the triangle pip. -// $f-dropdown-triangle-size: 6px; -// $f-dropdown-triangle-color: $white; -// $f-dropdown-triangle-side-offset: 10px; - -// We use these to control styles for the list elements. -// $f-dropdown-list-style: none; -// $f-dropdown-font-color: $charcoal; -// $f-dropdown-font-size: rem-calc(14); -// $f-dropdown-list-padding: rem-calc(5, 10); -// $f-dropdown-line-height: rem-calc(18); -// $f-dropdown-list-hover-bg: $smoke; -// $dropdown-mobile-default-float: 0; - -// We use this to control the styles for when the dropdown has custom content. -// $f-dropdown-content-padding: rem-calc(20); - -// Default radius for dropdown. -// $f-dropdown-radius: $global-radius; - - -// 09. Dropdown Buttons -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-button-classes: $include-html-classes; - -// We use these to set the color of the pip in dropdown buttons -// $dropdown-button-pip-color: $white; -// $dropdown-button-pip-color-alt: $oil; - -// We use these to set the size of the pip in dropdown buttons -// $button-pip-tny: rem-calc(6); -// $button-pip-sml: rem-calc(7); -// $button-pip-med: rem-calc(9); -// $button-pip-lrg: rem-calc(11); - -// We use these to style tiny dropdown buttons -// $dropdown-button-padding-tny: $button-pip-tny * 7; -// $dropdown-button-pip-size-tny: $button-pip-tny; -// $dropdown-button-pip-opposite-tny: $button-pip-tny * 3; -// $dropdown-button-pip-top-tny: (-$button-pip-tny / 2) + rem-calc(1); - -// We use these to style small dropdown buttons -// $dropdown-button-padding-sml: $button-pip-sml * 7; -// $dropdown-button-pip-size-sml: $button-pip-sml; -// $dropdown-button-pip-opposite-sml: $button-pip-sml * 3; -// $dropdown-button-pip-top-sml: (-$button-pip-sml / 2) + rem-calc(1); - -// We use these to style medium dropdown buttons -// $dropdown-button-padding-med: $button-pip-med * 6 + rem-calc(3); -// $dropdown-button-pip-size-med: $button-pip-med - rem-calc(3); -// $dropdown-button-pip-opposite-med: $button-pip-med * 2.5; -// $dropdown-button-pip-top-med: (-$button-pip-med / 2) + rem-calc(2); - -// We use these to style large dropdown buttons -// $dropdown-button-padding-lrg: $button-pip-lrg * 5 + rem-calc(3); -// $dropdown-button-pip-size-lrg: $button-pip-lrg - rem-calc(6); -// $dropdown-button-pip-opposite-lrg: $button-pip-lrg * 2.5; -// $dropdown-button-pip-top-lrg: (-$button-pip-lrg / 2) + rem-calc(3); - -// 10. Flex Video -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-media-classes: $include-html-classes; - -// We use these to control video container padding and margins -// $flex-video-padding-top: rem-calc(25); -// $flex-video-padding-bottom: 67.5%; -// $flex-video-margin-bottom: rem-calc(16); - -// We use this to control widescreen bottom padding -// $flex-video-widescreen-padding-bottom: 56.34%; - -// 11. Forms -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-form-classes: $include-html-classes; - -// We use this to set the base for lots of form spacing and positioning styles -// $form-spacing: rem-calc(16); - -// We use these to style the labels in different ways -// $form-label-pointer: pointer; -// $form-label-font-size: rem-calc(14); -// $form-label-font-weight: $font-weight-normal; -// $form-label-line-height: 1.5; -// $form-label-font-color: scale-color($black, $lightness: 30%); -// $form-label-small-transform: capitalize; -// $form-label-bottom-margin: 0; -// $input-font-family: inherit; -// $input-font-color: rgba(0,0,0,0.75); -// $input-font-size: rem-calc(14); -// $input-placeholder-font-color: #cccccc; -// $input-bg-color: $white; -// $input-focus-bg-color: scale-color($white, $lightness: -2%); -// $input-border-color: scale-color($white, $lightness: -20%); -// $input-focus-border-color: scale-color($white, $lightness: -40%); -// $input-border-style: solid; -// $input-border-width: 1px; -// $input-border-radius: $global-radius; -// $input-disabled-bg: $gainsboro; -// $input-disabled-cursor: $cursor-default-value; -// $input-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); -// $input-include-glowing-effect: false; - -// We use these to style the fieldset border and spacing. -// $fieldset-border-style: solid; -// $fieldset-border-width: 1px; -// $fieldset-border-color: $gainsboro; -// $fieldset-padding: rem-calc(20); -// $fieldset-margin: rem-calc(18 0); - -// We use these to style the legends when you use them -// $legend-bg: $white; -// $legend-font-weight: $font-weight-bold; -// $legend-padding: rem-calc(0 3); - -// We use these to style the prefix and postfix input elements -// $input-prefix-bg: scale-color($white, $lightness: -5%); -// $input-prefix-border-color: scale-color($white, $lightness: -20%); -// $input-prefix-border-size: 1px; -// $input-prefix-border-type: solid; -// $input-prefix-overflow: hidden; -// $input-prefix-font-color: $oil; -// $input-prefix-font-color-alt: $white; - -// We use this setting to turn on/off HTML5 number spinners (the up/down arrows) -// $input-number-spinners: true; - -// We use these to style the error states for inputs and labels -// $input-error-message-padding: rem-calc(6 9 9); -// $input-error-message-top: -1px; -// $input-error-message-font-size: rem-calc(12); -// $input-error-message-font-weight: $font-weight-normal; -// $input-error-message-font-style: italic; -// $input-error-message-font-color: $white; -// $input-error-message-bg-color: $alert-color; -// $input-error-message-font-color-alt: $oil; - -// We use this to style the glowing effect of inputs when focused -// $glowing-effect-fade-time: .45s; -// $glowing-effect-color: $input-focus-border-color; - -// We use this to style the transition when inputs are focused and when the glowing effect is disabled. -// $input-transition-fade-time: 0.15s; -// $input-transition-fade-timing-function: linear; - -// Select variables -// $select-bg-color: $ghost; -// $select-hover-bg-color: scale-color($select-bg-color, $lightness: -3%); - - -// 12. Icon Bar -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// We use these to style the icon-bar and items -// $icon-bar-bg: $oil; -// $icon-bar-font-color: $white; -// $icon-bar-font-color-hover: $icon-bar-font-color; -// $icon-bar-font-size: 1rem; -// $icon-bar-hover-color: $primary-color; -// $icon-bar-icon-color: $white; -// $icon-bar-icon-color-hover: $icon-bar-icon-color; -// $icon-bar-icon-size: 1.875rem; -// $icon-bar-image-width: 1.875rem; -// $icon-bar-image-height: 1.875rem; -// $icon-bar-active-color: $primary-color; -// $icon-bar-item-padding: 1.25rem; - -// We use this to set default opacity and cursor for disabled icons. -// $icon-bar-disabled-opacity: .7; - -// 13. Inline Lists -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-inline-list-classes: $include-html-classes; - -// We use this to control the margins and padding of the inline list. -// $inline-list-top-margin: 0; -// $inline-list-opposite-margin: 0; -// $inline-list-bottom-margin: rem-calc(17); -// $inline-list-default-float-margin: rem-calc(-22); -// $inline-list-default-float-list-margin: rem-calc(22); - -// $inline-list-padding: 0; - -// We use this to control the overflow of the inline list. -// $inline-list-overflow: hidden; - -// We use this to control the list items -// $inline-list-display: block; - -// We use this to control any elements within list items -// $inline-list-children-display: block; - -// 14. Joyride -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-joyride-classes: $include-html-classes; - -// Controlling default Joyride styles -// $joyride-tip-bg: $oil; -// $joyride-tip-default-width: 300px; -// $joyride-tip-padding: rem-calc(18 20 24); -// $joyride-tip-border: solid 1px $charcoal; -// $joyride-tip-radius: 4px; -// $joyride-tip-position-offset: 22px; - -// Here, we're setting the tip font styles -// $joyride-tip-font-color: $white; -// $joyride-tip-font-size: rem-calc(14); -// $joyride-tip-header-weight: $font-weight-bold; - -// This changes the nub size -// $joyride-tip-nub-size: 10px; - -// This adjusts the styles for the timer when its enabled -// $joyride-tip-timer-width: 50px; -// $joyride-tip-timer-height: 3px; -// $joyride-tip-timer-color: $steel; - -// This changes up the styles for the close button -// $joyride-tip-close-color: $monsoon; -// $joyride-tip-close-size: 24px; -// $joyride-tip-close-weight: $font-weight-normal; - -// When Joyride is filling the screen, we use this style for the bg -// $joyride-screenfill: rgba(0,0,0,0.5); - -// 15. Keystrokes -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-keystroke-classes: $include-html-classes; - -// We use these to control text styles. -// $keystroke-font: "Consolas", "Menlo", "Courier", monospace; -// $keystroke-font-size: inherit; -// $keystroke-font-color: $jet; -// $keystroke-font-color-alt: $white; -// $keystroke-function-factor: -7%; - -// We use this to control keystroke padding. -// $keystroke-padding: rem-calc(2 4 0); - -// We use these to control background and border styles. -// $keystroke-bg: scale-color($white, $lightness: $keystroke-function-factor); -// $keystroke-border-style: solid; -// $keystroke-border-width: 1px; -// $keystroke-border-color: scale-color($keystroke-bg, $lightness: $keystroke-function-factor); -// $keystroke-radius: $global-radius; - -// 16. Labels -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-label-classes: $include-html-classes; - -// We use these to style the labels -// $label-padding: rem-calc(4 8 4); -// $label-radius: $global-radius; - -// We use these to style the label text -// $label-font-sizing: rem-calc(11); -// $label-font-weight: $font-weight-normal; -// $label-font-color: $oil; -// $label-font-color-alt: $white; -// $label-font-family: $body-font-family; - -// 17. Magellan -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-magellan-classes: $include-html-classes; - -// $magellan-bg: $white; -// $magellan-padding: 10px; - -// 18. Off-canvas -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// Off Canvas Tab Bar Variables -// $include-html-off-canvas-classes: $include-html-classes; - -// $tabbar-bg: $oil; -// $tabbar-height: rem-calc(45); -// $tabbar-icon-width: $tabbar-height; -// $tabbar-line-height: $tabbar-height; -// $tabbar-color: $white; -// $tabbar-middle-padding: 0 rem-calc(10); - -// Off Canvas Divider Styles -// $tabbar-left-section-border: solid 1px scale-color($tabbar-bg, $lightness: -50%); -// $tabbar-right-section-border: $tabbar-left-section-border; - - -// Off Canvas Tab Bar Headers -// $tabbar-header-color: $white; -// $tabbar-header-weight: $font-weight-bold; -// $tabbar-header-line-height: $tabbar-height; -// $tabbar-header-margin: 0; - -// Off Canvas Menu Variables -// $off-canvas-width: rem-calc(250); -// $off-canvas-bg: $oil; -// $off-canvas-bg-hover: scale-color($tabbar-bg, $lightness: -30%); -// $off-canvas-bg-active: scale-color($tabbar-bg, $lightness: -30%); - -// Off Canvas Menu List Variables -// $off-canvas-label-padding: .3rem rem-calc(15); -// $off-canvas-label-color: $aluminum; -// $off-canvas-label-text-transform: uppercase; -// $off-canvas-label-font-size: rem-calc(12); -// $off-canvas-label-font-weight: $font-weight-bold; -// $off-canvas-label-bg: $tuatara; -// $off-canvas-label-border-top: 1px solid scale-color($off-canvas-label-bg, $lightness: 14%); -// $off-canvas-label-border-bottom: none; -// $off-canvas-label-margin:0; -// $off-canvas-link-padding: rem-calc(10, 15); -// $off-canvas-link-color: rgba($white, .7); -// $off-canvas-link-border-bottom: 1px solid scale-color($off-canvas-bg, $lightness: -25%); -// $off-canvas-back-bg: #444; -// $off-canvas-back-border-top: $off-canvas-label-border-top; -// $off-canvas-back-border-bottom: $off-canvas-label-border-bottom; -// $off-canvas-back-hover-bg: scale-color($off-canvas-back-bg, $lightness: -30%); -// $off-canvas-back-hover-border-top: 1px solid scale-color($off-canvas-label-bg, $lightness: 14%); -// $off-canvas-back-hover-border-bottom: none; - -// Off Canvas Menu Icon Variables -// $tabbar-menu-icon-color: $white; -// $tabbar-menu-icon-hover: scale-color($tabbar-menu-icon-color, $lightness: -30%); - -// $tabbar-menu-icon-text-indent: rem-calc(35); -// $tabbar-menu-icon-width: $tabbar-icon-width; -// $tabbar-menu-icon-height: $tabbar-height; -// $tabbar-menu-icon-padding: 0; - -// $tabbar-hamburger-icon-width: rem-calc(16); -// $tabbar-hamburger-icon-left: false; -// $tabbar-hamburger-icon-top: false; -// $tabbar-hamburger-icon-thickness: 1px; -// $tabbar-hamburger-icon-gap: 6px; - -// Off Canvas Back-Link Overlay -// $off-canvas-overlay-transition: background 300ms ease; -// $off-canvas-overlay-cursor: pointer; -// $off-canvas-overlay-box-shadow: -4px 0 4px rgba($black, .5), 4px 0 4px rgba($black, .5); -// $off-canvas-overlay-background: rgba($white, .2); -// $off-canvas-overlay-background-hover: rgba($white, .05); - -// Transition Variables -// $menu-slide: "transform 500ms ease"; - -// 19. Orbit -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-orbit-classes: $include-html-classes; - -// We use these to control the caption styles -// $orbit-container-bg: none; -// $orbit-caption-bg: rgba(51,51,51, .8); -// $orbit-caption-font-color: $white; -// $orbit-caption-font-size: rem-calc(14); -// $orbit-caption-position: "bottom"; // Supported values: "bottom", "under" -// $orbit-caption-padding: rem-calc(10 14); -// $orbit-caption-height: auto; - -// We use these to control the left/right nav styles -// $orbit-nav-bg: transparent; -// $orbit-nav-bg-hover: rgba(0,0,0,0.3); -// $orbit-nav-arrow-color: $white; -// $orbit-nav-arrow-color-hover: $white; - -// We use these to control the timer styles -// $orbit-timer-bg: rgba(255,255,255,0.3); -// $orbit-timer-show-progress-bar: true; - -// We use these to control the bullet nav styles -// $orbit-bullet-nav-color: $iron; -// $orbit-bullet-nav-color-active: $aluminum; -// $orbit-bullet-radius: rem-calc(9); - -// We use these to controls the style of slide numbers -// $orbit-slide-number-bg: rgba(0,0,0,0); -// $orbit-slide-number-font-color: $white; -// $orbit-slide-number-padding: rem-calc(5); - -// Graceful Loading Wrapper and preloader -// $wrapper-class: "slideshow-wrapper"; -// $preloader-class: "preloader"; - -// Hide controls on small -// $orbit-nav-hide-for-small: true; -// $orbit-bullet-hide-for-small: true; -// $orbit-timer-hide-for-small: true; - -// 20. Pagination -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-pagination-classes: $include-html-classes; - -// We use these to control the pagination container -// $pagination-height: rem-calc(24); -// $pagination-margin: rem-calc(-5); - -// We use these to set the list-item properties -// $pagination-li-float: $default-float; -// $pagination-li-height: rem-calc(24); -// $pagination-li-font-color: $jet; -// $pagination-li-font-size: rem-calc(14); -// $pagination-li-margin: rem-calc(5); - -// We use these for the pagination anchor links -// $pagination-link-pad: rem-calc(1 10 1); -// $pagination-link-font-color: $aluminum; -// $pagination-link-active-bg: scale-color($white, $lightness: -10%); - -// We use these for disabled anchor links -// $pagination-link-unavailable-cursor: default; -// $pagination-link-unavailable-font-color: $aluminum; -// $pagination-link-unavailable-bg-active: transparent; - -// We use these for currently selected anchor links -// $pagination-link-current-background: $primary-color; -// $pagination-link-current-font-color: $white; -// $pagination-link-current-font-weight: $font-weight-bold; -// $pagination-link-current-cursor: default; -// $pagination-link-current-active-bg: $primary-color; - -// 21. Panels -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-panel-classes: $include-html-classes; - -// We use these to control the background and border styles -// $panel-bg: scale-color($white, $lightness: -5%); -// $panel-border-style: solid; -// $panel-border-size: 1px; -// $callout-panel-bg: scale-color($primary-color, $lightness: 94%); - -// We use this % to control how much we darken things on hover -// $panel-border-color: scale-color($panel-bg, $lightness: -11%); - -// We use these to set default inner padding and bottom margin -// $panel-margin-bottom: rem-calc(20); -// $panel-padding: rem-calc(20); - -// We use these to set default font colors -// $panel-font-color: $oil; -// $panel-font-color-alt: $white; - -// $panel-header-adjust: true; -// $callout-panel-link-color: $primary-color; -// $callout-panel-link-color-hover: scale-color($callout-panel-link-color, $lightness: -14%); - -// 22. Pricing Tables -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-pricing-classes: $include-html-classes; - -// We use this to control the border color -// $price-table-border: solid 1px $gainsboro; - -// We use this to control the bottom margin of the pricing table -// $price-table-margin-bottom: rem-calc(20); - -// We use these to control the title styles -// $price-title-bg: $oil; -// $price-title-padding: rem-calc(15 20); -// $price-title-align: center; -// $price-title-color: $smoke; -// $price-title-weight: $font-weight-normal; -// $price-title-size: rem-calc(16); -// $price-title-font-family: $body-font-family; - -// We use these to control the price styles -// $price-money-bg: $vapor; -// $price-money-padding: rem-calc(15 20); -// $price-money-align: center; -// $price-money-color: $oil; -// $price-money-weight: $font-weight-normal; -// $price-money-size: rem-calc(32); -// $price-money-font-family: $body-font-family; - - -// We use these to control the description styles -// $price-bg: $white; -// $price-desc-color: $monsoon; -// $price-desc-padding: rem-calc(15); -// $price-desc-align: center; -// $price-desc-font-size: rem-calc(12); -// $price-desc-weight: $font-weight-normal; -// $price-desc-line-height: 1.4; -// $price-desc-bottom-border: dotted 1px $gainsboro; - -// We use these to control the list item styles -// $price-item-color: $oil; -// $price-item-padding: rem-calc(15); -// $price-item-align: center; -// $price-item-font-size: rem-calc(14); -// $price-item-weight: $font-weight-normal; -// $price-item-bottom-border: dotted 1px $gainsboro; - -// We use these to control the CTA area styles -// $price-cta-bg: $white; -// $price-cta-align: center; -// $price-cta-padding: rem-calc(20 20 0); - -// 23. Progress Bar -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-media-classes: $include-html-classes; - -// We use this to set the progress bar height -// $progress-bar-height: rem-calc(25); -// $progress-bar-color: $vapor; - -// We use these to control the border styles -// $progress-bar-border-color: scale-color($white, $lightness: 20%); -// $progress-bar-border-size: 1px; -// $progress-bar-border-style: solid; -// $progress-bar-border-radius: $global-radius; - -// We use these to control the margin & padding -// $progress-bar-margin-bottom: rem-calc(10); - -// We use these to set the meter colors -// $progress-meter-color: $primary-color; -// $progress-meter-secondary-color: $secondary-color; -// $progress-meter-success-color: $success-color; -// $progress-meter-alert-color: $alert-color; - -// 24. Range Slider -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-range-slider-classes: $include-html-classes; - -// These variables define the slider bar styles -// $range-slider-bar-width: 100%; -// $range-slider-bar-height: rem-calc(16); - -// $range-slider-bar-border-width: 1px; -// $range-slider-bar-border-style: solid; -// $range-slider-bar-border-color: $gainsboro; -// $range-slider-radius: $global-radius; -// $range-slider-round: $global-rounded; -// $range-slider-bar-bg-color: $ghost; -// $range-slider-active-segment-bg-color: scale-color($secondary-color, $lightness: -1%); - -// Vertical bar styles -// $range-slider-vertical-bar-width: rem-calc(16); -// $range-slider-vertical-bar-height: rem-calc(200); - -// These variables define the slider handle styles -// $range-slider-handle-width: rem-calc(32); -// $range-slider-handle-height: rem-calc(22); -// $range-slider-handle-position-top: rem-calc(-5); -// $range-slider-handle-bg-color: $primary-color; -// $range-slider-handle-border-width: 1px; -// $range-slider-handle-border-style: solid; -// $range-slider-handle-border-color: none; -// $range-slider-handle-radius: $global-radius; -// $range-slider-handle-round: $global-rounded; -// $range-slider-handle-bg-hover-color: scale-color($primary-color, $lightness: -12%); -// $range-slider-handle-cursor: pointer; - -// $range-slider-disabled-opacity: .7; -// $range-slider-disabled-cursor: $cursor-disabled-value; - -// 25. Reveal -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-reveal-classes: $include-html-classes; - -// We use these to control the style of the reveal overlay. -// $reveal-overlay-bg: rgba($black, .45); -// $reveal-overlay-bg-old: $black; - -// We use these to control the style of the modal itself. -// $reveal-modal-bg: $white; -// $reveal-position-top: rem-calc(100); -// $reveal-default-width: 80%; -// $reveal-max-width: $row-width; -// $reveal-modal-padding: rem-calc(20); -// $reveal-box-shadow: 0 0 10px rgba($black,.4); - -// We use these to style the reveal close button -// $reveal-close-font-size: rem-calc(40); -// $reveal-close-top: rem-calc(10); -// $reveal-close-side: rem-calc(22); -// $reveal-close-color: $base; -// $reveal-close-weight: $font-weight-bold; - -// We use this to set the default radius used throughout the core. -// $reveal-radius: $global-radius; -// $reveal-round: $global-rounded; - -// We use these to control the modal border -// $reveal-border-style: solid; -// $reveal-border-width: 1px; -// $reveal-border-color: $steel; - -// $reveal-modal-class: "reveal-modal"; -// $close-reveal-modal-class: "close-reveal-modal"; - -// 26. Side Nav -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-nav-classes: $include-html-classes; - -// We use this to control padding. -// $side-nav-padding: rem-calc(14 0); - -// We use these to control list styles. -// $side-nav-list-type: none; -// $side-nav-list-position: outside; -// $side-nav-list-margin: rem-calc(0 0 7 0); - -// We use these to control link styles. -// $side-nav-link-color: $primary-color; -// $side-nav-link-color-active: scale-color($side-nav-link-color, $lightness: 30%); -// $side-nav-link-color-hover: scale-color($side-nav-link-color, $lightness: 30%); -// $side-nav-link-bg-hover: hsla(0, 0, 0, .025); -// $side-nav-link-margin: 0; -// $side-nav-link-padding: rem-calc(7 14); -// $side-nav-font-size: rem-calc(14); -// $side-nav-font-weight: $font-weight-normal; -// $side-nav-font-weight-active: $side-nav-font-weight; -// $side-nav-font-family: $body-font-family; -// $side-nav-font-family-active: $side-nav-font-family; - -// We use these to control heading styles. -// $side-nav-heading-color: $side-nav-link-color; -// $side-nav-heading-font-size: $side-nav-font-size; -// $side-nav-heading-font-weight: bold; -// $side-nav-heading-text-transform: uppercase; - -// We use these to control border styles -// $side-nav-divider-size: 1px; -// $side-nav-divider-style: solid; -// $side-nav-divider-color: scale-color($white, $lightness: 10%); - -// 27. Split Buttons -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-button-classes: $include-html-classes; - -// We use these to control different shared styles for Split Buttons -// $split-button-function-factor: 10%; -// $split-button-pip-color: $white; -// $split-button-span-border-color: rgba(255,255,255,0.5); -// $split-button-pip-color-alt: $oil; -// $split-button-active-bg-tint: rgba(0,0,0,0.1); - -// We use these to control tiny split buttons -// $split-button-padding-tny: $button-pip-tny * 10; -// $split-button-span-width-tny: $button-pip-tny * 6; -// $split-button-pip-size-tny: $button-pip-tny; -// $split-button-pip-top-tny: $button-pip-tny * 2; -// $split-button-pip-default-float-tny: rem-calc(-6); - -// We use these to control small split buttons -// $split-button-padding-sml: $button-pip-sml * 10; -// $split-button-span-width-sml: $button-pip-sml * 6; -// $split-button-pip-size-sml: $button-pip-sml; -// $split-button-pip-top-sml: $button-pip-sml * 1.5; -// $split-button-pip-default-float-sml: rem-calc(-6); - -// We use these to control medium split buttons -// $split-button-padding-med: $button-pip-med * 9; -// $split-button-span-width-med: $button-pip-med * 5.5; -// $split-button-pip-size-med: $button-pip-med - rem-calc(3); -// $split-button-pip-top-med: $button-pip-med * 1.5; -// $split-button-pip-default-float-med: rem-calc(-6); - -// We use these to control large split buttons -// $split-button-padding-lrg: $button-pip-lrg * 8; -// $split-button-span-width-lrg: $button-pip-lrg * 5; -// $split-button-pip-size-lrg: $button-pip-lrg - rem-calc(6); -// $split-button-pip-top-lrg: $button-pip-lrg + rem-calc(5); -// $split-button-pip-default-float-lrg: rem-calc(-6); - -// 28. Sub Nav -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-nav-classes: $include-html-classes; - -// We use these to control margin and padding -// $sub-nav-list-margin: rem-calc(-4 0 18); -// $sub-nav-list-padding-top: rem-calc(4); - -// We use this to control the definition -// $sub-nav-font-family: $body-font-family; -// $sub-nav-font-size: rem-calc(14); -// $sub-nav-font-color: $aluminum; -// $sub-nav-font-weight: $font-weight-normal; -// $sub-nav-text-decoration: none; -// $sub-nav-padding: rem-calc(3 16); -// $sub-nav-border-radius: 3px; -// $sub-nav-font-color-hover: scale-color($sub-nav-font-color, $lightness: -25%); - - -// We use these to control the active item styles - -// $sub-nav-active-font-weight: $font-weight-normal; -// $sub-nav-active-bg: $primary-color; -// $sub-nav-active-bg-hover: scale-color($sub-nav-active-bg, $lightness: -14%); -// $sub-nav-active-color: $white; -// $sub-nav-active-padding: $sub-nav-padding; -// $sub-nav-active-cursor: default; - -// $sub-nav-item-divider: ""; -// $sub-nav-item-divider-margin: rem-calc(12); - -// 29. Switch -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-form-classes: $include-html-classes; - -// Controlling background color for the switch container -// $switch-bg: $gainsboro; - -// We use these to control the switch heights for our default classes -// $switch-height-tny: 1.5rem; -// $switch-height-sml: 1.75rem; -// $switch-height-med: 2rem; -// $switch-height-lrg: 2.5rem; -// $switch-bottom-margin: 1.5rem; - -// We use these to style the switch-paddle -// $switch-paddle-bg: $white; -// $switch-paddle-transition-speed: .15s; -// $switch-paddle-transition-ease: ease-out; -// $switch-active-color: $primary-color; - -// 30. Tables -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-table-classes: $include-html-classes; - -// These control the background color for the table and even rows -// $table-bg: $white; -// $table-even-row-bg: $snow; - -// These control the table cell border style -// $table-border-style: solid; -// $table-border-size: 1px; -// $table-border-color: $gainsboro; - -// These control the table head styles -// $table-head-bg: $white-smoke; -// $table-head-font-size: rem-calc(14); -// $table-head-font-color: $jet; -// $table-head-font-weight: $font-weight-bold; -// $table-head-padding: rem-calc(8 10 10); - -// These control the table foot styles -// $table-foot-bg: $table-head-bg; -// $table-foot-font-size: $table-head-font-size; -// $table-foot-font-color: $table-head-font-color; -// $table-foot-font-weight: $table-head-font-weight; -// $table-foot-padding: $table-head-padding; - -// These control the caption -// $table-caption-bg: transparent; -// $table-caption-font-color: $table-head-font-color; -// $table-caption-font-size: rem-calc(16); -// $table-caption-font-weight: bold; - -// These control the row padding and font styles -// $table-row-padding: rem-calc(9 10); -// $table-row-font-size: rem-calc(14); -// $table-row-font-color: $jet; -// $table-line-height: rem-calc(18); - -// These are for controlling the layout, display and margin of tables -// $table-layout: auto; -// $table-display: table-cell; -// $table-margin-bottom: rem-calc(20); - - -// 31. Tabs -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-tabs-classes: $include-html-classes; - -// $tabs-navigation-padding: rem-calc(16); -// $tabs-navigation-bg-color: $silver; -// $tabs-navigation-active-bg-color: $white; -// $tabs-navigation-hover-bg-color: scale-color($tabs-navigation-bg-color, $lightness: -6%); -// $tabs-navigation-font-color: $jet; -// $tabs-navigation-active-font-color: $tabs-navigation-font-color; -// $tabs-navigation-font-size: rem-calc(16); -// $tabs-navigation-font-family: $body-font-family; - -// $tabs-content-margin-bottom: rem-calc(24); -// $tabs-content-padding: ($column-gutter/2); - -// $tabs-vertical-navigation-margin-bottom: 1.25rem; - -// 32. Thumbnails -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-media-classes: $include-html-classes; - -// We use these to control border styles -// $thumb-border-style: solid; -// $thumb-border-width: 4px; -// $thumb-border-color: $white; -// $thumb-box-shadow: 0 0 0 1px rgba($black,.2); -// $thumb-box-shadow-hover: 0 0 6px 1px rgba($primary-color,0.5); - -// Radius and transition speed for thumbs -// $thumb-radius: $global-radius; -// $thumb-transition-speed: 200ms; - -// 33. Tooltips -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-tooltip-classes: $include-html-classes; - -// $has-tip-border-bottom: dotted 1px $iron; -// $has-tip-font-weight: $font-weight-bold; -// $has-tip-font-color: $oil; -// $has-tip-border-bottom-hover: dotted 1px scale-color($primary-color, $lightness: -55%); -// $has-tip-font-color-hover: $primary-color; -// $has-tip-cursor-type: help; - -// $tooltip-padding: rem-calc(12); -// $tooltip-bg: $oil; -// $tooltip-font-size: rem-calc(14); -// $tooltip-font-weight: $font-weight-normal; -// $tooltip-font-color: $white; -// $tooltip-line-height: 1.3; -// $tooltip-close-font-size: rem-calc(10); -// $tooltip-close-font-weight: $font-weight-normal; -// $tooltip-close-font-color: $monsoon; -// $tooltip-font-size-sml: rem-calc(14); -// $tooltip-radius: $global-radius; -// $tooltip-rounded: $global-rounded; -// $tooltip-pip-size: 5px; -// $tooltip-max-width: 300px; - -// 34. Top Bar -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-top-bar-classes: $include-html-classes; - -// Background color for the top bar -// $topbar-bg-color: $oil; -// $topbar-bg: $topbar-bg-color; - -// Height and margin -// $topbar-height: rem-calc(45); -// $topbar-margin-bottom: 0; - -// Controlling the styles for the title in the top bar -// $topbar-title-weight: $font-weight-normal; -// $topbar-title-font-size: rem-calc(17); - -// Set the link colors and styles for top-level nav -// $topbar-link-color: $white; -// $topbar-link-color-hover: $white; -// $topbar-link-color-active: $white; -// $topbar-link-color-active-hover: $white; -// $topbar-link-weight: $font-weight-normal; -// $topbar-link-font-size: rem-calc(13); -// $topbar-link-hover-lightness: -10%; // Darken by 10% -// $topbar-link-bg: $topbar-bg; -// $topbar-link-bg-hover: $jet; -// $topbar-link-bg-color-hover: $charcoal; -// $topbar-link-bg-active: $primary-color; -// $topbar-link-bg-active-hover: scale-color($primary-color, $lightness: -14%); -// $topbar-link-font-family: $body-font-family; -// $topbar-link-text-transform: none; -// $topbar-link-padding: ($topbar-height / 3); -// $topbar-back-link-size: rem-calc(18); -// $topbar-link-dropdown-padding: rem-calc(20); -// $topbar-button-font-size: .75rem; -// $topbar-button-top: 7px; - -// Style the top bar dropdown elements -// $topbar-dropdown-bg: $oil; -// $topbar-dropdown-link-color: $white; -// $topbar-dropdown-link-color-hover: $topbar-link-color-hover; -// $topbar-dropdown-link-bg: $oil; -// $topbar-dropdown-link-bg-hover: $jet; -// $topbar-dropdown-link-weight: $font-weight-normal; -// $topbar-dropdown-toggle-size: 5px; -// $topbar-dropdown-toggle-color: $white; -// $topbar-dropdown-toggle-alpha: .4; - -// $topbar-dropdown-label-color: $monsoon; -// $topbar-dropdown-label-text-transform: uppercase; -// $topbar-dropdown-label-font-weight: $font-weight-bold; -// $topbar-dropdown-label-font-size: rem-calc(10); -// $topbar-dropdown-label-bg: $oil; - -// Top menu icon styles -// $topbar-menu-link-transform: uppercase; -// $topbar-menu-link-font-size: rem-calc(13); -// $topbar-menu-link-weight: $font-weight-bold; -// $topbar-menu-link-color: $white; -// $topbar-menu-icon-color: $white; -// $topbar-menu-link-color-toggled: $jumbo; -// $topbar-menu-icon-color-toggled: $jumbo; -// $topbar-menu-icon-position: $opposite-direction; // Change to $default-float for a left menu icon - -// Transitions and breakpoint styles -// $topbar-transition-speed: 300ms; -// Using rem-calc for the below breakpoint causes issues with top bar -// $topbar-breakpoint: #{lower-bound($medium-range)}; // Change to 9999px for always mobile layout -// $topbar-media-query: "#{$screen} and (min-width:#{lower-bound($topbar-breakpoint)})"; - -// Top-bar input styles -// $topbar-input-height: rem-calc(28); - -// Divider Styles -// $topbar-divider-border-bottom: solid 1px scale-color($topbar-bg-color, $lightness: 13%); -// $topbar-divider-border-top: solid 1px scale-color($topbar-bg-color, $lightness: -50%); - -// Sticky Class -// $topbar-sticky-class: ".sticky"; -// $topbar-arrows: true; //Set false to remove the triangle icon from the menu item -// $topbar-dropdown-arrows: true; //Set false to remove the \00bb >> text from dropdown subnavigation li// - -// 36. Visibility Classes -// - - - - - - - - - - - - - - - - - - - - - - - - - - -// $include-html-visibility-classes: $include-html-classes; -// $include-accessibility-classes: true; -// $include-table-visibility-classes: true; -// $include-legacy-visibility-classes: true; - -@import 'foundation'; diff --git a/app/assets/stylesheets/home.scss b/app/assets/stylesheets/home.scss index a6536d4..e69de29 100644 --- a/app/assets/stylesheets/home.scss +++ b/app/assets/stylesheets/home.scss @@ -1,24 +0,0 @@ -a.home-link { - span { - padding-left: 10px; - } -} - -img.duckrails-logo { - width: 200px; - height: 200px; -} - -.welcome { - display: inline-block; - margin: auto; - - & > div { - margin-right: 20px; - } - - .home-welcome { - padding-top: 50px; - margin-right: 0; - } -} diff --git a/app/assets/stylesheets/mocks.scss b/app/assets/stylesheets/mocks.scss index c54f306..64af295 100644 --- a/app/assets/stylesheets/mocks.scss +++ b/app/assets/stylesheets/mocks.scss @@ -1,79 +1,22 @@ -textarea { - &.tall { - height: 400px; - } - - &.short { - height: 100px; - } -} - -table { - &.mocks { - width: 100%; - - td.actions { - width: 5%; - white-space: nowrap; - } - - a.button { - margin-bottom: 0; - } - - span.active { - color: #31B404; - } - - span.inactive { - color: #CCCCCC; +.mock-form { + .tab-content { + p { + margin-top: 5px; + color: #666; } } -} - -div.mock { - clear: both; - - border: 1px solid #80d4ff; - background-color: #cceeff; - margin-bottom: 10px; - padding: 10px; - min-height: 50px; - cursor: move; - - &:after { - content: " "; - display: block; - height: 0; - clear: both; - } - - .mock-name { - font-size: 20px; - font-weight: bold; - color: #444; - } - - .mock-request-method { - color: #004466; - margin-right: 10px; - font-weight: bold; - } - .mock-path { - color: #555555; - font-weight: bold; + .nav-tabs { + .nav-link { + &.error { + color: #dc3545; + } + } } } -.sortable-placeholder { - border: 1px dashed #CCC; - background-color: #f9f9f9; - min-height: 50px; - margin-bottom: 10px; -} - -.sortable { - display: list-item; - list-style: none; +.sorting-mock { + border: 1px solid #666; + padding: 5px; + border-radius: 5px; } diff --git a/app/controllers/duckrails/mocks_controller.rb b/app/controllers/duckrails/mocks_controller.rb index 1e42f50..9a57cc9 100644 --- a/app/controllers/duckrails/mocks_controller.rb +++ b/app/controllers/duckrails/mocks_controller.rb @@ -6,10 +6,12 @@ class MocksController < ApplicationController before_action :load_mock, only: [:edit, :update, :destroy, :deactivate, :activate] after_action :reload_routes, only: [:update, :create, :destroy, :deactivate, :activate, :update_order] + before_action :set_cache_headers, only: [:serve_mock] + skip_before_action :verify_authenticity_token, :only => [:serve_mock] def index - if params[:sort] + if params[:sort].present? @mocks = Duckrails::Mock.all render :sort_index else @@ -43,7 +45,7 @@ def update_order end end - render nothing: true + render plain: nil end def create @@ -75,22 +77,34 @@ def deactivate # This is the one and only action mapped to each mock route def serve_mock - mock = Duckrails::Mock.find params[:duckrails_mock_id] - overrides = (evaluate_content(mock.script_type, mock.script, true) || {}).with_indifferent_access - - mock.headers.each do |header| + @mock = Duckrails::Mock.find params[:duckrails_mock_id] + + overrides = if @mock.script_type.present? + Duckrails::Scripts::Manager. + for(@mock.script_type). + evaluate(@mock.script, binding, force_json: true). + with_indifferent_access + else + {} + end + + @mock.headers.each do |header| add_response_header header end - if overrides[:headers] - overrides[:headers].each do |header| - add_response_header header - end + overrides[:headers]&.each do |header| + add_response_header header end - status = overrides[:status_code] || mock.status - content_type = overrides[:content_type] || mock.content_type - body = overrides[:body] || evaluate_content(mock.body_type, mock.body_content) + status = overrides[:status_code] || @mock.status + content_type = overrides[:content_type] || @mock.content_type + + unless (body = overrides[:body]) + body = + Duckrails::Scripts::Manager. + for(@mock.body_type). + evaluate(@mock.body_content, binding) + end render body: body, content_type: content_type, status: status end @@ -110,38 +124,6 @@ def add_response_header(header) response.headers[header[:name]] = header[:value] end - def evaluate_content(script_type, script, force_json = false) - return nil unless script_type.present? - - result = case script_type - when Duckrails::Mock::SCRIPT_TYPE_STATIC - script - when Duckrails::Mock::SCRIPT_TYPE_EMBEDDED_RUBY - context_variables = { - response: response, - request: request, - headers: Hash[request.headers.select{ |header| header[1].is_a? String }], - parameters: params - } - - Erubis::Eruby.new(script).evaluate(context_variables) - when Duckrails::Mock::SCRIPT_TYPE_JS - headers = request.headers.select do |header| - header[1].is_a? String - end - - context = ExecJS.compile("parameters = #{params.to_json}; headers = #{Hash[headers].to_json}") - context.exec script - end unless script.blank? - - force_json ? JSON.parse(result.blank? ? '{}' : result) : result - rescue StandardError => error - response.headers['Duckrails-Error'] = error.to_s - logger.error error.message - logger.error error.backtrace.join "\n" - nil - end - def reload_routes Duckrails::Router.reload_routes! unless @skip_reloading end @@ -167,5 +149,13 @@ def mock_params def load_mock @mock = Duckrails::Mock.find params[:id] end + + private + + def set_cache_headers + response.headers['Cache-Control'] = 'no-cache, no-store' + response.headers['Pragma'] = 'no-cache' + response.headers['Expires'] = 'Mon, 01 Jan 1990 00:00:00 GMT' + end end end diff --git a/app/helpers/duckrails/mocks_helper.rb b/app/helpers/duckrails/mocks_helper.rb index 4ba32c8..533415c 100644 --- a/app/helpers/duckrails/mocks_helper.rb +++ b/app/helpers/duckrails/mocks_helper.rb @@ -5,9 +5,9 @@ def available_mime_types end def available_script_types - [ [t(Duckrails::Mock::SCRIPT_TYPE_EMBEDDED_RUBY), Duckrails::Mock::SCRIPT_TYPE_EMBEDDED_RUBY], - [t(Duckrails::Mock::SCRIPT_TYPE_JS), Duckrails::Mock::SCRIPT_TYPE_JS], - [t(Duckrails::Mock::SCRIPT_TYPE_STATIC), Duckrails::Mock::SCRIPT_TYPE_STATIC] ] + Duckrails::Scripts.enabled_script_types.map do |key| + [t(key), key] + end end end end diff --git a/app/javascript/channels/consumer.js b/app/javascript/channels/consumer.js new file mode 100644 index 0000000..7a709d7 --- /dev/null +++ b/app/javascript/channels/consumer.js @@ -0,0 +1,7 @@ + +// Action Cable provides the framework to deal with WebSockets in Rails. +// You can generate new channels where WebSocket features live using the `rails generate channel` command. + +import { createConsumer } from "@rails/actioncable" + +export default createConsumer() diff --git a/app/javascript/channels/index.js b/app/javascript/channels/index.js new file mode 100644 index 0000000..0cfcf74 --- /dev/null +++ b/app/javascript/channels/index.js @@ -0,0 +1,5 @@ +// Load all the channels within this directory and all subdirectories. +// Channel files must be named *_channel.js. + +const channels = require.context('.', true, /_channel\.js$/) +channels.keys().forEach(channels) diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js new file mode 100644 index 0000000..16b4f1a --- /dev/null +++ b/app/javascript/packs/application.js @@ -0,0 +1,21 @@ +// This file is automatically compiled by Webpack, along with any other files +// present in this directory. You're encouraged to place your actual application logic in +// a relevant structure within app/javascript and only use these pack files to reference +// that code so it'll be compiled. + +require("@rails/ujs").start() +require("@rails/activestorage").start() +require("channels") +require("packs/mocks") +require("@nathanvda/cocoon") +require('webpack-jquery-ui'); +require('webpack-jquery-ui/css'); + +// Uncomment to copy all static images under ../images to the output folder and reference +// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) +// or the `imagePath` JavaScript helper below. +// +// const images = require.context('../images', true) +// const imagePath = (name) => images(name, true) + +import "bootstrap"; diff --git a/app/assets/javascripts/mocks.js b/app/javascript/packs/mocks.js similarity index 76% rename from app/assets/javascripts/mocks.js rename to app/javascript/packs/mocks.js index 9eaa910..5692032 100644 --- a/app/assets/javascripts/mocks.js +++ b/app/javascript/packs/mocks.js @@ -1,12 +1,12 @@ setMockPositions = function () { $('div.mock').each(function(i) { - $(this).data('new-pos', i); + $(this).data('new-pos', i); }); } updateMocksOrder = function (event) { event.preventDefault(); - + setMockPositions(); var $sortable = $('.sortable'); @@ -44,16 +44,19 @@ updateMocksOrder = function (event) { } } -$(function(){ - if ($('form.mock-form').find('.tabs-content .content').length > 0) { +$(function() { + var tabs = $('form.mock-form').find('.nav-tabs .nav-item'); + var tabPanes = $('form.mock-form').find('.tab-content .tab-pane'); + + if (tabPanes.length > 0) { var first_error_tab = null; - $('form.mock-form').find('.tabs-content .content').each(function(index, element) { + tabPanes.each(function(index, element) { var $element = $(element); var elementId = $element.prop('id'); - var $tabLink = $('a[href="#' + elementId + '"]'); + var $tabLink = tabs.find('a[href="#' + elementId + '"]'); - if ($element.find('small.error').length) { + if ($element.find('.invalid-feedback').length) { $tabLink.addClass('error'); if (!first_error_tab) { @@ -68,4 +71,6 @@ $(function(){ } $('.update-mocks-order').on('click', updateMocksOrder); + + $('.sortable').sortable(); }); diff --git a/app/models/duckrails/mock.rb b/app/models/duckrails/mock.rb index 9101bed..12dfb92 100644 --- a/app/models/duckrails/mock.rb +++ b/app/models/duckrails/mock.rb @@ -1,61 +1,65 @@ -class Duckrails::Mock < ActiveRecord::Base - SCRIPT_TYPE_EMBEDDED_RUBY = 'embedded_ruby' - SCRIPT_TYPE_JS = 'js' - SCRIPT_TYPE_STATIC = 'static' - - has_many :headers, dependent: :destroy, inverse_of: :mock - accepts_nested_attributes_for :headers, allow_destroy: true, reject_if: :all_blank - - validates :status, presence: true - validates :request_method, presence: true - validates :content_type, presence: true - validates :route_path, presence: true, route: true - validates :name, presence: true, uniqueness: { case_sensitive: false } - validates :body_type, inclusion: { in: [SCRIPT_TYPE_STATIC, - SCRIPT_TYPE_EMBEDDED_RUBY, - SCRIPT_TYPE_JS], - allow_blank: true }, - presence: { unless: 'body_content.blank?' } - validates :body_content, presence: { unless: 'body_type.blank?' } - validates :script_type, inclusion: { in: [SCRIPT_TYPE_STATIC, - SCRIPT_TYPE_EMBEDDED_RUBY, - SCRIPT_TYPE_JS], - allow_blank: true }, - presence: { unless: 'script.blank?' } - validates :script, presence: { unless: 'script_type.blank?' } - validates :active, presence: { if: 'active.nil?' } - - before_save :set_order - after_save :register - after_destroy :unregister - - default_scope { order(mock_order: :asc) } - - def dynamic? - body_type != SCRIPT_TYPE_STATIC - end +module Duckrails + class Mock < ActiveRecord::Base + has_many :headers, dependent: :destroy, inverse_of: :mock + accepts_nested_attributes_for :headers, allow_destroy: true, reject_if: :all_blank - def activate! - self.update_attributes!(active: true) - end + validates :status, presence: true + validates :request_method, presence: true + validates :content_type, presence: true + validates :route_path, presence: true, route: true + validates :name, presence: true, uniqueness: { case_sensitive: false } - def deactivate! - self.update_attributes!(active: false) - end + validates :body_type, inclusion: { + in: Duckrails::Scripts.enabled_script_types, + allow_blank: true + }, + presence: { + unless: -> { body_content.blank? } + } - ######### - protected - ######### + validates :body_content, presence: { unless: -> { body_type.blank? } } - def set_order - self.mock_order ||= (Duckrails::Mock.maximum(:mock_order) || 0) + 1 - end + validates :script_type, inclusion: { + in: Duckrails::Scripts.enabled_script_types, + allow_blank: true + }, + presence: { unless: -> { script.blank? } } - def register - Duckrails::Router.register_mock self - end + validates :script, presence: { unless: -> { script_type.blank? } } + validates :active, presence: { if: -> { active.nil? } } + + before_save :set_order + after_save :register + after_destroy :unregister + + default_scope { order(mock_order: :asc) } + + def dynamic? + body_type != Duckrails::Scripts::SCRIPT_TYPE_STATIC + end + + def activate! + self.update!(active: true) + end + + def deactivate! + self.update!(active: false) + end + + ######### + protected + ######### + + def set_order + self.mock_order ||= (Duckrails::Mock.maximum(:mock_order) || 0) + 1 + end + + def register + Duckrails::Router.register_mock self + end - def unregister - Duckrails::Router.unregister_mock self + def unregister + Duckrails::Router.unregister_mock self + end end end diff --git a/app/views/duckrails/home/index.html.erb b/app/views/duckrails/home/index.html.erb index ddf2e26..f5c117a 100644 --- a/app/views/duckrails/home/index.html.erb +++ b/app/views/duckrails/home/index.html.erb @@ -1,33 +1,31 @@ <% title t(:home) %>
-
+
- <%= image_tag 'duckrails.png', class: 'duckrails-logo' %> + <%= image_tag 'duckrails.png', class: 'logo' %>
-
-

<%= t(:mock_the_universe) %>

-

- <%= t(:welcome_message) %> +

+

<%= t(:welcome_message) %>

+ +

+ <%= t(:introduction) %>

-
-
- <%= link_to duckrails_mocks_path, class: 'button expand' do %> - +
+ <%= link_to duckrails_mocks_path, class: 'btn btn-primary' do %> + <%= t(:view_all_mocks) %> <% end %> -
-
- <%= link_to new_duckrails_mock_path, class: 'button expand' do %> + <%= link_to new_duckrails_mock_path, class: 'btn btn-success' do %> <%= t(:create_new_mock) %> <% end %> diff --git a/app/views/duckrails/mocks/_form.html.erb b/app/views/duckrails/mocks/_form.html.erb index 7a8ffab..9222a77 100644 --- a/app/views/duckrails/mocks/_form.html.erb +++ b/app/views/duckrails/mocks/_form.html.erb @@ -1,105 +1,120 @@ <%= simple_form_for @mock, html: { class: 'mock-form' } do |form| %> -
    -
  • General
  • -
  • Response body
  • -
  • Headers
  • -
  • Advanced
  • + -
    -
    +
    +

    <%= t :general_tab_header %>

    -
    +
    <%= form.input :name, hint: t(:field_name_hint) %>
    -
    +
    <%= form.input :active, hint: t(:field_active_hint), wrapper_html: { class: 'checkbox-wrapper' } %>
    -
    +
    <%= form.input :description, input_html: { class: 'short' }, hint: t(:field_description_hint) %>
    -
    +
    <%= form.input :request_method, collection: Duckrails::Router::METHODS, hint: t(:field_request_method_hint) %>
    -
    +
    <%= form.input :status, hint: t(:field_status_hint) %>
    -
    +
    <%= form.input :route_path, hint: t(:field_route_path_hint) %>
    -
    +

    <%= t :response_body_tab_header %>

    -
    +
    <%= form.input :body_type, collection: available_script_types, include_blank: true, hint: t(:field_body_type_hint) %>
    -
    +
    <%= form.input :content_type, collection: available_mime_types, include_blank: true, hint: t(:field_content_type_hint) %>
    -
    +
    <%= form.input :body_content, input_html: { class: 'tall' }, hint: t(:field_body_content_hint) %>
    -
    -
    - <%= link_to_add_association form, - :headers, - title: t(:add_header_link_title), - data: { - association_insertion_method: 'append', - association_insertion_node: '.mock-headers' - } do %> - - <%= t(:add_header) %> - <% end %> +
    +
    +
    +
    + <%= link_to_add_association form, + :headers, + title: t(:add_header_link_title), + data: { + association_insertion_method: 'append', + association_insertion_node: '.mock-headers' + } do %> + + <%= t(:add_header) %> + <% end %> +
    + +

    <%= t :headers_tab_header %>

    +
    -

    <%= t :headers_tab_header %>

    -
    +
    <%= form.simple_fields_for :headers do |header_fields| %> <%= render partial: 'header_fields', locals: { f: header_fields } %> <% end %> -
    -
    +

    <%= t :advanced_tab_header %>

    -
    +
    <%= form.input :script_type, collection: available_script_types, include_blank: true, hint: t(:field_script_type_hint) %>
    -
    +
    <%= form.input :script, input_html: { class: 'tall' }, hint: t(:field_script_hint) %>
    @@ -107,20 +122,14 @@
    -
    - <% if @mock.new_record? %> -   - <% else %> - <%= link_to(t(:delete), duckrails_mock_path(@mock), method: :delete, class: 'button alert expand', data: { confirm: t(:mock_deletion_confirmation) }) %> +
    + <% unless @mock.new_record? %> + <%= link_to(t(:delete), duckrails_mock_path(@mock), method: :delete, class: 'btn btn-danger', data: { confirm: t(:mock_deletion_confirmation) }) %> <% end %> -
    -
    - <%= link_to t(:cancel), duckrails_mocks_path, class: 'button secondary expand' %> -
    + <%= link_to t(:cancel), duckrails_mocks_path, class: 'btn btn-secondary' %> -
    - <%= form.submit t(:save), class: 'button expand' %> + <%= form.submit t(:save), class: 'btn btn-success' %>
    <% end %> diff --git a/app/views/duckrails/mocks/_header_fields.html.erb b/app/views/duckrails/mocks/_header_fields.html.erb index cc194a0..8aedac8 100644 --- a/app/views/duckrails/mocks/_header_fields.html.erb +++ b/app/views/duckrails/mocks/_header_fields.html.erb @@ -1,16 +1,16 @@
    -
    +
    -
    +
    <%= f.input :name, hint: t(:field_header_name_hint) %>
    -
    +
    <%= f.input :value, hint: t(:field_header_value_hint) %>
    -
    +
    <%= link_to_remove_association f, wrapper_class: 'header-fields', class: 'button tiny' do %> diff --git a/app/views/duckrails/mocks/index.html.erb b/app/views/duckrails/mocks/index.html.erb index 447efb6..a7c316c 100644 --- a/app/views/duckrails/mocks/index.html.erb +++ b/app/views/duckrails/mocks/index.html.erb @@ -2,19 +2,20 @@

    <%= t :mocks %>

    -

    +

    <%= t :mocks_index_page_guide %>

    <% if @mocks.blank? %> -
    +
    <%= t :no_mocks_warning %>
    <% else %> - +
    + @@ -25,10 +26,14 @@ <% @mocks.each do |mock| %> - + + @@ -44,25 +49,11 @@ <% end %> @@ -80,7 +85,7 @@
    <%= t :mock_name %><%= t :mock_body_type %> <%= t :mock_method %> <%= t :mock_route %> <%= t :mock_active %>
    + <%= mock.name %> + <%= t(mock.body_type) %> + <%= mock.request_method %> - <%= link_to edit_duckrails_mock_path(mock), - title: 'Edit mock', - class: 'button tiny edit' do %> - - <% end %> - - <%= link_to duckrails_mock_path(mock), method: :delete, - title: 'Delete mock', - data: { - confirm: t(:mock_deletion_confirmation) - }, class: 'button tiny delete' do %> - - <% end %> - <%= link_to deactivate_duckrails_mock_path(mock), method: :put, title: 'Deactivate mock', data: { confirm: t(:mock_deactivation_confirmation) - }, class: 'button tiny deactivate secondary' do %> + }, class: 'btn btn-link btn-sm text-secondary deactivate' do %> <% end if mock.active? %> @@ -70,9 +61,23 @@ title: 'Activate mock', data: { confirm: t(:mock_activation_confirmation) - }, class: 'button tiny activate success' do %> + }, class: 'btn btn-link btn-sm text-success activate' do %> <% end unless mock.active? %> + + <%= link_to edit_duckrails_mock_path(mock), + title: 'Edit mock', + class: 'btn btn-sm btn-link text-primary edit' do %> + + <% end %> + + <%= link_to duckrails_mock_path(mock), method: :delete, + title: 'Delete mock', + data: { + confirm: t(:mock_deletion_confirmation) + }, class: 'btn btn-link btn-sm text-danger delete' do %> + + <% end %>
    -
    +
    <%= paginate @mocks %>
    @@ -88,17 +93,17 @@
    -
    +
    <%= link_to duckrails_mocks_path(sort: true), title: "Change the order of the mocks", - class: 'button secondary' do %> + class: 'btn btn-secondary' do %> <%= t :change_mocks_order %> <% end if @mocks.size > 1 %> <%= link_to new_duckrails_mock_path, title: "Create a new mock", - class: 'button' do %> + class: 'btn btn-success' do %> <%= t :create_new_mock %> <% end %> diff --git a/app/views/duckrails/mocks/sort_index.html.erb b/app/views/duckrails/mocks/sort_index.html.erb index 68991a1..13fefbf 100644 --- a/app/views/duckrails/mocks/sort_index.html.erb +++ b/app/views/duckrails/mocks/sort_index.html.erb @@ -2,7 +2,7 @@

    <%= t :change_mocks_order %>

    -

    +

    <%= t :mocks_sort_index_page_guide %>

    @@ -14,24 +14,26 @@ mock_success_url: duckrails_mocks_path } do %> <% @mocks.each do |mock| %> - <%= content_tag :div, data: { mock_id: mock.id, old_pos: mock.mock_order }, class: 'mock' do %> -
    - <%= mock.name %> -
    +
    + <%= content_tag :div, data: { mock_id: mock.id, old_pos: mock.mock_order }, class: 'mock' do %> +
    + <%= mock.name %> +
    -
    - <%= mock.route_path %> -
    +
    + <%= mock.route_path %> +
    -
    - <%= mock.request_method %> -
    - <% end %> +
    + <%= mock.request_method %> +
    + <% end %> +
    <% end %> <% end %> -
    - <%= link_to t(:cancel), duckrails_mocks_path, class: 'button secondary' %> +
    + <%= link_to t(:cancel), duckrails_mocks_path, class: 'btn btn-secondary' %> - <%= link_to t(:save), '#', class: 'button success update-mocks-order' %> + <%= link_to t(:save), '#', class: 'btn btn-success update-mocks-order' %>
    diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1fe92cf..31718ea 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,28 +1,28 @@ - - + <%= csrf_meta_tags %> + <%= csp_meta_tag %> - <%= content_for?(:title) ? yield(:title) : 'DuckRails' %> + <%= content_for(:title) || 'DuckRails' %> - <%= stylesheet_link_tag "application" %> - <%= javascript_include_tag "vendor/modernizr" %> - <%= javascript_include_tag "application" %> - <%= csrf_meta_tags %> + <%= stylesheet_link_tag 'application', media: 'all' %> + <%= javascript_pack_tag 'application' %> - <%= render 'shared/header' %> + <%= render 'shared/navigation_bar' %> -
    -
    -
    - <%= yield %> +
    +
    +
    +
    + <%= yield %> +
    -
    - <%= render 'shared/footer' %> + <%= render 'shared/footer' %> +
    diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb index 5bb7215..19e8acc 100644 --- a/app/views/shared/_footer.html.erb +++ b/app/views/shared/_footer.html.erb @@ -1,15 +1,13 @@