<%= time_ago_in_words json_data["article"]["published_at"] %> ago
+ - <% cache "activity-published-article-reactions-#{@last_user_reaction}-#{json_data['article']['updated_at']}-#{json_data['article']['id']}" do %> -diff --git a/app/assets/images/small-comment-filled.svg b/app/assets/images/small-comment-filled.svg new file mode 100644 index 000000000..6d350fae7 --- /dev/null +++ b/app/assets/images/small-comment-filled.svg @@ -0,0 +1,3 @@ + diff --git a/app/assets/images/small-heart-filled.svg b/app/assets/images/small-heart-filled.svg new file mode 100644 index 000000000..0ac236523 --- /dev/null +++ b/app/assets/images/small-heart-filled.svg @@ -0,0 +1,3 @@ + diff --git a/app/assets/images/small-link.svg b/app/assets/images/small-link.svg new file mode 100644 index 000000000..b2ca1c45b --- /dev/null +++ b/app/assets/images/small-link.svg @@ -0,0 +1,3 @@ + diff --git a/app/assets/javascripts/initializers/initNotifications.js b/app/assets/javascripts/initializers/initNotifications.js index 1879f0b89..fec5475da 100644 --- a/app/assets/javascripts/initializers/initNotifications.js +++ b/app/assets/javascripts/initializers/initNotifications.js @@ -109,8 +109,9 @@ function initReactions() { var thisButt = this; document .getElementById('comment-form-for-' + thisButt.dataset.reactableId) - .classList.add('showing'); - thisButt.innerHTML = ''; + .classList.remove('hidden'); + thisButt.classList.add('hidden'); + thisButt.classList.remove('inline-flex'); setTimeout(function () { document .getElementById( diff --git a/app/assets/javascripts/initializers/initializeCommentsPage.js.erb b/app/assets/javascripts/initializers/initializeCommentsPage.js.erb index 2a49de7ab..8736ad4c3 100644 --- a/app/assets/javascripts/initializers/initializeCommentsPage.js.erb +++ b/app/assets/javascripts/initializers/initializeCommentsPage.js.erb @@ -238,7 +238,7 @@ function handleCommentSubmit(event) { } else if (document.getElementById("notifications-container")) { var newDiv = document.createElement("span") - newDiv.innerHTML = '
' + newDiv.innerHTML = '<%= time_ago_in_words json_data["article"]["published_at"] %> ago
+ - <% cache "activity-published-article-reactions-#{@last_user_reaction}-#{json_data['article']['updated_at']}-#{json_data['article']['id']}" do %> -<%= json_data["badge_achievement"]["badge"]["description"] %>
+<%= json_data["badge_achievement"]["rewarding_context_message"].html_safe %>
- <%= json_data["badge_achievement"]["badge"]["description"] %> -
-" class="crayons-btn w-100 m:w-50">Visit your profile
+You also get 5 new credits to use for community listings if you have anything you'd like to promote. 🎉
+Visit Settings to manage your notifications.
+ <% end %> +Since they are new to the community, could you leave a nice reply to help them feel welcome? Thank you!
+All negative reactions are 100% private. If this comment violates the code of conduct, please downvote/report as inappropriate.
+ + <% elsif notification.action == "First" %> +<%= time_ago_in_words notification.created_at %> ago
+ +Give them their first reply! 🎉
+" class="crayons-link fw-bold"><%= first_notification["name"] %> followed you!
+ <%= follow_button(notification.decorate.mocked_object("user"), "follow-back") %>+ <% if notification.json_data["aggregated_siblings"].length == 2 %> + " class="crayons-link fw-bold"><%= json_data_array.first["name"] %> and + " class="crayons-link fw-bold"><%= json_data_array.second["name"] %> followed you! + <% else %> + " class="crayons-link fw-bold"><%= json_data_array.first["name"] %> + and <%= notification.json_data["aggregated_siblings"].size - 1 %> others followed you! + <% end %> +
<% end %>🎉🎉🎉🎉🎉🎉🎉🎉
+🎉🎉🎉🎉🎉🎉🎉🎉
+ " class="crayons-link fw-bold"><%= h(json_data["article"]["title"]) %> passed <%= notification.milestone_count %> <%= notification.milestone_type.pluralize.downcase %>! + - " rel="noopener noreferrer" target="_blank"> -