Skip to content

Commit

Permalink
Merge pull request #48 from sk-ys/master
Browse files Browse the repository at this point in the history
After updating note in issue, add a heart button
  • Loading branch information
cat-in-136 authored Jan 2, 2024
2 parents 1fe4a83 + 28a2ca3 commit 6cfe721
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<%# frozen_string_literal: true %>
<% self.class.send :include, HeartsHelper %>
(function() {
const link = "<%= escape_javascript(heart_link_with_counter(@journal, User.current)) %>";
$(link).prependTo($("#change-<%= @journal.id %> .journal-actions"));
})();
6 changes: 6 additions & 0 deletions lib/redmine_hearts/view_hook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ def view_account_left_bottom(context={})
end
end

def view_journals_update_js_bottom(context={})
context[:controller].send(:render_to_string, {
:partial => "hooks/redmine_hearts/view_journals_update_js_bottom"
})
end

private
def heartable_subject(controller)
subject = nil
Expand Down

0 comments on commit 6cfe721

Please sign in to comment.