https://github.com/rolandasb/staff_bar
Show basic application information for administrators in Rails projects.
https://github.com/rolandasb/staff_bar
admin administrators rails ruby ruby-on-rails staff
Last synced: 2 months ago
JSON representation
Show basic application information for administrators in Rails projects.
- Host: GitHub
- URL: https://github.com/rolandasb/staff_bar
- Owner: rolandasb
- License: mit
- Created: 2019-10-29T10:27:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-14T11:06:25.000Z (almost 2 years ago)
- Last Synced: 2025-02-18T16:08:31.018Z (over 1 year ago)
- Topics: admin, administrators, rails, ruby, ruby-on-rails, staff
- Language: Ruby
- Homepage: https://rubygems.org/gems/staff_bar
- Size: 216 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Staff bar
[](preview.png)
Staff bar is a tiny utility for Ruby on Rails projects. It shows a bar with some basic project information: commit hash, branch, Ruby & Rails versions, environment and caching status. You can also make a list of links that you want to show on a bar for a quick access to your internal tools.
## Usage
```ruby
# Add this to Gemfile
gem 'staff_bar'
# Install dependencies
bundle
```
Add this to `app/views/layouts/application.html.erb`:
```ruby
...
<%= staff_bar if current_user.staff? %>
<%= yield %>
...
```
(you can change `current_user.staff?` to whatever your administrators logic is of course.)
Add this to your `application.css` to use default styles:
```css
*= require staff_bar
```
To show current branch, add staff_bar capistrano tasks in `Capfile`:
```ruby
require "staff_bar/capistrano"
```
This will create `BRANCH` file when deploying, which will staff bar use to show the branch.
## Configuration
```ruby
# app/config/initializers/staff_bar.rb
StaffBar.configure do |config|
config.links = [
{ url: '/jobs', title: 'Jobs queue' },
{ url: '/logs', title: 'Open logs' }
];
config.theme = :dark # or :light
config.position = :bottom # or :top
config.highlight_envs = [:production]
end
```
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).