phcdevworks_notifications 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +26 -0
- data/Rakefile +32 -0
- data/app/assets/config/phcdevworks_notifications_manifest.js +3 -0
- data/app/assets/javascripts/phcdevworks_notifications/application.js +0 -0
- data/app/assets/stylesheets/phcdevworks_notifications/application.css +15 -0
- data/app/controllers/phcdevworks_notifications/application_controller.rb +5 -0
- data/app/helpers/phcdevworks_notifications/application_helper.rb +21 -0
- data/app/jobs/phcdevworks_notifications/application_job.rb +4 -0
- data/app/mailers/phcdevworks_notifications/application_mailer.rb +6 -0
- data/app/models/phcdevworks_notifications/application_record.rb +5 -0
- data/app/views/layouts/phcdevworks_notifications/application.html.erb +18 -0
- data/app/views/phcdevworks_notifications/bootstrap/_notifications.html.erb +0 -0
- data/app/views/phcdevworks_notifications/bootstrap/_validations.html.erb +0 -0
- data/config/routes.rb +2 -0
- data/lib/phcdevworks_notifications.rb +5 -0
- data/lib/phcdevworks_notifications/engine.rb +11 -0
- data/lib/phcdevworks_notifications/version.rb +3 -0
- data/lib/tasks/phcdevworks_notifications_tasks.rake +4 -0
- metadata +104 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d399cfaebe223744a9380dc2fff5fb47b2144392b605151a42ab6e9a88760db1
|
4
|
+
data.tar.gz: 81797df083557c15a3c8f596dbe66952d00a96d8967ddfd8571ab8b703294d10
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f9d2f316e90deb74a652bab21dc540be4252e4c466b88e969e5a2262b9ba691e788ec426a71065eab3e4b6cfb4e631d7da0dd6151d7bf48f5fdaea2cf43e654d
|
7
|
+
data.tar.gz: 65c5d90a3acacd42094c711e592a0042f40e5f593d30454f7b9158c186b78ca17acbb39d648a78273f5075425ae89284f5c928588419bd47db6203d6abe3a9a2
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2019 - PHCDEVWORKS
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
### PHCDevworks Notifi for Rails 6 (Form Validation & Notification Engine)
|
2
|
+
PHCDevworks Notifi Rails 6 engine with helpers for alerts and form validation notifications.
|
3
|
+
|
4
|
+
* Add alert and form validation helpers ruby on rails.
|
5
|
+
* Setup in seconds with only one line of code in the application_helper file.
|
6
|
+
* Save time and keep your rails projects manageable, tidy and secure.
|
7
|
+
|
8
|
+
#### Step 1 - Add PHCDevworks Notifi to your gemfile
|
9
|
+
|
10
|
+
gem 'phcdevworks_notifications'
|
11
|
+
bundle install
|
12
|
+
|
13
|
+
#### Step 2 - Load Helpers in the Application's Controller
|
14
|
+
Add the line of code below into your app/controllers/application_controller.rb (application's controller file).
|
15
|
+
|
16
|
+
helper PhcdevworksNotifications::Engine.helpers
|
17
|
+
|
18
|
+
#### How to Add Bootstrap 4 Notifications to Layouts
|
19
|
+
Add the line of code below to your app/views/layouts/application.rb
|
20
|
+
|
21
|
+
<%= render 'phcdevworks_notifications/bootstrap/notifications' %>
|
22
|
+
|
23
|
+
#### How to Add Bootstrap 4 Validations to your Form
|
24
|
+
Add the line of code below to your _form.rb file. Change @example_object to the same one on your form.
|
25
|
+
|
26
|
+
<%= render 'phcdevworks_notifications/bootstrap/validations', :object => @example_object %>
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'PhcdevworksNotifications'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("test/test_app/Rakefile", __dir__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
load 'rails/tasks/statistics.rake'
|
21
|
+
|
22
|
+
require 'bundler/gem_tasks'
|
23
|
+
|
24
|
+
require 'rake/testtask'
|
25
|
+
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
27
|
+
t.libs << 'test'
|
28
|
+
t.pattern = 'test/**/*_test.rb'
|
29
|
+
t.verbose = false
|
30
|
+
end
|
31
|
+
|
32
|
+
task default: :test
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module PhcdevworksNotifications
|
2
|
+
module ApplicationHelper
|
3
|
+
|
4
|
+
# PHCNotifi - Bootstrap Notification Helpers for Rails
|
5
|
+
def phc_notifi(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
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
|
5
|
+
<title>PHCDevworks Alerts & Form Validation Notifications</title>
|
6
|
+
<%= csrf_meta_tags %>
|
7
|
+
<%= csp_meta_tag %>
|
8
|
+
|
9
|
+
<%= stylesheet_link_tag "phcdevworks_notifications/application", media: "all" %>
|
10
|
+
<%= javascript_include_tag "phcdevworks_notifications/application" %>
|
11
|
+
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
|
15
|
+
<%= yield %>
|
16
|
+
|
17
|
+
</body>
|
18
|
+
</html>
|
File without changes
|
File without changes
|
data/config/routes.rb
ADDED
metadata
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: phcdevworks_notifications
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- PHCDevworks
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-05-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 6.0.0.rc1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 6.0.0.rc1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sassc-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sqlite3
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Rails helpers and partial views for alerts and form validation notifications.
|
56
|
+
email:
|
57
|
+
- developers@phcdevworks.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- MIT-LICENSE
|
63
|
+
- README.md
|
64
|
+
- Rakefile
|
65
|
+
- app/assets/config/phcdevworks_notifications_manifest.js
|
66
|
+
- app/assets/javascripts/phcdevworks_notifications/application.js
|
67
|
+
- app/assets/stylesheets/phcdevworks_notifications/application.css
|
68
|
+
- app/controllers/phcdevworks_notifications/application_controller.rb
|
69
|
+
- app/helpers/phcdevworks_notifications/application_helper.rb
|
70
|
+
- app/jobs/phcdevworks_notifications/application_job.rb
|
71
|
+
- app/mailers/phcdevworks_notifications/application_mailer.rb
|
72
|
+
- app/models/phcdevworks_notifications/application_record.rb
|
73
|
+
- app/views/layouts/phcdevworks_notifications/application.html.erb
|
74
|
+
- app/views/phcdevworks_notifications/bootstrap/_notifications.html.erb
|
75
|
+
- app/views/phcdevworks_notifications/bootstrap/_validations.html.erb
|
76
|
+
- config/routes.rb
|
77
|
+
- lib/phcdevworks_notifications.rb
|
78
|
+
- lib/phcdevworks_notifications/engine.rb
|
79
|
+
- lib/phcdevworks_notifications/version.rb
|
80
|
+
- lib/tasks/phcdevworks_notifications_tasks.rake
|
81
|
+
homepage: https://phcdevworks.com/
|
82
|
+
licenses:
|
83
|
+
- MIT
|
84
|
+
metadata: {}
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
requirements: []
|
100
|
+
rubygems_version: 3.0.3
|
101
|
+
signing_key:
|
102
|
+
specification_version: 4
|
103
|
+
summary: PHCDevworks - Helpers - Notifications
|
104
|
+
test_files: []
|