From 0b9f399c06836098f386d08478f412d2d18f3d74 Mon Sep 17 00:00:00 2001 From: Arun Kumar Date: Fri, 31 Aug 2018 11:11:57 -0500 Subject: [PATCH 1/2] Isolate moderator and admin actions for ease of usability --- app/assets/v2/css/bounty.css | 11 +++++++++ app/assets/v2/js/pages/bounty_details.js | 27 +++++++++++++++------ app/dashboard/templates/bounty/details.html | 1 + 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/app/assets/v2/css/bounty.css b/app/assets/v2/css/bounty.css index ee40312aef2..5139bb37344 100644 --- a/app/assets/v2/css/bounty.css +++ b/app/assets/v2/css/bounty.css @@ -344,6 +344,17 @@ a.btn { margin-bottom: 10px; } +#moderator-admin-actions:not(:empty) { + background: #e9e9e9; + padding: 16px; +} + +.sticky { + position: fixed; + top: 0; + z-index: 1010; +} + #btn-white { background-color: #FFFFFF; border: 1px solid #979797; diff --git a/app/assets/v2/js/pages/bounty_details.js b/app/assets/v2/js/pages/bounty_details.js index d5f406b6d34..93b64dee985 100644 --- a/app/assets/v2/js/pages/bounty_details.js +++ b/app/assets/v2/js/pages/bounty_details.js @@ -963,7 +963,7 @@ var do_actions = function(result) { enabled: true, href: url, text: gettext('Suspend Auto Approval'), - parent: 'right_actions', + parent: 'moderator-admin-actions', title: gettext('Suspend *Auto Approval* of Bounty Hunters Who Have Applied for This Bounty'), color: 'white', buttonclass: 'admin-only' @@ -980,7 +980,7 @@ var do_actions = function(result) { enabled: true, href: url, text: gettext('Hide Bounty'), - parent: 'right_actions', + parent: 'moderator-admin-actions', title: gettext('Hides Bounty from Active Bounties'), color: 'white', buttonclass: 'admin-only' @@ -997,7 +997,7 @@ var do_actions = function(result) { enabled: true, href: url, text: gettext('Toggle Remarket Ready'), - parent: 'right_actions', + parent: 'moderator-admin-actions', title: gettext('Sets Remarket Ready if not already remarket ready. Unsets it if already remarket ready.'), color: 'white', buttonclass: 'admin-only' @@ -1014,7 +1014,7 @@ var do_actions = function(result) { enabled: true, href: url, text: gettext('Mark as Reviewed'), - parent: 'right_actions', + parent: 'moderator-admin-actions', title: gettext('Marks the bounty activity as reviewed.'), color: 'white', buttonclass: 'admin-only' @@ -1030,7 +1030,7 @@ var do_actions = function(result) { enabled: true, href: url, text: gettext('Contact Funder'), - parent: 'right_actions', + parent: 'moderator-admin-actions', title: gettext('Contact Funder via Email'), color: 'white', buttonclass: 'admin-only contact_bounty_hunter' @@ -1046,7 +1046,7 @@ var do_actions = function(result) { enabled: true, href: url, text: gettext('Snooze Gitcoinbot'), - parent: 'right_actions', + parent: 'moderator-admin-actions', title: gettext('Snooze Gitcoinbot reminders'), color: 'white', buttonclass: 'admin-only snooze_gitcoin_bot' @@ -1062,7 +1062,7 @@ var do_actions = function(result) { enabled: true, href: url, text: gettext('Override Status'), - parent: 'right_actions', + parent: 'moderator-admin-actions', title: gettext('Override Status with a status of your choosing'), color: 'white', buttonclass: 'admin-only admin_override_satatus' @@ -1078,7 +1078,7 @@ var do_actions = function(result) { enabled: true, href: url, text: gettext('View in Admin'), - parent: 'right_actions', + parent: 'moderator-admin-actions', title: gettext('View in Admin'), color: 'white', buttonclass: 'admin-only' @@ -1294,6 +1294,17 @@ const is_bounty_expired = function(bounty) { }; var main = function() { + const moderatorAndAdminActions = $('#moderator-admin-actions'); + const scrollHeight = 150; + + $(window).scroll(RAFThrottle(() => { + if (window.scrollY > scrollHeight) { + moderatorAndAdminActions.addClass('sticky'); + } else { + moderatorAndAdminActions.removeClass('sticky'); + } + })); + setTimeout(function() { // setup attach_work_actions(); diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index 45ec1cb4471..fc86e773bf6 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -43,6 +43,7 @@
{% trans "Be the OSS Funding you wish to see in the world." %}
+
From dc4a5272a3dc38aa9f6c8ad89b8767a58e1f482a Mon Sep 17 00:00:00 2001 From: Aditya Anand Date: Sat, 1 Sep 2018 00:21:43 +0530 Subject: [PATCH 2/2] bounty: updated admin css --- app/assets/v2/css/bounty.css | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/assets/v2/css/bounty.css b/app/assets/v2/css/bounty.css index 5139bb37344..9cb6034ad8e 100644 --- a/app/assets/v2/css/bounty.css +++ b/app/assets/v2/css/bounty.css @@ -344,11 +344,6 @@ a.btn { margin-bottom: 10px; } -#moderator-admin-actions:not(:empty) { - background: #e9e9e9; - padding: 16px; -} - .sticky { position: fixed; top: 0; @@ -533,6 +528,18 @@ a.btn { padding-left: 5px; } +#moderator-admin-actions:not(:empty) { + background: #F2F6F9; + padding: 16px 0 10px; + text-align: center; + left: 0; +} + +#moderator-admin-actions:not(:empty) a { + border: none !important; + margin: 0 3px 5px; +} + @media (max-width: 767px) { #title {