This toolkit includes a shared header and some other view helpers designed for our Biola web applications.
Add this line to your application's Gemfile:
gem 'biola_frontend_toolkit'
And then execute:
$ bundle
Or install it yourself as:
$ gem install biola_frontend_toolkit
- bootstrap-sass
- font-awesome-rails
- slim
Your layout file should look something like this
doctype html
html lang="en-us"
head
/ frontend_toolkit/head includes default html head tags and csrf_meta_tags
= render 'frontend_toolkit/head', title: 'Direcotry'
= stylesheet_link_tag "application", media: "all"
body class="#{controller_name} #{action_name}"
= render 'frontend_toolkit/header'
= yield
= javascript_include_tag "application"
Include the following in application.css.scss
. This will add require statements for bootstrap
and font-awesome
automatically. It also includes some biola variables and mixins.
@import "biola-frontend-toolkit";
Include the following in application.js
. This includes jquery
, jquery_ujs
, and bootstrap
automatically.
//= require biola-frontend-toolkit
current_user
- When a user is logged inlogout_path
- Should return a link to the logout path/whateverpath?login=true
- Should be caught by ApplicationController and redirect to login page if not already logged in.
Create a new file called /config/initializers/biola_frontend_toolkit.rb
BiolaFrontendToolkit.configure do |config|
config.app_name = Settings.app.name
config.app_version = Version.current # optional
config.relative_root = Settings.app.relative_url_root
config.release_phase = Settings.release.phase
# App Links
config.app_links = [
{title: 'Gmail', url: 'http://mail.biola.edu', icon: 'envelope-square'},
{title: 'Forms', url: 'http://forms.biola.edu', icon: 'check-square-o'},
]
# Profile Links
config.profile_links = [
{title: 'My Account', url: [:my_account, :user], icon: 'user'},
]
# Google Analytics ## Optional ##
config.ga_account = 'UA-XXXXXXXX-XX'
config.ga_domain = 'biola.edu'
config.ga_enabled = true # defaults to false
end
Use this partial to include default html head tags and csrf_meta_tags
Use frontend_toolkit/header
for content publishers and other employee web apps.
Use frontend_toolkit/prerelease_banner
when your app is in the alpha or beta phases. Make sure BiolaFrontendToolkit.config.release_phase is set to alpha
or beta
.
= render 'frontend_toolkit/prerelease_banner', feedback_form_url: Settings.feedback.form_url
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request