{"id":24093236,"url":"https://github.com/umd-lib/umd_lib_style","last_synced_at":"2025-02-27T10:47:41.525Z","repository":{"id":43181696,"uuid":"56175399","full_name":"umd-lib/umd_lib_style","owner":"umd-lib","description":"UMD Libraries branding for Rails applications","archived":false,"fork":false,"pushed_at":"2022-03-15T11:09:43.000Z","size":667,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-01-10T09:26:02.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umd-lib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-13T18:14:25.000Z","updated_at":"2022-03-14T22:18:04.000Z","dependencies_parsed_at":"2022-08-31T15:01:47.867Z","dependency_job_id":null,"html_url":"https://github.com/umd-lib/umd_lib_style","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fumd_lib_style","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fumd_lib_style/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fumd_lib_style/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fumd_lib_style/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umd-lib","download_url":"https://codeload.github.com/umd-lib/umd_lib_style/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241005361,"owners_count":19892779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-10T09:26:18.845Z","updated_at":"2025-02-27T10:47:41.506Z","avatar_url":"https://github.com/umd-lib.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UMD Lib Style\n\nGem containing the common UMD Libraries Rails application layout and styles.\nBuilt on Bootstrap 3.4.1, and designed to support Rails 6.1 and webpacker.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for information about changes to this gem.\n\n## Git Tagging\n\nWhen a new version of this gem is created, be sure to update the version\nnumber in the lib/umd_style/version.rb to match the Git tag.\n\n## Usage\n\nMake the following changes in your Rails project:\n\n### Gemfile\n\nAdd the \"umd_lib_style\" gem. To use the \"develop\" branch version:\n\n```ruby\ngem 'umd_lib_style', github: 'umd-lib/umd_lib_style', branch: 'develop'\n```\n\nor to use a specific version:\n\n```ruby\ngem 'umd_lib_style', github: 'umd-lib/umd_lib_style', ref: '\u003cGIT_TAG\u003e'\n```\n\nwhere \u003cGIT_TAG\u003e is the Git tag of the version to use. For example, to use\nthe Git tagged \"3.0.0\" version, use:\n\n```ruby\ngem 'umd_lib_style', github: 'umd-lib/umd_lib_style', ref: '3.0.0'\n```\n\n### package.json\n\nAdd the following lines:\n\n```json\n    \"bootstrap\": \"3.4.1\",\n    \"jquery\": \"3.6.0\",\n```\n\nNote: The versions should match the respective versions in the\n\"package.json\" file of the \"umd_lib_style\" version you are using.\n\n### app/assets/stylesheets/application.scss\n\nIf necessary, rename the \"app/assets/stylesheets/application.css\" file to\n\"app/assets/stylesheets/application.scss\" and add the following line:\n\n```javascript\n@import \"umd_lib\";\n```\n\n### app/javascript/packs/application.js\n\nAdd the following line:\n\n```javascript\nimport 'bootstrap/dist/js/bootstrap';\n```\n\n### config/webpack/environment.js\n\nAdd the following lines:\n\n```javascript\nconst webpack = require('webpack')\n\nenvironment.plugins.append('Provide', new webpack.ProvidePlugin({\n  $: 'jquery/src/jquery',\n  jQuery: 'jquery/src/jquery'\n}));\n```\n\n### app/views/layouts/application.html.erb\n\nRemove the existing comnent and replace with the following:\n\n```erb\n\u003c% provide :app_name, 'APP_NAME' %\u003e\n\u003c%= render 'layouts/umd_lib' %\u003e\n```\n\nchanging \"APP_NAME\" to your application name.\n\nAfter making the above changes, run:\n\n```bash\n$ bundle install\n$ yarn\n```\n\n## Upgrading from v2 to v3\n\nApplications that use version 2.x of \"umd_lib_style\" (such as the\n[umd-handle](https://github.com/umd-lib/umd-handle)) will require the\nfollowing changes for v3:\n\n1) Application must be upgraded to Rails 6.1\n\n2) Application must use Ruby 2.7.5 (or later)\n\n3) The \"app/views/layouts/_umd_lib.html.erb\" file in \"umd_lib_style\" now\nuses the \"javascript_pack_tag\" tag, so any custom\n\"app/views/layouts/_umd_lib.html.erb\" file in the application can be removed.\n\n## Scaffolding CSS\n\nIf you generated your app with Rails scaffolding, you should remove the\n*app/assets/stylesheets/scaffold.css.scss* file, to remove any potential\nconflicts with the Bootstrap styles.\n\n## content_for blocks\n\nThe \"content_for\" block allows for additions/customization of particular\nsections of the layout.\n\n### Additional \"head\" content - additional_head_content\n\nEnables additional directives to be added into the \"head\" section of the HTML\npage.\n\n#### Additional \"head\" content - Sample Usage\n\nIn Rails 5.2, an additional \"csp_meta\" tag is added into the \"head\" section of\nthe layouts/application.html.erb file. To include this tag into a Rails\napplication using this gem, add a `content_for` block to your\n*app/views/layout/application.html.erb* file\n\n```erb\n\u003c% content_for :additional_head_content do %\u003e\n  \u003c%= csp_meta_tag %\u003e\n\u003c% end %\u003e\n```\n\n### Custom Navbar - navbar\n\nThis gem provides a fixed full page width navigation bar at the top of the page,\ncontaining the application name and a set of drop-down menus.\n\n#### Custom Navbar - Sample Usage\n\nThe application name is set using a \"app_name\" block. To include your own custom\nmarkup in the navbar, add a `content_for` block to your\n*app/views/layout/application.html.erb* file.\n\n```erb\n\u003c% provide :app_name, 'Autonumber Service' %\u003e\n\n\u003c% content_for :navbar do %\u003e\n  \u003cul class=\"nav navbar-nav\"\u003e\n    \u003cli\u003e\u003c%= link_to 'Auto Numbers', auto_numbers_path %\u003e\u003c/li\u003e\n    \u003cli\u003e\u003c%= link_to 'Names', names_path %\u003e\u003c/li\u003e\n    \u003cli\u003e\u003c%= link_to 'Repositories', repositories_path %\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c% end %\u003e\n\n\u003c%= render 'layouts/umd_lib' %\u003e\n```\n\n### Custom Nav Banner - \"navbar_banner\"\n\nDisplays a full page width banner directly below the navbar, which will not\nscroll off the screen. Used by the Annual Staffing Request application to show a\nbanner when impersonating another user.\n\n#### Custom Nav Banner - Sample Usage\n\n```erb\n\u003c% content_for :navbar_banner do %\u003e\n  \u003c%= render 'layouts/impersonate' %\u003e\n\u003c% end %\u003e\n```\n\n### Environment Banner\n\nIn keeping with [SSDR policy][1], an \"environment banner\" will be displayed at\nthe top of each page when running on non-production servers.\n\nBy default, in the local development environment (determined by\n`Rails.env.development?` returning `true`), a \"Local Environment\" banner will be\ndisplayed.\n\nOn non-production servers, the environment banner can be configured using the\nfollowing environment variables:\n\n* ENVIRONMENT_BANNER - the text to display in the banner\n* ENVIRONMENT_BANNER_FOREGROUND - the foreground color for the banner, as a CSS\n  color\n* ENVIRONMENT_BANNER_BACKGROUND - the background color for the banner, as a CSS\n  color\n* ENVIRONMENT_BANNER_ENABLED - (optional) \"false\" (case-sensitive) disables the\n  banner. Anything else (including blank, or not providing the variable) enables\n  the banner.\n\n### Page Content Container class\n\n By default, the content of the page is placed in a \\\u003cdiv\u003e using the Bootstrap\n \"container\" class. Applications (such as Annual Staffing Request) may wish to\n override this setting to use some other class, such as \"container-fluid\". To do\n so, add the following \"provide\" line to your\n *app/views/layout/application.html.erb* file:\n\n```erb\n\u003c% provide :container_class, \"container-fluid\" %\u003e\n```\n\n### Footer - \"application_footer\"\n\nPer UMD policy, a footer containing a \"Web Accessibility\" link is provided by\ndefault. Applications wishing to override the default footer can do so by\ndefining a \"content_for\" block to your *app/views/layout/application.html.erb*\nfile.\n\n#### Footer - Sample Usage\n\n```erb\n\u003c% content_for :application_footer do %\u003e\n  \u003cfooter class=\"footer\"\u003e\n    \u003cp\u003eCustom footer\u003c/p\u003e\n  \u003c/footer\u003e\n\u003c% end %\u003e\n```\n\n## umd_lib_style Development\n\nUnit tests can be run using the following command:\n\n```bash\n$ bundle install\n$ yarn\n$ rails test\n```\n\n[1]: https://confluence.umd.edu/display/LIB/Create+Environment+Banners\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumd-lib%2Fumd_lib_style","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumd-lib%2Fumd_lib_style","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumd-lib%2Fumd_lib_style/lists"}