Redmine Bootstrap套件插件
一个红色插件,使您可以轻松地开发自己的Redmine插件;)
为什么?
由于Redmine不支持资产管道,因此我们需要安装jQuery插件作为Redmine插件,以在全球加载它们。
它提供:
- Bootstrapswitch 1.8
- codemirror 3.2
- JQuery Filetree
- jQuery Tagit
- JQuery UI Bootstrap 0.5-2014-04-19
- Fontawesome 4.7.0
- Highcharts 4.1.4
- Zeroclipboard 2.3.0
- Bootstrap通知
以及一组各种导轨辅助方法(见下文)。
安装
只需将其克隆到您的Redmine插件目录中:
cd REDMINE_ROOT/plugins git clone https://githu*b.*com*/jbox-web/redmine_bootstrap_kit.git
包括什么?
它提供以下导轨辅助方法:
Bootstrapkit Assets Loader:
bootstrap_load_module ( rbk_module )
此方法将加载所需模块所需的所有JS和CSS文件。
可用以下模块:
- 警报
- 标签
- 模态
- 分页
- 转变
- 表
- 选项卡
- font_awesome
- 下拉
- 工具提示
- 通知
- tag_it
Bootstrapswitch:
bootstrap_switch_tag ( opts = { } , & block )
fontawesome:
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 = { } )
主持人:
present ( object , klass = nil , * args )
JQuery Tagit:
tag_it_list ( id , list_opts = { } , tag_it_opts = { } , & block )
WillPaginateHelper:
paginate ( collection , opts = { } )
ZeroclipboardHelper:
zero_clipboard_button_for ( target )
如何使用?
要使用Redmine Bootstrap套件助手方法,您必须首先添加: redmine_bootstrap_kit helper在您的控制器中:
redmine_bootstrap_kit
end\”>
class MyPluginController < ApplicationController ... helper : redmine_bootstrap_kit end
然后,使用bootstrap_load_module方法,您可以在视图中加载所需的资产:
<% 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 %>
如果要使用提供的JS帮助者,则需要bootstrap_load_base方法调用(请参见下文)。
创建Bootstrapswitch按钮
在您的观点中:
<% content_for :header_tags do %> <%= bootstrap_load_base %> <%= bootstrap_load_module(:switch) %> <% end %> < p > < label > This is a switch button </ label > <%= bootstrap_switch_tag do %> <%= hidden_field_tag \"extra[enable]\" , \"false\" %> <%= check_box_tag \"extra[enable]\" %> <% end %> </ p > <%= javascript_tag do %> $(document).ready(function() { setBootstrapSwitch(); }); <% end %>
创建标记列表
在您的观点中:
<% content_for :header_tags do %> <%= bootstrap_load_base %> <%= bootstrap_load_module(:tag_it) %> <% end %> < p > < label > This is a TagIt list </ label > </ p > <%= tag_it_list \'plugin_emails_list\' , { name : \'plugin[emails_list][]\' } , { placeholder : \'+ add email\' } do %> < li > john@doe.com </ li > < li > jane@doe.com </ li > <% end %> <%= javascript_tag do %> $(document).ready(function() { setTagIt(); }); <% end %>
贡献
您可以以多种方式为此插件做出贡献:
- 帮助文档
- 贡献代码(功能或错误文件)
- 报告一个错误
- 提交翻译
