phcdevworks_notifications 2.2.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +31 -26
- data/app/helpers/phcdevworks_notifications/application_helper.rb +21 -21
- data/app/views/phcdevworks_notifications/bootstrap/_notifications.html.erb +12 -12
- data/app/views/phcdevworks_notifications/bootstrap/_validations.html.erb +14 -14
- data/app/views/phcdevworks_notifications/custom/_notifications.html.erb +8 -0
- data/app/views/phcdevworks_notifications/metronic/_notifications.html.erb +15 -15
- data/app/views/phcdevworks_notifications/metronic/_validations.html.erb +18 -18
- data/lib/phcdevworks_notifications/engine.rb +0 -8
- data/lib/phcdevworks_notifications/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 050534af49240652196e7c79021fb8b392b31899da3d1fa657299e049147a518
|
4
|
+
data.tar.gz: 79b1d967212c484518ec9634921af0fc9017c61af3cd7a6caa920148eee12398
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6d3ea87e3f0000abb8d87cecc60c4731d52d2c89ec14e612845e8560e7e0877e576f39ea26ea2762a9f812c96b84e10f33b110bf5974c9355076b792b8f5716
|
7
|
+
data.tar.gz: 68b28d192237056611ab108cda3b82e17054c1186f5dda76b0ec207703617852050ffeb10c3a59c8c2511df7f0ebfb3807c21a9f505c410cd567bef291f4fba9
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,26 +1,31 @@
|
|
1
|
-
### PHCDevworks Notifications for Rails
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
*
|
6
|
-
*
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
1
|
+
### PHCDevworks Notifications for Rails 7 (Form Validation & Notification Engine)
|
2
|
+
|
3
|
+
PHCDevworks Notifications Rails 7 engine with helpers for alerts and form validation notifications.
|
4
|
+
|
5
|
+
* Add alert and form validation helpers ruby on rails.
|
6
|
+
* Setup in seconds with only one line of code in the application_helper file.
|
7
|
+
* Save time and keep your rails projects manageable, tidy and secure.
|
8
|
+
|
9
|
+
#### Step 1 - Add PHCDevworks Notifications to your gemfile
|
10
|
+
|
11
|
+
gem 'phcdevworks_notifications'
|
12
|
+
bundle install
|
13
|
+
|
14
|
+
#### Step 2 - Load Helpers in the Application's Controller
|
15
|
+
Add the line of code below into your app/controllers/application_controller.rb (application's controller file).
|
16
|
+
|
17
|
+
helper PhcdevworksNotifications::Engine.helpers
|
18
|
+
|
19
|
+
#### How to Add Bootstrap 4 Notifications to Layouts
|
20
|
+
Add the line of code below to your app/views/layouts/application.rb
|
21
|
+
|
22
|
+
<%= render 'phcdevworks_notifications/bootstrap/notifications' %>
|
23
|
+
|
24
|
+
#### How to Add Bootstrap 4 Validations to your Form
|
25
|
+
Add the line of code below to your _form.rb file. Change @example_object to the same one on your form.
|
26
|
+
|
27
|
+
<%= render 'phcdevworks_notifications/bootstrap/validations', :object => @example_object %>
|
28
|
+
|
29
|
+
### Status
|
30
|
+
|
31
|
+
[](https://badge.fury.io/rb/phcdevworks_notifications) [](https://github.com/phcdevworks/phcdevworks_notifications/actions/workflows/publish_gem_github_com.yml) [](https://github.com/phcdevworks/phcdevworks_notifications/actions/workflows/publish_gem_rubygems_org.yml)
|
@@ -1,21 +1,21 @@
|
|
1
|
-
module PhcdevworksNotifications
|
2
|
-
module ApplicationHelper
|
3
|
-
|
4
|
-
# PHCNotifi - Bootstrap Notification Helpers for Rails
|
5
|
-
def phc_notification(flash_type)
|
6
|
-
case flash_type
|
7
|
-
when 'success'
|
8
|
-
'alert-success'
|
9
|
-
when 'error'
|
10
|
-
'alert-danger'
|
11
|
-
when 'alert'
|
12
|
-
'alert-warning'
|
13
|
-
when 'notice'
|
14
|
-
'alert-info'
|
15
|
-
else
|
16
|
-
flash_type.to_s
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
1
|
+
module PhcdevworksNotifications
|
2
|
+
module ApplicationHelper
|
3
|
+
|
4
|
+
# PHCNotifi - Bootstrap Notification Helpers for Rails
|
5
|
+
def phc_notification(flash_type)
|
6
|
+
case flash_type
|
7
|
+
when 'success'
|
8
|
+
'alert-success'
|
9
|
+
when 'error'
|
10
|
+
'alert-danger'
|
11
|
+
when 'alert'
|
12
|
+
'alert-warning'
|
13
|
+
when 'notice'
|
14
|
+
'alert-info'
|
15
|
+
else
|
16
|
+
flash_type.to_s
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
<% flash.each do |flash_type, phc_notification_msg| %>
|
2
|
-
<div class="row">
|
3
|
-
<div class="col-md-12">
|
4
|
-
<div class="alert <%= phc_notification(flash_type) %> alert-dismissable fade show" role="alert">
|
5
|
-
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
6
|
-
<span aria-hidden="true">×</span>
|
7
|
-
</button>
|
8
|
-
<h4 class="text-center"><%= phc_notification_msg %></h4>
|
9
|
-
</div>
|
10
|
-
</div>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
1
|
+
<% flash.each do |flash_type, phc_notification_msg| %>
|
2
|
+
<div class="row">
|
3
|
+
<div class="col-md-12">
|
4
|
+
<div class="alert <%= phc_notification(flash_type) %> alert-dismissable fade show" role="alert" id="phcdevworks_notifi_alert">
|
5
|
+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
6
|
+
<span aria-hidden="true">×</span>
|
7
|
+
</button>
|
8
|
+
<h4 class="text-center"><%= phc_notification_msg %></h4>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
@@ -1,14 +1,14 @@
|
|
1
|
-
<% if object.errors.any? %>
|
2
|
-
<div class="alert alert-danger alert-dismissable fade show" role="alert">
|
3
|
-
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
4
|
-
<span aria-hidden="true">×</span>
|
5
|
-
</button>
|
6
|
-
<h4 class="text-center">The form contains <%= pluralize(object.errors.count, "error") %>.</h4>
|
7
|
-
<ul class="list-group">
|
8
|
-
<% object.errors.full_messages.each do |phc_notification_msg| %>
|
9
|
-
<li class="list-group-item list-group-item-danger borderless"><%= phc_notification_msg %></li>
|
10
|
-
<li class="list-group-item list-group-item-danger "></li>
|
11
|
-
<% end %>
|
12
|
-
</ul>
|
13
|
-
</div>
|
14
|
-
<% end %>
|
1
|
+
<% if object.errors.any? %>
|
2
|
+
<div class="alert alert-danger alert-dismissable fade show" role="alert">
|
3
|
+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
4
|
+
<span aria-hidden="true">×</span>
|
5
|
+
</button>
|
6
|
+
<h4 class="text-center">The form contains <%= pluralize(object.errors.count, "error") %>.</h4>
|
7
|
+
<ul class="list-group">
|
8
|
+
<% object.errors.full_messages.each do |phc_notification_msg| %>
|
9
|
+
<li class="list-group-item list-group-item-danger borderless"><%= phc_notification_msg %></li>
|
10
|
+
<li class="list-group-item list-group-item-danger "></li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<% flash.each do |flash_type, phc_notification_msg| %>
|
2
|
+
<div class="alert <%= phc_notification(flash_type) %> alert-dismissable fade show" role="alert" id="phcdevworks_notifi_alert">
|
3
|
+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
4
|
+
<span aria-hidden="true">×</span>
|
5
|
+
</button>
|
6
|
+
<h4 class="text-center"><%= phc_notification_msg %></h4>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
@@ -1,15 +1,15 @@
|
|
1
|
-
<% flash.each do |flash_type, phc_notification_msg| %>
|
2
|
-
<div class="row">
|
3
|
-
<div class="col-md-12">
|
4
|
-
<div class="alert <%= phc_notification(flash_type) %> fade show" role="alert">
|
5
|
-
<!-- <div class="alert-icon"><i class="flaticon-<%= phc_notification(flash_type) %>"></i></div> -->
|
6
|
-
<div class="alert-text"><%= phc_notification_msg %></div>
|
7
|
-
<div class="alert-close">
|
8
|
-
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
9
|
-
<span aria-hidden="true"><i class="la la-close"></i></span>
|
10
|
-
</button>
|
11
|
-
</div>
|
12
|
-
</div>
|
13
|
-
</div>
|
14
|
-
</div>
|
15
|
-
<% end %>
|
1
|
+
<% flash.each do |flash_type, phc_notification_msg| %>
|
2
|
+
<div class="row">
|
3
|
+
<div class="col-md-12">
|
4
|
+
<div class="alert <%= phc_notification(flash_type) %> fade show" role="alert">
|
5
|
+
<!-- <div class="alert-icon"><i class="flaticon-<%= phc_notification(flash_type) %>"></i></div> -->
|
6
|
+
<div class="alert-text"><%= phc_notification_msg %></div>
|
7
|
+
<div class="alert-close">
|
8
|
+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
9
|
+
<span aria-hidden="true"><i class="la la-close"></i></span>
|
10
|
+
</button>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
@@ -1,18 +1,18 @@
|
|
1
|
-
<% if object.errors.any? %>
|
2
|
-
<div class="alert alert-outline-danger fade show" role="alert">
|
3
|
-
<div class="alert-text">
|
4
|
-
<h4 class="alert-heading text-center">The form contains <%= pluralize(object.errors.count, "error") %>.</h4>
|
5
|
-
<br>
|
6
|
-
<ul class="list-group">
|
7
|
-
<% object.errors.full_messages.each do |phc_notification_msg| %>
|
8
|
-
<li class="list-group-item"><%= phc_notification_msg %></li>
|
9
|
-
<% end %>
|
10
|
-
</ul>
|
11
|
-
</div>
|
12
|
-
<div class="alert-close">
|
13
|
-
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
14
|
-
<span aria-hidden="true"><i class="la la-close"></i></span>
|
15
|
-
</button>
|
16
|
-
</div>
|
17
|
-
</div>
|
18
|
-
<% end %>
|
1
|
+
<% if object.errors.any? %>
|
2
|
+
<div class="alert alert-outline-danger fade show" role="alert">
|
3
|
+
<div class="alert-text">
|
4
|
+
<h4 class="alert-heading text-center">The form contains <%= pluralize(object.errors.count, "error") %>.</h4>
|
5
|
+
<br>
|
6
|
+
<ul class="list-group">
|
7
|
+
<% object.errors.full_messages.each do |phc_notification_msg| %>
|
8
|
+
<li class="list-group-item"><%= phc_notification_msg %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<div class="alert-close">
|
13
|
+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
14
|
+
<span aria-hidden="true"><i class="la la-close"></i></span>
|
15
|
+
</button>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcdevworks_notifications
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PHCDevworks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '7.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '7.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: phcthemes_admin_panel_pack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '5.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '5.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: phcthemes_web_theme_pack
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '5.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '5.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: sqlite3
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- app/helpers/phcdevworks_notifications/application_helper.rb
|
80
80
|
- app/views/phcdevworks_notifications/bootstrap/_notifications.html.erb
|
81
81
|
- app/views/phcdevworks_notifications/bootstrap/_validations.html.erb
|
82
|
+
- app/views/phcdevworks_notifications/custom/_notifications.html.erb
|
82
83
|
- app/views/phcdevworks_notifications/metronic/_notifications.html.erb
|
83
84
|
- app/views/phcdevworks_notifications/metronic/_validations.html.erb
|
84
85
|
- lib/phcdevworks_notifications.rb
|
@@ -89,7 +90,6 @@ homepage: https://phcdevworks.com/
|
|
89
90
|
licenses:
|
90
91
|
- MIT
|
91
92
|
metadata:
|
92
|
-
allowed_push_host: https://rubygems.org/
|
93
93
|
homepage_uri: https://phcdevworks.com/
|
94
94
|
source_code_uri: https://github.com/phcdevworks/phcdevworks_notifications
|
95
95
|
changelog_uri: https://github.com/phcdevworks/phcdevworks_notifications/releases
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
rubygems_version: 3.0.3
|
111
|
+
rubygems_version: 3.0.3.1
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: PHCDevworks - Helpers - Notifications
|