Class: Engine2::Templates
Class Method Summary collapse
- .blob ⇒ Object
- .bsselect_picker(options = {}) ⇒ Object
- .checkbox ⇒ Object
- .checkbox_button(options = {}) ⇒ Object
- .checkbox_buttons(options = {}) ⇒ Object
- .currency ⇒ Object
- .date_picker ⇒ Object
- .date_range ⇒ Object
- .date_time ⇒ Object
- .datetime_picker ⇒ Object
- .decimal ⇒ Object
- .decimal_date ⇒ Object
- .decimal_time ⇒ Object
- .default_template ⇒ Object
- .email(length) ⇒ Object
- .file_store ⇒ Object
- .input_text(length) ⇒ Object
- .integer ⇒ Object
- .list_bsmselect(length, options = {}) ⇒ Object
- .list_bsselect(length, options = {}) ⇒ Object
- .list_buttons(options = {}) ⇒ Object
- .list_mbuttons(options = {}) ⇒ Object
- .list_select(length, options = {}) ⇒ Object
- .password(length) ⇒ Object
- .radio_checkbox ⇒ Object
- .scaffold ⇒ Object
-
.scaffold_picker(options = {}) ⇒ Object
def bs_select_picker(options) { resource: options, template: “fields/bs_select” } end.
- .select_picker(options = {}) ⇒ Object
- .text ⇒ Object
- .text_area(cols, rows) ⇒ Object
- .time_picker ⇒ Object
- .typeahead_picker(options = {}) ⇒ Object
Class Method Details
.blob ⇒ Object
33 34 35 |
# File 'lib/engine2/templates.rb', line 33 def blob {template: "fields/blob"} end |
.bsselect_picker(options = {}) ⇒ Object
111 112 113 114 115 116 |
# File 'lib/engine2/templates.rb', line 111 def bsselect_picker = {} .merge({ template: [:optional] ? "fields/bsselect_picker_opt" : "fields/bsselect_picker", animation: BS_ANIMATION }) end |
.checkbox ⇒ Object
151 152 153 |
# File 'lib/engine2/templates.rb', line 151 def checkbox {template: "fields/checkbox"} end |
.checkbox_button(options = {}) ⇒ Object
161 162 163 |
# File 'lib/engine2/templates.rb', line 161 def = {} {template: "fields/checkbox_button"}.merge() end |
.checkbox_buttons(options = {}) ⇒ Object
155 156 157 158 159 |
# File 'lib/engine2/templates.rb', line 155 def = {} .merge({ template: [:optional] ? "fields/checkbox_buttons_opt" : "fields/checkbox_buttons" }) end |
.currency ⇒ Object
147 148 149 |
# File 'lib/engine2/templates.rb', line 147 def currency {template: "fields/currency"} end |
.date_picker ⇒ Object
53 54 55 |
# File 'lib/engine2/templates.rb', line 53 def date_picker {template: "fields/date", animation: BS_ANIMATION} end |
.date_range ⇒ Object
139 140 141 |
# File 'lib/engine2/templates.rb', line 139 def date_range {template: "fields/date_range", animation: BS_ANIMATION} end |
.date_time ⇒ Object
143 144 145 |
# File 'lib/engine2/templates.rb', line 143 def date_time {template: "fields/date_time", animation: BS_ANIMATION} end |
.datetime_picker ⇒ Object
61 62 63 |
# File 'lib/engine2/templates.rb', line 61 def datetime_picker {template: "fields/datetime", animation: BS_ANIMATION} end |
.decimal ⇒ Object
41 42 43 |
# File 'lib/engine2/templates.rb', line 41 def decimal {template: "fields/integer"} end |
.decimal_date ⇒ Object
45 46 47 |
# File 'lib/engine2/templates.rb', line 45 def decimal_date {template: "fields/decimal_date", animation: BS_ANIMATION} end |
.decimal_time ⇒ Object
49 50 51 |
# File 'lib/engine2/templates.rb', line 49 def decimal_time {template: "fields/decimal_time", animation: BS_ANIMATION} end |
.default_template ⇒ Object
9 10 11 |
# File 'lib/engine2/templates.rb', line 9 def default_template {template: "fields/input_text"} end |
.email(length) ⇒ Object
135 136 137 |
# File 'lib/engine2/templates.rb', line 135 def email length {template: "fields/email", length: length} end |
.file_store ⇒ Object
29 30 31 |
# File 'lib/engine2/templates.rb', line 29 def file_store {template: "fields/file_store"} end |
.input_text(length) ⇒ Object
17 18 19 |
# File 'lib/engine2/templates.rb', line 17 def input_text length {template: "fields/input_text", length: length} end |
.integer ⇒ Object
37 38 39 |
# File 'lib/engine2/templates.rb', line 37 def integer {template: "fields/integer"} end |
.list_bsmselect(length, options = {}) ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/engine2/templates.rb', line 85 def list_bsmselect length, = {} .merge({ template: "fields/list_bsmselect", length: length, animation: BS_ANIMATION }) end |
.list_bsselect(length, options = {}) ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/engine2/templates.rb', line 77 def list_bsselect length, = {} .merge({ template: [:optional] ? "fields/list_bsselect_opt" : "fields/list_bsselect", length: length, animation: BS_ANIMATION }) end |
.list_buttons(options = {}) ⇒ Object
93 94 95 96 97 |
# File 'lib/engine2/templates.rb', line 93 def = {} .merge({ template: [:optional] ? "fields/list_buttons_opt" : "fields/list_buttons" }) end |
.list_mbuttons(options = {}) ⇒ Object
99 100 101 102 103 |
# File 'lib/engine2/templates.rb', line 99 def = {} .merge({ template: [:optional] ? "fields/list_mbuttons_opt" : "fields/list_mbuttons" }) end |
.list_select(length, options = {}) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/engine2/templates.rb', line 65 def list_select length, = {} template = if [:multiple] "fields/list_mselect" else [:optional] ? "fields/list_select_opt" : "fields/list_select" end .merge({ template: template, length: length }) end |
.password(length) ⇒ Object
25 26 27 |
# File 'lib/engine2/templates.rb', line 25 def password length {template: "fields/password", length: length} end |
.radio_checkbox ⇒ Object
165 166 167 |
# File 'lib/engine2/templates.rb', line 165 def radio_checkbox {template: "fields/radio_checkbox"} end |
.scaffold ⇒ Object
169 170 171 |
# File 'lib/engine2/templates.rb', line 169 def scaffold {template: "fields/scaffold"} end |
.scaffold_picker(options = {}) ⇒ Object
def bs_select_picker(options)
{
resource: [:resource],
template: "fields/bs_select"
}
end
125 126 127 128 129 |
# File 'lib/engine2/templates.rb', line 125 def scaffold_picker = {} .merge({ template: 'fields/scaffold_picker' }) end |
.select_picker(options = {}) ⇒ Object
105 106 107 108 109 |
# File 'lib/engine2/templates.rb', line 105 def select_picker = {} .merge({ template: [:optional] ? "fields/select_picker_opt" : "fields/select_picker" }) end |
.text ⇒ Object
21 22 23 |
# File 'lib/engine2/templates.rb', line 21 def text {template: "fields/text"} end |
.text_area(cols, rows) ⇒ Object
13 14 15 |
# File 'lib/engine2/templates.rb', line 13 def text_area cols, rows {template: "fields/text_area", cols: cols, rows: rows} end |
.time_picker ⇒ Object
57 58 59 |
# File 'lib/engine2/templates.rb', line 57 def time_picker {template: "fields/time", animation: BS_ANIMATION} end |
.typeahead_picker(options = {}) ⇒ Object
131 132 133 |
# File 'lib/engine2/templates.rb', line 131 def typeahead_picker = {} {template: "fields/typeahead_picker", length: 20, limit: 10, min_length: 0, animation: BS_ANIMATION}.merge() end |