From 9728a89b041c7e64ecb55bb52e4ed51a1f781487 Mon Sep 17 00:00:00 2001 From: Miguel Angel G Date: Thu, 12 Mar 2020 03:31:50 -0600 Subject: [PATCH 1/5] Add counter on comments list --- app/assets/v2/js/activity.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/app/assets/v2/js/activity.js b/app/assets/v2/js/activity.js index 9a5349c70ac..0aa632bd689 100644 --- a/app/assets/v2/js/activity.js +++ b/app/assets/v2/js/activity.js @@ -440,6 +440,7 @@ $(document).ready(function() { if (getParam('tab') && getParam('tab').indexOf('activity:') != -1) { hide_after_n_comments = 100; } + const limit_hide_option = 10; // remote post var params = { 'method': 'comment' @@ -449,7 +450,6 @@ $(document).ready(function() { var $target = $parent.parents('.activity.box').find('.comment_container'); var $existing_textarea = $target.find('textarea.enter-activity-comment'); var existing_text = $existing_textarea.length ? $existing_textarea.val() : ''; - if (!$target.length) { $target = $parent.parents('.box').find('.comment_container'); } @@ -495,12 +495,13 @@ $(document).ready(function() { var show_more_box = ''; var is_hidden = (num_comments - i) >= hide_after_n_comments && override_hide_comments != true; var is_first_hidden = i == 0 && num_comments >= hide_after_n_comments && override_hide_comments != true; + const show_all_option = num_comments > limit_hide_option; if (is_first_hidden) { show_more_box = ` -
+ `; @@ -630,16 +631,29 @@ $(document).ready(function() { // post comment activity $(document).on('click', '.show_more', function(e) { e.preventDefault(); - var num_to_unhide_at_once = 3; + const num_to_unhide_at_once = 3; for (var i = 0; i < num_to_unhide_at_once; i++) { get_hidden_comments($(this)).last().removeClass('hidden'); } if (get_hidden_comments($(this)).length == 0) { $(this).remove(); + } else { + $(this).find('.comment-count').text(get_hidden_comments($(this)).length); } }); + $(document).on('click', '.show_all', function(e) { + e.preventDefault(); + const hiddenComments = get_hidden_comments($(this)); + + for (let i = 0; i < hiddenComments.length; i++) { + hiddenComments[i].classList.remove('hidden'); + } + + $(this).remove(); + }); + // post comment activity $(document).on('click', '.comment_activity', function(e) { e.preventDefault(); From 285731eeb11aa89540181df50037fb82af01212b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 08:15:20 +0000 Subject: [PATCH 2/5] Bump acorn from 6.3.0 to 6.4.1 Bumps [acorn](https://github.com/acornjs/acorn) from 6.3.0 to 6.4.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/6.3.0...6.4.1) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- yarn.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6e6671ea906..4b65fe51f2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -293,9 +293,9 @@ } }, "acorn": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", - "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", "dev": true }, "acorn-jsx": { diff --git a/yarn.lock b/yarn.lock index 3e413ea9b69..1d4955d8057 100644 --- a/yarn.lock +++ b/yarn.lock @@ -202,9 +202,9 @@ acorn-jsx@^5.0.0: integrity sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw== acorn@^6.0.7: - version "6.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e" - integrity sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA== + version "6.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" + integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== ajv@^6.10.2, ajv@^6.5.5, ajv@^6.9.1: version "6.10.2" From f9dd5a8615c1ef833c469969b76ca5e6a8d2069d Mon Sep 17 00:00:00 2001 From: walidmujahid Date: Tue, 17 Mar 2020 18:20:14 -0400 Subject: [PATCH 3/5] remove duplicate icon closing tags --- app/dashboard/templates/profiles/status_box.html | 2 +- app/townsquare/templates/townsquare/shared/shareactivity.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/dashboard/templates/profiles/status_box.html b/app/dashboard/templates/profiles/status_box.html index 37af07a8579..a60ef202434 100644 --- a/app/dashboard/templates/profiles/status_box.html +++ b/app/dashboard/templates/profiles/status_box.html @@ -11,7 +11,7 @@ > - +
diff --git a/app/townsquare/templates/townsquare/shared/shareactivity.html b/app/townsquare/templates/townsquare/shared/shareactivity.html index e2ac6256c69..53d8df6305d 100644 --- a/app/townsquare/templates/townsquare/shared/shareactivity.html +++ b/app/townsquare/templates/townsquare/shared/shareactivity.html @@ -19,8 +19,8 @@ data-maxlen={% if max_length %}{{max_length}}{%else%}280{%endif%} > - - + +
From 33ab7b5905b71dcb7a92790f2259b722c47144b7 Mon Sep 17 00:00:00 2001 From: owocki Date: Thu, 19 Mar 2020 15:50:29 -0600 Subject: [PATCH 4/5] rate limit update --- app/dashboard/tip_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dashboard/tip_views.py b/app/dashboard/tip_views.py index 0e76387199c..fe680e49514 100644 --- a/app/dashboard/tip_views.py +++ b/app/dashboard/tip_views.py @@ -297,7 +297,7 @@ def tipee_address(request, handle): @csrf_exempt -@ratelimit(key='ip', rate='5/m', method=ratelimit.UNSAFE, block=True) +@ratelimit(key='ip', rate='15/m', method=ratelimit.UNSAFE, block=True) def send_tip_3(request): """Handle the third stage of sending a tip (the POST). From 684e7293e03ae08b054057c37fa02fe314106bb6 Mon Sep 17 00:00:00 2001 From: walidmujahid Date: Wed, 18 Mar 2020 19:12:27 -0400 Subject: [PATCH 5/5] add .gitattributes and normalise line endings for .sh files fixes https://github.com/gitcoinco/web/issues/6136 --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..d6c0fd08894 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf