kuppayam 0.2.1.pre.materialize → 0.2.2.pre.materialize

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
  SHA256:
3
- metadata.gz: 9444e04f0829d3bfda475bce5f7e505388cc6b962e74e1e7022bd09b66372c93
4
- data.tar.gz: c90a8fe45e4c753c250a213e155b79874f199e1cf3856f9178b202874f4ee937
3
+ metadata.gz: a2e3c09738450913c37f7e62321c2cd4b5b4cb6daf71e629b57f85575c1a4af0
4
+ data.tar.gz: b3a6b53b892fa02ca93b89abdac902a2098203cb51a3ed1509d3466f90b36538
5
5
  SHA512:
6
- metadata.gz: f7b6ee4449ebca53ed157cc956c82f8b3d0ed19d2544e5820d2c4675b4709a9b6e86f3dd6c9d4b80c01ec808c8e22fa42619195107580ab64b3010e84d5d2408
7
- data.tar.gz: 38e18b9f5aa2e83ede15fb22535570db8a6067e399f3246879e20ec9342b29495c71b8f570cc8ba9cee6ed402d2cdde3c3cd98796e1cd4867706bb92d9dbefab
6
+ metadata.gz: 2d91584df35dcc5a3574221e4a8a4dc8592b62856d6bdd2c55b465b4d985d6975736fd2714a648a4d81c5a0b7a34d7fb90ec7f789001eb59ea2efd545a7cfa57
7
+ data.tar.gz: b84d38f0da4f30a7b647a262975865266e1bc509a5ff19704059cf27903da33050daceae55060326e9f50f52f1f992582ef7332c9298aa5a0f6983b84b6f5349
@@ -5,13 +5,12 @@ module Kuppayam
5
5
  rescue_from ActionController::InvalidAuthenticityToken, :with => :handle_invalid_authenticity_token
6
6
 
7
7
  # Choose the theme and set one of the following in your inherited controllers
8
- before_action :set_layout
9
- layout :determine_layout
10
-
11
- before_action :stylesheet_filename, :javascript_filename
8
+ before_action :set_layout, :stylesheet_filename, :javascript_filename
12
9
  before_action :set_locale, :set_default_title, :set_navs, :parse_pagination_params
13
10
  before_action :configure_filters, :configure_notification, :configure_breadcrumbs
14
11
 
12
+ layout :determine_layout
13
+
15
14
  include ParamsParserHelper
16
15
  include RenderHelper
17
16
 
@@ -9,7 +9,7 @@
9
9
  <meta name="msapplication-TileImage" content="assets/img/favicon/mstile-144x144.png">
10
10
  <meta name="theme-color" content="#ffffff">
11
11
 
12
- <link rel="Shortcut Icon" href="/assets/favicon.png">
12
+ <link rel="Shortcut Icon" href="<%= asset_path("favicon.png") %>">
13
13
 
14
14
  <title><%= title -%></title>
15
15
 
@@ -5,7 +5,7 @@
5
5
  <meta name="description" content="Admin Module" />
6
6
  <meta name="author" content="Right IT Solutions" />
7
7
 
8
- <link rel="shortcut icon" href="/assets/favicon.png" type="image/x-icon">
8
+ <link rel="Shortcut Icon" href="<%= asset_path("favicon.png") %>">
9
9
  <title><%= title -%></title>
10
10
  <%#= meta_tags %>
11
11
 
@@ -303,6 +303,38 @@ module Kuppayam
303
303
  button_text = "#{object.new_record? ? "Create" : "Update"}" if button_text.blank?
304
304
  submit_tag(button_text, "data-reset-text"=>button_text, "data-loading-text"=>saving_message, :class=>classes)
305
305
  end
306
+
307
+ # Displays Full errors with basic alert styles
308
+ # Example
309
+ # theme_form_errors(@user)
310
+ def theme_form_errors(object, **options)
311
+ options.reverse_merge!(
312
+ row_class: "row mb-10",
313
+ col_class: "col-md-12",
314
+ alert_class: "alert alert-danger",
315
+ ul_class: "",
316
+ li_class: ""
317
+ )
318
+ if object.errors.any?
319
+ content_tag(:div, class: options[:row_class]) do
320
+ content_tag(:div, class: options[:col_class]) do
321
+ content_tag(:div, class: options[:alert_class]) do
322
+ content_tag(:ul, class: options[:ul_class]) do
323
+ li_array = []
324
+ object.errors.each do |attr, msg|
325
+ next unless object.errors[attr].last == msg
326
+ li_array << content_tag(:li, class: options[:li_class]) do
327
+ "#{attr.to_s.titleize} #{msg}"
328
+ end
329
+ end
330
+ raw(li_array.join(" "))
331
+ end
332
+ end
333
+ end
334
+ end
335
+ end
336
+ end
337
+
306
338
  end
307
339
  end
308
340
  end
@@ -1,3 +1,3 @@
1
1
  module Kuppayam
2
- VERSION = '0.2.1.pre.materialize'
2
+ VERSION = '0.2.2.pre.materialize'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuppayam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1.pre.materialize
4
+ version: 0.2.2.pre.materialize
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-09 00:00:00.000000000 Z
11
+ date: 2018-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails