diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index a35712f340..10b29448d3 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -33,4 +33,23 @@ jQuery(document).ready(function($) { $('.activity-comment#i-did-this').find('button.btn-primary').click(function(e) { $('.activity-comment#i-did-this').hide(); }); + $(".datepicker").datepicker({format: 'mm-dd-yyyy'}); + $("#collapse-button").click(function(){ + $(this).remove(); + }); + $(function() { + $("img").lazyload(); + }); + $("#event-datepicker").hide(); + $("#date-toggle").click(function(){ + $("#event-datepicker").toggle(); + }); + $("#save-event-date").click(function(){ + eventDate= $(".datepicker").datepicker(); + if(eventDate!== null) + { + addTag("date:"+eventDate.val()); + alert("Event date has been added"); + } + }); }); diff --git a/app/views/notes/show.html.erb b/app/views/notes/show.html.erb index 1748cba63d..8ef85910d2 100644 --- a/app/views/notes/show.html.erb +++ b/app/views/notes/show.html.erb @@ -87,6 +87,15 @@ <% 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') %> +
This looks like an event.
+