phcnotifi 45.0.0 → 46.0.0

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: 714c12539324dc66a5e9d3f6fcc20599c9f878d56dda41d898bb68a743105fcd
4
- data.tar.gz: b3bdcecff309ebcc38e120d2a53b1c9c286e3ddd8e4f87ae90efdf466e9679e7
3
+ metadata.gz: 07e0ffe17d6b4eb126c8f3a9c65a8b55356b1359e161d4afadca6f5bc8ea5d10
4
+ data.tar.gz: dcb3ae854e219f166ad4079c578cb1eebc676d06e38adcb38144ed47e40e21d1
5
5
  SHA512:
6
- metadata.gz: c7d9b867bc17562b8e5ff6eb63a14db551d13058ed6084c9cecb3fdc0645104a5602e89c0d02bd5c5b99d8b141ce3a66d36cbb5795f5b5c276164fef13f5ea54
7
- data.tar.gz: 5b301c2c90529205ef59f65b003a7762418993ad94c672e0b861d361aa1ea39f116357f72354c6b2f79a1b5f722095e687e8016a2e2ddd3b2e7e826fa40416de
6
+ metadata.gz: 3d97caf2afdaeaf3abfb08d7908a85b241915921460b57541392225cb51f1c9de4e29a5fc178605897a992d8dda21dc5e03448c8fc55c6bd4a34cb780c24a365
7
+ data.tar.gz: 32003734fcdf602b1074821b16628f6b95976f0746474480d5820cb70e2e523bb899c9a534aa5a4fdf16de6a6482c7881116e5710ccdc5a5904f038c69bf988d
data/README.md CHANGED
@@ -18,9 +18,9 @@ Add the line of code below into your app/controllers/application_controller.rb (
18
18
  #### How to Add Notifications to Layouts
19
19
  Add the line of code below to your app/views/layouts/application.rb
20
20
 
21
- <%= render 'phcnotifi/notifications' %>
21
+ <%= render 'phcnotifi/default/notifications' %>
22
22
 
23
23
  #### How to Add Validations to your Form
24
24
  Add the line of code below to your _form.rb file. Change @example_object to the same one on your form.
25
25
 
26
- <%= render 'phcnotifi/validations', :object => @example_object %>
26
+ <%= render 'phcnotifi/default/validations', :object => @example_object %>
@@ -2,12 +2,18 @@ module Phcnotifi
2
2
  module ApplicationHelper
3
3
 
4
4
  # PHCNotifi - Bootstrap Notifications for Rails
5
- def flash_class(level)
6
- case level.to_sym
7
- when :notice then "alert alert-info"
8
- when :success then "alert alert-success"
9
- when :error then "alert alert-danger"
10
- when :alert then "alert alert-warning"
5
+ def bootstrap_class_for_flash(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
11
17
  end
12
18
  end
13
19
 
@@ -0,0 +1,10 @@
1
+ <% flash.each do |type, msg| %>
2
+ <div class="row">
3
+ <div class="col-md-12">
4
+ <div class="alert <%= phc_notifi(type) %> alert-dismissable fade show" role="alert">
5
+ <span class="close" data-dismiss="alert">×</span>
6
+ <%= msg %>
7
+ </div>
8
+ </div>
9
+ </div>
10
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <% if object.errors.any? %>
2
+ <div class="alert alert-danger alert-dismissable fade show" role="alert">
3
+ <h4>The form contains <%= pluralize(object.errors.count, "error") %>.</h4>
4
+ <ul class="list-group">
5
+ <% object.errors.full_messages.each do |msg| %>
6
+ <li class="list-group-item list-group-item-danger borderless"><%= msg %></li>
7
+ <li class="list-group-item list-group-item-danger "></li>
8
+ <% end %>
9
+ </ul>
10
+ <span class="close" data-dismiss="alert">×</span>
11
+ </div>
12
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <% flash.each do |type, msg| %>
2
+ <div class="row">
3
+ <div class="col-md-12">
4
+ <div class="alert <%= phc_notifi(type) %> alert-dismissable fade show" role="alert">
5
+ <%= msg %>
6
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
7
+ <span aria-hidden="true">&times;</span>
8
+ </button>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ <% end %>
@@ -1,11 +1,14 @@
1
1
  <% if object.errors.any? %>
2
- <div class="alert alert alert-danger alert-dismissible" role="alert">
3
- <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
2
+ <div class="alert alert-danger alert-dismissable fade show" role="alert">
4
3
  <h4>The form contains <%= pluralize(object.errors.count, "error") %>.</h4>
5
4
  <ul class="list-group">
6
5
  <% object.errors.full_messages.each do |msg| %>
7
6
  <li class="list-group-item list-group-item-danger borderless"><%= msg %></li>
7
+ <li class="list-group-item list-group-item-danger "></li>
8
8
  <% end %>
9
9
  </ul>
10
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
11
+ <span aria-hidden="true">&times;</span>
12
+ </button>
10
13
  </div>
11
14
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module Phcnotifi
2
- VERSION = '45.0.0'
2
+ VERSION = '46.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcnotifi
3
3
  version: !ruby/object:Gem::Version
4
- version: 45.0.0
4
+ version: 46.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-07 00:00:00.000000000 Z
11
+ date: 2019-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -362,8 +362,10 @@ files:
362
362
  - app/jobs/phcnotifi/application_job.rb
363
363
  - app/mailers/phcnotifi/application_mailer.rb
364
364
  - app/models/phcnotifi/application_record.rb
365
- - app/views/phcnotifi/_notifications.html.erb
366
- - app/views/phcnotifi/_validations.html.erb
365
+ - app/views/phcnotifi/admin_four/_notifications.html.erb
366
+ - app/views/phcnotifi/admin_four/_validations.html.erb
367
+ - app/views/phcnotifi/default/_notifications.html.erb
368
+ - app/views/phcnotifi/default/_validations.html.erb
367
369
  - lib/phcnotifi.rb
368
370
  - lib/phcnotifi/engine.rb
369
371
  - lib/phcnotifi/version.rb
@@ -1,13 +0,0 @@
1
- <div class="row">
2
- <div class=".col-md-12">
3
- <div class="alert alert-dismissible alert-warning hidden alert-please-update" role="alert">
4
- <button aria-label="Close" class="close" data-dismiss="alert" type="button"><span aria-hidden="true"> ×</span></button><strong>Please update</strong>Despite the fact that the record doens't show on your screen you must save it to delete it!
5
- </div>
6
- <% flash.each do |key, value| %>
7
- <div class="<%= flash_class(key) %> fade in">
8
- <a href="#" data-dismiss="alert" class="close">×</a>
9
- <%= value %>
10
- </div>
11
- <% end %>
12
- </div>
13
- </div>