Layouts
Batteries-included application and mailer layouts.
CAUTION
These features use trademarks of the University of Massachusetts Amherst. Usage of these trademarks is permitted only for internal, non-commercial use. See the license for more information.
To guard against misuse, you must explicitly opt in to make them available for use:
# config/initializers/brand.rb
UMTS::Brand.use_university_trademarks!Application
Three application layouts are included. All include a standard title tag, meta tags (including favicons), link tags, script tags, and flashes.
umts/brand/bareis as minimal as possible and has no header/footer contentumts/brand/privateadds a navbar section in the headerumts/brand/publicadds university branded header/footer content
class ApplicationController < ActionController::Base
layout 'umts/brand/{layout}'
endOptions
The following general customizations are supported. These are intentionally as limited as possible to enforce consistency and will be expanded only if absolutely necessary.
Title
Add a primary page title with a conventional content_for :title call.
-# your_view.html.haml
- content_for :title, 'My Page' # will produce "My Page * Department or Application * UMass AmherstCustomize the secondary page title using the following translations.
en:
application:
name: "My App"
umts:
brand:
department:
name: "My Department" # if application.name is not definedFlash
Implement custom flashes by adding a flash partial in your app's view path lookup chain.
-# app/view/application/_flash.html.haml
- if flash.present?
.alert.alert-primary
This will always be rendered in the flash section (you must conditionally
render your content from the flash hash yourself).Navbar (required for private/public)
Implement your navbar by adding a navbar partial in your app's view path lookup chain.
The public/private layouts wrap the content in a styled container and assume the partial will always be defined. If you wish to omit a navbar, use the bare layout instead.
-# app/view/application/_navbar.html.haml
%nav.navbar.navbar-expand
-# ...Department names (public)
Customize the department names using the following translations.
en:
umts:
brand:
department:
name: "My Department"
parent_name: "My Department's Parent"Mailer
A mailer layout modeled after the official university marketing cloud template.
class ApplicationMailer < ActionMailer::Base
layout 'umts/brand/mailer'
endErrors
Custom dynamic error pages that work with the branded application layouts.
# config/initializers/brand.rb
UMTS::Brand.use_dynamic_error_pages! # controller inherits from ApplicationController by default
# or
UMTS::Brand.use_dynamic_error_pages! parent_controller: MyController # if you need to customize the parent controller