From b6fd5214edfcdfbf87b06b5769e21dba5cdf6ee9 Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Thu, 1 Sep 2022 15:45:08 -0400 Subject: [PATCH 1/6] Empty all repository contents ** Why are these changes being introduced: * It ends up being easier to rebuild this gem from scratch, rather than trying to make piecemeal changes to its infrastructure. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/engx-175 ** How does this address that need: * This deletes everything in the repository, in preparation for starting fresh. ** Document any side effects to this change: * Some of these files will be restored entirely in a later commit, and others will have changes made to them. For now, though, it is easiest to just delete everything. --- .gitignore | 10 - CODE_OF_CONDUCT.md | 74 --- Gemfile | 6 - Gemfile.lock | 167 ------- LICENSE.txt | 21 - Makefile | 56 --- README.md | 108 ----- Rakefile | 10 - app/helpers/link_helper.rb | 22 - app/views/layouts/_flash.html.erb | 8 - app/views/layouts/_global_alert.html.erb | 9 - app/views/layouts/_head.html.erb | 44 -- app/views/layouts/_institute_footer.html.erb | 15 - app/views/layouts/_js_exception_handler.erb | 14 - app/views/layouts/_libraries_footer.html.erb | 60 --- app/views/layouts/_site_footer.html.erb | 1 - app/views/layouts/_site_header.html.erb | 17 - app/views/layouts/_site_nav.html.erb | 16 - app/views/layouts/application.html.erb | 39 -- bin/console | 14 - bin/setup | 8 - lib/mitlibraries/theme.rb | 11 - lib/mitlibraries/theme/version.rb | 5 - mitlibraries-theme.gemspec | 28 -- test/mitlibraries/theme_test.rb | 11 - test/test_helper.rb | 4 - vendor/assets/images/favicon.ico | Bin 15406 -> 0 bytes vendor/assets/images/mitlib-wordmark.svg | 1 - vendor/assets/images/vi-shape7-tp.svg | 1 - .../assets/stylesheets/elements/_content.scss | 74 --- .../stylesheets/elements/_controls.scss | 156 ------ .../assets/stylesheets/elements/_footer.scss | 132 ----- .../assets/stylesheets/elements/_forms.scss | 151 ------ .../assets/stylesheets/elements/_header.scss | 93 ---- .../assets/stylesheets/elements/_modules.scss | 187 -------- .../assets/stylesheets/elements/_tables.scss | 112 ----- vendor/assets/stylesheets/global/_base.scss | 67 --- .../assets/stylesheets/global/_helpers.scss | 161 ------- .../assets/stylesheets/global/_layouts.scss | 452 ------------------ vendor/assets/stylesheets/global/_shame.scss | 4 - .../stylesheets/global/_typography.scss | 81 ---- vendor/assets/stylesheets/global/_unsets.scss | 29 -- .../assets/stylesheets/global/_variables.scss | 120 ----- .../stylesheets/global/_vendor-overrides.scss | 1 - .../js-elements/_expand-collapse.scss | 35 -- vendor/assets/stylesheets/libraries-main.scss | 39 -- 46 files changed, 2674 deletions(-) delete mode 100644 .gitignore delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 Gemfile delete mode 100644 Gemfile.lock delete mode 100644 LICENSE.txt delete mode 100644 Makefile delete mode 100644 README.md delete mode 100644 Rakefile delete mode 100644 app/helpers/link_helper.rb delete mode 100644 app/views/layouts/_flash.html.erb delete mode 100644 app/views/layouts/_global_alert.html.erb delete mode 100644 app/views/layouts/_head.html.erb delete mode 100644 app/views/layouts/_institute_footer.html.erb delete mode 100644 app/views/layouts/_js_exception_handler.erb delete mode 100644 app/views/layouts/_libraries_footer.html.erb delete mode 100644 app/views/layouts/_site_footer.html.erb delete mode 100644 app/views/layouts/_site_header.html.erb delete mode 100644 app/views/layouts/_site_nav.html.erb delete mode 100644 app/views/layouts/application.html.erb delete mode 100755 bin/console delete mode 100755 bin/setup delete mode 100644 lib/mitlibraries/theme.rb delete mode 100644 lib/mitlibraries/theme/version.rb delete mode 100644 mitlibraries-theme.gemspec delete mode 100644 test/mitlibraries/theme_test.rb delete mode 100644 test/test_helper.rb delete mode 100644 vendor/assets/images/favicon.ico delete mode 100644 vendor/assets/images/mitlib-wordmark.svg delete mode 100644 vendor/assets/images/vi-shape7-tp.svg delete mode 100644 vendor/assets/stylesheets/elements/_content.scss delete mode 100644 vendor/assets/stylesheets/elements/_controls.scss delete mode 100644 vendor/assets/stylesheets/elements/_footer.scss delete mode 100644 vendor/assets/stylesheets/elements/_forms.scss delete mode 100644 vendor/assets/stylesheets/elements/_header.scss delete mode 100644 vendor/assets/stylesheets/elements/_modules.scss delete mode 100644 vendor/assets/stylesheets/elements/_tables.scss delete mode 100644 vendor/assets/stylesheets/global/_base.scss delete mode 100644 vendor/assets/stylesheets/global/_helpers.scss delete mode 100644 vendor/assets/stylesheets/global/_layouts.scss delete mode 100644 vendor/assets/stylesheets/global/_shame.scss delete mode 100644 vendor/assets/stylesheets/global/_typography.scss delete mode 100644 vendor/assets/stylesheets/global/_unsets.scss delete mode 100644 vendor/assets/stylesheets/global/_variables.scss delete mode 100644 vendor/assets/stylesheets/global/_vendor-overrides.scss delete mode 100644 vendor/assets/stylesheets/js-elements/_expand-collapse.scss delete mode 100644 vendor/assets/stylesheets/libraries-main.scss diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c93de6e..0000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/.bundle/ -/.yardoc -/_yardoc/ -/coverage/ -/doc/ -/pkg/ -/spec/reports/ -/tmp/ -.DS_Store -*.gem diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 151f11c..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at jprevost@mit.edu. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 7336717..0000000 --- a/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source 'https://rubygems.org' - -git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } - -# Specify your gem's dependencies in mitlibraries-theme.gemspec -gemspec diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 2d03604..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,167 +0,0 @@ -PATH - remote: . - specs: - mitlibraries-theme (0.7.0) - rails (>= 5, < 8) - sassc (~> 2) - -GEM - remote: https://rubygems.org/ - specs: - actioncable (7.0.2.3) - actionpack (= 7.0.2.3) - activesupport (= 7.0.2.3) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (7.0.2.3) - actionpack (= 7.0.2.3) - activejob (= 7.0.2.3) - activerecord (= 7.0.2.3) - activestorage (= 7.0.2.3) - activesupport (= 7.0.2.3) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.2.3) - actionpack (= 7.0.2.3) - actionview (= 7.0.2.3) - activejob (= 7.0.2.3) - activesupport (= 7.0.2.3) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.2.3) - actionview (= 7.0.2.3) - activesupport (= 7.0.2.3) - rack (~> 2.0, >= 2.2.0) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.2.3) - actionpack (= 7.0.2.3) - activerecord (= 7.0.2.3) - activestorage (= 7.0.2.3) - activesupport (= 7.0.2.3) - globalid (>= 0.6.0) - nokogiri (>= 1.8.5) - actionview (7.0.2.3) - activesupport (= 7.0.2.3) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.2.3) - activesupport (= 7.0.2.3) - globalid (>= 0.3.6) - activemodel (7.0.2.3) - activesupport (= 7.0.2.3) - activerecord (7.0.2.3) - activemodel (= 7.0.2.3) - activesupport (= 7.0.2.3) - activestorage (7.0.2.3) - actionpack (= 7.0.2.3) - activejob (= 7.0.2.3) - activerecord (= 7.0.2.3) - activesupport (= 7.0.2.3) - marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.2.3) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - builder (3.2.4) - concurrent-ruby (1.1.10) - crass (1.0.6) - digest (3.1.0) - erubi (1.10.0) - ffi (1.15.5) - globalid (1.0.0) - activesupport (>= 5.0) - i18n (1.10.0) - concurrent-ruby (~> 1.0) - loofah (2.16.0) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - marcel (1.0.2) - method_source (1.0.0) - mini_mime (1.1.2) - mini_portile2 (2.8.0) - minitest (5.14.4) - net-imap (0.2.3) - digest - net-protocol - strscan - net-pop (0.1.1) - digest - net-protocol - timeout - net-protocol (0.1.3) - timeout - net-smtp (0.3.1) - digest - net-protocol - timeout - nio4r (2.5.8) - nokogiri (1.13.3) - mini_portile2 (~> 2.8.0) - racc (~> 1.4) - racc (1.6.0) - rack (2.2.3) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (7.0.2.3) - actioncable (= 7.0.2.3) - actionmailbox (= 7.0.2.3) - actionmailer (= 7.0.2.3) - actionpack (= 7.0.2.3) - actiontext (= 7.0.2.3) - actionview (= 7.0.2.3) - activejob (= 7.0.2.3) - activemodel (= 7.0.2.3) - activerecord (= 7.0.2.3) - activestorage (= 7.0.2.3) - activesupport (= 7.0.2.3) - bundler (>= 1.15.0) - railties (= 7.0.2.3) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) - loofah (~> 2.3) - railties (7.0.2.3) - actionpack (= 7.0.2.3) - activesupport (= 7.0.2.3) - method_source - rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) - rake (13.0.3) - sassc (2.4.0) - ffi (~> 1.9) - strscan (3.0.1) - thor (1.2.1) - timeout (0.2.0) - tzinfo (2.0.4) - concurrent-ruby (~> 1.0) - websocket-driver (0.7.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - zeitwerk (2.5.4) - -PLATFORMS - ruby - -DEPENDENCIES - bundler (~> 2.0) - minitest (~> 5.0) - mitlibraries-theme! - rake (~> 13.0) - -BUNDLED WITH - 2.1.4 diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 3e4289e..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 MIT Libraries - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Makefile b/Makefile deleted file mode 100644 index d916fe1..0000000 --- a/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -.PHONY: help fetch update cleanup dist publish -SHELL=/bin/bash -GEMSPEC=$(shell ls *.gemspec | head -1) -VERSION=$(shell ruby -e 'puts Gem::Specification::load("$(GEMSPEC)").version') -PROJECT=$(shell ruby -e 'puts Gem::Specification.load("$(GEMSPEC)").name') -GEM=$(PROJECT)-$(VERSION).gem - -help: ## Print this message - @awk 'BEGIN { FS = ":.*##"; print "Usage: make \n\nTargets:" } \ - /^[-_[:alpha:]]+:.?*##/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST) - -fetch: clean ## Grab latest from theme repo (auto runs clean first) - mkdir -p tmp - curl -o tmp/assets.zip https://codeload.github.com/MITLibraries/mitlib-style/zip/master - unzip -o -d tmp tmp/assets.zip - -update: fetch ## Synchronize latest (auto runs clean and fetch first) - # cleanup targets first in case assets were removed - rm -rf vendor/assets/images/ - rm -rf vendor/assets/stylesheets/ - - mkdir vendor/assets/images/ - mkdir vendor/assets/stylesheets/ - - cp -R tmp/mitlib-style-master/_assets/i/* vendor/assets/images - cp -R tmp/mitlib-style-master/_assets/sass/* vendor/assets/stylesheets - - rm -rf vendor/assets/stylesheets/apps/ - rm -f vendor/assets/stylesheets/ebooks-main.scss - rm -f vendor/assets/stylesheets/guide-helper.scss - rm -f vendor/assets/stylesheets/quicksubmit.sass - - # We need to double $ so make doesn't think it's a variable and escape the $ for bash. Hence \$$. - sed -i '' "s+url('#{\$$image-path}/vi-shape7-tp.svg')+image-url('vi-shape7-tp.svg')+g" vendor/assets/stylesheets/elements/*.scss - - @tput setaf 2 - @tput bold - @echo "Assets updated. Make sure to update version in:" - @echo " lib/mitlibraries/theme/version.rb" - @echo "before building with 'make dist'" - @tput sgr0 - -clean: ## Delete downloaded zip and extracted files - rm -f tmp/assets.zip - rm -rf tmp/mitlib-style-master - -dist: ## Build the gem from the current gemspec - gem build mitlibraries-theme.gemspec - @tput setaf 2 - @tput bold - @echo "Finished building gem. To test locally add to your project Gemfile:" - @echo " gem 'mitlibraries-theme', path: '$(shell pwd)'" - @tput sgr0 - -publish: ## Publish the gem version defined in the gemspec - gem push "$(GEM)" diff --git a/README.md b/README.md deleted file mode 100644 index 0e58f8e..0000000 --- a/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# Mitlibraries::Theme - -Provides base CSS and Images used by MIT Libraries for our websites. - -## Installation - -Add this line to your application's Gemfile: - -```ruby -gem 'mitlibraries-theme' -``` - -And then execute: - -```shell -$ bundle -``` - -Or install it yourself as: - -```shell -$ gem install mitlibraries-theme -``` - -## Usage - -After you bundle, delete your application local `app/views/layouts/application.rb` to use the layout the gem provides. - -Rename your `app/assets/stylesheets/application.css` to `app/assets/stylesheets/application.scss` and remove anything like: - -```ruby -*= require_tree . -*= require_self -``` - -Add -`@import "libraries-main";` - -If you have local overrides for styles, import them _after_ the shared styles. - -You'll want to set `<%= content_for(:title, "SOMETHING") %>` on your views. - -You'll want to copy `app/views/layouts/_site_nav.html.erb` into your local -repo and make appropriate changes. - -`app/views/layouts/_site_footer.html.erb` is also available if you really need -a third footer above the other two (I'm looking at you bento!). - -If you need to make changes to other templates, you can also copy those to your local repo but you should check with others as the main header / footer / etc are probably best left as they are in this gem. - -## Adding Additional JavaScript to HTML Head - -You can load additional js to individual pages using: - -```ruby -<% content_for :additional_js do %> - -<% end %> -``` - -This can appear as many times as you need on as many templates as you need. If -called multiple times the results are concatenated. This is intended primarily -for adding external support libraries. For JS you are writing, include via -`application.scss` as normal. - -## Adding Additional Meta headers to HTML Head - -You can load additional meta headers to individual pages using: - -```ruby -<% content_for :additional_meta_tag do %> - - -<% end %> -``` - -This can appear as many times as you need on as many templates as you need. If -called multiple times the results are concatenated. - -## Development - -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. - -Building and publishing this gem is handled via the `Makefile`. - -Run `make help` for details. - -If your goal is to fetch the latest assets from the style repo and publish the -changes, this would get you there: - -- `make update` -- manually update the version in `lib/mitlibraries/theme/version.rb` -- `make dist` -- test the gem in a local version of a site that uses it with the info the previous command provided on completion -- commit and PR -- `make publish` - -## Contributing - -Bug reports and pull requests are welcome on GitHub at https://github.com/MITLibraries/mitlibraries-theme. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. - -## License - -The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). - -## Code of Conduct - -Everyone interacting in the Mitlibraries::Theme project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/MITLibraries/mitlibraries-theme/blob/master/CODE_OF_CONDUCT.md). diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 4b2b782..0000000 --- a/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'bundler/gem_tasks' -require 'rake/testtask' - -Rake::TestTask.new(:test) do |t| - t.libs << 'test' - t.libs << 'lib' - t.test_files = FileList['test/**/*_test.rb'] -end - -task default: :test diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb deleted file mode 100644 index 242c997..0000000 --- a/app/helpers/link_helper.rb +++ /dev/null @@ -1,22 +0,0 @@ -module LinkHelper - # helper wrapper around link_to that inserts visual and screen reader info - # for navigation links - def nav_link_to(name, url) - link_to(name, url, - class: link_class(url), - 'aria-current': aria_current?(url)) - end - - private - - # Includes css `current` class if current page - def link_class(url) - return 'nav-item' unless current_page?(url) - 'nav-item current' - end - - # Includes css `current` class if current page - def aria_current?(url) - return 'page' if current_page?(url) - end -end diff --git a/app/views/layouts/_flash.html.erb b/app/views/layouts/_flash.html.erb deleted file mode 100644 index 3654694..0000000 --- a/app/views/layouts/_flash.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% if flash %> - <% flash.each do |msg_type, message| %> - <% next if msg_type == 'global' %> - - <% end %> -<% end %> diff --git a/app/views/layouts/_global_alert.html.erb b/app/views/layouts/_global_alert.html.erb deleted file mode 100644 index 7746d90..0000000 --- a/app/views/layouts/_global_alert.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% if ENV['GLOBAL_ALERT'] %> -
-
-
-

<%= sanitize(ENV['GLOBAL_ALERT']) %>

-
-
-
-<% end %> diff --git a/app/views/layouts/_head.html.erb b/app/views/layouts/_head.html.erb deleted file mode 100644 index 8bd9689..0000000 --- a/app/views/layouts/_head.html.erb +++ /dev/null @@ -1,44 +0,0 @@ - - - -<%= content_for?(:title) ? yield(:title) : " MIT Libraries" %> -<%= csrf_meta_tags %> - -<%= yield :additional_meta_tag %> - - - - - -<%= stylesheet_link_tag "application", :media => "all" %> - - - -<%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %> - -<%= render partial: "layouts/js_exception_handler" %> -<%= javascript_include_tag "application" %> - - - -<%= yield :additional_js %> - -<% if (ENV['MATOMO_URL'].present? && ENV['MATOMO_SITE_ID'].present?) %> - - - -<% end %> diff --git a/app/views/layouts/_institute_footer.html.erb b/app/views/layouts/_institute_footer.html.erb deleted file mode 100644 index 3004c8c..0000000 --- a/app/views/layouts/_institute_footer.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/app/views/layouts/_js_exception_handler.erb b/app/views/layouts/_js_exception_handler.erb deleted file mode 100644 index 609995e..0000000 --- a/app/views/layouts/_js_exception_handler.erb +++ /dev/null @@ -1,14 +0,0 @@ -<% if ENV['JS_EXCEPTION_LOGGER_KEY'].present? %> - - - -<% end %> diff --git a/app/views/layouts/_libraries_footer.html.erb b/app/views/layouts/_libraries_footer.html.erb deleted file mode 100644 index f342a86..0000000 --- a/app/views/layouts/_libraries_footer.html.erb +++ /dev/null @@ -1,60 +0,0 @@ - diff --git a/app/views/layouts/_site_footer.html.erb b/app/views/layouts/_site_footer.html.erb deleted file mode 100644 index fb15738..0000000 --- a/app/views/layouts/_site_footer.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%# This template can be used to place content at the bottom of each page above the libraries and institute footers %> diff --git a/app/views/layouts/_site_header.html.erb b/app/views/layouts/_site_header.html.erb deleted file mode 100644 index e1a517b..0000000 --- a/app/views/layouts/_site_header.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/app/views/layouts/_site_nav.html.erb b/app/views/layouts/_site_nav.html.erb deleted file mode 100644 index 842491c..0000000 --- a/app/views/layouts/_site_nav.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -
-
- -
-
- -
-
-
-
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100644 index aa7b2a3..0000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,39 +0,0 @@ - - - - <%= render partial: "layouts/head" %> - - - - -
- - <%= render partial: "layouts/global_alert" %> - - <%= render partial: "layouts/site_header" %> - - <%= render partial: "layouts/site_nav" %> - -
-
-
- <%= render partial: "layouts/flash" %> - - <%= yield %> - - <%= render partial: "layouts/site_footer" %> -
- -
-
- - - -
- <%= render partial: "layouts/libraries_footer" %> - <%= render partial: "layouts/institute_footer" %> -
-
- - - diff --git a/bin/console b/bin/console deleted file mode 100755 index 02539f3..0000000 --- a/bin/console +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby - -require 'bundler/setup' -require 'mitlibraries/theme' - -# You can add fixtures and/or initialization code here to make experimenting -# with your gem easier. You can also use a different console, if you like. - -# (If you use this, don't forget to add pry to your Gemfile!) -# require "pry" -# Pry.start - -require 'irb' -IRB.start(__FILE__) diff --git a/bin/setup b/bin/setup deleted file mode 100755 index dce67d8..0000000 --- a/bin/setup +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -IFS=$'\n\t' -set -vx - -bundle install - -# Do any other automated setup that you need to do here diff --git a/lib/mitlibraries/theme.rb b/lib/mitlibraries/theme.rb deleted file mode 100644 index ebdc3c2..0000000 --- a/lib/mitlibraries/theme.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'mitlibraries/theme/version' - -module Mitlibraries - module Theme - module Rails - class Engine < ::Rails::Engine - config.assets.precompile += %w[favicon.ico mitlib-wordmark.svg] - end - end - end -end diff --git a/lib/mitlibraries/theme/version.rb b/lib/mitlibraries/theme/version.rb deleted file mode 100644 index 4825738..0000000 --- a/lib/mitlibraries/theme/version.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Mitlibraries - module Theme - VERSION = '0.8.0'.freeze - end -end diff --git a/mitlibraries-theme.gemspec b/mitlibraries-theme.gemspec deleted file mode 100644 index 9aeb1a0..0000000 --- a/mitlibraries-theme.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -lib = File.expand_path('lib', __dir__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'mitlibraries/theme/version' - -Gem::Specification.new do |spec| - spec.name = 'mitlibraries-theme' - spec.version = Mitlibraries::Theme::VERSION - spec.authors = ['Jeremy Prevost'] - spec.email = ['jprevost@mit.edu'] - - spec.summary = 'General theme for MIT Libraries Rails apps' - spec.homepage = 'https://github.com/MITLibraries/mitlibraries-theme' - spec.license = 'MIT' - - spec.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(test|spec|features)/}) - end - - spec.bindir = 'exe' - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ['lib'] - - spec.add_development_dependency 'bundler', '~> 2.0' - spec.add_development_dependency 'minitest', '~> 5.0' - spec.add_development_dependency 'rake', '~> 13.0' - spec.add_dependency 'rails', '>= 5', '< 8' - spec.add_dependency 'sassc', '~> 2' -end diff --git a/test/mitlibraries/theme_test.rb b/test/mitlibraries/theme_test.rb deleted file mode 100644 index c9b69c8..0000000 --- a/test/mitlibraries/theme_test.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'test_helper' - -class Mitlibraries::ThemeTest < Minitest::Test - def test_that_it_has_a_version_number - refute_nil ::Mitlibraries::Theme::VERSION - end - - def test_it_does_something_useful - assert false - end -end diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index a9ad8d9..0000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,4 +0,0 @@ -$LOAD_PATH.unshift File.expand_path('../lib', __dir__) -require 'mitlibraries/theme' - -require 'minitest/autorun' diff --git a/vendor/assets/images/favicon.ico b/vendor/assets/images/favicon.ico deleted file mode 100644 index 1ee0b8481ef574b55088a0b12db8db016c19e4ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15406 zcmeI3cbHYx6~!ODcLtC)Gk1_;L2Ou1!QQc;fDKV&iDEPg_KqzNmmc*8#CPq}u&)j1j)lCb!!o|*5GaKJ8u!skyG!rZ+FhNi~GaM96y?C&!U z=@$}>_x1VxmNR>Xx0iI(xb$;moquru@Y&<-!XDcWvAK_&HPHUPaemJ*cEv{f?AUz= z*u4LEwh%U5Z+K~5=0~n;PU#i?^g#Qt`6Rwe!i=qkgg@NhK0I}KSDW{*kG2b^Yn}J* z=@5?JZ$R#O=2)?*F+6f{xA5!lcMNNdA8FrDUS~x3#jTwJYd(2dSCjj;vwMbn&+Be$ z_}=_|wUz3_t2cKF&t2Iij9alGG)j&e=JyJJf2Lrv?X~@oaQL2eCf8`K=g(!|H(Yy! z$@u+m^$2rj*4du--Dz;R`sCjB`y|=@%clwf+hw22{=Va;L&GQ9@0U*(%pT|i9i8yC z0cMle7k3J0&gob4d35oU8#{-8Jy!@v$*%5C?1y!(Ik{JO^1EG2pJ&%*?0IwhhL0X< zAFevFx7l&V)J3E-pUDnOkA8s=IQ+t`QRUD5lh?n!{^(j4%Pu_oi z_waMsdzG=sl?3$ouKeW(i@F4K_Ux7HImQ%z{_?e5%*Kp8>45&>uaC70+f0t}_x0(6 z%m%lAyGIx|x*<%SI3j#-Ux(83`1;Z(+J)6usSn%gnNQ{a%)wlzD|Wt+jn9`Jv$3-C zW{`>iY z#mZ&Jf+v->&Cb`-?+5KVIJZ9I$Bb&UI3OPJ&4(}Q7RHZjFx&x$-oLlK$w0g<5iYK6 zah%1PN<6G32Y8ajFCVw6_I01)pY@T0_;!riVUwZZXSZ|;|B@c?w-*+53HTp2_2*mr zPW<6FmE)5zakY`*rE9v_UcXd~FF0I&l0=-GBFuXH(r)3Ok_~(OMtC+uae~iR&Q(nx ziDESgpURiFFf6S;W^?W9H@A1RHNft}_NXhakpyt?<}-SRzezS^_`Txy2;tr+ld;-- z{#g<>Tx*2k>px_}qh_brQz?5AcHedd!&24&>-pPtjZM%Cvhn?AiZ%X@w(|Az?_-78 zcQ1^#I{uJP;QTUeGP9s<`y;nSbMThg&=l7sx@J>?Aw`r}5{X%HR1MU4Cun z!BJL?1#?n4^Y%*TZ?g4R*W(g-kSiUN7#=KH(8KaEYkeTR_=flpHnHdAa~FvV;iq6V zI=~-RY|(F#D>1#Jf957G&z4=_M5zo-is?qfbvP5_$YbCLzhf8hjPZA#+rvJ4U$&TF z{!)AI>HLZL-y6lagag1K%447We#|}tEkC)hk-Nw*uIpp>9cXePC;pSJ(UKfVfam<_ z!RYh9zps7q`Mkfgr=Q%=x#a8kCH7l?jp(~z4>=LLEI1sll7GHAdD!m}dx=BJf6*&( z1YY?Z*!NQ9DD;j${`uj!4r{$4Ua-Bm)k>oqj0>P2@U#|Rt0f0(fH(L7GJx0kIWmx| z95dh$ z*-0K8@Y{sQ}U-7?LW*?C7LX{>?8*dLh>-Hp01 zKX*%igTdrc?9Uw34e(y%ASaO*JTBc2uT4cW~f1)q40e&p&=? zSL53YkLVlzCRz9lyLw!rCyzs)3;Dri>{gqTRntjgHQEQlKh}9iwfSbn+7v$`=YVbc1{8o0*1$N~N{7ObGwP1kQS zJV%EubFwG{*oWU5zG^<~$!FO)k!8v{!^4}(Rp^!%AeDK0G&ht5Bie|tWlhQSwH&iI~$Gv@TST-6*Wqvm>4Jq+fgM{uIBG@tt;7LsSt zHRIr{du}(x@X0yJTk6r|*Kabewp6+zUsmH};3oNw7{{k>JG(~(|DrYqhxwitT*>(| zI;P$wF0n`X`s@w4_^y(ZMb6W`m#p>@6 z59RBR(*EelptEvL1}@Vd;5+(fyBGUd%z@v-MVt>|7xHZ6$0^SGdejDwDK7o*^gS_q zBHQOrwhPmXy$tk5j{$wMuXAJr=bY3oa8Tz#*cYGA^Wr>i;GgKOR$t)%<#YNZYS9*E z>(yMJWaTlHwOq7Wta;!*UI*j5;21UGm{AR~F=Iwp&iU-|7!&vqwtV%b&SCEzhKO^- zaj74a+iUs$hU-+XZxZueI06{zd%(wD)Zg@1@iXFL>kWq)o*B23?Cb$-dqw>In0*FV zuE}HI^2wal1^vO=y{5!uoT;ATPjBjEaqY4_t-dh5nWUjnc;6^~Ju;kqXg}3`k)JXS ztb6aC_TgORU%vle>;XKSq@G7}bHj__;=fgI6W>6#FBHpg6?)+j<0FSZL6{G(0*4vL zczFJ0$My~zsRtRcp%QnpI&I7E$ON`l>y@SR#GVlP&H4yf2{%Y_II(^QIT&8%yp27; zf5BgR29;c5+5L%}ahmFo=I2CTiPhm3s6Rlxh;Dg(s5urpk;oHM1m&*~-#>#jc1V%2j3wGf;G|4OkevAEb+ z{Oo(u`G*h2`j~xy13y+=AFBTR_;IzcFS};>?@>S0lk|zPEq!(Ra|qm zp1`Ddwg8TLobnD9cuy>SF0q;gE=LW)UfBbBBbJD3>XvfOnm(V^pL$^GLENF*IcH39FnzB1{Um{N8gTW) zVvTI_$exQ%>ZQ7;JZDAU+hT)Zc0S_06`nzd*zyq7i7A%39Es@zJad1=hMcV;KhJ}M zd#H|Z?%BNDJ}>Xlzrli!Gq_65;=DHI_PjpvbvQRYJjS{Ip~pAx(D|-}JA{L046^gv{5(;&oKJwe)Li(p%R*e=wXlcIGzWxV-PW-r=Th0=x>I`^4xtlp z8C_wAUwyBm^-NlaWv+XFk6aJ@gm=218ediKb=np~YjPiQ@vNysEH`JdiG2N$&P14l zeK997Kwfki=_4`@`SHcMv+4}r^SW{wTY8VVaev_i=OMl>9D+Lsn~Cd@f69G{zrmed zl!M@e;G^d{;a`7D;RM33B8LoM@zES`aTI`gp=HJct`hBeErWA zU-$$0xKe)R66a7Y0T1Aw0QHc^Chy2b?ubr^n$L?|Pxk|` zzsJ}oj~2pZ$Mr7ulTsP7wnn%6C`bIZ*sJh8Fb8)Nz% zHL}Ms_$PhMt4{1y!c}CT{ybHDH=Zk&?}6HXgyrKbZ*?0YBb?(3_4cTp;4xs(#o|}k zhjDOv@Syp6ptbu*!X(La^XWZvwE%u~qP+Boh5G^)lM z9A4B}i1*Fe3wLsM+H?i0oj50ceo>baW;qwcPrz4l%Z;*QHpe3?dxw*9XUg~ezG`k_ zz%h1Nb)P<`JxGSx>UI3$){Z3(jSlJ0Oy6>-^_`s)gCp>R9hFPs`G34WMeSsqLtKYg zMc=H!T`%|rxr5K>rJsCY|1dgt{#;GBZToEOsK{5}y<6)`M)U;_rT0kOmGoEaF;&*I zu@2`>KAQam$3XS~42=TzU5 zrNl{yR8YZmT40t@!d@yvq*<2K#FDrd`(bJ;fLH zLm%Wb&B1)+?*+o*N*^qjrLBKQ-OUwdb58~TaryBh`T+Zh<3wC-%iM|e)V)s+HqrZ- zP<9V4-FsW+PRC-;oyF5$7bnJFJZ3$fiAj1y+(Br`hhklk&W*p*H)Aed+&L(}E4w`M zBM&`9{4~q2>3{G-|Lg}`ec*!b7Jt!yQ$Hbo_>6i9U(3ov&BmQypPRg$Jxj@sZTs)B zRz4T(Db|_j=xuSbdAetIitw74b9;b8*XxXK^2BT`#~LG>%d&Fd>u{^3dX{;JC(g>U zJ*n*Yw*1cA2klyC^{x8~JfFLw_yPFAJ#H}E_dpFse<=EJ%;WT_=(iE4jLXV^U8oQI z{ufw89*DigtPNA2%RXQIcX)kb{`|7|irbc4dDpq!?e4ncDwt0m_5LdRgl}?pf;+$5 zo1u^Iby2ze%(IE^6a2V%*MsMOsW@A{JP_;jTUC2_&xg2uO+1}*(`+q8d{7(GKgy1! z55Re^)yUE*auX}qC$F=Z+t7>iRdjI(^|$PwAKN+`z)j{KEKXd!+sE3(75@hi&jIsx z#RuSC&xk|14CoO~;C{zD@m}o?Ilg`-c|b7$E~AGlR8vN*%CFV@eqyW<|LD!Jg`U*~ z^ZJHWYWALEZ+zC&!Q$BQInNKg<2(4oak}4D?c9j{bLNHLnVmHL*(=gJBF)R3+Qj=Q z+_8WQGZ#99Z|3j3q|d~;W1J$xOX?3}gRJ~;OYTk8=4P?q^|G+vs9+Za-7@Lmj%m_9exI9qz=gXe7Qb259D4xeBNt?to+11d38N;=@|Ew>r|Sl3ttZ z9eL3KYtv(QdH9^XhaXjw0bRgN`Ckae5_{C2{GUlk1SaF!%GT%Ygi` z=R<$Td$`E(mY(D8R3(p%d5u^G-?Duoe20GiyuIs6af)48A8zM;Qhd9X{G2tMKetZ_ zJBWK~p4k7Z^tsVZ4JIeOWcPV$!gHioxIy{8+0RtTv*euaf&Y#2XYg}m*E7PVr?pICf-y#?n{jtSzrg^~{82*_@Bhac?xs;`;gNlt z84Hd#S}z!%#D_R%J55~1?=P{B+3K~vrTccs!5I98o@e>l7rxB>H11ZrKG-Yu9(61H bGH=&fvh%t6L3+W9bv@{-pRY8q%o_L)Jw~VV diff --git a/vendor/assets/images/mitlib-wordmark.svg b/vendor/assets/images/mitlib-wordmark.svg deleted file mode 100644 index e2685b9..0000000 --- a/vendor/assets/images/mitlib-wordmark.svg +++ /dev/null @@ -1 +0,0 @@ -MIT Libraries Logo diff --git a/vendor/assets/images/vi-shape7-tp.svg b/vendor/assets/images/vi-shape7-tp.svg deleted file mode 100644 index 4ce4164..0000000 --- a/vendor/assets/images/vi-shape7-tp.svg +++ /dev/null @@ -1 +0,0 @@ -vi-shape7-tp diff --git a/vendor/assets/stylesheets/elements/_content.scss b/vendor/assets/stylesheets/elements/_content.scss deleted file mode 100644 index 2e8b794..0000000 --- a/vendor/assets/stylesheets/elements/_content.scss +++ /dev/null @@ -1,74 +0,0 @@ -// content-specific styles - -.wrap-content { - -// unreset base content pieces - h1, - .hd-1 { - @extend .hd-1; - } - - h2, - .hd-2 { - @extend .hd-2; - } - - h3, - .hd-3 { - @extend .hd-3; - } - - h4, - .hd-4 { - @extend .hd-4; - } - - h5, - .hd-5 { - @extend .hd-5; - } - - h6, - .hd-6 { - @extend .hd-6; - } - - .subtitle { - @extend .hd-subtitle1; - } - - .subtitle2 { - @extend .hd-subtitle2; - } - - .subtitle3 { - @extend .hd-subtitle3; - } - - li { - margin-bottom: .5em; - } - - // wordpress specific classes - .title-page { - margin-bottom: 1rem; - padding: .5rem 0 1rem 0; - font-weight: $fw-bold; - } - - .cta-link { - transition: background-color ease-in-out .3s; - display: inline-block; - padding: .5em; - color: $black; - font-size: $fs-large; - font-weight: $fw-bold; - text-decoration: underline; - - &:hover { - background-color: $brand-secondary; - color: $white; - } - } -} - diff --git a/vendor/assets/stylesheets/elements/_controls.scss b/vendor/assets/stylesheets/elements/_controls.scss deleted file mode 100644 index e96f56f..0000000 --- a/vendor/assets/stylesheets/elements/_controls.scss +++ /dev/null @@ -1,156 +0,0 @@ - -.button-primary { - transition: background-color .25s, border .25s; - display: inline-block; - border: 1px solid $brand-primary; - border-radius: 3px; - padding: 5px 10px; - background-color: $brand-primary; - color: $white; - text-decoration: none; - - &:hover, - &:focus { - background-color: $brand-primary-accent; - border-color: $brand-primary-accent; - color: $white; - text-decoration: none; - } - - &.green { - border: 1px solid darken($black, 5%); - background-color: $black; - - &:hover, - &:focus { - background-color: saturate($green-muted, 20%); - border-color: $green-muted; - } - } - - &.magenta { - border: 1px solid darken($black, 5%); - background-color: $black; - - &:hover, - &:focus { - background-color: saturate($magenta-muted, 20%); - border-color: $magenta-muted; - } - } - - &.warn { - border: 1px solid darken($error, 10%); - background-color: darken($error, 5%); - - &:before { - font-family: FontAwesome; - content: "\f071 "; - font-size: .8em; - margin-right: 5px; - } - - &:hover, - &:focus { - background-color: saturate($error, 20%); - border-color: $error; - } - } -} - -.button-secondary { - transition: background-color .25s, border .25s; - display: inline-block; - border: 1px solid $gray-l2; - border-radius: 3px; - padding: 5px 10px; - background-color: transparent; - color: $black; - text-decoration: none; - - &:hover, - &:focus { - background-color: $brand-primary-accent; - border-color: $brand-primary-accent; - color: $white; - text-decoration: none; - } - - &.green { - color: $black; - - &:hover, - &:focus { - background-color: saturate($green-muted, 20%); - border-color: $green-muted; - color: $white; - } - } - - &.magenta { - color: $black; - - &:hover, - &:focus { - background-color: saturate($magenta-muted, 20%); - border-color: $magenta-muted; - color: $white; - } - } - - &.warn { - color: $error; - - &:before { - font-family: FontAwesome; - content: "\f071 "; - font-size: .8em; - margin-right: 5px; - } - - &:hover, - &:focus { - background-color: saturate($error, 20%); - border-color: $error; - color: $white; - } - } -} - -.button-subtle { - @extend .button-secondary; - border: 0; -} - -.button-small { - padding: 2px 10px; -} - - -// ruby pagination nav -.pagination { - margin: 1rem; - - .page { - display: inline-block; - min-width: 3rem; - text-align: center; - } - - a { - @extend .button-subtle; - } - - .current { - font-weight: $fw-bold; - } - - .gap { - } - - .next { - } - - .last { - } -} diff --git a/vendor/assets/stylesheets/elements/_footer.scss b/vendor/assets/stylesheets/elements/_footer.scss deleted file mode 100644 index 34f2544..0000000 --- a/vendor/assets/stylesheets/elements/_footer.scss +++ /dev/null @@ -1,132 +0,0 @@ -// footer styles - -.wrap-outer-footer { - background-color: $black; - color: $white; - font-size: $fs-xsmall; -} - -.wrap-footer { - background: $black image-url('vi-shape7-tp.svg') no-repeat 10% center; - - a { - @extend %link; - color: $white; - text-decoration: none; - - &:hover, - &:active, - &:focus { - text-decoration: underline; - color: $white; - } - } - - .title { - @extend .hd-6; - margin-bottom: .8rem; - } - - .wrap-list .link-sub { - display: list-item; - list-style-type: none; - margin-bottom: .65rem; - font-weight: $fw-light; - } - - .logo-mit-lib { - fill: $white; - - img { - max-height: 60px; - max-width: 100%; - vertical-align: baseline; - } - } - - .wrap-policies { - @extend .list-inline-pipe; - font-size: $fs-small; - } - - .wrap-social { - - p, a { - display: inline-block; - vertical-align: middle; - margin-left: .5rem; - margin-bottom: 0; - text-transform: uppercase; - font-size: $fs-xsmall; - } - - svg { - height: 2em; - width: 2em; - border-radius: 50%; - padding: 0.2em; - background: $white none repeat scroll 0 0; - - path { - fill: $gray-d1; - } - } - } -} - -// footer - adjustments for slim -.wrap-footer.footer-slim { - - .sitemap-libraries-abbrev a { - @extend .list-inline-pipe; - font-size: $fs-small; - } - -} - -// MIT footer -.wrap-outer-footer-institute { - background-color: $gray-d1; - font-size: $fs-xxsmall; - color: $gray-l3; - - .footer-info-institute { - display: flex; - justify-content: space-between; - align-items: baseline; - } - - a { - @extend %link; - color: $white; - &:hover, - &:active, - &:focus { - color: $white; - } - } - - .link-logo-mit { - - .logo-mit { - fill: $gray-l2; - - .color { - fill: $white; - } - } - } - - .about-mit { - color: $gray-l3; - margin-right: 4%; - text-transform: uppercase; - white-space: nowrap; - } - - .license { - margin-left: auto; - margin-top: 1rem; - color: $gray-l3; - } -} diff --git a/vendor/assets/stylesheets/elements/_forms.scss b/vendor/assets/stylesheets/elements/_forms.scss deleted file mode 100644 index eec4935..0000000 --- a/vendor/assets/stylesheets/elements/_forms.scss +++ /dev/null @@ -1,151 +0,0 @@ -// base form styles - -form { - margin: 1.5rem 0; - - fieldset { - margin-top: 1.5rem; - margin-bottom: 1.5rem; - border: 1px solid $gray-l2; - padding: 1rem 1.5rem; - } - - legend { - padding: 0 1rem; - font-size: $fs-small; - color: $gray; - text-transform: uppercase; - } - - .field-wrap, - .field-group { - margin-bottom: 1rem; - } - - .field-label { - display: inline-block; - margin-bottom: .2rem; - font-size: $fs-small; - font-weight: $fw-bold; - } - - .field { - display: block; - margin-top: .2rem; - margin-bottom: .2rem; - - &:focus, &:active { - border-color: $brand-primary-accent; - box-shadow: 0 0 5px rgba($brand-primary-accent,.8); - } - - &.wide { - width: 90%; - } - } - - .field-text { - min-width: 25rem; - border: 1px solid $gray-l2; - border-radius: 2px; - padding: 6px 12px; - background-image: none; - background-color: $white-t; - box-shadow: inset 0 0 3px rgba(0,0,0,.2); - } - - .tip, - .hint { - font-size: $fs-small; - color: $informational; - margin-bottom: 0; - - &.error { - color: $error; - } - } - - .field-textarea { - display: block; - min-width: 25rem; - } - - .field-select { - display: block; - min-width: 25rem; - } - - .field-upload { - border: none; - } - - .group-inline { - margin-bottom: 1rem; - - .field-wrap { - display: inline-block; - vertical-align: top; - margin-bottom: .2rem; - } - - .field-select { - min-width: auto; - } - } - - .fields-inline { - - .field-label { - display: inline-block; - max-width: 30%; - } - - .field { - display: inline-block; - max-width: 65%; - } - - &.field-radio { - display: inline-block; - margin-right: 1.5rem; - } - } - - .disabled { - color: $gray; - cursor: not-allowed; - } - -// CASE: form/field error - error class should go on field-wrap - .error { - - .field-label { - color: $error; - } - - .field { - border-color: $error; - } - - .tip, - .hint { - color: $error; - } - - } - -} - -// simple input - button type form -.form-horizontal { - .form-input { - display: inline-block; - width: 80%; - } - - .form-action { - display: inline-block; - width: 18%; - } -} - diff --git a/vendor/assets/stylesheets/elements/_header.scss b/vendor/assets/stylesheets/elements/_header.scss deleted file mode 100644 index b6e4e72..0000000 --- a/vendor/assets/stylesheets/elements/_header.scss +++ /dev/null @@ -1,93 +0,0 @@ -// header and navigation styles - -#skip { - position: absolute; - overflow: hidden; - top: 0; - left: 0; - height: 0; - width: 0; - color: $gray-l2; - background-color: $black; - border-bottom: 2px solid $success; - - &:focus { - position: relative; - display: block; - height: auto; - width: 100%; - padding: 5px 2%; - } -} - -.wrap-outer-header { - background-color: $black; - color: $white; -} - -.wrap-header { - background: $black image-url('vi-shape7-tp.svg') no-repeat 0 65%; - - .logo-mit-lib { - display: inline-block; - fill: $white; - color: $white; - - img { - width: auto; - max-height: 44px; - max-width: 100%; - } - } - - .link-logo-mit { - color: $white; - - .logo-mit { - fill: $gray-l1; - - .color { - fill: $white; - } - } - } -} - -// local header and nav -.wrap-outer-header-local { - border-bottom: 1px solid $gray-l2; - background-color: $white-t; - color: $gray-d1; - - .wrap-header-local { - padding-top: 2rem; - } - - a { - color: $gray-d1; - text-decoration: none; - } - - .title-site { - @extend .hd-2; - margin-bottom: 0; - } - - .action-auth { - @extend .button-primary; - } -} - - -// breadcrumb styles -.wrap-outer-breadcrumb { - background-color: $white; - color: $gray; - font-size: $fs-xsmall; -} - -.wrap-breadcrumb { - padding-top: 7px; - padding-bottom: 5px; -} - diff --git a/vendor/assets/stylesheets/elements/_modules.scss b/vendor/assets/stylesheets/elements/_modules.scss deleted file mode 100644 index e6f29cc..0000000 --- a/vendor/assets/stylesheets/elements/_modules.scss +++ /dev/null @@ -1,187 +0,0 @@ -// modules and other reusable bits - -.box-content { - border: 1px solid $gray-l3; - background-color: $white-t; - padding: 3%; -} - -.bit { - margin: 0 0 3rem 0; - border-top: 3px solid $gray-l2; - padding-top: 1rem; - font-size: $fs-small; - - .title { - @extend .hd-5; - } - - ul { - @extend .list-unbulleted; - } -} - -// global app style alerts and notices - -.alert { - - p { - margin-top: .2rem; - margin-bottom: .2rem; - } - - &.info { - color: $black; - } - - &.success { - color: $success; - } - - &.warning { - color: $warning; - } - - &.error { - color: $error; - } -} - -.wrap-notices { - background-color: $gray-d1; - color: $white; - font-size: $fs-xsmall; - - a { - color: $brand-primary2; - } - - &.info { - } - - &.success { - border-bottom: 4px solid $success; - } - - &.warning { - border-bottom: 4px solid $warning; - } - - &.error { - border-bottom: 4px solid $error; - } -} - -.alert-banner { - display: block; - margin-bottom: 2rem; - border-radius: 2px; - padding: 1.6rem 2rem; - border: 1px solid $brand-primary; - border-top: 5px solid $brand-primary; - color: $black-t; - font-weight: $fw-bold; - - .fa { - display: inline-block; - margin-right: .5em; - } - - &.success { - border: 1px solid $success; - border-top: 3px solid $success; - color: $black-t; - } - - &.warning { - border: 1px solid $warning; - border-top: 5px solid $warning; - color: $black-t; - } - - &.error { - border: 1px solid $error; - border-top: 5px solid $error; - color: $black-t; - } - - &.privacy-notice { - position: fixed; - bottom: 40px; - left: 10%; - right: 10%; - width: 80%; - display: flex; - justify-content: space-between; - background-color: #eee; - p { - margin-right: .5em; - } - } -} - -.inline-action { - - @media (min-width: $bp-screen-md) { - - .message { - display: inline-block; - vertical-align: middle; - width: 65% - } - - .actions { - display: inline-block; - vertical-align: middle; - width: 34%; - text-align: right; - } - } -} - -.well { - margin: 2rem 0; - background-color: $wisp; - box-shadow: inset 0 0 5px $shadow; - padding: 2rem 2.5rem; -} - -.panel { - position: relative; - margin: 1.5rem 0; - border: 1px solid $gray-l2; - background-color: $white; - border-top: 4px solid $brand-primary; - - .panel-heading { - @extend .copy-lead; - margin: 1.5rem 2rem .5rem 2rem; - } - - .panel-body { - margin: .5rem 2rem 1.5rem 2rem; - } - - .panel-footer { - font-size: $fs-small; - border-top: 1px solid $gray-l2; - background-color: $wisp; - padding: 1rem 2rem; - } - - &.panel-info { - border-top: 4px solid $brand-primary; - } - - &.panel-success { - border-top: 4px solid $success; - } - - &.panel-warning { - border-top: 4px solid $warning; - } - - &.panel-danger { - border-top: 4px solid $error; - } -} diff --git a/vendor/assets/stylesheets/elements/_tables.scss b/vendor/assets/stylesheets/elements/_tables.scss deleted file mode 100644 index a18cdff..0000000 --- a/vendor/assets/stylesheets/elements/_tables.scss +++ /dev/null @@ -1,112 +0,0 @@ -// tables - -.highlight { - background-color: lighten($warning, 20%); -} - -%table-base { - margin-top: 1rem; - margin-bottom: 2rem; - - caption { - margin-bottom: .5rem; - font-size: $fs-small; - text-align: left; - } - - tr:hover { - background-color: $smoke; - } - - th { - font-weight: $fw-bold; - text-align: left; - } - - th, - td { - padding: .75rem; - border: 1px solid $gray-l3; - } - - tfoot { - - tr { - border-top: 2px solid $gray-l3; - font-weight: $fw-bold; - } - } - - // can be used on cols, rows, or cells - .is-highlighted { - @extend .highlight; - } - - // can be used on rows or cells only - .align-left { - text-align: left; - } - - .align-center { - text-align: center; - } - - .align-right { - text-align: right; - } -} - -.table { - @extend %table-base; -} - -.table-simplified { - @extend %table-base; - - th, - td { - border: none; - border-bottom: 1px solid $gray-l3; - } -} - -// extra cozy -.table-cozy { - - th, - td { - padding: .5rem; - } -} - -// extra comfortable -.table-spacious { - - th, - td { - padding: 1.2rem; - } -} - -// wrapping div allows horizontally large tables to scroll on small screens -.wrapper-table-scrollable { - width: 100%; - overflow-y: auto; -} - -// responsive table enables `supplemental` columns to hide on small screens -.table-responsive { - - th.supplemental, - td.supplemental { - display: none; - } - - @media(min-width: $bp-screen-md) { - - th.supplemental, - td.supplemental { - display: table-cell; - } - } -} diff --git a/vendor/assets/stylesheets/global/_base.scss b/vendor/assets/stylesheets/global/_base.scss deleted file mode 100644 index 8eb5249..0000000 --- a/vendor/assets/stylesheets/global/_base.scss +++ /dev/null @@ -1,67 +0,0 @@ -// Base setup - -* { - box-sizing: border-box; -} - -html, body { - height: 100%; - font-size: 62.5%; -} - -body { - background-color: $gray; - color: $white; - font-size: 16px; - font-size: 1.6rem; - line-height: $lh-base; - font-family: $base-font; - -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - -ol, -ul { - padding-left: 2.5rem; -} - -li > ul, -li > ol { - margin-top: .5rem; -} - -dt { - font-weight: $fw-bold; -} - -dd { - margin-left: 0; - margin-bottom: 1rem; -} - -hr { - margin: 2rem 0; - border: none; - border-top: 1px solid $gray-l1; -} - -a { - @extend %link; -} - -// because -.wrap-outer-header.reasons { - background: #f23074; /* Old browsers */ - background: -moz-linear-gradient(45deg, #f23074 0%, #d6d628 36%, #207cca 66%, #544b8c 100%); /* FF3.6-15 */ - background: -webkit-linear-gradient(45deg, #f23074 0%,#d6d628 36%,#207cca 66%,#544b8c 100%); /* Chrome10-25,Safari5.1-6 */ - background: linear-gradient(45deg, #f23074 0%,#d6d628 36%,#207cca 66%,#544b8c 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f23074', endColorstr='#544b8c',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ - - .wrap-header { - background: transparent; - } -} diff --git a/vendor/assets/stylesheets/global/_helpers.scss b/vendor/assets/stylesheets/global/_helpers.scss deleted file mode 100644 index 9e0683b..0000000 --- a/vendor/assets/stylesheets/global/_helpers.scss +++ /dev/null @@ -1,161 +0,0 @@ -// mixins and extends for simple stuff that gets reused a lot - -.sr { - border: 0 none; - clip: rect(1px, 1px, 1px, 1px); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; - word-wrap: normal; -} - -@mixin sr-focusable { - &:focus { - position: static; - display: block; - height: auto; - width: auto; - } -} - -// flexbox wrapper -.wrap-bar { - display: flex; - justify-content: space-between; - align-items: center; -} - -@mixin clearfix { - &:after { - content: ''; - display: table; - clear: both; - } -} - -%unbutton { - @extend %link; - -webkit-appearance: none; - -moz-appearance: none; - border: 0; - background-color: transparent; - cursor: pointer; -} - -// remove spacing from first/last children -%clear-first-child { - &:first-child { - margin-top: 0; - padding-top: 0; - border-top: none; - } -} - -%clear-last-child { - &:last-child { - margin-bottom: 0; - padding-bottom: 0; - border-bottom: none; - } -} - -%text-ellipsis { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - -// lists -%reset-list { - margin: 0; - padding: 0; - list-style: none; - text-indent: 0; - - li, - dt, - dd { - margin: 0; - padding: 0; - } -} - -.list-unbulleted { - list-style: none; - padding-left: 0; - text-indent: 0; -} - -.list-inline { - @extend %reset-list; - - li, - dt, - dd { - display: inline-block; - } -} - -.list-inline-pipe { - padding-left: 0; - - li, - .item { - display: inline-block; - padding-right: 1rem; - - &:after { - content: ' | '; - margin-left: 1rem; - } - - &:last-child:after { - content: ''; - } - } -} - -.is-hidden { - display: none; -} - - -%link { - transition: all .25s ease-in-out 0s; - color: $brand-primary; - text-decoration: underline; - - // STATE: hover, active, focus - &:hover, - &:active, - &:focus { - color: $brand-primary-accent; - } - - // STATE: is disabled - &:disabled, - &.is-disabled { - border: none; - background-color: $gray-l3; - color: $gray-d1; - - &:hover { - border: none; - background-color: $gray-l3; - color: $gray-d1; - cursor: not-allowed; - } - } - - // STATE: is pressed or active - &:active, - &.is-pressed, - &.is-active { - color: $brand-secondary; - } -} - - diff --git a/vendor/assets/stylesheets/global/_layouts.scss b/vendor/assets/stylesheets/global/_layouts.scss deleted file mode 100644 index 7ca82a1..0000000 --- a/vendor/assets/stylesheets/global/_layouts.scss +++ /dev/null @@ -1,452 +0,0 @@ -// layouts - -// base layout styles for everyone! -.layout-band { - @include clearfix; -} - -.wrap-gridband, -.wrap-notice, -.wrap-header, -.wrap-header-local, -.wrap-breadcrumb, -.wrap-content, -.wrap-footer, -.wrap-footer-institute { - @include clearfix; - max-width: 114rem; - margin: 0 auto; - padding: 10px 4%; -} - -// generic grid options - -.gridband { - @include clearfix; - - .grid-item { - width: auto; - float: none; - } - - // 2-col generic with overflow - &.layout-2c { - - @media (min-width: $bp-screen-md) { - .grid-item { - float: left; - width: 48%; - margin-right: 3%; - - &:nth-child(2n+0) { - float: right; - margin-right: 0; - } - } - } - } - - // 3-col generic with overflow - &.layout-3c { - - @media (min-width: $bp-screen-md) { - .grid-item { - float: left; - width: 32%; - margin-right: 2%; - - &:nth-child(3n+3) { - float: right; - margin-right: 0; - } - } - } - } - - // 4-col generic with overflow - &.layout-4c { - - @media (min-width: $bp-screen-md) { - .grid-item { - float: left; - width: 23%; - margin-right: 2%; - - &:nth-child(4n+4) { - float: right; - margin-right: 0; - } - } - } - } -} - -// ---------------------------- -// #HEADER - global, slim, local -// ---------------------------- - -// simplified slim header for light branding -.wrap-header { - - .header-slim { - - .logo-mit-lib img { - height: 35px; - } - } -} - -.wrap-header-core, -.wrap-header-supp { - display: inline-block; - vertical-align: bottom; -} - -.wrap-header-core { - width: 65%; -} - -.wrap-header-supp { - width: 33%; - - .link-logo-mit { - float: right; - } -} - -// local header -.wrap-header-local { - - .wrap-local-nav { - margin-top: 8px; - - .nav-item { - @extend .button-subtle; - display: inline-block; - margin-right: 10px; - font-size: $fs-small; - text-decoration: none; - - &.current { - border: 1px solid $brand-primary-accent; - } - } - } -} - -// ---------------------------- -// #CONTENT -// ---------------------------- - -.wrap-outer-content { - background-color: $white-t; - color: $black; -} - -.wrap-content { - padding-top: 3rem; - padding-bottom: 2%; - - .content-main { - padding-bottom: 3rem; - } -} - -// 3/4 - 1/4 2-column layout -.layout-3q1q { - - @media (min-width: $bp-screen-md) { - - .col3q { - float: left; - width: 73%; - } - - .col1q-r { - float: right; - width: 22%; - margin-left: 3% - } - } -} - -// 1/4 - 3/4 2-column layout -.layout-1q3q { - - @media (min-width: $bp-screen-md) { - - .col1q { - float: left; - width: 22%; - margin-right: 3% - } - - .col3q { - float: right; - width: 73%; - } - } -} - -// 1/4 - 1/2 - 1/4 3-column layout -.layout-1q2q1q { - - @media (min-width: $bp-screen-md) { - - .col1q { - float: left; - width: 22%; - margin-right: 3% - } - - .content-main { - float: left; - width: 48%; - margin-right: 3% - } - - .col1q-r { - float: right; - width: 22%; - } - } -} - -// 1/3 - 2/3 2-column layout -.layout-1t2t { - - @media (min-width: $bp-screen-md) { - display: flex; - - .col1t { - float: left; - width: 33%; - margin-right: 3% - } - - .col2t { - float: right; - width: 63%; - } - } -} - -// 2/3 - 1/3 2-column layout -.layout-2t1t { - - @media (min-width: $bp-screen-md) { - display: flex; - - .col2t { - float: left; - width: 63%; - margin-right: 3% - } - - .col1t-r { - float: right; - width: 33%; - } - } -} - - - -// ---------------------------- -// #FOOTER - base and full -// ---------------------------- - -.wrap-footer { - padding: 3.5rem 4%; - - .wrap-sitemap { - - // hide the sub menu items on small screens - .menu-sub { - display: none; - } - } - - .identity { - margin-top: 4rem; - margin-bottom: 2rem; - } - - .wrap-logo-lib { - display: inline-block; - vertical-align: bottom; - margin: 0 20px 20px 0; - } - - .wrap-social { - display: inline-block; - vertical-align: bottom; - margin-bottom: 20px; - } - - .wrap-policies { - width: 100%; - border-top: 1px solid $gray; - padding-top: 2rem; - - span { - display: inline-block; - margin: 1rem 1.5rem 1rem 0; - - &.item { - margin-right: 0; - } - - &:after { - content:''; - } - } - } - - .wrap-social .text-find-us { - display: none; - } - - // bigger than small mobile - able to handle columns ok - @media (min-width: $bp-screen-md) { - - .wrap-sitemap { - display: flex; - flex-direction: row; - - .col { - margin-right: 3%; - - &:last-child { - margin-right: 0; - } - } - - .menu-sub { - display: block; - } - } - - .identity { - display: flex; - flex-wrap: wrap; - justify-content: space-between; - margin: 4% 0 0 0; - } - - .wrap-logo-lib, - .wrap-policies, - .wrap-social { - align-self: flex-end; - margin-top: 0; - margin-bottom: 0; - } - - .wrap-logo-lib { - order: 1; - margin-right: 4%; - } - - .wrap-policies { - order: 2; - padding: auto; - border-top: none; - width: auto; - - span { - margin-top: 0; - margin-bottom: 0; - } - } - - .wrap-social { - order: 3; - margin-left: auto; - } - } - - // large screen - able to handle several inline items - @media (min-width: $bp-screen-lg) { - - .wrap-social { - order: 3; - } - - .wrap-policies { - order: 2; - } - - } -} - -// footer - adjustments for slim -.wrap-footer.footer-slim { - padding: 1.5rem 4%; - - .wrap-middle { - order: 2; - display: flex; - flex: 1; // No other element gets a value, forcing this element to be greedy in its sizing - flex-direction: column; - align-items: flex-start; - - .wrap-policies { - align-self: flex-start; // This overrides the flex-end applicable to vertial alignment in full footer. - } - - .wrap-sitemap { - display: inline-block; - margin-bottom: 2rem; - - .item { - display: block; - margin-right: 10px; - margin-bottom: 5px; - } - } - } - - - // larger screen - able to handle several inline items - @media (min-width: $bp-screen-md) { - - .wrap-middle { - order: 2; - - .wrap-policies { - margin-left: 2%; - order: 2; - } - - .wrap-sitemap { - display: inline-block; - margin-left: 2%; - margin-bottom: auto; - order: 1; - - .item { - display: inline-block; - margin-bottom: auto; - } - } - } - - .wrap-social { - order: 3; - } - } - - @media (min-width: $bp-screen-lg) { - .wrap-policies { - } - - .wrap-sitemap { - } - } -} - -// mit institute footer -.wrap-footer-institute { - padding: 20px 4%; -} - diff --git a/vendor/assets/stylesheets/global/_shame.scss b/vendor/assets/stylesheets/global/_shame.scss deleted file mode 100644 index d2abe20..0000000 --- a/vendor/assets/stylesheets/global/_shame.scss +++ /dev/null @@ -1,4 +0,0 @@ -// remove the forms required asterisk abbr underline -abbr.required { - text-decoration: none; -} diff --git a/vendor/assets/stylesheets/global/_typography.scss b/vendor/assets/stylesheets/global/_typography.scss deleted file mode 100644 index 2317690..0000000 --- a/vendor/assets/stylesheets/global/_typography.scss +++ /dev/null @@ -1,81 +0,0 @@ -// general typography helpers - -// headers -.hd-1 { - margin-bottom: .5em; - font-size: $fs-xxxlarge; - line-height: $lh-tight; - font-weight: $fw-bold; -} - -.hd-2 { - margin-bottom: .5em; - font-size: $fs-xxlarge; - line-height: $lh-tight; - font-weight: $fw-bold; -} - -.hd-3 { - margin-bottom: .5em; - font-size: $fs-xlarge; - line-height: $lh-tight; - font-weight: $fw-normal; -} - -.hd-4 { - margin-bottom: .5em; - font-size: $fs-large; - line-height: $lh-tight; - font-weight: $fw-bold; -} - -.hd-5 { - margin-bottom: .5em; - font-size: $fs-base; - line-height: $lh-tight; - font-weight: $fw-bold; -} - -.hd-6 { - margin-bottom: .5em; - font-size: $fs-base; - line-height: $lh-tight; - font-weight: $fw-bold; -} - -.hd-subtitle1 { - margin-bottom: .5em; - font-size: $fs-base; - text-transform: uppercase; -} - -.hd-subtitle2 { - margin-bottom: .5em; - font-size: $fs-small; - text-transform: uppercase; -} - -.hd-subtitle3 { - margin-bottom: .5em; - font-size: $fs-xsmall; - text-transform: uppercase; -} - -// copy - -.copy-lead { - font-size: $fs-xlarge; -} - -.copy-base { - font-size: $fs-base; -} - -.copy-sup { - font-size: $fs-xsmall; -} - -.copy-micro { - font-size: $fs-xxsmall; - font-weight: $fw-normal; -} diff --git a/vendor/assets/stylesheets/global/_unsets.scss b/vendor/assets/stylesheets/global/_unsets.scss deleted file mode 100644 index 9ccfba2..0000000 --- a/vendor/assets/stylesheets/global/_unsets.scss +++ /dev/null @@ -1,29 +0,0 @@ -// clear base browser styling - -h1, h2, h3, h4, h5, h6 { - margin: 0; - font-weight: normal; - font-size: 1rem; - line-height: 1; -} - -p, -ol, -ul, -dl { - margin: 0 0 1em 0; -} - -img { - max-width: 100%; - vertical-align: middle; -} - -a { - text-decoration: none; -} - -input[type=checkbox], -input[type=radio] { - margin-right: .5rem; -} diff --git a/vendor/assets/stylesheets/global/_variables.scss b/vendor/assets/stylesheets/global/_variables.scss deleted file mode 100644 index 18fa150..0000000 --- a/vendor/assets/stylesheets/global/_variables.scss +++ /dev/null @@ -1,120 +0,0 @@ - -// ---------------------------- -// #SETTINGS -// ---------------------------- -$image-path: '/dest/i' !default; - -// ---------------------------- -// #GRID -// ---------------------------- - -// grid - breakpoints -$bp-screen-sm: 480px; -$bp-screen-md: 768px; -$bp-screen-lg: 1024px; -$bp-screen-xl: 1280px; - - -// ---------------------------- -// #COLORS -// ---------------------------- - -// NOTE: if updating color variables, you should also update -// the guide helper scss and the examples file; - -// colors - grayscale -$black: #000; -$black-t: #000; // true black -$white: #fff; -$white-warm: #ede8e2; -$white-t: #fff; // true white -$gray: #595959; // accessible on #f3f3f3 -$gray-d1: #333; -$gray-d2: #222; -$gray-l1: #767676; // accessible on #fff -$gray-l2: #ccc; -$gray-l3: #dedede; -$gray-l4: #f3f3f3; -$gray-warm: #c6b6a3; -$transparent: rgba(0, 0, 0, 0); // transparent black -$transparent-w: rgba(255,255,255,0); // transparent white -$glare: rgba($white-t, .3); -$shadow: rgba($black-t, .5); -$smoke: rgba($gray, .3); -$wisp: rgba($gray, .1); - -// pentagram colors - named -$magenta: #FF00FF; -$red: #FF0000; -$orange: #FF7700; -$yellow: #FFC800; -$green: #00C800; -$blue: #0000FF; -$blue-bright: #00C8FF; - -// pentagram colors secondary -$magenta-muted: #C702C7; -$red-muted: #D50606; -$orange-muted: #E46212; -$yellow-muted: #FFC422; -$green-muted: #008700; -$blue-muted: #1A1A83; -$blue-bright-muted: #04A6CF; - - -// colors - brand -$brand-primary: $black; -$brand-primary-accent: $blue; -$brand-primary2: $blue-bright; // accessible on dark -$brand-secondary: $magenta-muted; - -// colors - utilities -$success: $green-muted; -$warning: $yellow; -$error: $red-muted; -$informational: $gray; - - -// ---------------------------- -// #TYPOGRAPHY -// ---------------------------- - -$base-font: 'Helvetica Neue', Helvetica, Arial, 'Open Sans', sans-serif; -$alt-fonts: 'Georgia', Cambria, 'Times New Roman', Times, serif; - -// font-sizes and line-heights -$fs-xxxsmall: .9rem; -$fs-xxsmall: 1rem; -$fs-xsmall: 1.2rem; -$fs-smallish: 1.3rem; -$fs-small: 1.4rem; -$fs-base: 1.6rem; -$fs-large: 2.0rem; -$fs-xlarge: 2.6rem; -$fs-xxlarge: 3.2rem; -$fs-xxxlarge: 4.2rem; -$fs-xxxxlarge: 4.8rem; - -$fw-bold: 600; -$fw-normal: 400; -$fw-light: 300; - -$lh-xtight: .92; -$lh-tight: 1; -$lh-base: 1.2; -$lh-loose: 1.5; -$lh-xloose: 1.7; - - -// ---------------------------- -// #DEPTH -// ---------------------------- - -$z-depth-way-back: -1000; -$z-depth-back: -100; -$z-depth-lil-back: -10; -$z-depth-base: 1; -$z-depth-lil-front: 10; -$z-depth-front: 100; -$z-depth-way-front: 1000; - diff --git a/vendor/assets/stylesheets/global/_vendor-overrides.scss b/vendor/assets/stylesheets/global/_vendor-overrides.scss deleted file mode 100644 index b5b9801..0000000 --- a/vendor/assets/stylesheets/global/_vendor-overrides.scss +++ /dev/null @@ -1 +0,0 @@ -// Styles needed to override vendor stuff diff --git a/vendor/assets/stylesheets/js-elements/_expand-collapse.scss b/vendor/assets/stylesheets/js-elements/_expand-collapse.scss deleted file mode 100644 index 3b772d9..0000000 --- a/vendor/assets/stylesheets/js-elements/_expand-collapse.scss +++ /dev/null @@ -1,35 +0,0 @@ -.no-js { - .expand-collapse-control { - display: none; - } -} - -.js { - .expand-collapse-wrap { - position: relative; - overflow: hidden; - margin-bottom: 2rem; - padding-bottom: 2rem; - transition: height 200ms; - } - - .expand-container { - margin-bottom: 4rem; - } - - .expand-collapse-control { - position: absolute; - bottom: 0; - left: 0; - width: 100%; - margin: 0; - padding: 4rem .5rem .5rem .5rem; - background: #fff; // fallback - background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #f3f3f3 50%); - - .button { - @extend %unbutton; - @extend .button-secondary; - } - } -} diff --git a/vendor/assets/stylesheets/libraries-main.scss b/vendor/assets/stylesheets/libraries-main.scss deleted file mode 100644 index 378ea86..0000000 --- a/vendor/assets/stylesheets/libraries-main.scss +++ /dev/null @@ -1,39 +0,0 @@ -// ------------------------------ -// MIT Libraries Build Compile - LTR -// this compile makes a plain base css that includes everything for -// header, footer, and basic content styling across apps - -// +Base - Utilities -// ==================== -@import 'global/unsets'; -@import 'global/variables'; -@import 'global/helpers'; - -// +Starter -// ==================== -@import 'global/base'; -@import 'global/typography'; -@import 'global/layouts'; // various standard layouts - -// +Elements -// ==================== -@import 'elements/content'; // general content styles -@import 'elements/controls'; // buttons, link styles, sliders, etc. -@import 'elements/forms'; -@import 'elements/modules'; // block level UI bits -@import 'elements/tables'; -@import 'elements/header'; -@import 'elements/footer'; - -// +Specific Views -// ==================== - -// +Utility -// ==================== -@import 'global/vendor-overrides'; // overrides to vendor-provided styling -@import 'global/shame'; // used for any bad-form/orphaned scss - - -// +Select styles that need js -@import 'js-elements/expand-collapse'; - From 569a38d843419f40e0a7ae4579256acef5931d89 Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Thu, 1 Sep 2022 15:52:25 -0400 Subject: [PATCH 2/6] rails plugin new mitlibraries-theme --mountable --skip-git ** Why are these changes being introduced: * After deleting everything in the previous commit, now we need to start over with a fresh start. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/engx-175 ** How does this address that need: * This commits the output of the first command to initialize a new Rails engine, found at https://guides.rubyonrails.org/engines.html ** Document any side effects to this change: * None --- .gitignore | 12 +++ Gemfile | 12 +++ MIT-LICENSE | 20 ++++ README.md | 28 ++++++ Rakefile | 8 ++ .../config/mitlibraries_theme_manifest.js | 1 + app/assets/images/mitlibraries/theme/.keep | 0 .../mitlibraries/theme/application.css | 15 +++ app/controllers/concerns/.keep | 0 .../theme/application_controller.rb | 6 ++ .../mitlibraries/theme/application_helper.rb | 6 ++ .../mitlibraries/theme/application_job.rb | 6 ++ .../mitlibraries/theme/application_mailer.rb | 8 ++ app/models/concerns/.keep | 0 .../mitlibraries/theme/application_record.rb | 7 ++ .../mitlibraries/theme/application.html.erb | 15 +++ bin/rails | 14 +++ config/routes.rb | 2 + lib/mitlibraries/theme.rb | 8 ++ lib/mitlibraries/theme/engine.rb | 7 ++ lib/mitlibraries/theme/version.rb | 5 + lib/tasks/mitlibraries/theme_tasks.rake | 4 + mitlibraries-theme.gemspec | 26 ++++++ test/controllers/.keep | 0 test/dummy/Rakefile | 6 ++ test/dummy/app/assets/config/manifest.js | 3 + test/dummy/app/assets/images/.keep | 0 .../app/assets/stylesheets/application.css | 15 +++ .../app/channels/application_cable/channel.rb | 4 + .../channels/application_cable/connection.rb | 4 + .../app/controllers/application_controller.rb | 2 + test/dummy/app/controllers/concerns/.keep | 0 test/dummy/app/helpers/application_helper.rb | 2 + test/dummy/app/jobs/application_job.rb | 7 ++ test/dummy/app/mailers/application_mailer.rb | 4 + test/dummy/app/models/application_record.rb | 3 + test/dummy/app/models/concerns/.keep | 0 .../app/views/layouts/application.html.erb | 15 +++ test/dummy/app/views/layouts/mailer.html.erb | 13 +++ test/dummy/app/views/layouts/mailer.text.erb | 1 + test/dummy/bin/rails | 4 + test/dummy/bin/rake | 4 + test/dummy/bin/setup | 33 +++++++ test/dummy/config.ru | 6 ++ test/dummy/config/application.rb | 25 +++++ test/dummy/config/boot.rb | 5 + test/dummy/config/cable.yml | 10 ++ test/dummy/config/database.yml | 25 +++++ test/dummy/config/environment.rb | 5 + test/dummy/config/environments/development.rb | 70 ++++++++++++++ test/dummy/config/environments/production.rb | 93 +++++++++++++++++++ test/dummy/config/environments/test.rb | 60 ++++++++++++ test/dummy/config/initializers/assets.rb | 12 +++ .../initializers/content_security_policy.rb | 25 +++++ .../initializers/filter_parameter_logging.rb | 8 ++ test/dummy/config/initializers/inflections.rb | 16 ++++ .../config/initializers/permissions_policy.rb | 11 +++ test/dummy/config/locales/en.yml | 33 +++++++ test/dummy/config/puma.rb | 43 +++++++++ test/dummy/config/routes.rb | 3 + test/dummy/config/storage.yml | 34 +++++++ test/dummy/lib/assets/.keep | 0 test/dummy/log/.keep | 0 test/dummy/public/404.html | 67 +++++++++++++ test/dummy/public/422.html | 67 +++++++++++++ test/dummy/public/500.html | 66 +++++++++++++ .../public/apple-touch-icon-precomposed.png | 0 test/dummy/public/apple-touch-icon.png | 0 test/dummy/public/favicon.ico | 0 test/fixtures/files/.keep | 0 test/helpers/.keep | 0 test/integration/.keep | 0 test/integration/navigation_test.rb | 7 ++ test/mailers/.keep | 0 test/mitlibraries/theme_test.rb | 7 ++ test/models/.keep | 0 test/test_helper.rb | 15 +++ 77 files changed, 1043 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 MIT-LICENSE create mode 100644 README.md create mode 100644 Rakefile create mode 100644 app/assets/config/mitlibraries_theme_manifest.js create mode 100644 app/assets/images/mitlibraries/theme/.keep create mode 100644 app/assets/stylesheets/mitlibraries/theme/application.css create mode 100644 app/controllers/concerns/.keep create mode 100644 app/controllers/mitlibraries/theme/application_controller.rb create mode 100644 app/helpers/mitlibraries/theme/application_helper.rb create mode 100644 app/jobs/mitlibraries/theme/application_job.rb create mode 100644 app/mailers/mitlibraries/theme/application_mailer.rb create mode 100644 app/models/concerns/.keep create mode 100644 app/models/mitlibraries/theme/application_record.rb create mode 100644 app/views/layouts/mitlibraries/theme/application.html.erb create mode 100755 bin/rails create mode 100644 config/routes.rb create mode 100644 lib/mitlibraries/theme.rb create mode 100644 lib/mitlibraries/theme/engine.rb create mode 100644 lib/mitlibraries/theme/version.rb create mode 100644 lib/tasks/mitlibraries/theme_tasks.rake create mode 100644 mitlibraries-theme.gemspec create mode 100644 test/controllers/.keep create mode 100644 test/dummy/Rakefile create mode 100644 test/dummy/app/assets/config/manifest.js create mode 100644 test/dummy/app/assets/images/.keep create mode 100644 test/dummy/app/assets/stylesheets/application.css create mode 100644 test/dummy/app/channels/application_cable/channel.rb create mode 100644 test/dummy/app/channels/application_cable/connection.rb create mode 100644 test/dummy/app/controllers/application_controller.rb create mode 100644 test/dummy/app/controllers/concerns/.keep create mode 100644 test/dummy/app/helpers/application_helper.rb create mode 100644 test/dummy/app/jobs/application_job.rb create mode 100644 test/dummy/app/mailers/application_mailer.rb create mode 100644 test/dummy/app/models/application_record.rb create mode 100644 test/dummy/app/models/concerns/.keep create mode 100644 test/dummy/app/views/layouts/application.html.erb create mode 100644 test/dummy/app/views/layouts/mailer.html.erb create mode 100644 test/dummy/app/views/layouts/mailer.text.erb create mode 100755 test/dummy/bin/rails create mode 100755 test/dummy/bin/rake create mode 100755 test/dummy/bin/setup create mode 100644 test/dummy/config.ru create mode 100644 test/dummy/config/application.rb create mode 100644 test/dummy/config/boot.rb create mode 100644 test/dummy/config/cable.yml create mode 100644 test/dummy/config/database.yml create mode 100644 test/dummy/config/environment.rb create mode 100644 test/dummy/config/environments/development.rb create mode 100644 test/dummy/config/environments/production.rb create mode 100644 test/dummy/config/environments/test.rb create mode 100644 test/dummy/config/initializers/assets.rb create mode 100644 test/dummy/config/initializers/content_security_policy.rb create mode 100644 test/dummy/config/initializers/filter_parameter_logging.rb create mode 100644 test/dummy/config/initializers/inflections.rb create mode 100644 test/dummy/config/initializers/permissions_policy.rb create mode 100644 test/dummy/config/locales/en.yml create mode 100644 test/dummy/config/puma.rb create mode 100644 test/dummy/config/routes.rb create mode 100644 test/dummy/config/storage.yml create mode 100644 test/dummy/lib/assets/.keep create mode 100644 test/dummy/log/.keep create mode 100644 test/dummy/public/404.html create mode 100644 test/dummy/public/422.html create mode 100644 test/dummy/public/500.html create mode 100644 test/dummy/public/apple-touch-icon-precomposed.png create mode 100644 test/dummy/public/apple-touch-icon.png create mode 100644 test/dummy/public/favicon.ico create mode 100644 test/fixtures/files/.keep create mode 100644 test/helpers/.keep create mode 100644 test/integration/.keep create mode 100644 test/integration/navigation_test.rb create mode 100644 test/mailers/.keep create mode 100644 test/mitlibraries/theme_test.rb create mode 100644 test/models/.keep create mode 100644 test/test_helper.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e635b83 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +/.bundle/ +/doc/ +/log/*.log +/pkg/ +/tmp/ +/test/dummy/db/*.sqlite3 +/test/dummy/db/*.sqlite3-* +/test/dummy/log/*.log +/test/dummy/storage/ +/test/dummy/tmp/ + +.DS_Store diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..bd8697b --- /dev/null +++ b/Gemfile @@ -0,0 +1,12 @@ +source "https://rubygems.org" +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +# Specify your gem's dependencies in mitlibraries-theme.gemspec. +gemspec + +gem "sqlite3" + +gem "sprockets-rails" + +# Start debugger with binding.b [https://github.com/ruby/debug] +# gem "debug", ">= 1.0.0" diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..74da3fb --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright 2022 TODO: Write your name + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3442376 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# Mitlibraries::Theme +Short description and motivation. + +## Usage +How to use my plugin. + +## Installation +Add this line to your application's Gemfile: + +```ruby +gem "mitlibraries-theme" +``` + +And then execute: +```bash +$ bundle +``` + +Or install it yourself as: +```bash +$ gem install mitlibraries-theme +``` + +## Contributing +Contribution directions go here. + +## License +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..e7793b5 --- /dev/null +++ b/Rakefile @@ -0,0 +1,8 @@ +require "bundler/setup" + +APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__) +load "rails/tasks/engine.rake" + +load "rails/tasks/statistics.rake" + +require "bundler/gem_tasks" diff --git a/app/assets/config/mitlibraries_theme_manifest.js b/app/assets/config/mitlibraries_theme_manifest.js new file mode 100644 index 0000000..a247401 --- /dev/null +++ b/app/assets/config/mitlibraries_theme_manifest.js @@ -0,0 +1 @@ +//= link_directory ../stylesheets/mitlibraries/theme .css diff --git a/app/assets/images/mitlibraries/theme/.keep b/app/assets/images/mitlibraries/theme/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/stylesheets/mitlibraries/theme/application.css b/app/assets/stylesheets/mitlibraries/theme/application.css new file mode 100644 index 0000000..0ebd7fe --- /dev/null +++ b/app/assets/stylesheets/mitlibraries/theme/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/mitlibraries/theme/application_controller.rb b/app/controllers/mitlibraries/theme/application_controller.rb new file mode 100644 index 0000000..fda00a9 --- /dev/null +++ b/app/controllers/mitlibraries/theme/application_controller.rb @@ -0,0 +1,6 @@ +module Mitlibraries + module Theme + class ApplicationController < ActionController::Base + end + end +end diff --git a/app/helpers/mitlibraries/theme/application_helper.rb b/app/helpers/mitlibraries/theme/application_helper.rb new file mode 100644 index 0000000..44819f8 --- /dev/null +++ b/app/helpers/mitlibraries/theme/application_helper.rb @@ -0,0 +1,6 @@ +module Mitlibraries + module Theme + module ApplicationHelper + end + end +end diff --git a/app/jobs/mitlibraries/theme/application_job.rb b/app/jobs/mitlibraries/theme/application_job.rb new file mode 100644 index 0000000..a780c18 --- /dev/null +++ b/app/jobs/mitlibraries/theme/application_job.rb @@ -0,0 +1,6 @@ +module Mitlibraries + module Theme + class ApplicationJob < ActiveJob::Base + end + end +end diff --git a/app/mailers/mitlibraries/theme/application_mailer.rb b/app/mailers/mitlibraries/theme/application_mailer.rb new file mode 100644 index 0000000..07ea431 --- /dev/null +++ b/app/mailers/mitlibraries/theme/application_mailer.rb @@ -0,0 +1,8 @@ +module Mitlibraries + module Theme + class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" + end + end +end diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/mitlibraries/theme/application_record.rb b/app/models/mitlibraries/theme/application_record.rb new file mode 100644 index 0000000..868ac94 --- /dev/null +++ b/app/models/mitlibraries/theme/application_record.rb @@ -0,0 +1,7 @@ +module Mitlibraries + module Theme + class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true + end + end +end diff --git a/app/views/layouts/mitlibraries/theme/application.html.erb b/app/views/layouts/mitlibraries/theme/application.html.erb new file mode 100644 index 0000000..d841a31 --- /dev/null +++ b/app/views/layouts/mitlibraries/theme/application.html.erb @@ -0,0 +1,15 @@ + + + + Mitlibraries theme + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag "mitlibraries/theme/application", media: "all" %> + + + +<%= yield %> + + + diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..9b81051 --- /dev/null +++ b/bin/rails @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails gems +# installed from the root of your application. + +ENGINE_ROOT = File.expand_path("..", __dir__) +ENGINE_PATH = File.expand_path("../lib/mitlibraries/theme/engine", __dir__) +APP_PATH = File.expand_path("../test/dummy/config/application", __dir__) + +# Set up gems listed in the Gemfile. +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) +require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) + +require "rails/all" +require "rails/engine/commands" diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..42e6ecd --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,2 @@ +Mitlibraries::Theme::Engine.routes.draw do +end diff --git a/lib/mitlibraries/theme.rb b/lib/mitlibraries/theme.rb new file mode 100644 index 0000000..764bd2d --- /dev/null +++ b/lib/mitlibraries/theme.rb @@ -0,0 +1,8 @@ +require "mitlibraries/theme/version" +require "mitlibraries/theme/engine" + +module Mitlibraries + module Theme + # Your code goes here... + end +end diff --git a/lib/mitlibraries/theme/engine.rb b/lib/mitlibraries/theme/engine.rb new file mode 100644 index 0000000..4e11735 --- /dev/null +++ b/lib/mitlibraries/theme/engine.rb @@ -0,0 +1,7 @@ +module Mitlibraries + module Theme + class Engine < ::Rails::Engine + isolate_namespace Mitlibraries::Theme + end + end +end diff --git a/lib/mitlibraries/theme/version.rb b/lib/mitlibraries/theme/version.rb new file mode 100644 index 0000000..c359da8 --- /dev/null +++ b/lib/mitlibraries/theme/version.rb @@ -0,0 +1,5 @@ +module Mitlibraries + module Theme + VERSION = "0.1.0" + end +end diff --git a/lib/tasks/mitlibraries/theme_tasks.rake b/lib/tasks/mitlibraries/theme_tasks.rake new file mode 100644 index 0000000..fce13f0 --- /dev/null +++ b/lib/tasks/mitlibraries/theme_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :mitlibraries_theme do +# # Task goes here +# end diff --git a/mitlibraries-theme.gemspec b/mitlibraries-theme.gemspec new file mode 100644 index 0000000..8140514 --- /dev/null +++ b/mitlibraries-theme.gemspec @@ -0,0 +1,26 @@ +require_relative "lib/mitlibraries/theme/version" + +Gem::Specification.new do |spec| + spec.name = "mitlibraries-theme" + spec.version = Mitlibraries::Theme::VERSION + spec.authors = ["TODO: Write your name"] + spec.email = ["TODO: Write your email address"] + spec.homepage = "TODO" + spec.summary = "TODO: Summary of Mitlibraries::Theme." + spec.description = "TODO: Description of Mitlibraries::Theme." + spec.license = "MIT" + + # Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host" + # to allow pushing to a single host or delete this section to allow pushing to any host. + spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here." + spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here." + + spec.files = Dir.chdir(File.expand_path(__dir__)) do + Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] + end + + spec.add_dependency "rails", ">= 7.0.3.1" +end diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/Rakefile b/test/dummy/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/test/dummy/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/test/dummy/app/assets/config/manifest.js b/test/dummy/app/assets/config/manifest.js new file mode 100644 index 0000000..98c8cc0 --- /dev/null +++ b/test/dummy/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css +//= link mitlibraries_theme_manifest.js diff --git a/test/dummy/app/assets/images/.keep b/test/dummy/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/assets/stylesheets/application.css b/test/dummy/app/assets/stylesheets/application.css new file mode 100644 index 0000000..0ebd7fe --- /dev/null +++ b/test/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/test/dummy/app/channels/application_cable/channel.rb b/test/dummy/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..d672697 --- /dev/null +++ b/test/dummy/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/test/dummy/app/channels/application_cable/connection.rb b/test/dummy/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..0ff5442 --- /dev/null +++ b/test/dummy/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/test/dummy/app/controllers/application_controller.rb b/test/dummy/app/controllers/application_controller.rb new file mode 100644 index 0000000..09705d1 --- /dev/null +++ b/test/dummy/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/test/dummy/app/controllers/concerns/.keep b/test/dummy/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/helpers/application_helper.rb b/test/dummy/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/test/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/test/dummy/app/jobs/application_job.rb b/test/dummy/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/test/dummy/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/test/dummy/app/mailers/application_mailer.rb b/test/dummy/app/mailers/application_mailer.rb new file mode 100644 index 0000000..3c34c81 --- /dev/null +++ b/test/dummy/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/test/dummy/app/models/application_record.rb b/test/dummy/app/models/application_record.rb new file mode 100644 index 0000000..b63caeb --- /dev/null +++ b/test/dummy/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/test/dummy/app/models/concerns/.keep b/test/dummy/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/views/layouts/application.html.erb b/test/dummy/app/views/layouts/application.html.erb new file mode 100644 index 0000000..f72b4ef --- /dev/null +++ b/test/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,15 @@ + + + + Dummy + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag "application" %> + + + + <%= yield %> + + diff --git a/test/dummy/app/views/layouts/mailer.html.erb b/test/dummy/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..cbd34d2 --- /dev/null +++ b/test/dummy/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/test/dummy/app/views/layouts/mailer.text.erb b/test/dummy/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/test/dummy/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/test/dummy/bin/rails b/test/dummy/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/test/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/test/dummy/bin/rake b/test/dummy/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/test/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/test/dummy/bin/setup b/test/dummy/bin/setup new file mode 100755 index 0000000..ec47b79 --- /dev/null +++ b/test/dummy/bin/setup @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby +require "fileutils" + +# path to your application root. +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + puts "\n== Restarting application server ==" + system! "bin/rails restart" +end diff --git a/test/dummy/config.ru b/test/dummy/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/test/dummy/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb new file mode 100644 index 0000000..081758d --- /dev/null +++ b/test/dummy/config/application.rb @@ -0,0 +1,25 @@ +require_relative "boot" + +require "rails/all" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) +require "mitlibraries/theme" + +module Dummy + class Application < Rails::Application + config.load_defaults Rails::VERSION::STRING.to_f + + # For compatibility with applications that use this config + config.action_controller.include_all_helpers = false + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + end +end diff --git a/test/dummy/config/boot.rb b/test/dummy/config/boot.rb new file mode 100644 index 0000000..116591a --- /dev/null +++ b/test/dummy/config/boot.rb @@ -0,0 +1,5 @@ +# Set up gems listed in the Gemfile. +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__) + +require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) +$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__) diff --git a/test/dummy/config/cable.yml b/test/dummy/config/cable.yml new file mode 100644 index 0000000..98367f8 --- /dev/null +++ b/test/dummy/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: dummy_production diff --git a/test/dummy/config/database.yml b/test/dummy/config/database.yml new file mode 100644 index 0000000..fcba57f --- /dev/null +++ b/test/dummy/config/database.yml @@ -0,0 +1,25 @@ +# SQLite. Versions 3.8.0 and up are supported. +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem "sqlite3" +# +default: &default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/test/dummy/config/environment.rb b/test/dummy/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/test/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb new file mode 100644 index 0000000..8500f45 --- /dev/null +++ b/test/dummy/config/environments/development.rb @@ -0,0 +1,70 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing + config.server_timing = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true +end diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb new file mode 100644 index 0000000..8e989b5 --- /dev/null +++ b/test/dummy/config/environments/production.rb @@ -0,0 +1,93 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? + + # Compress CSS using a preprocessor. + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Mount Action Cable outside main process or domain. + # config.action_cable.mount_path = nil + # config.action_cable.url = "wss://example.com/cable" + # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Include generic and useful information about system operation, but avoid logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). + config.log_level = :info + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment). + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "dummy_production" + + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require "syslog/logger" + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb new file mode 100644 index 0000000..6ea4d1e --- /dev/null +++ b/test/dummy/config/environments/test.rb @@ -0,0 +1,60 @@ +require "active_support/core_ext/integer/time" + +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Turn false under Spring and add config.action_view.cache_template_loading = true. + config.cache_classes = true + + # Eager loading loads your whole application. When running a single test locally, + # this probably isn't necessary. It's a good idea to do in a continuous integration + # system, or in some way before deploying your code. + config.eager_load = ENV["CI"].present? + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{1.hour.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + config.cache_store = :null_store + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + config.action_mailer.perform_caching = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true +end diff --git a/test/dummy/config/initializers/assets.rb b/test/dummy/config/initializers/assets.rb new file mode 100644 index 0000000..2eeef96 --- /dev/null +++ b/test/dummy/config/initializers/assets.rb @@ -0,0 +1,12 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/test/dummy/config/initializers/content_security_policy.rb b/test/dummy/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..54f47cf --- /dev/null +++ b/test/dummy/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap and inline scripts +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src) +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/test/dummy/config/initializers/filter_parameter_logging.rb b/test/dummy/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..adc6568 --- /dev/null +++ b/test/dummy/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be filtered from the log file. Use this to limit dissemination of +# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported +# notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/test/dummy/config/initializers/inflections.rb b/test/dummy/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/test/dummy/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/test/dummy/config/initializers/permissions_policy.rb b/test/dummy/config/initializers/permissions_policy.rb new file mode 100644 index 0000000..00f64d7 --- /dev/null +++ b/test/dummy/config/initializers/permissions_policy.rb @@ -0,0 +1,11 @@ +# Define an application-wide HTTP permissions policy. For further +# information see https://developers.google.com/web/updates/2018/06/feature-policy +# +# Rails.application.config.permissions_policy do |f| +# f.camera :none +# f.gyroscope :none +# f.microphone :none +# f.usb :none +# f.fullscreen :self +# f.payment :self, "https://secure.example.com" +# end diff --git a/test/dummy/config/locales/en.yml b/test/dummy/config/locales/en.yml new file mode 100644 index 0000000..8ca56fc --- /dev/null +++ b/test/dummy/config/locales/en.yml @@ -0,0 +1,33 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# "true": "foo" +# +# To learn more, please read the Rails Internationalization guide +# available at https://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/test/dummy/config/puma.rb b/test/dummy/config/puma.rb new file mode 100644 index 0000000..daaf036 --- /dev/null +++ b/test/dummy/config/puma.rb @@ -0,0 +1,43 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +# +worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked web server processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. +# +# preload_app! + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb new file mode 100644 index 0000000..1f9c15a --- /dev/null +++ b/test/dummy/config/routes.rb @@ -0,0 +1,3 @@ +Rails.application.routes.draw do + mount Mitlibraries::Theme::Engine => "/mitlibraries-theme" +end diff --git a/test/dummy/config/storage.yml b/test/dummy/config/storage.yml new file mode 100644 index 0000000..4942ab6 --- /dev/null +++ b/test/dummy/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/test/dummy/lib/assets/.keep b/test/dummy/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/log/.keep b/test/dummy/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/public/404.html b/test/dummy/public/404.html new file mode 100644 index 0000000..2be3af2 --- /dev/null +++ b/test/dummy/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/test/dummy/public/422.html b/test/dummy/public/422.html new file mode 100644 index 0000000..c08eac0 --- /dev/null +++ b/test/dummy/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/test/dummy/public/500.html b/test/dummy/public/500.html new file mode 100644 index 0000000..78a030a --- /dev/null +++ b/test/dummy/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/test/dummy/public/apple-touch-icon-precomposed.png b/test/dummy/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/public/apple-touch-icon.png b/test/dummy/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/public/favicon.ico b/test/dummy/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/navigation_test.rb b/test/integration/navigation_test.rb new file mode 100644 index 0000000..ebbc098 --- /dev/null +++ b/test/integration/navigation_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class NavigationTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/mitlibraries/theme_test.rb b/test/mitlibraries/theme_test.rb new file mode 100644 index 0000000..f2d1c9e --- /dev/null +++ b/test/mitlibraries/theme_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class Mitlibraries::ThemeTest < ActiveSupport::TestCase + test "it has a version number" do + assert Mitlibraries::Theme::VERSION + end +end diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..7230d9c --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,15 @@ +# Configure Rails Environment +ENV["RAILS_ENV"] = "test" + +require_relative "../test/dummy/config/environment" +ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)] +ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__) +require "rails/test_help" + +# Load fixtures from the engine +if ActiveSupport::TestCase.respond_to?(:fixture_path=) + ActiveSupport::TestCase.fixture_path = File.expand_path("fixtures", __dir__) + ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path + ActiveSupport::TestCase.file_fixture_path = ActiveSupport::TestCase.fixture_path + "/files" + ActiveSupport::TestCase.fixtures :all +end From dc4978e10fa90a10de3ef87310f5ea7949baac72 Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Thu, 1 Sep 2022 16:08:07 -0400 Subject: [PATCH 3/6] Copy vendor, layouts, and helpers from Tesseract ** Why are these changes being introduced: * Starting from the boilerplate engine, we need to copy/paste the contents of the proof-of-concept gem (Tesseract) which was developed earlier in this ticket. * We also need to remove an unused application layout template in a namespaced folder path, to prevent future confusion. * The tests for the link helper class need to be added. * The theme assets in vendor/assets need to be added to the asset pipeline. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/engx-175 ** How does this address that need: * This copies the key parts of the Tesseract proof of concept into this gem: * link helper class (including tests) * layout partials * vendor/assets materials (including adding them to asset pipeline) * The changes made in these files from the old theme gem will appear in the overall diff. Most of these changes are the addition of new boilerplate files, but the following specific changes should be noted: * The addition of `extend self` to the link helper class, which helps expose `nav_link_to` to implementing apps. * The addition of the csp_meta_tag directive to the application layout * The change of the body class from `app-thing` to `app-tesseract` * Removes the unused application layout template from its namespaced path. The file which gets used is still in the prior location. ** Document any side effects to this change: * None --- app/helpers/link_helper.rb | 24 + app/views/layouts/_flash.html.erb | 8 + app/views/layouts/_global_alert.html.erb | 9 + app/views/layouts/_head.html.erb | 45 ++ app/views/layouts/_institute_footer.html.erb | 15 + app/views/layouts/_js_exception_handler.erb | 14 + app/views/layouts/_libraries_footer.html.erb | 60 +++ app/views/layouts/_site_footer.html.erb | 1 + app/views/layouts/_site_header.html.erb | 17 + app/views/layouts/_site_nav.html.erb | 16 + app/views/layouts/application.html.erb | 39 ++ .../mitlibraries/theme/application.html.erb | 15 - lib/mitlibraries/theme/engine.rb | 4 + test/helpers/link_helper_test.rb | 17 + vendor/assets/images/favicon.ico | Bin 0 -> 15406 bytes vendor/assets/images/mitlib-wordmark.svg | 1 + vendor/assets/images/vi-shape7-tp.svg | 1 + .../assets/stylesheets/elements/_content.scss | 74 +++ .../stylesheets/elements/_controls.scss | 156 ++++++ .../assets/stylesheets/elements/_footer.scss | 132 +++++ .../assets/stylesheets/elements/_forms.scss | 151 ++++++ .../assets/stylesheets/elements/_header.scss | 93 ++++ .../assets/stylesheets/elements/_modules.scss | 187 ++++++++ .../assets/stylesheets/elements/_tables.scss | 112 +++++ vendor/assets/stylesheets/global/_base.scss | 67 +++ .../assets/stylesheets/global/_helpers.scss | 161 +++++++ .../assets/stylesheets/global/_layouts.scss | 452 ++++++++++++++++++ vendor/assets/stylesheets/global/_shame.scss | 4 + .../stylesheets/global/_typography.scss | 81 ++++ vendor/assets/stylesheets/global/_unsets.scss | 29 ++ .../assets/stylesheets/global/_variables.scss | 120 +++++ .../stylesheets/global/_vendor-overrides.scss | 1 + .../js-elements/_expand-collapse.scss | 35 ++ vendor/assets/stylesheets/libraries-main.scss | 39 ++ 34 files changed, 2165 insertions(+), 15 deletions(-) create mode 100644 app/helpers/link_helper.rb create mode 100644 app/views/layouts/_flash.html.erb create mode 100644 app/views/layouts/_global_alert.html.erb create mode 100644 app/views/layouts/_head.html.erb create mode 100644 app/views/layouts/_institute_footer.html.erb create mode 100644 app/views/layouts/_js_exception_handler.erb create mode 100644 app/views/layouts/_libraries_footer.html.erb create mode 100644 app/views/layouts/_site_footer.html.erb create mode 100644 app/views/layouts/_site_header.html.erb create mode 100644 app/views/layouts/_site_nav.html.erb create mode 100644 app/views/layouts/application.html.erb delete mode 100644 app/views/layouts/mitlibraries/theme/application.html.erb create mode 100644 test/helpers/link_helper_test.rb create mode 100644 vendor/assets/images/favicon.ico create mode 100644 vendor/assets/images/mitlib-wordmark.svg create mode 100644 vendor/assets/images/vi-shape7-tp.svg create mode 100644 vendor/assets/stylesheets/elements/_content.scss create mode 100644 vendor/assets/stylesheets/elements/_controls.scss create mode 100644 vendor/assets/stylesheets/elements/_footer.scss create mode 100644 vendor/assets/stylesheets/elements/_forms.scss create mode 100644 vendor/assets/stylesheets/elements/_header.scss create mode 100644 vendor/assets/stylesheets/elements/_modules.scss create mode 100644 vendor/assets/stylesheets/elements/_tables.scss create mode 100644 vendor/assets/stylesheets/global/_base.scss create mode 100644 vendor/assets/stylesheets/global/_helpers.scss create mode 100644 vendor/assets/stylesheets/global/_layouts.scss create mode 100644 vendor/assets/stylesheets/global/_shame.scss create mode 100644 vendor/assets/stylesheets/global/_typography.scss create mode 100644 vendor/assets/stylesheets/global/_unsets.scss create mode 100644 vendor/assets/stylesheets/global/_variables.scss create mode 100644 vendor/assets/stylesheets/global/_vendor-overrides.scss create mode 100644 vendor/assets/stylesheets/js-elements/_expand-collapse.scss create mode 100644 vendor/assets/stylesheets/libraries-main.scss diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb new file mode 100644 index 0000000..00e52f4 --- /dev/null +++ b/app/helpers/link_helper.rb @@ -0,0 +1,24 @@ +module LinkHelper + extend self + + # helper wrapper around link_to that inserts visual and screen reader info + # for navigation links + def nav_link_to(name, url) + link_to(name, url, + class: link_class(url), + 'aria-current': aria_current?(url)) + end + + private + + # Includes css `current` class if current page + def link_class(url) + return 'nav-item' unless current_page?(url) + 'nav-item current' + end + + # Includes css `current` class if current page + def aria_current?(url) + return 'page' if current_page?(url) + end +end diff --git a/app/views/layouts/_flash.html.erb b/app/views/layouts/_flash.html.erb new file mode 100644 index 0000000..3654694 --- /dev/null +++ b/app/views/layouts/_flash.html.erb @@ -0,0 +1,8 @@ +<% if flash %> + <% flash.each do |msg_type, message| %> + <% next if msg_type == 'global' %> + + <% end %> +<% end %> diff --git a/app/views/layouts/_global_alert.html.erb b/app/views/layouts/_global_alert.html.erb new file mode 100644 index 0000000..7746d90 --- /dev/null +++ b/app/views/layouts/_global_alert.html.erb @@ -0,0 +1,9 @@ +<% if ENV['GLOBAL_ALERT'] %> +
+
+
+

<%= sanitize(ENV['GLOBAL_ALERT']) %>

+
+
+
+<% end %> diff --git a/app/views/layouts/_head.html.erb b/app/views/layouts/_head.html.erb new file mode 100644 index 0000000..c41e1ec --- /dev/null +++ b/app/views/layouts/_head.html.erb @@ -0,0 +1,45 @@ + + + +<%= content_for?(:title) ? yield(:title) : " MIT Libraries" %> +<%= csrf_meta_tags %> +<%= csp_meta_tag %> + +<%= yield :additional_meta_tag %> + + + + + +<%= stylesheet_link_tag "application", :media => "all" %> + + + +<%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %> + +<%= render partial: "layouts/js_exception_handler" %> +<%= javascript_include_tag "application" %> + + + +<%= yield :additional_js %> + +<% if (ENV['MATOMO_URL'].present? && ENV['MATOMO_SITE_ID'].present?) %> + + + +<% end %> diff --git a/app/views/layouts/_institute_footer.html.erb b/app/views/layouts/_institute_footer.html.erb new file mode 100644 index 0000000..3004c8c --- /dev/null +++ b/app/views/layouts/_institute_footer.html.erb @@ -0,0 +1,15 @@ + diff --git a/app/views/layouts/_js_exception_handler.erb b/app/views/layouts/_js_exception_handler.erb new file mode 100644 index 0000000..609995e --- /dev/null +++ b/app/views/layouts/_js_exception_handler.erb @@ -0,0 +1,14 @@ +<% if ENV['JS_EXCEPTION_LOGGER_KEY'].present? %> + + + +<% end %> diff --git a/app/views/layouts/_libraries_footer.html.erb b/app/views/layouts/_libraries_footer.html.erb new file mode 100644 index 0000000..f342a86 --- /dev/null +++ b/app/views/layouts/_libraries_footer.html.erb @@ -0,0 +1,60 @@ + diff --git a/app/views/layouts/_site_footer.html.erb b/app/views/layouts/_site_footer.html.erb new file mode 100644 index 0000000..fb15738 --- /dev/null +++ b/app/views/layouts/_site_footer.html.erb @@ -0,0 +1 @@ +<%# This template can be used to place content at the bottom of each page above the libraries and institute footers %> diff --git a/app/views/layouts/_site_header.html.erb b/app/views/layouts/_site_header.html.erb new file mode 100644 index 0000000..e1a517b --- /dev/null +++ b/app/views/layouts/_site_header.html.erb @@ -0,0 +1,17 @@ + diff --git a/app/views/layouts/_site_nav.html.erb b/app/views/layouts/_site_nav.html.erb new file mode 100644 index 0000000..842491c --- /dev/null +++ b/app/views/layouts/_site_nav.html.erb @@ -0,0 +1,16 @@ +
+
+ +
+
+ +
+
+
+
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..7cfab07 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,39 @@ + + + + <%= render partial: "layouts/head" %> + + + + +
+ + <%= render partial: "layouts/global_alert" %> + + <%= render partial: "layouts/site_header" %> + + <%= render partial: "layouts/site_nav" %> + +
+
+
+ <%= render partial: "layouts/flash" %> + + <%= yield %> + + <%= render partial: "layouts/site_footer" %> +
+ +
+
+ + + +
+ <%= render partial: "layouts/libraries_footer" %> + <%= render partial: "layouts/institute_footer" %> +
+
+ + + diff --git a/app/views/layouts/mitlibraries/theme/application.html.erb b/app/views/layouts/mitlibraries/theme/application.html.erb deleted file mode 100644 index d841a31..0000000 --- a/app/views/layouts/mitlibraries/theme/application.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - - - - Mitlibraries theme - <%= csrf_meta_tags %> - <%= csp_meta_tag %> - - <%= stylesheet_link_tag "mitlibraries/theme/application", media: "all" %> - - - -<%= yield %> - - - diff --git a/lib/mitlibraries/theme/engine.rb b/lib/mitlibraries/theme/engine.rb index 4e11735..dc885a5 100644 --- a/lib/mitlibraries/theme/engine.rb +++ b/lib/mitlibraries/theme/engine.rb @@ -2,6 +2,10 @@ module Mitlibraries module Theme class Engine < ::Rails::Engine isolate_namespace Mitlibraries::Theme + + initializer "mitlibraries.theme.assets.precompile" do |app| + app.config.assets.precompile += %w( favicon.ico mitlib-wordmark.svg vi-shape7-tp.svg libraries-main.css ) + end end end end diff --git a/test/helpers/link_helper_test.rb b/test/helpers/link_helper_test.rb new file mode 100644 index 0000000..97a5e55 --- /dev/null +++ b/test/helpers/link_helper_test.rb @@ -0,0 +1,17 @@ +require 'test_helper' + +class LinkHelperTest < ActionView::TestCase + test 'nav_link_to denotes links to current page' do + target_url = '/' + expected = 'Home' + assert current_page?(target_url) + assert_equal expected, nav_link_to('Home', '/') + end + + test 'nav_link_to links to arbitrary page' do + target_url = '/foo' + expected = 'Foo' + refute current_page?(target_url) + assert_equal expected, nav_link_to('Foo', '/foo') + end +end diff --git a/vendor/assets/images/favicon.ico b/vendor/assets/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..1ee0b8481ef574b55088a0b12db8db016c19e4ca GIT binary patch literal 15406 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 bGH=&fvh%t6L3+W9bv@{-pRY8q%o_L)Jw~VV literal 0 HcmV?d00001 diff --git a/vendor/assets/images/mitlib-wordmark.svg b/vendor/assets/images/mitlib-wordmark.svg new file mode 100644 index 0000000..e2685b9 --- /dev/null +++ b/vendor/assets/images/mitlib-wordmark.svg @@ -0,0 +1 @@ +MIT Libraries Logo diff --git a/vendor/assets/images/vi-shape7-tp.svg b/vendor/assets/images/vi-shape7-tp.svg new file mode 100644 index 0000000..4ce4164 --- /dev/null +++ b/vendor/assets/images/vi-shape7-tp.svg @@ -0,0 +1 @@ +vi-shape7-tp diff --git a/vendor/assets/stylesheets/elements/_content.scss b/vendor/assets/stylesheets/elements/_content.scss new file mode 100644 index 0000000..2e8b794 --- /dev/null +++ b/vendor/assets/stylesheets/elements/_content.scss @@ -0,0 +1,74 @@ +// content-specific styles + +.wrap-content { + +// unreset base content pieces + h1, + .hd-1 { + @extend .hd-1; + } + + h2, + .hd-2 { + @extend .hd-2; + } + + h3, + .hd-3 { + @extend .hd-3; + } + + h4, + .hd-4 { + @extend .hd-4; + } + + h5, + .hd-5 { + @extend .hd-5; + } + + h6, + .hd-6 { + @extend .hd-6; + } + + .subtitle { + @extend .hd-subtitle1; + } + + .subtitle2 { + @extend .hd-subtitle2; + } + + .subtitle3 { + @extend .hd-subtitle3; + } + + li { + margin-bottom: .5em; + } + + // wordpress specific classes + .title-page { + margin-bottom: 1rem; + padding: .5rem 0 1rem 0; + font-weight: $fw-bold; + } + + .cta-link { + transition: background-color ease-in-out .3s; + display: inline-block; + padding: .5em; + color: $black; + font-size: $fs-large; + font-weight: $fw-bold; + text-decoration: underline; + + &:hover { + background-color: $brand-secondary; + color: $white; + } + } +} + diff --git a/vendor/assets/stylesheets/elements/_controls.scss b/vendor/assets/stylesheets/elements/_controls.scss new file mode 100644 index 0000000..e96f56f --- /dev/null +++ b/vendor/assets/stylesheets/elements/_controls.scss @@ -0,0 +1,156 @@ + +.button-primary { + transition: background-color .25s, border .25s; + display: inline-block; + border: 1px solid $brand-primary; + border-radius: 3px; + padding: 5px 10px; + background-color: $brand-primary; + color: $white; + text-decoration: none; + + &:hover, + &:focus { + background-color: $brand-primary-accent; + border-color: $brand-primary-accent; + color: $white; + text-decoration: none; + } + + &.green { + border: 1px solid darken($black, 5%); + background-color: $black; + + &:hover, + &:focus { + background-color: saturate($green-muted, 20%); + border-color: $green-muted; + } + } + + &.magenta { + border: 1px solid darken($black, 5%); + background-color: $black; + + &:hover, + &:focus { + background-color: saturate($magenta-muted, 20%); + border-color: $magenta-muted; + } + } + + &.warn { + border: 1px solid darken($error, 10%); + background-color: darken($error, 5%); + + &:before { + font-family: FontAwesome; + content: "\f071 "; + font-size: .8em; + margin-right: 5px; + } + + &:hover, + &:focus { + background-color: saturate($error, 20%); + border-color: $error; + } + } +} + +.button-secondary { + transition: background-color .25s, border .25s; + display: inline-block; + border: 1px solid $gray-l2; + border-radius: 3px; + padding: 5px 10px; + background-color: transparent; + color: $black; + text-decoration: none; + + &:hover, + &:focus { + background-color: $brand-primary-accent; + border-color: $brand-primary-accent; + color: $white; + text-decoration: none; + } + + &.green { + color: $black; + + &:hover, + &:focus { + background-color: saturate($green-muted, 20%); + border-color: $green-muted; + color: $white; + } + } + + &.magenta { + color: $black; + + &:hover, + &:focus { + background-color: saturate($magenta-muted, 20%); + border-color: $magenta-muted; + color: $white; + } + } + + &.warn { + color: $error; + + &:before { + font-family: FontAwesome; + content: "\f071 "; + font-size: .8em; + margin-right: 5px; + } + + &:hover, + &:focus { + background-color: saturate($error, 20%); + border-color: $error; + color: $white; + } + } +} + +.button-subtle { + @extend .button-secondary; + border: 0; +} + +.button-small { + padding: 2px 10px; +} + + +// ruby pagination nav +.pagination { + margin: 1rem; + + .page { + display: inline-block; + min-width: 3rem; + text-align: center; + } + + a { + @extend .button-subtle; + } + + .current { + font-weight: $fw-bold; + } + + .gap { + } + + .next { + } + + .last { + } +} diff --git a/vendor/assets/stylesheets/elements/_footer.scss b/vendor/assets/stylesheets/elements/_footer.scss new file mode 100644 index 0000000..34f2544 --- /dev/null +++ b/vendor/assets/stylesheets/elements/_footer.scss @@ -0,0 +1,132 @@ +// footer styles + +.wrap-outer-footer { + background-color: $black; + color: $white; + font-size: $fs-xsmall; +} + +.wrap-footer { + background: $black image-url('vi-shape7-tp.svg') no-repeat 10% center; + + a { + @extend %link; + color: $white; + text-decoration: none; + + &:hover, + &:active, + &:focus { + text-decoration: underline; + color: $white; + } + } + + .title { + @extend .hd-6; + margin-bottom: .8rem; + } + + .wrap-list .link-sub { + display: list-item; + list-style-type: none; + margin-bottom: .65rem; + font-weight: $fw-light; + } + + .logo-mit-lib { + fill: $white; + + img { + max-height: 60px; + max-width: 100%; + vertical-align: baseline; + } + } + + .wrap-policies { + @extend .list-inline-pipe; + font-size: $fs-small; + } + + .wrap-social { + + p, a { + display: inline-block; + vertical-align: middle; + margin-left: .5rem; + margin-bottom: 0; + text-transform: uppercase; + font-size: $fs-xsmall; + } + + svg { + height: 2em; + width: 2em; + border-radius: 50%; + padding: 0.2em; + background: $white none repeat scroll 0 0; + + path { + fill: $gray-d1; + } + } + } +} + +// footer - adjustments for slim +.wrap-footer.footer-slim { + + .sitemap-libraries-abbrev a { + @extend .list-inline-pipe; + font-size: $fs-small; + } + +} + +// MIT footer +.wrap-outer-footer-institute { + background-color: $gray-d1; + font-size: $fs-xxsmall; + color: $gray-l3; + + .footer-info-institute { + display: flex; + justify-content: space-between; + align-items: baseline; + } + + a { + @extend %link; + color: $white; + &:hover, + &:active, + &:focus { + color: $white; + } + } + + .link-logo-mit { + + .logo-mit { + fill: $gray-l2; + + .color { + fill: $white; + } + } + } + + .about-mit { + color: $gray-l3; + margin-right: 4%; + text-transform: uppercase; + white-space: nowrap; + } + + .license { + margin-left: auto; + margin-top: 1rem; + color: $gray-l3; + } +} diff --git a/vendor/assets/stylesheets/elements/_forms.scss b/vendor/assets/stylesheets/elements/_forms.scss new file mode 100644 index 0000000..eec4935 --- /dev/null +++ b/vendor/assets/stylesheets/elements/_forms.scss @@ -0,0 +1,151 @@ +// base form styles + +form { + margin: 1.5rem 0; + + fieldset { + margin-top: 1.5rem; + margin-bottom: 1.5rem; + border: 1px solid $gray-l2; + padding: 1rem 1.5rem; + } + + legend { + padding: 0 1rem; + font-size: $fs-small; + color: $gray; + text-transform: uppercase; + } + + .field-wrap, + .field-group { + margin-bottom: 1rem; + } + + .field-label { + display: inline-block; + margin-bottom: .2rem; + font-size: $fs-small; + font-weight: $fw-bold; + } + + .field { + display: block; + margin-top: .2rem; + margin-bottom: .2rem; + + &:focus, &:active { + border-color: $brand-primary-accent; + box-shadow: 0 0 5px rgba($brand-primary-accent,.8); + } + + &.wide { + width: 90%; + } + } + + .field-text { + min-width: 25rem; + border: 1px solid $gray-l2; + border-radius: 2px; + padding: 6px 12px; + background-image: none; + background-color: $white-t; + box-shadow: inset 0 0 3px rgba(0,0,0,.2); + } + + .tip, + .hint { + font-size: $fs-small; + color: $informational; + margin-bottom: 0; + + &.error { + color: $error; + } + } + + .field-textarea { + display: block; + min-width: 25rem; + } + + .field-select { + display: block; + min-width: 25rem; + } + + .field-upload { + border: none; + } + + .group-inline { + margin-bottom: 1rem; + + .field-wrap { + display: inline-block; + vertical-align: top; + margin-bottom: .2rem; + } + + .field-select { + min-width: auto; + } + } + + .fields-inline { + + .field-label { + display: inline-block; + max-width: 30%; + } + + .field { + display: inline-block; + max-width: 65%; + } + + &.field-radio { + display: inline-block; + margin-right: 1.5rem; + } + } + + .disabled { + color: $gray; + cursor: not-allowed; + } + +// CASE: form/field error - error class should go on field-wrap + .error { + + .field-label { + color: $error; + } + + .field { + border-color: $error; + } + + .tip, + .hint { + color: $error; + } + + } + +} + +// simple input - button type form +.form-horizontal { + .form-input { + display: inline-block; + width: 80%; + } + + .form-action { + display: inline-block; + width: 18%; + } +} + diff --git a/vendor/assets/stylesheets/elements/_header.scss b/vendor/assets/stylesheets/elements/_header.scss new file mode 100644 index 0000000..b6e4e72 --- /dev/null +++ b/vendor/assets/stylesheets/elements/_header.scss @@ -0,0 +1,93 @@ +// header and navigation styles + +#skip { + position: absolute; + overflow: hidden; + top: 0; + left: 0; + height: 0; + width: 0; + color: $gray-l2; + background-color: $black; + border-bottom: 2px solid $success; + + &:focus { + position: relative; + display: block; + height: auto; + width: 100%; + padding: 5px 2%; + } +} + +.wrap-outer-header { + background-color: $black; + color: $white; +} + +.wrap-header { + background: $black image-url('vi-shape7-tp.svg') no-repeat 0 65%; + + .logo-mit-lib { + display: inline-block; + fill: $white; + color: $white; + + img { + width: auto; + max-height: 44px; + max-width: 100%; + } + } + + .link-logo-mit { + color: $white; + + .logo-mit { + fill: $gray-l1; + + .color { + fill: $white; + } + } + } +} + +// local header and nav +.wrap-outer-header-local { + border-bottom: 1px solid $gray-l2; + background-color: $white-t; + color: $gray-d1; + + .wrap-header-local { + padding-top: 2rem; + } + + a { + color: $gray-d1; + text-decoration: none; + } + + .title-site { + @extend .hd-2; + margin-bottom: 0; + } + + .action-auth { + @extend .button-primary; + } +} + + +// breadcrumb styles +.wrap-outer-breadcrumb { + background-color: $white; + color: $gray; + font-size: $fs-xsmall; +} + +.wrap-breadcrumb { + padding-top: 7px; + padding-bottom: 5px; +} + diff --git a/vendor/assets/stylesheets/elements/_modules.scss b/vendor/assets/stylesheets/elements/_modules.scss new file mode 100644 index 0000000..e6f29cc --- /dev/null +++ b/vendor/assets/stylesheets/elements/_modules.scss @@ -0,0 +1,187 @@ +// modules and other reusable bits + +.box-content { + border: 1px solid $gray-l3; + background-color: $white-t; + padding: 3%; +} + +.bit { + margin: 0 0 3rem 0; + border-top: 3px solid $gray-l2; + padding-top: 1rem; + font-size: $fs-small; + + .title { + @extend .hd-5; + } + + ul { + @extend .list-unbulleted; + } +} + +// global app style alerts and notices + +.alert { + + p { + margin-top: .2rem; + margin-bottom: .2rem; + } + + &.info { + color: $black; + } + + &.success { + color: $success; + } + + &.warning { + color: $warning; + } + + &.error { + color: $error; + } +} + +.wrap-notices { + background-color: $gray-d1; + color: $white; + font-size: $fs-xsmall; + + a { + color: $brand-primary2; + } + + &.info { + } + + &.success { + border-bottom: 4px solid $success; + } + + &.warning { + border-bottom: 4px solid $warning; + } + + &.error { + border-bottom: 4px solid $error; + } +} + +.alert-banner { + display: block; + margin-bottom: 2rem; + border-radius: 2px; + padding: 1.6rem 2rem; + border: 1px solid $brand-primary; + border-top: 5px solid $brand-primary; + color: $black-t; + font-weight: $fw-bold; + + .fa { + display: inline-block; + margin-right: .5em; + } + + &.success { + border: 1px solid $success; + border-top: 3px solid $success; + color: $black-t; + } + + &.warning { + border: 1px solid $warning; + border-top: 5px solid $warning; + color: $black-t; + } + + &.error { + border: 1px solid $error; + border-top: 5px solid $error; + color: $black-t; + } + + &.privacy-notice { + position: fixed; + bottom: 40px; + left: 10%; + right: 10%; + width: 80%; + display: flex; + justify-content: space-between; + background-color: #eee; + p { + margin-right: .5em; + } + } +} + +.inline-action { + + @media (min-width: $bp-screen-md) { + + .message { + display: inline-block; + vertical-align: middle; + width: 65% + } + + .actions { + display: inline-block; + vertical-align: middle; + width: 34%; + text-align: right; + } + } +} + +.well { + margin: 2rem 0; + background-color: $wisp; + box-shadow: inset 0 0 5px $shadow; + padding: 2rem 2.5rem; +} + +.panel { + position: relative; + margin: 1.5rem 0; + border: 1px solid $gray-l2; + background-color: $white; + border-top: 4px solid $brand-primary; + + .panel-heading { + @extend .copy-lead; + margin: 1.5rem 2rem .5rem 2rem; + } + + .panel-body { + margin: .5rem 2rem 1.5rem 2rem; + } + + .panel-footer { + font-size: $fs-small; + border-top: 1px solid $gray-l2; + background-color: $wisp; + padding: 1rem 2rem; + } + + &.panel-info { + border-top: 4px solid $brand-primary; + } + + &.panel-success { + border-top: 4px solid $success; + } + + &.panel-warning { + border-top: 4px solid $warning; + } + + &.panel-danger { + border-top: 4px solid $error; + } +} diff --git a/vendor/assets/stylesheets/elements/_tables.scss b/vendor/assets/stylesheets/elements/_tables.scss new file mode 100644 index 0000000..a18cdff --- /dev/null +++ b/vendor/assets/stylesheets/elements/_tables.scss @@ -0,0 +1,112 @@ +// tables + +.highlight { + background-color: lighten($warning, 20%); +} + +%table-base { + margin-top: 1rem; + margin-bottom: 2rem; + + caption { + margin-bottom: .5rem; + font-size: $fs-small; + text-align: left; + } + + tr:hover { + background-color: $smoke; + } + + th { + font-weight: $fw-bold; + text-align: left; + } + + th, + td { + padding: .75rem; + border: 1px solid $gray-l3; + } + + tfoot { + + tr { + border-top: 2px solid $gray-l3; + font-weight: $fw-bold; + } + } + + // can be used on cols, rows, or cells + .is-highlighted { + @extend .highlight; + } + + // can be used on rows or cells only + .align-left { + text-align: left; + } + + .align-center { + text-align: center; + } + + .align-right { + text-align: right; + } +} + +.table { + @extend %table-base; +} + +.table-simplified { + @extend %table-base; + + th, + td { + border: none; + border-bottom: 1px solid $gray-l3; + } +} + +// extra cozy +.table-cozy { + + th, + td { + padding: .5rem; + } +} + +// extra comfortable +.table-spacious { + + th, + td { + padding: 1.2rem; + } +} + +// wrapping div allows horizontally large tables to scroll on small screens +.wrapper-table-scrollable { + width: 100%; + overflow-y: auto; +} + +// responsive table enables `supplemental` columns to hide on small screens +.table-responsive { + + th.supplemental, + td.supplemental { + display: none; + } + + @media(min-width: $bp-screen-md) { + + th.supplemental, + td.supplemental { + display: table-cell; + } + } +} diff --git a/vendor/assets/stylesheets/global/_base.scss b/vendor/assets/stylesheets/global/_base.scss new file mode 100644 index 0000000..8eb5249 --- /dev/null +++ b/vendor/assets/stylesheets/global/_base.scss @@ -0,0 +1,67 @@ +// Base setup + +* { + box-sizing: border-box; +} + +html, body { + height: 100%; + font-size: 62.5%; +} + +body { + background-color: $gray; + color: $white; + font-size: 16px; + font-size: 1.6rem; + line-height: $lh-base; + font-family: $base-font; + +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +ol, +ul { + padding-left: 2.5rem; +} + +li > ul, +li > ol { + margin-top: .5rem; +} + +dt { + font-weight: $fw-bold; +} + +dd { + margin-left: 0; + margin-bottom: 1rem; +} + +hr { + margin: 2rem 0; + border: none; + border-top: 1px solid $gray-l1; +} + +a { + @extend %link; +} + +// because +.wrap-outer-header.reasons { + background: #f23074; /* Old browsers */ + background: -moz-linear-gradient(45deg, #f23074 0%, #d6d628 36%, #207cca 66%, #544b8c 100%); /* FF3.6-15 */ + background: -webkit-linear-gradient(45deg, #f23074 0%,#d6d628 36%,#207cca 66%,#544b8c 100%); /* Chrome10-25,Safari5.1-6 */ + background: linear-gradient(45deg, #f23074 0%,#d6d628 36%,#207cca 66%,#544b8c 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f23074', endColorstr='#544b8c',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ + + .wrap-header { + background: transparent; + } +} diff --git a/vendor/assets/stylesheets/global/_helpers.scss b/vendor/assets/stylesheets/global/_helpers.scss new file mode 100644 index 0000000..9e0683b --- /dev/null +++ b/vendor/assets/stylesheets/global/_helpers.scss @@ -0,0 +1,161 @@ +// mixins and extends for simple stuff that gets reused a lot + +.sr { + border: 0 none; + clip: rect(1px, 1px, 1px, 1px); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; + word-wrap: normal; +} + +@mixin sr-focusable { + &:focus { + position: static; + display: block; + height: auto; + width: auto; + } +} + +// flexbox wrapper +.wrap-bar { + display: flex; + justify-content: space-between; + align-items: center; +} + +@mixin clearfix { + &:after { + content: ''; + display: table; + clear: both; + } +} + +%unbutton { + @extend %link; + -webkit-appearance: none; + -moz-appearance: none; + border: 0; + background-color: transparent; + cursor: pointer; +} + +// remove spacing from first/last children +%clear-first-child { + &:first-child { + margin-top: 0; + padding-top: 0; + border-top: none; + } +} + +%clear-last-child { + &:last-child { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; + } +} + +%text-ellipsis { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +// lists +%reset-list { + margin: 0; + padding: 0; + list-style: none; + text-indent: 0; + + li, + dt, + dd { + margin: 0; + padding: 0; + } +} + +.list-unbulleted { + list-style: none; + padding-left: 0; + text-indent: 0; +} + +.list-inline { + @extend %reset-list; + + li, + dt, + dd { + display: inline-block; + } +} + +.list-inline-pipe { + padding-left: 0; + + li, + .item { + display: inline-block; + padding-right: 1rem; + + &:after { + content: ' | '; + margin-left: 1rem; + } + + &:last-child:after { + content: ''; + } + } +} + +.is-hidden { + display: none; +} + + +%link { + transition: all .25s ease-in-out 0s; + color: $brand-primary; + text-decoration: underline; + + // STATE: hover, active, focus + &:hover, + &:active, + &:focus { + color: $brand-primary-accent; + } + + // STATE: is disabled + &:disabled, + &.is-disabled { + border: none; + background-color: $gray-l3; + color: $gray-d1; + + &:hover { + border: none; + background-color: $gray-l3; + color: $gray-d1; + cursor: not-allowed; + } + } + + // STATE: is pressed or active + &:active, + &.is-pressed, + &.is-active { + color: $brand-secondary; + } +} + + diff --git a/vendor/assets/stylesheets/global/_layouts.scss b/vendor/assets/stylesheets/global/_layouts.scss new file mode 100644 index 0000000..7ca82a1 --- /dev/null +++ b/vendor/assets/stylesheets/global/_layouts.scss @@ -0,0 +1,452 @@ +// layouts + +// base layout styles for everyone! +.layout-band { + @include clearfix; +} + +.wrap-gridband, +.wrap-notice, +.wrap-header, +.wrap-header-local, +.wrap-breadcrumb, +.wrap-content, +.wrap-footer, +.wrap-footer-institute { + @include clearfix; + max-width: 114rem; + margin: 0 auto; + padding: 10px 4%; +} + +// generic grid options + +.gridband { + @include clearfix; + + .grid-item { + width: auto; + float: none; + } + + // 2-col generic with overflow + &.layout-2c { + + @media (min-width: $bp-screen-md) { + .grid-item { + float: left; + width: 48%; + margin-right: 3%; + + &:nth-child(2n+0) { + float: right; + margin-right: 0; + } + } + } + } + + // 3-col generic with overflow + &.layout-3c { + + @media (min-width: $bp-screen-md) { + .grid-item { + float: left; + width: 32%; + margin-right: 2%; + + &:nth-child(3n+3) { + float: right; + margin-right: 0; + } + } + } + } + + // 4-col generic with overflow + &.layout-4c { + + @media (min-width: $bp-screen-md) { + .grid-item { + float: left; + width: 23%; + margin-right: 2%; + + &:nth-child(4n+4) { + float: right; + margin-right: 0; + } + } + } + } +} + +// ---------------------------- +// #HEADER - global, slim, local +// ---------------------------- + +// simplified slim header for light branding +.wrap-header { + + .header-slim { + + .logo-mit-lib img { + height: 35px; + } + } +} + +.wrap-header-core, +.wrap-header-supp { + display: inline-block; + vertical-align: bottom; +} + +.wrap-header-core { + width: 65%; +} + +.wrap-header-supp { + width: 33%; + + .link-logo-mit { + float: right; + } +} + +// local header +.wrap-header-local { + + .wrap-local-nav { + margin-top: 8px; + + .nav-item { + @extend .button-subtle; + display: inline-block; + margin-right: 10px; + font-size: $fs-small; + text-decoration: none; + + &.current { + border: 1px solid $brand-primary-accent; + } + } + } +} + +// ---------------------------- +// #CONTENT +// ---------------------------- + +.wrap-outer-content { + background-color: $white-t; + color: $black; +} + +.wrap-content { + padding-top: 3rem; + padding-bottom: 2%; + + .content-main { + padding-bottom: 3rem; + } +} + +// 3/4 - 1/4 2-column layout +.layout-3q1q { + + @media (min-width: $bp-screen-md) { + + .col3q { + float: left; + width: 73%; + } + + .col1q-r { + float: right; + width: 22%; + margin-left: 3% + } + } +} + +// 1/4 - 3/4 2-column layout +.layout-1q3q { + + @media (min-width: $bp-screen-md) { + + .col1q { + float: left; + width: 22%; + margin-right: 3% + } + + .col3q { + float: right; + width: 73%; + } + } +} + +// 1/4 - 1/2 - 1/4 3-column layout +.layout-1q2q1q { + + @media (min-width: $bp-screen-md) { + + .col1q { + float: left; + width: 22%; + margin-right: 3% + } + + .content-main { + float: left; + width: 48%; + margin-right: 3% + } + + .col1q-r { + float: right; + width: 22%; + } + } +} + +// 1/3 - 2/3 2-column layout +.layout-1t2t { + + @media (min-width: $bp-screen-md) { + display: flex; + + .col1t { + float: left; + width: 33%; + margin-right: 3% + } + + .col2t { + float: right; + width: 63%; + } + } +} + +// 2/3 - 1/3 2-column layout +.layout-2t1t { + + @media (min-width: $bp-screen-md) { + display: flex; + + .col2t { + float: left; + width: 63%; + margin-right: 3% + } + + .col1t-r { + float: right; + width: 33%; + } + } +} + + + +// ---------------------------- +// #FOOTER - base and full +// ---------------------------- + +.wrap-footer { + padding: 3.5rem 4%; + + .wrap-sitemap { + + // hide the sub menu items on small screens + .menu-sub { + display: none; + } + } + + .identity { + margin-top: 4rem; + margin-bottom: 2rem; + } + + .wrap-logo-lib { + display: inline-block; + vertical-align: bottom; + margin: 0 20px 20px 0; + } + + .wrap-social { + display: inline-block; + vertical-align: bottom; + margin-bottom: 20px; + } + + .wrap-policies { + width: 100%; + border-top: 1px solid $gray; + padding-top: 2rem; + + span { + display: inline-block; + margin: 1rem 1.5rem 1rem 0; + + &.item { + margin-right: 0; + } + + &:after { + content:''; + } + } + } + + .wrap-social .text-find-us { + display: none; + } + + // bigger than small mobile - able to handle columns ok + @media (min-width: $bp-screen-md) { + + .wrap-sitemap { + display: flex; + flex-direction: row; + + .col { + margin-right: 3%; + + &:last-child { + margin-right: 0; + } + } + + .menu-sub { + display: block; + } + } + + .identity { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + margin: 4% 0 0 0; + } + + .wrap-logo-lib, + .wrap-policies, + .wrap-social { + align-self: flex-end; + margin-top: 0; + margin-bottom: 0; + } + + .wrap-logo-lib { + order: 1; + margin-right: 4%; + } + + .wrap-policies { + order: 2; + padding: auto; + border-top: none; + width: auto; + + span { + margin-top: 0; + margin-bottom: 0; + } + } + + .wrap-social { + order: 3; + margin-left: auto; + } + } + + // large screen - able to handle several inline items + @media (min-width: $bp-screen-lg) { + + .wrap-social { + order: 3; + } + + .wrap-policies { + order: 2; + } + + } +} + +// footer - adjustments for slim +.wrap-footer.footer-slim { + padding: 1.5rem 4%; + + .wrap-middle { + order: 2; + display: flex; + flex: 1; // No other element gets a value, forcing this element to be greedy in its sizing + flex-direction: column; + align-items: flex-start; + + .wrap-policies { + align-self: flex-start; // This overrides the flex-end applicable to vertial alignment in full footer. + } + + .wrap-sitemap { + display: inline-block; + margin-bottom: 2rem; + + .item { + display: block; + margin-right: 10px; + margin-bottom: 5px; + } + } + } + + + // larger screen - able to handle several inline items + @media (min-width: $bp-screen-md) { + + .wrap-middle { + order: 2; + + .wrap-policies { + margin-left: 2%; + order: 2; + } + + .wrap-sitemap { + display: inline-block; + margin-left: 2%; + margin-bottom: auto; + order: 1; + + .item { + display: inline-block; + margin-bottom: auto; + } + } + } + + .wrap-social { + order: 3; + } + } + + @media (min-width: $bp-screen-lg) { + .wrap-policies { + } + + .wrap-sitemap { + } + } +} + +// mit institute footer +.wrap-footer-institute { + padding: 20px 4%; +} + diff --git a/vendor/assets/stylesheets/global/_shame.scss b/vendor/assets/stylesheets/global/_shame.scss new file mode 100644 index 0000000..d2abe20 --- /dev/null +++ b/vendor/assets/stylesheets/global/_shame.scss @@ -0,0 +1,4 @@ +// remove the forms required asterisk abbr underline +abbr.required { + text-decoration: none; +} diff --git a/vendor/assets/stylesheets/global/_typography.scss b/vendor/assets/stylesheets/global/_typography.scss new file mode 100644 index 0000000..2317690 --- /dev/null +++ b/vendor/assets/stylesheets/global/_typography.scss @@ -0,0 +1,81 @@ +// general typography helpers + +// headers +.hd-1 { + margin-bottom: .5em; + font-size: $fs-xxxlarge; + line-height: $lh-tight; + font-weight: $fw-bold; +} + +.hd-2 { + margin-bottom: .5em; + font-size: $fs-xxlarge; + line-height: $lh-tight; + font-weight: $fw-bold; +} + +.hd-3 { + margin-bottom: .5em; + font-size: $fs-xlarge; + line-height: $lh-tight; + font-weight: $fw-normal; +} + +.hd-4 { + margin-bottom: .5em; + font-size: $fs-large; + line-height: $lh-tight; + font-weight: $fw-bold; +} + +.hd-5 { + margin-bottom: .5em; + font-size: $fs-base; + line-height: $lh-tight; + font-weight: $fw-bold; +} + +.hd-6 { + margin-bottom: .5em; + font-size: $fs-base; + line-height: $lh-tight; + font-weight: $fw-bold; +} + +.hd-subtitle1 { + margin-bottom: .5em; + font-size: $fs-base; + text-transform: uppercase; +} + +.hd-subtitle2 { + margin-bottom: .5em; + font-size: $fs-small; + text-transform: uppercase; +} + +.hd-subtitle3 { + margin-bottom: .5em; + font-size: $fs-xsmall; + text-transform: uppercase; +} + +// copy + +.copy-lead { + font-size: $fs-xlarge; +} + +.copy-base { + font-size: $fs-base; +} + +.copy-sup { + font-size: $fs-xsmall; +} + +.copy-micro { + font-size: $fs-xxsmall; + font-weight: $fw-normal; +} diff --git a/vendor/assets/stylesheets/global/_unsets.scss b/vendor/assets/stylesheets/global/_unsets.scss new file mode 100644 index 0000000..9ccfba2 --- /dev/null +++ b/vendor/assets/stylesheets/global/_unsets.scss @@ -0,0 +1,29 @@ +// clear base browser styling + +h1, h2, h3, h4, h5, h6 { + margin: 0; + font-weight: normal; + font-size: 1rem; + line-height: 1; +} + +p, +ol, +ul, +dl { + margin: 0 0 1em 0; +} + +img { + max-width: 100%; + vertical-align: middle; +} + +a { + text-decoration: none; +} + +input[type=checkbox], +input[type=radio] { + margin-right: .5rem; +} diff --git a/vendor/assets/stylesheets/global/_variables.scss b/vendor/assets/stylesheets/global/_variables.scss new file mode 100644 index 0000000..18fa150 --- /dev/null +++ b/vendor/assets/stylesheets/global/_variables.scss @@ -0,0 +1,120 @@ + +// ---------------------------- +// #SETTINGS +// ---------------------------- +$image-path: '/dest/i' !default; + +// ---------------------------- +// #GRID +// ---------------------------- + +// grid - breakpoints +$bp-screen-sm: 480px; +$bp-screen-md: 768px; +$bp-screen-lg: 1024px; +$bp-screen-xl: 1280px; + + +// ---------------------------- +// #COLORS +// ---------------------------- + +// NOTE: if updating color variables, you should also update +// the guide helper scss and the examples file; + +// colors - grayscale +$black: #000; +$black-t: #000; // true black +$white: #fff; +$white-warm: #ede8e2; +$white-t: #fff; // true white +$gray: #595959; // accessible on #f3f3f3 +$gray-d1: #333; +$gray-d2: #222; +$gray-l1: #767676; // accessible on #fff +$gray-l2: #ccc; +$gray-l3: #dedede; +$gray-l4: #f3f3f3; +$gray-warm: #c6b6a3; +$transparent: rgba(0, 0, 0, 0); // transparent black +$transparent-w: rgba(255,255,255,0); // transparent white +$glare: rgba($white-t, .3); +$shadow: rgba($black-t, .5); +$smoke: rgba($gray, .3); +$wisp: rgba($gray, .1); + +// pentagram colors - named +$magenta: #FF00FF; +$red: #FF0000; +$orange: #FF7700; +$yellow: #FFC800; +$green: #00C800; +$blue: #0000FF; +$blue-bright: #00C8FF; + +// pentagram colors secondary +$magenta-muted: #C702C7; +$red-muted: #D50606; +$orange-muted: #E46212; +$yellow-muted: #FFC422; +$green-muted: #008700; +$blue-muted: #1A1A83; +$blue-bright-muted: #04A6CF; + + +// colors - brand +$brand-primary: $black; +$brand-primary-accent: $blue; +$brand-primary2: $blue-bright; // accessible on dark +$brand-secondary: $magenta-muted; + +// colors - utilities +$success: $green-muted; +$warning: $yellow; +$error: $red-muted; +$informational: $gray; + + +// ---------------------------- +// #TYPOGRAPHY +// ---------------------------- + +$base-font: 'Helvetica Neue', Helvetica, Arial, 'Open Sans', sans-serif; +$alt-fonts: 'Georgia', Cambria, 'Times New Roman', Times, serif; + +// font-sizes and line-heights +$fs-xxxsmall: .9rem; +$fs-xxsmall: 1rem; +$fs-xsmall: 1.2rem; +$fs-smallish: 1.3rem; +$fs-small: 1.4rem; +$fs-base: 1.6rem; +$fs-large: 2.0rem; +$fs-xlarge: 2.6rem; +$fs-xxlarge: 3.2rem; +$fs-xxxlarge: 4.2rem; +$fs-xxxxlarge: 4.8rem; + +$fw-bold: 600; +$fw-normal: 400; +$fw-light: 300; + +$lh-xtight: .92; +$lh-tight: 1; +$lh-base: 1.2; +$lh-loose: 1.5; +$lh-xloose: 1.7; + + +// ---------------------------- +// #DEPTH +// ---------------------------- + +$z-depth-way-back: -1000; +$z-depth-back: -100; +$z-depth-lil-back: -10; +$z-depth-base: 1; +$z-depth-lil-front: 10; +$z-depth-front: 100; +$z-depth-way-front: 1000; + diff --git a/vendor/assets/stylesheets/global/_vendor-overrides.scss b/vendor/assets/stylesheets/global/_vendor-overrides.scss new file mode 100644 index 0000000..b5b9801 --- /dev/null +++ b/vendor/assets/stylesheets/global/_vendor-overrides.scss @@ -0,0 +1 @@ +// Styles needed to override vendor stuff diff --git a/vendor/assets/stylesheets/js-elements/_expand-collapse.scss b/vendor/assets/stylesheets/js-elements/_expand-collapse.scss new file mode 100644 index 0000000..3b772d9 --- /dev/null +++ b/vendor/assets/stylesheets/js-elements/_expand-collapse.scss @@ -0,0 +1,35 @@ +.no-js { + .expand-collapse-control { + display: none; + } +} + +.js { + .expand-collapse-wrap { + position: relative; + overflow: hidden; + margin-bottom: 2rem; + padding-bottom: 2rem; + transition: height 200ms; + } + + .expand-container { + margin-bottom: 4rem; + } + + .expand-collapse-control { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + margin: 0; + padding: 4rem .5rem .5rem .5rem; + background: #fff; // fallback + background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #f3f3f3 50%); + + .button { + @extend %unbutton; + @extend .button-secondary; + } + } +} diff --git a/vendor/assets/stylesheets/libraries-main.scss b/vendor/assets/stylesheets/libraries-main.scss new file mode 100644 index 0000000..378ea86 --- /dev/null +++ b/vendor/assets/stylesheets/libraries-main.scss @@ -0,0 +1,39 @@ +// ------------------------------ +// MIT Libraries Build Compile - LTR +// this compile makes a plain base css that includes everything for +// header, footer, and basic content styling across apps + +// +Base - Utilities +// ==================== +@import 'global/unsets'; +@import 'global/variables'; +@import 'global/helpers'; + +// +Starter +// ==================== +@import 'global/base'; +@import 'global/typography'; +@import 'global/layouts'; // various standard layouts + +// +Elements +// ==================== +@import 'elements/content'; // general content styles +@import 'elements/controls'; // buttons, link styles, sliders, etc. +@import 'elements/forms'; +@import 'elements/modules'; // block level UI bits +@import 'elements/tables'; +@import 'elements/header'; +@import 'elements/footer'; + +// +Specific Views +// ==================== + +// +Utility +// ==================== +@import 'global/vendor-overrides'; // overrides to vendor-provided styling +@import 'global/shame'; // used for any bad-form/orphaned scss + + +// +Select styles that need js +@import 'js-elements/expand-collapse'; + From 7e52c15ec0e59f55ff763242c06488c06afa278e Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Wed, 7 Sep 2022 11:52:32 -0400 Subject: [PATCH 4/6] Restore meta files, some minor updates ** Why are these changes being introduced: * The choice to start this branch by wiping the directory and creating a new gem from `rails new plugin` meant that some meta files which are unrelated have been removed (such as the code of conduct and makefile) * Some minor parts of other files are not optimal (quoting of strings, for example) ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/engx-175 ** How does this address that need: * This restores some meta files from the project root, as well as some values from the gemspec file. * The project readme is updated, with an additional step under the usage section. * Some minor changes to the gemspec file, as well as the contents of lib/ ** Document any side effects to this change: * None --- CODE_OF_CONDUCT.md | 74 ++++++++++++ Gemfile | 4 +- Gemfile.lock | 188 ++++++++++++++++++++++++++++++ LICENSE.txt | 21 ++++ MIT-LICENSE | 20 ---- Makefile | 56 +++++++++ README.md | 106 +++++++++++++++-- lib/mitlibraries/theme.rb | 6 +- lib/mitlibraries/theme/version.rb | 2 +- mitlibraries-theme.gemspec | 25 ++-- test/mitlibraries/theme_test.rb | 4 +- 11 files changed, 459 insertions(+), 47 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 Gemfile.lock create mode 100644 LICENSE.txt delete mode 100644 MIT-LICENSE create mode 100644 Makefile diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..151f11c --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at jprevost@mit.edu. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/Gemfile b/Gemfile index bd8697b..1f71a88 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ -source "https://rubygems.org" +source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -# Specify your gem's dependencies in mitlibraries-theme.gemspec. +# Specify your gem's dependencies in mitlibraries-theme.gemspec gemspec gem "sqlite3" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..757214a --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,188 @@ +PATH + remote: . + specs: + mitlibraries-theme (0.9.0) + rails (>= 6, < 8) + sassc-rails (~> 2) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.3.1) + actionpack (= 7.0.3.1) + activesupport (= 7.0.3.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.3.1) + actionpack (= 7.0.3.1) + activejob (= 7.0.3.1) + activerecord (= 7.0.3.1) + activestorage (= 7.0.3.1) + activesupport (= 7.0.3.1) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.3.1) + actionpack (= 7.0.3.1) + actionview (= 7.0.3.1) + activejob (= 7.0.3.1) + activesupport (= 7.0.3.1) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.3.1) + actionview (= 7.0.3.1) + activesupport (= 7.0.3.1) + rack (~> 2.0, >= 2.2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.3.1) + actionpack (= 7.0.3.1) + activerecord (= 7.0.3.1) + activestorage (= 7.0.3.1) + activesupport (= 7.0.3.1) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.3.1) + activesupport (= 7.0.3.1) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.3.1) + activesupport (= 7.0.3.1) + globalid (>= 0.3.6) + activemodel (7.0.3.1) + activesupport (= 7.0.3.1) + activerecord (7.0.3.1) + activemodel (= 7.0.3.1) + activesupport (= 7.0.3.1) + activestorage (7.0.3.1) + actionpack (= 7.0.3.1) + activejob (= 7.0.3.1) + activerecord (= 7.0.3.1) + activesupport (= 7.0.3.1) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.3.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + builder (3.2.4) + concurrent-ruby (1.1.10) + crass (1.0.6) + debug (1.6.2) + irb (>= 1.3.6) + reline (>= 0.3.1) + digest (3.1.0) + erubi (1.11.0) + ffi (1.15.5) + globalid (1.0.0) + activesupport (>= 5.0) + i18n (1.12.0) + concurrent-ruby (~> 1.0) + io-console (0.5.11) + irb (1.4.1) + reline (>= 0.3.0) + loofah (2.18.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (1.0.2) + method_source (1.0.0) + mini_mime (1.1.2) + minitest (5.16.3) + net-imap (0.2.3) + digest + net-protocol + strscan + net-pop (0.1.1) + digest + net-protocol + timeout + net-protocol (0.1.3) + timeout + net-smtp (0.3.1) + digest + net-protocol + timeout + nio4r (2.5.8) + nokogiri (1.13.8-x86_64-darwin) + racc (~> 1.4) + racc (1.6.0) + rack (2.2.4) + rack-test (2.0.2) + rack (>= 1.3) + rails (7.0.3.1) + actioncable (= 7.0.3.1) + actionmailbox (= 7.0.3.1) + actionmailer (= 7.0.3.1) + actionpack (= 7.0.3.1) + actiontext (= 7.0.3.1) + actionview (= 7.0.3.1) + activejob (= 7.0.3.1) + activemodel (= 7.0.3.1) + activerecord (= 7.0.3.1) + activestorage (= 7.0.3.1) + activesupport (= 7.0.3.1) + bundler (>= 1.15.0) + railties (= 7.0.3.1) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.4.3) + loofah (~> 2.3) + railties (7.0.3.1) + actionpack (= 7.0.3.1) + activesupport (= 7.0.3.1) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rake (13.0.6) + reline (0.3.1) + io-console (~> 0.5) + 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 + sprockets (4.1.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + sqlite3 (1.4.4) + strscan (3.0.4) + thor (1.2.1) + tilt (2.0.11) + timeout (0.3.0) + tzinfo (2.0.5) + concurrent-ruby (~> 1.0) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.6.0) + +PLATFORMS + x86_64-darwin-19 + +DEPENDENCIES + debug (~> 1) + mitlibraries-theme! + sprockets-rails + sqlite3 + +BUNDLED WITH + 2.3.7 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..3e4289e --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 MIT Libraries + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/MIT-LICENSE b/MIT-LICENSE deleted file mode 100644 index 74da3fb..0000000 --- a/MIT-LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2022 TODO: Write your name - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d916fe1 --- /dev/null +++ b/Makefile @@ -0,0 +1,56 @@ +.PHONY: help fetch update cleanup dist publish +SHELL=/bin/bash +GEMSPEC=$(shell ls *.gemspec | head -1) +VERSION=$(shell ruby -e 'puts Gem::Specification::load("$(GEMSPEC)").version') +PROJECT=$(shell ruby -e 'puts Gem::Specification.load("$(GEMSPEC)").name') +GEM=$(PROJECT)-$(VERSION).gem + +help: ## Print this message + @awk 'BEGIN { FS = ":.*##"; print "Usage: make \n\nTargets:" } \ + /^[-_[:alpha:]]+:.?*##/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST) + +fetch: clean ## Grab latest from theme repo (auto runs clean first) + mkdir -p tmp + curl -o tmp/assets.zip https://codeload.github.com/MITLibraries/mitlib-style/zip/master + unzip -o -d tmp tmp/assets.zip + +update: fetch ## Synchronize latest (auto runs clean and fetch first) + # cleanup targets first in case assets were removed + rm -rf vendor/assets/images/ + rm -rf vendor/assets/stylesheets/ + + mkdir vendor/assets/images/ + mkdir vendor/assets/stylesheets/ + + cp -R tmp/mitlib-style-master/_assets/i/* vendor/assets/images + cp -R tmp/mitlib-style-master/_assets/sass/* vendor/assets/stylesheets + + rm -rf vendor/assets/stylesheets/apps/ + rm -f vendor/assets/stylesheets/ebooks-main.scss + rm -f vendor/assets/stylesheets/guide-helper.scss + rm -f vendor/assets/stylesheets/quicksubmit.sass + + # We need to double $ so make doesn't think it's a variable and escape the $ for bash. Hence \$$. + sed -i '' "s+url('#{\$$image-path}/vi-shape7-tp.svg')+image-url('vi-shape7-tp.svg')+g" vendor/assets/stylesheets/elements/*.scss + + @tput setaf 2 + @tput bold + @echo "Assets updated. Make sure to update version in:" + @echo " lib/mitlibraries/theme/version.rb" + @echo "before building with 'make dist'" + @tput sgr0 + +clean: ## Delete downloaded zip and extracted files + rm -f tmp/assets.zip + rm -rf tmp/mitlib-style-master + +dist: ## Build the gem from the current gemspec + gem build mitlibraries-theme.gemspec + @tput setaf 2 + @tput bold + @echo "Finished building gem. To test locally add to your project Gemfile:" + @echo " gem 'mitlibraries-theme', path: '$(shell pwd)'" + @tput sgr0 + +publish: ## Publish the gem version defined in the gemspec + gem push "$(GEM)" diff --git a/README.md b/README.md index 3442376..27f26e5 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,120 @@ # Mitlibraries::Theme -Short description and motivation. -## Usage -How to use my plugin. +Provides base CSS and Images used by MIT Libraries for our websites. ## Installation + Add this line to your application's Gemfile: ```ruby -gem "mitlibraries-theme" +gem 'mitlibraries-theme' ``` And then execute: -```bash + +```shell $ bundle ``` Or install it yourself as: -```bash + +```shell $ gem install mitlibraries-theme ``` +## Usage + +### Controllers + +The gem includes a link helper class, which provides a function - `nav_link_to` - which renders links with particular classes and ARIA roles that are suited for site navigation. The default navigation partial at `app/views/layouts/_site_nav.html.erb` makes use of this function, and we recommend you copy this partial into your application with appropriate updates for your app. + +In order to make this function available to your application, please add the following line near the top of your local `app/controllers/application_controller.rb`: + +```ruby +helper Mitlibraries::Theme::Engine.helpers +``` + +### Layouts and stylesheets + +After you update your controller and bundle, delete your application local `app/views/layouts/application.rb` to use the layout the gem provides. + +Rename your `app/assets/stylesheets/application.css` to `app/assets/stylesheets/application.scss` and remove anything like: + +```ruby +*= require_tree . +*= require_self +``` + +Add +`@import "libraries-main";` + +If you have local overrides for styles, import them _after_ the shared styles. + +You'll want to set `<%= content_for(:title, "SOMETHING") %>` on your views. + +You'll want to copy `app/views/layouts/_site_nav.html.erb` into your local +repo and make appropriate changes. + +`app/views/layouts/_site_footer.html.erb` is also available if you really need +a third footer above the other two (I'm looking at you bento!). + +If you need to make changes to other templates, you can also copy those to your local repo but you should check with others as the main header / footer / etc are probably best left as they are in this gem. + +## Adding Additional JavaScript to HTML Head + +You can load additional js to individual pages using: + +```ruby +<% content_for :additional_js do %> + +<% end %> +``` + +This can appear as many times as you need on as many templates as you need. If +called multiple times the results are concatenated. This is intended primarily +for adding external support libraries. For JS you are writing, include via +`application.scss` as normal. + +## Adding Additional Meta headers to HTML Head + +You can load additional meta headers to individual pages using: + +```ruby +<% content_for :additional_meta_tag do %> + + +<% end %> +``` + +This can appear as many times as you need on as many templates as you need. If +called multiple times the results are concatenated. + +## Development + +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. + +Building and publishing this gem is handled via the `Makefile`. + +Run `make help` for details. + +If your goal is to fetch the latest assets from the style repo and publish the +changes, this would get you there: + +- `make update` +- manually update the version in `lib/mitlibraries/theme/version.rb` +- `make dist` +- test the gem in a local version of a site that uses it with the info the previous command provided on completion +- commit and PR +- `make publish` + ## Contributing -Contribution directions go here. + +Bug reports and pull requests are welcome on GitHub at https://github.com/MITLibraries/mitlibraries-theme. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License + The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). + +## Code of Conduct + +Everyone interacting in the Mitlibraries::Theme project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/MITLibraries/mitlibraries-theme/blob/master/CODE_OF_CONDUCT.md). diff --git a/lib/mitlibraries/theme.rb b/lib/mitlibraries/theme.rb index 764bd2d..0c9067f 100644 --- a/lib/mitlibraries/theme.rb +++ b/lib/mitlibraries/theme.rb @@ -1,8 +1,8 @@ -require "mitlibraries/theme/version" -require "mitlibraries/theme/engine" +require 'mitlibraries/theme/version' +require 'mitlibraries/theme/engine' module Mitlibraries module Theme - # Your code goes here... + # The precompilation step that used to be here has been moved to engine.rb. end end diff --git a/lib/mitlibraries/theme/version.rb b/lib/mitlibraries/theme/version.rb index c359da8..7c785dc 100644 --- a/lib/mitlibraries/theme/version.rb +++ b/lib/mitlibraries/theme/version.rb @@ -1,5 +1,5 @@ module Mitlibraries module Theme - VERSION = "0.1.0" + VERSION = '1.0.0'.freeze end end diff --git a/mitlibraries-theme.gemspec b/mitlibraries-theme.gemspec index 8140514..82764d5 100644 --- a/mitlibraries-theme.gemspec +++ b/mitlibraries-theme.gemspec @@ -1,26 +1,27 @@ require_relative "lib/mitlibraries/theme/version" Gem::Specification.new do |spec| - spec.name = "mitlibraries-theme" - spec.version = Mitlibraries::Theme::VERSION - spec.authors = ["TODO: Write your name"] - spec.email = ["TODO: Write your email address"] - spec.homepage = "TODO" - spec.summary = "TODO: Summary of Mitlibraries::Theme." - spec.description = "TODO: Description of Mitlibraries::Theme." - spec.license = "MIT" + spec.name = 'mitlibraries-theme' + spec.version = Mitlibraries::Theme::VERSION + spec.authors = ['Jeremy Prevost'] + spec.email = ['jprevost@mit.edu'] + spec.summary = 'General theme for MIT Libraries Rails apps' + spec.homepage = 'https://github.com/MITLibraries/mitlibraries-theme' + spec.license = 'MIT' # Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host" # to allow pushing to a single host or delete this section to allow pushing to any host. spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here." - spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here." + spec.metadata["source_code_uri"] = "https://github.com/MITLibraries/mitlibraries-theme" + spec.metadata["changelog_uri"] = "https://github.com/MITLibraries/mitlibraries-theme/releases" spec.files = Dir.chdir(File.expand_path(__dir__)) do - Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] + Dir["{app,config,db,lib}/**/*", "LICENSE.txt", "Rakefile", "README.md"] end - spec.add_dependency "rails", ">= 7.0.3.1" + spec.add_development_dependency 'debug', '~> 1' + spec.add_dependency 'rails', '>= 6', '< 8' + spec.add_dependency 'sassc-rails', '~> 2' end diff --git a/test/mitlibraries/theme_test.rb b/test/mitlibraries/theme_test.rb index f2d1c9e..062ca36 100644 --- a/test/mitlibraries/theme_test.rb +++ b/test/mitlibraries/theme_test.rb @@ -1,7 +1,7 @@ -require "test_helper" +require 'test_helper' class Mitlibraries::ThemeTest < ActiveSupport::TestCase - test "it has a version number" do + test 'it has a version number' do assert Mitlibraries::Theme::VERSION end end From ccc271896ed8cbf26fa9f724e35621e59fcd6dbd Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Thu, 1 Sep 2022 17:01:08 -0400 Subject: [PATCH 5/6] Update gem tooling ** Why are these changes being introduced: * This repository does not yet have our pull request template, nor does it take advantage of our shared ruby workflows in Github actions. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/engx-175 ** How does this address that need: * This copies the pull request template and workflow yml file from another rails app, to bring this in line with our other projects. * Adds and integrates simplecov so the shared workflow does not error. ** Document any side effects to this change: * The theme gem now has test coverage --- .github/PULL_REQUEST_TEMPLATE.md | 26 +++++++++++++++++++++ .github/workflows/mit-libraries-ruby-ci.yml | 10 ++++++++ .gitignore | 1 + .ruby-version | 1 + Gemfile.lock | 10 ++++++++ mitlibraries-theme.gemspec | 2 ++ test/test_helper.rb | 10 ++++++++ 7 files changed, 60 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/mit-libraries-ruby-ci.yml create mode 100644 .ruby-version diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..392b12c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ +#### Developer + +- [ ] All new ENV is documented in README +- [ ] All new ENV has been added to Heroku Pipeline, Staging and Prod +- [ ] ANDI or Wave has been run in accordance to + [our guide](https://mitlibraries.github.io/guides/basics/a11y.html) and + all issues introduced by these changes have been resolved or opened as new + issues (link to those issues in the Pull Request details above) +- [ ] Stakeholder approval has been confirmed (or is not needed) + +#### Code Reviewer + +- [ ] The commit message is clear and follows our guidelines + (not just this pull request message) +- [ ] There are appropriate tests covering any new functionality +- [ ] The documentation has been updated or is unnecessary +- [ ] The changes have been verified +- [ ] New dependencies are appropriate or there were no changes + +#### Requires database migrations? + +YES | NO + +#### Includes new or updated dependencies? + +YES | NO diff --git a/.github/workflows/mit-libraries-ruby-ci.yml b/.github/workflows/mit-libraries-ruby-ci.yml new file mode 100644 index 0000000..1b423c9 --- /dev/null +++ b/.github/workflows/mit-libraries-ruby-ci.yml @@ -0,0 +1,10 @@ +name: CI +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + shared: + uses: mitlibraries/.github/.github/workflows/ruby-shared-ci.yml@main diff --git a/.gitignore b/.gitignore index e635b83..984536f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.bundle/ +/coverage/ /doc/ /log/*.log /pkg/ diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..ef538c2 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.1.2 diff --git a/Gemfile.lock b/Gemfile.lock index 757214a..4070fd3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -80,6 +80,7 @@ GEM irb (>= 1.3.6) reline (>= 0.3.1) digest (3.1.0) + docile (1.4.0) erubi (1.11.0) ffi (1.15.5) globalid (1.0.0) @@ -156,6 +157,13 @@ GEM sprockets (> 3.0) sprockets-rails tilt + simplecov (0.21.2) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.12.3) + simplecov-lcov (0.8.0) + simplecov_json_formatter (0.1.4) sprockets (4.1.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -181,6 +189,8 @@ PLATFORMS DEPENDENCIES debug (~> 1) mitlibraries-theme! + simplecov (~> 0) + simplecov-lcov (~> 0) sprockets-rails sqlite3 diff --git a/mitlibraries-theme.gemspec b/mitlibraries-theme.gemspec index 82764d5..fa7bf62 100644 --- a/mitlibraries-theme.gemspec +++ b/mitlibraries-theme.gemspec @@ -22,6 +22,8 @@ Gem::Specification.new do |spec| end spec.add_development_dependency 'debug', '~> 1' + spec.add_development_dependency 'simplecov', '~> 0' + spec.add_development_dependency 'simplecov-lcov', '~> 0' spec.add_dependency 'rails', '>= 6', '< 8' spec.add_dependency 'sassc-rails', '~> 2' end diff --git a/test/test_helper.rb b/test/test_helper.rb index 7230d9c..6bc4afc 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,16 @@ # Configure Rails Environment ENV["RAILS_ENV"] = "test" +require 'simplecov' +require 'simplecov-lcov' +SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true +SimpleCov::Formatter::LcovFormatter.config.lcov_file_name = 'coverage.lcov' +SimpleCov.formatters = [ + SimpleCov::Formatter::HTMLFormatter, + SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter +] +SimpleCov.start('rails') + require_relative "../test/dummy/config/environment" ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)] ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__) From 47515e6b83cc8b1509125a907db5e5d72825d472 Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Mon, 30 Jan 2023 14:17:17 -0500 Subject: [PATCH 6/6] Address code review feedback - Change body class from app-tesseract to app-theme - Remove empty navigation test file Left unaddressed is some feedback about whether the dummy app needs an application.html.erb file --- app/views/layouts/application.html.erb | 2 +- test/integration/navigation_test.rb | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 test/integration/navigation_test.rb diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7cfab07..6fe2528 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,7 +3,7 @@ <%= render partial: "layouts/head" %> - +
diff --git a/test/integration/navigation_test.rb b/test/integration/navigation_test.rb deleted file mode 100644 index ebbc098..0000000 --- a/test/integration/navigation_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require "test_helper" - -class NavigationTest < ActionDispatch::IntegrationTest - # test "the truth" do - # assert true - # end -end