Skip to content

Commit

Permalink
added toast message
Browse files Browse the repository at this point in the history
  • Loading branch information
imajit committed Mar 17, 2021
1 parent 77bbaa8 commit ea2bd93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jQuery(document).ready(function($) {
if(eventDate!== null)
{
addTag("date:"+eventDate.val());
//$('.toast').toast('show');
$('#mytoast').addClass("show").fadeIn('fast').delay(2000).fadeOut('fast');
}
});
});
9 changes: 6 additions & 3 deletions app/views/notes/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
</table>
<% end %>

<% if current_user && (current_user.role == "admin" || current_user.role == "moderator" || current_user.id == @node.id || current_user.is_coauthor?(@node)) && @node.has_tag('event') %>
<% if current_user &&
( current_user.role == "admin" || current_user.role == "moderator" ||
current_user.id == @node.id || current_user.is_coauthor?(@node) ) &&
@node.has_tag('event') %>
<hr/>
<p>This looks like an event. <span><button id="date-toggle" class="btn-outline-secondary btn-sm" data-toggle="tooltip" data-placement="right" title="Add Date"><i class="fa fa-calendar" aria-hidden="true"></i></button></span></p>
<div id="event-datepicker">
Expand All @@ -97,9 +100,9 @@
Add date to your awesome event in this box
</small>

<!-- <div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast fade alert alert-success" id="mytoast" role="alert" aria-live="assertive" aria-atomic="true">
Date added successfully
</div> -->
</div>

</div>
<% end %>
Expand Down

0 comments on commit ea2bd93

Please sign in to comment.