Skip to content

Commit

Permalink
Merge branch 'devel' into v0.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Nov 18, 2015
2 parents dfbe1d2 + 67c5bcc commit 0d96d0c
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 47 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Nicolas Rodriguez <[email protected]>
2 changes: 0 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
The MIT License (MIT)

Copyright (c) 2013-2015 Nicolas Rodriguez ([email protected]), JBox Web (http://www.jbox-web.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
128 changes: 84 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
## Redmine Bootstrap Kit
## Redmine Bootstrap Kit Plugin

[![GitHub license](https://img.shields.io/github/license/jbox-web/redmine_bootstrap_kit.svg)](https://github.com/jbox-web/redmine_bootstrap_kit/blob/devel/LICENSE)
[![GitHub release](https://img.shields.io/github/release/jbox-web/redmine_bootstrap_kit.svg)](https://github.com/jbox-web/redmine_bootstrap_kit/releases/latest)
[![Code Climate](https://codeclimate.com/github/jbox-web/redmine_bootstrap_kit.png)](https://codeclimate.com/github/jbox-web/redmine_bootstrap_kit)
[![Dependency Status](https://gemnasium.com/jbox-web/redmine_bootstrap_kit.svg)](https://gemnasium.com/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 includes :
It provides :

* [BootstrapSwitch 1.8](https://github.com/nostalgiaz/bootstrap-switch)
* [CodeMirror 3.2](https://github.com/codemirror/codemirror)
Expand All @@ -12,61 +21,97 @@ It includes :
* [FontAwesome 4.3.0](http://fortawesome.github.io/Font-Awesome/)
* [Highcharts 4.1.4](https://github.com/highslide-software/highcharts.com)
* [ZeroClipboard 2.2.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 :

cd REDMINE_ROOT/plugins
git clone https://github.com/jbox-web/redmine_bootstrap_kit.git
```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 :

redmine_bootstrap_kit_load(rbk_module)
```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 :

bootstrap_switch_tag(opts = {}, &block)
```ruby
bootstrap_switch_tag(opts = {}, &block)
```

#### FontAwesome :

fa_icon(icon, opts = {})
label_with_icon(label, icon, icon_opts = {})
```ruby
fa_icon(icon, opts = {})
label_with_icon(label, icon, icon_opts = {})
```

#### AjaxHelper :

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 = {})
```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 :

present(object, klass = nil, *args)
```ruby
present(object, klass = nil, *args)
```

#### JQuery TagIt :

tag_it_list(id, list_opts = {}, tag_it_opts = {}, &block)
```ruby
tag_it_list(id, list_opts = {}, tag_it_opts = {}, &block)
```

#### WillPaginateHelper :

paginate(collection, opts = {})
```ruby
paginate(collection, opts = {})
```

#### ZeroClipboardHelper:

zero_clipboard_button_for(target)
```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
...

Expand All @@ -75,32 +120,37 @@ class MyPluginController < ApplicationController
end
```

Then with the ```redmine_bootstrap_kit_load``` method you can load the desired assets in your views :
Then with the ```bootstrap_load_module``` method you can load the desired assets in your views :

```
```html+erb
<% content_for :header_tags do %>
<%= redmine_bootstrap_kit_load(:redmine_bootstrap_kit) %>
<%= redmine_bootstrap_kit_load(:bootstrap_alerts) %>
<%= redmine_bootstrap_kit_load(:bootstrap_label) %>
<%= redmine_bootstrap_kit_load(:bootstrap_modals) %>
<%= redmine_bootstrap_kit_load(:bootstrap_switch) %>
<%= redmine_bootstrap_kit_load(:bootstrap_tables) %>
<%= redmine_bootstrap_kit_load(:jquery_tag_it) %>
<%= redmine_bootstrap_kit_load(:font_awesome) %>
<%= 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 ```:redmine_bootstrap_kit``` asset is needed if you want to use provided JS helpers (see below).
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 %>
<%= redmine_bootstrap_kit_load(:redmine_bootstrap_kit) %>
<%= redmine_bootstrap_kit_load(:bootstrap_switch) %>
<%= bootstrap_load_base %>
<%= bootstrap_load_module(:switch) %>
<% end %>
<p>
Expand All @@ -120,10 +170,10 @@ In your views :

In your views :

```
```html+erb
<% content_for :header_tags do %>
<%= redmine_bootstrap_kit_load(:redmine_bootstrap_kit) %>
<%= redmine_bootstrap_kit_load(:jquery_tag_it) %>
<%= bootstrap_load_base %>
<%= bootstrap_load_module(:tag_it) %>
<% end %>
<p>
Expand All @@ -142,20 +192,10 @@ In your views :
<% end %>
```

## Copyrights & License

Redmine Bootstrap Kit is completely free and open source and released under the [MIT License](https://github.com/jbox-web/redmine_bootstrap_kit/blob/devel/LICENSE).

Copyright (c) 2013-2015 Nicolas Rodriguez ([email protected]), JBox Web (http://www.jbox-web.com) [![endorse](https://api.coderwall.com/n-rodriguez/endorsecount.png)](https://coderwall.com/n-rodriguez)

## 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

You can also donate :)

[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FBT7E7DAVVEEU)
2 changes: 1 addition & 1 deletion assets/javascripts/bootstrap/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function setSortableElement(element, form) {
helper: fixHelper,
axis: 'y',
update: function(event, ui) {
$.post($(form).data('update-url'), $(this).sortable('serialize'));
$.post($(form).data('update-url'), $(this).sortable('serialize'), null, 'script');
}
});
}
5 changes: 5 additions & 0 deletions assets/stylesheets/bootstrap_custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,8 @@ div.flash.warning, .conflict {
.row > .col-md-12 {
padding: 0 10px;
}

/*Redmine fix*/
#ajax-indicator {
z-index: 1000;
}

0 comments on commit 0d96d0c

Please sign in to comment.