https://github.com/jbox-web/redmine_bootstrap_kit
A Redmine plugin which makes developing your own Redmine plugin easy ;)
https://github.com/jbox-web/redmine_bootstrap_kit
bootstrap fontawesome rails redmine redmine-plugin ruby
Last synced: 3 months ago
JSON representation
A Redmine plugin which makes developing your own Redmine plugin easy ;)
- Host: GitHub
- URL: https://github.com/jbox-web/redmine_bootstrap_kit
- Owner: jbox-web
- License: mit
- Created: 2014-04-19T14:17:26.000Z (about 11 years ago)
- Default Branch: devel
- Last Pushed: 2018-05-09T04:11:43.000Z (about 7 years ago)
- Last Synced: 2024-03-26T11:24:06.224Z (over 1 year ago)
- Topics: bootstrap, fontawesome, rails, redmine, redmine-plugin, ruby
- Language: JavaScript
- Homepage:
- Size: 2.23 MB
- Stars: 40
- Watchers: 12
- Forks: 20
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Redmine Bootstrap Kit Plugin
[](https://github.com/jbox-web/redmine_bootstrap_kit/blob/devel/LICENSE)
[](https://github.com/jbox-web/redmine_bootstrap_kit/releases/latest)
[](https://codeclimate.com/github/jbox-web/redmine_bootstrap_kit)### A Redmine plugin which makes developing your own Redmine plugin easy ;)
## Why?
As Redmine does not support asset pipeline, we need to install JQuery plugins as Redmine plugins to load them globally.
It provides :
* [BootstrapSwitch 1.8](https://github.com/nostalgiaz/bootstrap-switch)
* [CodeMirror 3.2](https://github.com/codemirror/codemirror)
* [jQuery FileTree](https://github.com/daverogers/jQueryFileTree)
* [jQuery TagIt](http://aehlke.github.io/tag-it/)
* [jQuery UI Bootstrap 0.5](http://jquery-ui-bootstrap.github.io/jquery-ui-bootstrap/) - 2014-04-19
* [FontAwesome 4.7.0](http://fortawesome.github.io/Font-Awesome/)
* [Highcharts 4.1.4](https://github.com/highslide-software/highcharts.com)
* [ZeroClipboard 2.3.0](https://github.com/zeroclipboard/zeroclipboard)
* [Bootstrap Notify](https://github.com/mouse0270/bootstrap-notify)And a set of various Rails helper methods (see below).
## Installation
Just clone it in your Redmine plugins directory :
```sh
cd REDMINE_ROOT/plugins
git clone https://github.com/jbox-web/redmine_bootstrap_kit.git
```## What's included?
It provides the following Rails helper methods :
#### BootstrapKit assets loader :
```ruby
bootstrap_load_module(rbk_module)
```This method loads all JS and CSS files needed by the required module.
The following modules are available :
* alerts
* label
* modals
* pagination
* switch
* tables
* tabs
* font_awesome
* dropdown
* tooltip
* notify
* tag_it#### BootstrapSwitch :
```ruby
bootstrap_switch_tag(opts = {}, &block)
```#### FontAwesome :
```ruby
fa_icon(icon, opts = {})
label_with_icon(label, icon, icon_opts = {})
```#### AjaxHelper :
```ruby
render_flash_messages_as_js(target = '#flash-messages', opts = {})
js_render_template(target, template, opts = {})
js_render_partial(target, partial, opts = {})
js_render(target, content, opts = {})
```#### PresenterHelper :
```ruby
present(object, klass = nil, *args)
```#### JQuery TagIt :
```ruby
tag_it_list(id, list_opts = {}, tag_it_opts = {}, &block)
```#### WillPaginateHelper :
```ruby
paginate(collection, opts = {})
```#### ZeroClipboardHelper:
```ruby
zero_clipboard_button_for(target)
```## How to use?
To use Redmine Bootstrap Kit helper methods you must first add ```:redmine_bootstrap_kit``` helper in your controller :
```ruby
class MyPluginController < ApplicationController
...helper :redmine_bootstrap_kit
end
```Then with the ```bootstrap_load_module``` method you can load the desired assets in your views :
```html+erb
<% content_for :header_tags do %>
<%= bootstrap_load_base %>
<%= bootstrap_load_module(:alerts) %>
<%= bootstrap_load_module(:label) %>
<%= bootstrap_load_module(:modals) %>
<%= bootstrap_load_module(:pagination) %>
<%= bootstrap_load_module(:switch) %>
<%= bootstrap_load_module(:tables) %>
<%= bootstrap_load_module(:tabs) %>
<%= bootstrap_load_module(:font_awesome) %>
<%= bootstrap_load_module(:dropdown) %>
<%= bootstrap_load_module(:tooltip) %>
<%= bootstrap_load_module(:notify) %>
<%= bootstrap_load_module(:tag_it) %>
<% end %>
```The ```bootstrap_load_base``` method call is needed if you want to use provided JS helpers (see below).
## To create BootstrapSwitch buttons
In your views :
```html+erb
<% content_for :header_tags do %>
<%= bootstrap_load_base %>
<%= bootstrap_load_module(:switch) %>
<% end %>
This is a switch button
<%= bootstrap_switch_tag do %>
<%= hidden_field_tag "extra[enable]", "false" %>
<%= check_box_tag "extra[enable]" %>
<% end %><%= javascript_tag do %>
$(document).ready(function() { setBootstrapSwitch(); });
<% end %>
```## To create TagIt lists
In your views :
```html+erb
<% content_for :header_tags do %>
<%= bootstrap_load_base %>
<%= bootstrap_load_module(:tag_it) %>
<% end %>
This is a TagIt list<%= tag_it_list 'plugin_emails_list',
{ name: 'plugin[emails_list][]' },
{ placeholder: '+ add email' } do %>
<% end %>
<%= javascript_tag do %>
$(document).ready(function() { setTagIt(); });
<% end %>
```
## Contribute
You can contribute to this plugin in many ways such as :
* Helping with documentation
* Contributing code (features or bugfixes)
* Reporting a bug
* Submitting translations