platformx 0.0.9 → 0.0.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c147823b57bb4944680f4fef16e47b811db8656
4
- data.tar.gz: a29e913ba9f1b8bbd435d85e5417dee34c62ad56
3
+ metadata.gz: 7124967b2a7204c719a5363dd1273ff7b5f742f9
4
+ data.tar.gz: e43da8713af2ee4873dc8a142a41eba98ef5ef15
5
5
  SHA512:
6
- metadata.gz: 07701c931dccea024e0c5411bf2c8f63b612d4530495f5f275ed69e771d25b034db2e059653525391282560d98cb4296074822b8ea04ee3d79d614747f87deff
7
- data.tar.gz: 057b7d17f2a8906984562bd97477b27d2c8e2f0e841bde4174e0f876b4abeb2a1403d08e6a9f5151c30aae497143949d76cfedae6f4f0b6c5ecca734debee237
6
+ metadata.gz: fae05630d353037b5c980b523242f286e20f4e14eebdb28b6cc2c92ae61b50ccd52c82a4899f24323f060732ef7ff511a9783949bc373857072f2fd2d10e5041
7
+ data.tar.gz: 3e528cae42329ec8421eccb0cd21c5cb29fee833a66deea5871592658040a580b645ac94d7a33bcb3caf03d2ba88558265c7e55737b3782da549482715e937f7
@@ -339,7 +339,7 @@ tb = <<EOS
339
339
  #{label}#{required_output}
340
340
  <div class="input-group">
341
341
  <input type="text" class="form-control" id="#{id}" name="post[#{name}]" value="#{value}" placeholder="#{placeholder}" data-parsley-type="number" #{required_tag} #{mask} #{maxlength} />
342
- <span class="input-group-addon">ft<sup>2</sup></span>
342
+ <span class="input-group-addon">sqft</span>
343
343
  </div>
344
344
  </div>
345
345
  EOS
@@ -1318,7 +1318,7 @@ EOS
1318
1318
  # @param title [String] title of the select
1319
1319
  # @param multple [Boolean] if multiple selection is enabled
1320
1320
  # @return [String] compiled select drop down
1321
- def x_select(id: "", name: "", value: "",name_col: "name", value_col: "id", label: "", css: "selectpicker", menu_style: "dropdown-blue", style: "btn-default btn-block", option_data: "", option_name: "name", option_value: "id", selected_value: "", title: "", multiple: false, add_none: false)
1321
+ def x_select(id: "", name: "", value: "",name_col: "name", value_col: "id", label: "", css: "selectpicker", menu_style: "dropdown-blue", style: "btn-default btn-block", option_data: "", option_name: "name", option_value: "id", selected_value: "", title: "", multiple: false, add_none: false, required: false)
1322
1322
 
1323
1323
  options_html = ""
1324
1324
  show_multiple = ""
@@ -1328,6 +1328,18 @@ EOS
1328
1328
  show_multiple = "Multiple"
1329
1329
  end
1330
1330
 
1331
+ if required
1332
+ if label != ""
1333
+ required_output = '<sup class="text-danger">*</sup>'
1334
+ else
1335
+ required_output = ''
1336
+ end
1337
+ required_tag = 'required="required"'
1338
+ else
1339
+ required_output = ""
1340
+ required_tag = ""
1341
+ end
1342
+
1331
1343
  multiple_name = ""
1332
1344
  if multiple == true
1333
1345
  multiple_name = "[]"
@@ -1358,13 +1370,13 @@ EOS
1358
1370
  end
1359
1371
 
1360
1372
  if add_none == true
1361
- add_none_option = "<option value=''>None</option>"
1373
+ add_none_option = "<option value=''>Select One</option>"
1362
1374
  end
1363
1375
 
1364
1376
  select = <<EOS
1365
1377
  <div class="form-group">
1366
- <label>#{label}</label>
1367
- <select id="#{id}" name="post[#{name}]#{multiple_name}" class="#{css}" data-title="#{title}" title="#{title}" data-style="#{style}" data-menu-style="#{menu_style}" #{show_multiple}">
1378
+ <label>#{label}#{required_output}</label>
1379
+ <select id="#{id}" name="post[#{name}]#{multiple_name}" class="#{css}" data-title="#{title}" title="#{title}" data-style="#{style}" data-menu-style="#{menu_style}" #{show_multiple}" #{required_tag}>
1368
1380
  #{add_none_option}
1369
1381
  #{options_html}
1370
1382
  </select>
@@ -40,12 +40,17 @@ end
40
40
  # @param header_css [String] header css of the card
41
41
  # @param buttons [String] card buttons
42
42
  # @return [String] rendered card top html
43
- def x_card_top(title: "",subtitle: "", card_class: "", header_css: "", buttons: "")
43
+ def x_card_top(title: "",subtitle: "", card_class: "", header_css: "", buttons: "", modal_cog_url: "")
44
+
45
+ modal_cog_html = ""
46
+ unless modal_cog_url == ""
47
+ modal_cog_html = "<a href='#{modal_cog_url}' class='btn btn-button btn-sm' data-toggle='modal'><i class='fa fa-cog'></i></a>"
48
+ end
44
49
  if title != ""
45
- title=<<EOS
50
+ title =<<EOS
46
51
  <div class="header #{header_css}">
47
52
  <h4 class="title pull-left">#{title}</h4>
48
- <div class="pull-right title_right">#{buttons}</div>
53
+ <div class="pull-right title_right">#{buttons} #{modal_cog_html}</div>
49
54
  <div class="clearfix"></div>
50
55
  <p class="category">#{subtitle}</p>
51
56
  </div>
@@ -69,6 +74,39 @@ EOS
69
74
  return panel
70
75
  end
71
76
 
77
+ # Accordian (top) view helper
78
+ def x_accordian_top(tag: "p", id: "accordian", title: "")
79
+
80
+ panel =<<EOS
81
+ <div class="panel-group" id="accordion">
82
+ <div class="panel panel-default">
83
+ <div class="panel-heading">
84
+ <#{tag} class="">
85
+ <a data-target="#accordian_#{id}" href="#" data-toggle="collapse">
86
+ #{title} <b class="caret"></b>
87
+ </a>
88
+ </#{tag}>
89
+ </div>
90
+ <div id="accordian_#{id}" class="panel-collapse collapse">
91
+ <div class="panel-body">
92
+ <!-- Start Accordian -->
93
+ EOS
94
+ return panel
95
+ end
96
+
97
+ # Accordian (bottom) view helper
98
+ # @return [String] accordian card bottom html
99
+ def x_accordian_bottom
100
+ panel =<<EOS
101
+ <!-- End Accordian -->
102
+ </div>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ EOS
107
+ return panel
108
+ end
109
+
72
110
  # Gravitar view helper
73
111
  # @param email [String] email of the user to show the garvitar
74
112
  # @return [String] gravitar image uri
@@ -128,17 +166,22 @@ end
128
166
  # @param value [String] number widget value
129
167
  # @param icon [String] number widget icon
130
168
  # @return [String] rendered number widget
131
- def x_number_widget(label: "", value: "", icon: "")
169
+ def x_number_widget(label: "", value: "", icon: "", info_modal: "")
132
170
 
133
171
  icon_html = ""
134
172
  unless icon == ""
135
173
  icon_html = "<i class='fa #{icon}'></i> "
136
174
  end
137
175
 
176
+ info_modal_html = ""
177
+ unless info_modal == ""
178
+ info_modal_html = "<a href='#{info_modal}' class='' data-toggle='modal'><i class='fa fa-info-circle'></i></a>"
179
+ end
180
+
138
181
  widget =<<EOS
139
182
  <div class="x_number_widget_wrapper">
140
183
  <div class="x_number_widget_value">#{value}</div>
141
- <div class="x_number_widget_label">#{icon_html}#{label}</div>
184
+ <div class="x_number_widget_label">#{icon_html}#{label} #{info_modal_html}</div>
142
185
  </div>
143
186
  EOS
144
187
 
@@ -1,3 +1,3 @@
1
1
  module Platformx
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.9.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: platformx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - timmushen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-22 00:00:00.000000000 Z
11
+ date: 2017-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler