Skip to content

Commit

Permalink
bounty : minor changes
Browse files Browse the repository at this point in the history
- changed the order of action buttons
- start work turns white on starting work
- added svg background to comment
- fixed margin between action buttons
  • Loading branch information
Aditya Anand committed Apr 2, 2018
1 parent 8715f87 commit 7a7e983
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 21 deletions.
14 changes: 13 additions & 1 deletion app/assets/v2/css/bounty.css
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ a.btn{


#right_actions .button--primary {
margin-right: 10px;
margin-right: 5px;
position: relative;
top: 1px;
}
Expand All @@ -235,12 +235,24 @@ a.btn{
border: 1px solid #979797;
color: #0D0764;
border-radius: 3px;
position: relative;
}

#btn-white img {
position: absolute;
width: 19px;
top: 7px;
right: 8px;
}

#btn-white .github-comment {
border-left: 1px solid #979797;
padding-left: 12px;
margin-left: 5px;
z-index: 1;
color: #FFFFFF;
position: relative;
font-size: 10px;
}

.activity {
Expand Down
32 changes: 15 additions & 17 deletions app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,24 +432,7 @@ var do_actions = function(result) {
// actions
var actions = [];

if (show_start_stop_work) {

// is enabled
var enabled = start_stop_work_enabled;
var interest_entry = {
enabled: enabled,
href: is_interested ? '/uninterested' : '/interested',
text: is_interested ? 'Stop Work' : 'Start Work',
parent: 'right_actions',
title: is_interested ? 'Notify the funder that you will not be working on this project' : 'Notify the funder that you would like to take on this project'
};

actions.push(interest_entry);

}

if (show_submit_work) {
// is enabled
var enabled = submit_work_enabled;
var _entry = {
enabled: enabled,
Expand All @@ -464,6 +447,21 @@ var do_actions = function(result) {
actions.push(_entry);
}

if (show_start_stop_work) {
var enabled = start_stop_work_enabled;
var interest_entry = {
enabled: enabled,
href: is_interested ? '/uninterested' : '/interested',
text: is_interested ? 'Stop Work' : 'Start Work',
parent: 'right_actions',
title: is_interested ? 'Notify the funder that you will not be working on this project' : 'Notify the funder that you would like to take on this project',
color: is_interested ? 'white' : '',
id: 'interest'
};

actions.push(interest_entry);
}

if (show_kill_bounty) {
var enabled = kill_bounty_enabled;
var _entry = {
Expand Down
12 changes: 10 additions & 2 deletions app/assets/v2/js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,18 @@ var mutate_interest = function(bounty_pk, direction) {
var request_url = '/actions/bounty/' + bounty_pk + '/interest/' + direction + '/';

$('#submit').toggleClass('none');
if (direction === 'new')
$('#interest a').toggleClass('btn')
.toggleClass('btn-small')
.toggleClass('button')
.toggleClass('button--primary');

if (direction === 'new') {
_alert({message: "Thanks for letting us know that you're ready to start work."}, 'success');
else if (direction === 'remove')
$('#interest a').attr('id', 'btn-white');
} else if (direction === 'remove') {
_alert({message: "You've stopped working on this, thanks for letting us know."}, 'success');
$('#interest a').attr('id', '');
}

$.post(request_url, function(result) {
result = sanitizeAPIResults(result);
Expand Down
3 changes: 2 additions & 1 deletion app/dashboard/templates/bounty_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ <h5 class="bounty-heading">Funder</h5>

<script id="action" type="text/x-jsrender">
[[if enabled]]
<span [[if id == 'submit']] id="[[:id]]" [[if !work_started]] class="none" [[/if]] [[/if]]
<span id="[[:id]]" [[if id == 'submit']] [[if !work_started]] class="none" [[/if]] [[/if]]
title='<div class="tooltip-info tooltip-sm">[[:title]]</div>'>
[[if pending_acceptance]]
<a class="button button--primary accept" role="button" href="[[:href]]" target="[[:target]]">
Expand All @@ -179,6 +179,7 @@ <h5 class="bounty-heading">Funder</h5>
[[if comments]]
<span class="font-caption">
[[:text]]
<img src={% static "v2/images/comment.svg" %}>
<span class="github-comment">
[[:comments]]
</span>
Expand Down

0 comments on commit 7a7e983

Please sign in to comment.