update notification

This commit is contained in:
Aung Myo
2017-10-26 14:06:42 +06:30
parent 15604fea2c
commit 6b88403186
7 changed files with 19 additions and 12 deletions

View File

@@ -57,6 +57,7 @@ $(document).on('turbolinks:load', function() {
var animateExit = $("#notify_message").attr('data-animate-exit'); var animateExit = $("#notify_message").attr('data-animate-exit');
var colorName = $("#notify_message").attr('data-color-name'); var colorName = $("#notify_message").attr('data-color-name');
var text = $("#notify_message").attr('data-message'); var text = $("#notify_message").attr('data-message');
console.log(text);
if (text != null || colorName != null){ if (text != null || colorName != null){
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit); showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
} }

View File

@@ -6,6 +6,7 @@
//= require turbolinks //= require turbolinks
//= require cable //= require cable
//= require jquery-slimscroll/jquery.slimscroll.js //= require jquery-slimscroll/jquery.slimscroll.js
//= require bootstrap-notify/bootstrap-notify.js
//= require node-waves/waves.js //= require node-waves/waves.js
//= require sweetalert/sweetalert.min.js //= require sweetalert/sweetalert.min.js
//= require BSBMaterial/admin.js //= require BSBMaterial/admin.js

View File

@@ -4,9 +4,10 @@ class BaseOrigamiController < ActionController::Base
#before_action :check_installation #before_action :check_installation
protect_from_forgery with: :exception protect_from_forgery with: :exception
rescue_from CanCan::AccessDenied do |exception| rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message flash[:warning] = exception.message
puts "ssssssssssss"
puts flash
redirect_to origami_root_path redirect_to origami_root_path
end end

View File

@@ -1,4 +1,4 @@
class Origami::CashOutsController < ApplicationController#BaseOrigamiController class Origami::CashOutsController < BaseOrigamiController
def new def new
end end

View File

@@ -1,4 +1,4 @@
class Origami::PayparPaymentsController < ApplicationController#BaseOrigamiController class Origami::PayparPaymentsController < BaseOrigamiController
def create def create
sale_id = params[:sale_id] sale_id = params[:sale_id]
redeem_amount = params[:redeem_amount] redeem_amount = params[:redeem_amount]

View File

@@ -1,4 +1,4 @@
class Origami::VoidController < ApplicationController class Origami::VoidController < BaseOrigamiController
authorize_resource :class => false authorize_resource :class => false
def overall_void def overall_void

View File

@@ -48,14 +48,18 @@
<!-- Main Content --> <!-- Main Content -->
<section class="content"> <section class="content">
<% flash.each do |type, message| %> <% flash.each do |type, message| %>
<% if !flash["errors"]%> <% if type == "notice"
<div class="alert fade in"> color = "alert-success"
<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button> elsif type == "error"
<%=message%> color = "alert-danger"
</div> else
<% end %> color = "bg-black"
end %>
<% end %>
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
</p>
<% end %>
<%= yield %> <%= yield %>
</section> </section>
</body> </body>