Skip to content

Commit

Permalink
Merge pull request gitcoinco#2132 from arun1595/moderator-admin-actions
Browse files Browse the repository at this point in the history
Isolate moderator and admin actions for ease of usability
  • Loading branch information
thelostone-mc authored Aug 31, 2018
2 parents 2836aff + dc4a527 commit 2ac66ca
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
18 changes: 18 additions & 0 deletions app/assets/v2/css/bounty.css
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ a.btn {
margin-bottom: 10px;
}

.sticky {
position: fixed;
top: 0;
z-index: 1010;
}

#btn-white {
background-color: #FFFFFF;
border: 1px solid #979797;
Expand Down Expand Up @@ -522,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 {
Expand Down
27 changes: 19 additions & 8 deletions app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,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'
Expand All @@ -977,7 +977,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'
Expand All @@ -994,7 +994,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'
Expand All @@ -1011,7 +1011,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'
Expand All @@ -1027,7 +1027,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'
Expand All @@ -1043,7 +1043,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'
Expand All @@ -1059,7 +1059,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'
Expand All @@ -1075,7 +1075,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'
Expand Down Expand Up @@ -1291,6 +1291,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();
Expand Down
1 change: 1 addition & 0 deletions app/dashboard/templates/bounty/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h6>{% trans "Be the OSS Funding you wish to see in the world." %}</h6>
</div>
</div>

<div class="col-12" id="moderator-admin-actions"></div>
<div class="col-12" id="bounty_details">
<div class="row font-body">
<div class="d-none d-lg-block col-lg-1">
Expand Down

0 comments on commit 2ac66ca

Please sign in to comment.