beautiful_scaffold 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +9 -0
- data/beautiful_scaffold.gemspec +1 -1
- data/lib/generators/beautiful_devisecancan_generator.rb +2 -2
- data/lib/generators/beautiful_locale_generator.rb +32 -19
- data/lib/generators/beautiful_scaffold_common_methods.rb +7 -4
- data/lib/generators/beautiful_scaffold_generator.rb +6 -2
- data/lib/generators/templates/app/assets/javascripts/application-bs.js +2 -8
- data/lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js +11 -11
- data/lib/generators/templates/app/assets/javascripts/bootstrap-colorpicker.js +1 -1
- data/lib/generators/templates/app/assets/javascripts/bootstrap-datepicker.js +799 -799
- data/lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js +17 -15
- data/lib/generators/templates/app/assets/javascripts/bootstrap-timepicker.js +135 -131
- data/lib/generators/templates/app/assets/javascripts/bootstrap-wysihtml5.js +24 -16
- data/lib/generators/templates/app/assets/javascripts/fixed_menu.js +7 -7
- data/lib/generators/templates/app/assets/stylesheets/application-bs.css +1 -0
- data/lib/generators/templates/app/assets/stylesheets/beautiful-scaffold.css.scss +4 -4
- data/lib/generators/templates/app/assets/stylesheets/bootstrap_and_overrides.css.less +40 -0
- data/lib/generators/templates/app/assets/stylesheets/colorpicker.css +1 -1
- data/lib/generators/templates/app/assets/stylesheets/datepicker.css +2 -2
- data/lib/generators/templates/app/assets/stylesheets/timepicker.css +3 -6
- data/lib/generators/templates/app/controllers/base.rb +4 -4
- data/lib/generators/templates/app/controllers/master_base.rb +1 -1
- data/lib/generators/templates/app/helpers/beautiful_helper.rb +31 -33
- data/lib/generators/templates/app/initializers/link_renderer.rb +5 -5
- data/lib/generators/templates/app/views/_form.html.erb +2 -2
- data/lib/generators/templates/app/views/_form_habtm_tag.html.erb +2 -2
- data/lib/generators/templates/app/views/_mass_inserting.html.erb +6 -6
- data/lib/generators/templates/app/views/_modal_columns.html.erb +19 -15
- data/lib/generators/templates/app/views/edit.html.erb +1 -1
- data/lib/generators/templates/app/views/index.html.erb +36 -34
- data/lib/generators/templates/app/views/layout.html.erb +19 -28
- data/lib/generators/templates/app/views/new.html.erb +1 -1
- data/lib/generators/templates/app/views/partials/_forget_password.html.erb +21 -17
- data/lib/generators/templates/app/views/partials/_form_field.html.erb +40 -58
- data/lib/generators/templates/app/views/partials/_index_batch.html.erb +2 -2
- data/lib/generators/templates/app/views/partials/_index_column.html.erb +17 -17
- data/lib/generators/templates/app/views/partials/_index_header.html.erb +7 -7
- data/lib/generators/templates/app/views/partials/_index_search.html.erb +1 -1
- data/lib/generators/templates/app/views/partials/_index_search_default_fields.html.erb +1 -1
- data/lib/generators/templates/app/views/partials/_register_form.html.erb +38 -34
- data/lib/generators/templates/app/views/partials/_sign_in_form.html.erb +4 -4
- data/lib/generators/templates/app/views/show.html.erb +2 -2
- metadata +40 -20
@@ -3,8 +3,8 @@
|
|
3
3
|
|
4
4
|
var templates = {
|
5
5
|
"font-styles": "<li class='dropdown'>" +
|
6
|
-
"<a class='btn dropdown-toggle' data-toggle='dropdown' href='#'>" +
|
7
|
-
"<i class='
|
6
|
+
"<a class='btn btn-default dropdown-toggle' data-toggle='dropdown' href='#'>" +
|
7
|
+
"<i class='fa fa-font'></i> <span class='current-font'>Normal text</span> <b class='caret'></b>" +
|
8
8
|
"</a>" +
|
9
9
|
"<ul class='dropdown-menu'>" +
|
10
10
|
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='div'>Normal text</a></li>" +
|
@@ -14,21 +14,23 @@
|
|
14
14
|
"</li>",
|
15
15
|
"emphasis": "<li>" +
|
16
16
|
"<div class='btn-group'>" +
|
17
|
-
"<a class='btn' data-wysihtml5-command='bold' title='CTRL+B'>Bold</a>" +
|
18
|
-
"<a class='btn' data-wysihtml5-command='italic' title='CTRL+I'>Italic</a>" +
|
19
|
-
"<a class='btn' data-wysihtml5-command='underline' title='CTRL+U'>Underline</a>" +
|
17
|
+
"<a class='btn btn-default' data-wysihtml5-command='bold' title='CTRL+B'>Bold</a>" +
|
18
|
+
"<a class='btn btn-default' data-wysihtml5-command='italic' title='CTRL+I'>Italic</a>" +
|
19
|
+
"<a class='btn btn-default' data-wysihtml5-command='underline' title='CTRL+U'>Underline</a>" +
|
20
20
|
"</div>" +
|
21
21
|
"</li>",
|
22
22
|
"lists": "<li>" +
|
23
23
|
"<div class='btn-group'>" +
|
24
|
-
"<a class='btn' data-wysihtml5-command='insertUnorderedList' title='Unordered List'><i class='
|
25
|
-
"<a class='btn' data-wysihtml5-command='insertOrderedList' title='Ordered List'><i class='
|
26
|
-
"<a class='btn' data-wysihtml5-command='Outdent' title='Outdent'><i class='
|
27
|
-
"<a class='btn' data-wysihtml5-command='Indent' title='Indent'><i class='
|
24
|
+
"<a class='btn btn-default' data-wysihtml5-command='insertUnorderedList' title='Unordered List'><i class='fa fa-list'></i></a>" +
|
25
|
+
"<a class='btn btn-default' data-wysihtml5-command='insertOrderedList' title='Ordered List'><i class='fa fa-th-list'></i></a>" +
|
26
|
+
"<a class='btn btn-default' data-wysihtml5-command='Outdent' title='Outdent'><i class='fa fa-outdent'></i></a>" +
|
27
|
+
"<a class='btn btn-default' data-wysihtml5-command='Indent' title='Indent'><i class='fa fa-indent'></i></a>" +
|
28
28
|
"</div>" +
|
29
29
|
"</li>",
|
30
30
|
"link": "<li>" +
|
31
31
|
"<div class='bootstrap-wysihtml5-insert-link-modal modal hide fade'>" +
|
32
|
+
"<div class='modal-dialog'>" +
|
33
|
+
"<div class='modal-content'>" +
|
32
34
|
"<div class='modal-header'>" +
|
33
35
|
"<a class='close' data-dismiss='modal'>×</a>" +
|
34
36
|
"<h3>Insert Link</h3>" +
|
@@ -37,14 +39,18 @@
|
|
37
39
|
"<input value='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'>" +
|
38
40
|
"</div>" +
|
39
41
|
"<div class='modal-footer'>" +
|
40
|
-
"<a href='#' class='btn' data-dismiss='modal'>Cancel</a>" +
|
42
|
+
"<a href='#' class='btn btn-default' data-dismiss='modal'>Cancel</a>" +
|
41
43
|
"<a href='#' class='btn btn-primary' data-dismiss='modal'>Insert link</a>" +
|
42
|
-
|
44
|
+
"</div>" +
|
45
|
+
"</div>" +
|
46
|
+
"</div>" +
|
43
47
|
"</div>" +
|
44
|
-
"<a class='btn' data-wysihtml5-command='createLink' title='Link'><i class='
|
48
|
+
"<a class='btn btn-default' data-wysihtml5-command='createLink' title='Link'><i class='fa fa-share'></i></a>" +
|
45
49
|
"</li>",
|
46
50
|
"image": "<li>" +
|
47
51
|
"<div class='bootstrap-wysihtml5-insert-image-modal modal hide fade'>" +
|
52
|
+
"<div class='modal-dialog'>" +
|
53
|
+
"<div class='modal-content'>" +
|
48
54
|
"<div class='modal-header'>" +
|
49
55
|
"<a class='close' data-dismiss='modal'>×</a>" +
|
50
56
|
"<h3>Insert Image</h3>" +
|
@@ -53,17 +59,19 @@
|
|
53
59
|
"<input value='http://' class='bootstrap-wysihtml5-insert-image-url input-xlarge'>" +
|
54
60
|
"</div>" +
|
55
61
|
"<div class='modal-footer'>" +
|
56
|
-
"<a href='#' class='btn' data-dismiss='modal'>Cancel</a>" +
|
57
|
-
"<a href='#' class='btn btn-primary' data-dismiss='modal'>Insert image</a>" +
|
62
|
+
"<a href='#' class='btn btn-default' data-dismiss='modal'>Cancel</a>" +
|
63
|
+
"<a href='#' class='btn btn-default btn-primary' data-dismiss='modal'>Insert image</a>" +
|
58
64
|
"</div>" +
|
65
|
+
"</div>" +
|
66
|
+
"</div>" +
|
59
67
|
"</div>" +
|
60
|
-
"<a class='btn' data-wysihtml5-command='insertImage' title='Insert image'><i class='
|
68
|
+
"<a class='btn btn-default' data-wysihtml5-command='insertImage' title='Insert image'><i class='fa fa-picture-o'></i></a>" +
|
61
69
|
"</li>",
|
62
70
|
|
63
71
|
"html":
|
64
72
|
"<li>" +
|
65
73
|
"<div class='btn-group'>" +
|
66
|
-
"<a class='btn' data-wysihtml5-action='change_view' title='Edit HTML'><i class='
|
74
|
+
"<a class='btn btn-default' data-wysihtml5-action='change_view' title='Edit HTML'><i class='fa fa-pencil'></i></a>" +
|
67
75
|
"</div>" +
|
68
76
|
"</li>"
|
69
77
|
};
|
@@ -1,19 +1,19 @@
|
|
1
1
|
function modify_dom_init(){
|
2
|
-
var span2 = $("body>div.container-fluid>div.row
|
3
|
-
span2.addClass("fixed visible-
|
4
|
-
span2.removeClass("
|
2
|
+
var span2 = $("body>div.container-fluid>div.row>div.col-md-2");
|
3
|
+
span2.addClass("fixed visible-md visible-lg");
|
4
|
+
span2.removeClass("col-md-2");
|
5
5
|
|
6
6
|
span2.children("ul").removeClass("well");
|
7
7
|
|
8
|
-
var span10 = $("body>div.container-fluid>div.row
|
8
|
+
var span10 = $("body>div.container-fluid>div.row>div.col-md-10");
|
9
9
|
span10.addClass("filler");
|
10
|
-
span10.removeClass("
|
10
|
+
span10.removeClass("col-md-10");
|
11
11
|
|
12
12
|
var cnt2 = $("body>div.container-fluid").contents();
|
13
13
|
$("body>div.container-fluid").replaceWith(cnt2);
|
14
14
|
|
15
|
-
var cnt = $("body>div.row
|
16
|
-
$("body>div.row
|
15
|
+
var cnt = $("body>div.row").contents();
|
16
|
+
$("body>div.row").replaceWith(cnt);
|
17
17
|
|
18
18
|
$('body').show();
|
19
19
|
$('body').css('display','block'); /* Hack Firefox previous line dosen't work with firefox */
|
@@ -151,16 +151,16 @@ html, body {
|
|
151
151
|
#jstree-marker-line {pointer-events: none;}
|
152
152
|
|
153
153
|
/* Search & filter */
|
154
|
-
.search-and-filter div.
|
154
|
+
.search-and-filter div.panel-group{
|
155
155
|
margin-bottom:0;
|
156
156
|
}
|
157
|
-
.search-and-filter div.
|
157
|
+
.search-and-filter div.panel-group .accordion-toggle{
|
158
158
|
padding-left:0;
|
159
159
|
}
|
160
|
-
.search-and-filter div.
|
160
|
+
.search-and-filter div.panel-group .panel.panel-default{
|
161
161
|
border:0;
|
162
162
|
}
|
163
|
-
.search-and-filter div.
|
163
|
+
.search-and-filter div.panel-group .panel-body{
|
164
164
|
padding:0;
|
165
165
|
margin-top:0;
|
166
166
|
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
//= depend_on_asset "glyphicons-halflings-regular.eot"
|
2
|
+
//= depend_on_asset "glyphicons-halflings-regular.woff"
|
3
|
+
//= depend_on_asset "glyphicons-halflings-regular.ttf"
|
4
|
+
//= depend_on_asset "glyphicons-halflings-regular.svg"
|
5
|
+
//= depend_on_asset "twitter/bootstrap/glyphicons-halflings.png"
|
6
|
+
//= depend_on_asset "twitter/bootstrap/glyphicons-halflings-white.png"
|
7
|
+
//= depend_on_asset "fontawesome-webfont.eot"
|
8
|
+
//= depend_on_asset "fontawesome-webfont.woff"
|
9
|
+
//= depend_on_asset "fontawesome-webfont.ttf"
|
10
|
+
//= depend_on_asset "fontawesome-webfont.svg"
|
11
|
+
|
12
|
+
@import "twitter/bootstrap/bootstrap";
|
13
|
+
|
14
|
+
// Set the correct sprite paths
|
15
|
+
@iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png");
|
16
|
+
@iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png");
|
17
|
+
|
18
|
+
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
|
19
|
+
@fontAwesomeEotPath: asset-url("fontawesome-webfont.eot");
|
20
|
+
@fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot?#iefix");
|
21
|
+
@fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff");
|
22
|
+
@fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf");
|
23
|
+
@fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");
|
24
|
+
|
25
|
+
// Font Awesome
|
26
|
+
@import "fontawesome/font-awesome";
|
27
|
+
|
28
|
+
// Glyphicons
|
29
|
+
//@import "twitter/bootstrap/sprites.less";
|
30
|
+
|
31
|
+
// Your custom LESS stylesheets goes here
|
32
|
+
//
|
33
|
+
// Since bootstrap was imported above you have access to its mixins which
|
34
|
+
// you may use and inherit here
|
35
|
+
//
|
36
|
+
// If you'd like to override bootstrap's own variables, you can do so here as well
|
37
|
+
// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation
|
38
|
+
//
|
39
|
+
// Example:
|
40
|
+
// @linkColor: #ff0000;
|
@@ -119,7 +119,7 @@ background-position: 0 100%;
|
|
119
119
|
.colorpicker-color div {
|
120
120
|
height: 10px;
|
121
121
|
}
|
122
|
-
.input-
|
122
|
+
.input-group.color .input-group-addon i, .input-group.color .input-group-addon i {
|
123
123
|
display: block;
|
124
124
|
cursor: pointer;
|
125
125
|
width: 16px;
|
@@ -215,8 +215,8 @@
|
|
215
215
|
.datepicker thead tr:first-child th:hover {
|
216
216
|
background: #eeeeee;
|
217
217
|
}
|
218
|
-
.input-
|
219
|
-
.input-
|
218
|
+
.input-group.date .input-group-addon i,
|
219
|
+
.input-group.date .input-group-addon i {
|
220
220
|
display: block;
|
221
221
|
cursor: pointer;
|
222
222
|
width: 16px;
|
@@ -28,10 +28,7 @@
|
|
28
28
|
position: absolute;
|
29
29
|
top: -6px;
|
30
30
|
}
|
31
|
-
.bootstrap-timepicker.modal {
|
32
|
-
margin-left: -100px;
|
33
|
-
margin-top: 0;
|
34
|
-
top: 30%;
|
31
|
+
.bootstrap-timepicker.modal .modal-dialog {
|
35
32
|
width: 200px;
|
36
33
|
}
|
37
34
|
.bootstrap-timepicker.modal .modal-content {
|
@@ -81,10 +78,10 @@
|
|
81
78
|
text-align: center;
|
82
79
|
width: 25px;
|
83
80
|
}
|
84
|
-
.bootstrap-timepicker-component .
|
81
|
+
.bootstrap-timepicker-component .input-group-addon {
|
85
82
|
cursor: pointer;
|
86
83
|
}
|
87
|
-
.bootstrap-timepicker-component .
|
84
|
+
.bootstrap-timepicker-component .input-group-addon i {
|
88
85
|
display: block;
|
89
86
|
height: 16px;
|
90
87
|
width: 16px;
|
@@ -1,16 +1,16 @@
|
|
1
1
|
# encoding : utf-8
|
2
2
|
class <%= namespace_for_class %><%= model_camelize.pluralize %>Controller < BeautifulController
|
3
3
|
|
4
|
-
|
4
|
+
before_action :load_<%= model %>, :only => [:show, :edit, :update, :destroy]
|
5
5
|
|
6
6
|
# Uncomment for check abilities with CanCan
|
7
7
|
#authorize_resource
|
8
8
|
|
9
9
|
def index
|
10
10
|
session[:fields] ||= {}
|
11
|
-
session[:fields][
|
12
|
-
do_select_fields(
|
13
|
-
do_sort_and_paginate(
|
11
|
+
session[:fields]["<%= model %>"] ||= (<%= model_camelize %>.columns.map(&:name) - ["id"])[0..4]
|
12
|
+
do_select_fields("<%= model %>")
|
13
|
+
do_sort_and_paginate("<%= model %>")
|
14
14
|
|
15
15
|
@q = <%= model_camelize %>.search(
|
16
16
|
params[:q]
|
@@ -2,7 +2,7 @@
|
|
2
2
|
module BeautifulHelper
|
3
3
|
|
4
4
|
def visible_column(model_name, field_name, display_default = 'table-cell', other_css = "")
|
5
|
-
return ('style="display:' + ((session[:fields][model_name
|
5
|
+
return ('style="display:' + ((session[:fields][model_name].to_a.include?(field_name)) ? display_default : 'none') + ';' + other_css + '"').html_safe
|
6
6
|
end
|
7
7
|
|
8
8
|
def dropdown_submenu(link_caption, &block)
|
@@ -23,13 +23,13 @@ module BeautifulHelper
|
|
23
23
|
attr = attr.to_s.downcase
|
24
24
|
sortstr = sort.to_s.downcase
|
25
25
|
opposite_sortstr = ""
|
26
|
-
csort = '' # <i class="
|
26
|
+
csort = '' # <i class="fa fa-stop"></i>
|
27
27
|
if attribute_name == attr then
|
28
28
|
if sortstr == "asc" then
|
29
|
-
csort = '<i class="
|
29
|
+
csort = '<i class="fa fa-chevron-up"></i>'
|
30
30
|
opposite_sortstr = "desc"
|
31
31
|
elsif sortstr == "desc" then
|
32
|
-
csort = '<i class="
|
32
|
+
csort = '<i class="fa fa-chevron-down"></i>'
|
33
33
|
opposite_sortstr = "asc"
|
34
34
|
end
|
35
35
|
else
|
@@ -85,7 +85,6 @@ module BeautifulHelper
|
|
85
85
|
infostr = ''
|
86
86
|
response = '' # See at end
|
87
87
|
response += f.label name_field, t(cap, :default => default_caption).capitalize, :class => "control-label"
|
88
|
-
response += '<div class="controls">'
|
89
88
|
|
90
89
|
type_of_column = ar_model.columns_hash[attribute_name].type unless ar_model.columns_hash[attribute_name].nil?
|
91
90
|
type_of_column ||= :other
|
@@ -95,25 +94,25 @@ module BeautifulHelper
|
|
95
94
|
interval = (dt ? (1..5) : (1..3))
|
96
95
|
|
97
96
|
# Greater than
|
98
|
-
response += '<div class="input-
|
99
|
-
response += '<span class="
|
97
|
+
response += '<div class="input-group input-' + type_of_column.to_s + '">'
|
98
|
+
response += '<span class="input-group-addon"><i class="fa fa-chevron-right"></i></span>'
|
100
99
|
response += f.text_field(
|
101
100
|
(name_field + "_dp_gt").to_sym,
|
102
101
|
:value => (begin params[:q][(name_field + "_dp_gt").to_sym] rescue '' end),
|
103
|
-
:class => "
|
102
|
+
:class => "col-md-9 dpicker form-control",
|
104
103
|
"data-id" => ("q_" + name_field + "_gteq"))
|
105
|
-
response += '<span class="
|
104
|
+
response += '<span class="input-group-addon"><i class="fa fa-calendar"></i></span>'
|
106
105
|
response += '</div>'
|
107
106
|
|
108
107
|
if dt then
|
109
|
-
response += '<div class="input-
|
110
|
-
response += '<span class="
|
108
|
+
response += '<div class="input-group input-' + type_of_column.to_s + '">'
|
109
|
+
response += '<span class="input-group-addon"><i class="fa fa-chevron-right"></i></span>'
|
111
110
|
response += f.text_field(
|
112
111
|
(name_field + "_tp_gt").to_sym,
|
113
112
|
:value => (begin params[:q][(name_field + "_tp_gt").to_sym] rescue '' end),
|
114
|
-
:class => "
|
113
|
+
:class => "col-md-9 tpicker form-control",
|
115
114
|
"data-id" => ("q_" + name_field + "_gteq"))
|
116
|
-
response += '<span class="
|
115
|
+
response += '<span class="input-group-addon"><i class="fa fa-clock-o"></i></span>'
|
117
116
|
response += '</div>'
|
118
117
|
end
|
119
118
|
|
@@ -124,25 +123,25 @@ module BeautifulHelper
|
|
124
123
|
end
|
125
124
|
|
126
125
|
# Less than
|
127
|
-
response += '<div class="input-
|
128
|
-
response += '<span class="
|
126
|
+
response += '<div class="input-group input-' + type_of_column.to_s + '">'
|
127
|
+
response += '<span class="input-group-addon"><i class="fa fa-chevron-left"></i></span>'
|
129
128
|
response += f.text_field(
|
130
129
|
(name_field + "_dp_lt").to_sym,
|
131
130
|
:value => (begin params[:q][(name_field + "_dp_lt").to_sym] rescue '' end),
|
132
|
-
:class => "
|
131
|
+
:class => "col-md-9 dpicker form-control",
|
133
132
|
"data-id" => ("q_" + name_field + "_lteq"))
|
134
|
-
response += '<span class="
|
133
|
+
response += '<span class="input-group-addon"><i class="fa fa-calendar"></i></span>'
|
135
134
|
response += '</div>'
|
136
135
|
|
137
136
|
if dt then
|
138
|
-
response += '<div class="input-
|
139
|
-
response += '<span class="
|
137
|
+
response += '<div class="input-group input-' + type_of_column.to_s + '">'
|
138
|
+
response += '<span class="input-group-addon"><i class="fa fa-chevron-left"></i></span>'
|
140
139
|
response += f.text_field(
|
141
140
|
(name_field + "_tp_lt").to_sym,
|
142
141
|
:value => (begin params[:q][(name_field + "_tp_lt").to_sym] rescue '' end),
|
143
|
-
:class => "
|
142
|
+
:class => "col-md-9 tpicker form-control",
|
144
143
|
"data-id" => ("q_" + name_field + "_lteq"))
|
145
|
-
response += '<span class="
|
144
|
+
response += '<span class="input-group-addon"><i class="fa fa-clock-o"></i></span>'
|
146
145
|
response += '</div>'
|
147
146
|
end
|
148
147
|
|
@@ -161,41 +160,40 @@ module BeautifulHelper
|
|
161
160
|
|
162
161
|
infostr = (begin session[:search][model_name.to_sym][(name_field + "_eq").to_sym] == "on" ? "" : "info" rescue "" end)
|
163
162
|
when :string then
|
164
|
-
response += f.text_field((name_field + "_cont").to_sym, :class => "filter
|
163
|
+
response += f.text_field((name_field + "_cont").to_sym, :class => "filter col-md-12 form-control")
|
165
164
|
|
166
165
|
infostr = info_input(model_name, (name_field + "_cont").to_sym)
|
167
166
|
when :integer, :float, :decimal then
|
168
167
|
if is_belongs_to_column?(name_field_bk) then
|
169
168
|
btmodel = get_belongs_to_model(name_field_bk).camelize.constantize
|
170
|
-
response += f.collection_select((name_field + "_eq").to_sym, btmodel.all, :id, :caption, { :include_blank => t(:all, :default => "All") }, { :class => "
|
169
|
+
response += f.collection_select((name_field + "_eq").to_sym, btmodel.all, :id, :caption, { :include_blank => t(:all, :default => "All") }, { :class => "col-md-12 form-control" })
|
171
170
|
|
172
171
|
infostr = info_input(model_name, (name_field + "_eq").to_sym)
|
173
172
|
elsif name_field == "id" then
|
174
|
-
response += f.text_field((name_field + "_eq").to_sym, :class => "filter
|
173
|
+
response += f.text_field((name_field + "_eq").to_sym, :class => "filter col-md-12 form-control")
|
175
174
|
|
176
175
|
infostr = info_input(model_name, (name_field + "_eq").to_sym)
|
177
176
|
else
|
178
|
-
response += '<div class="input-
|
179
|
-
response += '<span class="
|
180
|
-
response += f.text_field((name_field + "_gteq").to_sym, :class => "#{align_attribute("integer")} filter-min
|
177
|
+
response += '<div class="input-group">'
|
178
|
+
response += '<span class="input-group-addon" rel="tooltip" title="' + t(:greater_than, :default => "Greater than") + '"><i class="fa fa-chevron-right"></i></span>'
|
179
|
+
response += f.text_field((name_field + "_gteq").to_sym, :class => "#{align_attribute("integer")} filter-min col-md-10 form-control")
|
181
180
|
response += '</div>'
|
182
|
-
response += '<div class="input-
|
183
|
-
response += '<span class="
|
184
|
-
response += f.text_field((name_field + "_lteq").to_sym, :class => "#{align_attribute("integer")} filter-max
|
181
|
+
response += '<div class="input-group">'
|
182
|
+
response += '<span class="input-group-addon" rel="tooltip" title="' + t(:smaller_than, :default => "Smaller than") + '"><i class="fa fa-chevron-left"></i></span>'
|
183
|
+
response += f.text_field((name_field + "_lteq").to_sym, :class => "#{align_attribute("integer")} filter-max col-md-10 form-control")
|
185
184
|
response += '</div>'
|
186
185
|
|
187
186
|
infostr = info_input(model_name, [(name_field + "_lteq").to_sym, (name_field + "_gteq").to_sym])
|
188
187
|
end
|
189
188
|
else
|
190
|
-
response += f.text_field((name_field + "_cont").to_sym, :class => "filter
|
189
|
+
response += f.text_field((name_field + "_cont").to_sym, :class => "filter col-md-12 form-control")
|
191
190
|
infostr = info_input(model_name, (name_field + "_cont").to_sym)
|
192
191
|
end
|
193
192
|
|
194
|
-
response += '</div>'
|
195
193
|
response += '</div>'
|
196
194
|
|
197
195
|
# Add info class
|
198
|
-
response = '<div class="
|
196
|
+
response = '<div class="form-group ' + infostr + '">' + response
|
199
197
|
|
200
198
|
return response.html_safe
|
201
199
|
end
|
@@ -8,22 +8,22 @@ module WillPaginate
|
|
8
8
|
|
9
9
|
def page_number(page)
|
10
10
|
unless page == current_page
|
11
|
-
link(page, page, :rel => rel_value(page), :class => "btn")
|
11
|
+
link(page, page, :rel => rel_value(page), :class => "btn btn-default")
|
12
12
|
else
|
13
|
-
tag(:a, page, :class => 'current active btn')
|
13
|
+
tag(:a, page, :class => 'current active btn btn-default')
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
def gap
|
18
18
|
text = @template.will_paginate_translate(:page_gap) { '…' }
|
19
|
-
%(<a class="gap btn disabled">#{text}</a>)
|
19
|
+
%(<a class="gap btn btn-default disabled">#{text}</a>)
|
20
20
|
end
|
21
21
|
|
22
22
|
def previous_or_next_page(page, text, classname)
|
23
23
|
if page
|
24
|
-
link(text, page, :class => classname + ' btn')
|
24
|
+
link(text, page, :class => classname + ' btn btn-default')
|
25
25
|
else
|
26
|
-
tag(:a, text, :class => classname + ' disabled btn')
|
26
|
+
tag(:a, text, :class => classname + ' disabled btn btn-default')
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|