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 colorName = $("#notify_message").attr('data-color-name');
var text = $("#notify_message").attr('data-message');
console.log(text);
if (text != null || colorName != null){
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -48,14 +48,18 @@
<!-- Main Content -->
<section class="content">
<% flash.each do |type, message| %>
<% if !flash["errors"]%>
<div class="alert fade in">
<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button>
<%=message%>
</div>
<% end %>
<% end %>
<% if type == "notice"
color = "alert-success"
elsif type == "error"
color = "alert-danger"
else
color = "bg-black"
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 %>
</section>
</body>