Skip to content

Commit

Permalink
Merge pull request #2970 from anish-agnihotri2/issue_expiry
Browse files Browse the repository at this point in the history
Issue Explorer: Moving expiry date to flyout.
  • Loading branch information
octavioamu authored Dec 1, 2018
2 parents d426866 + 8d7f151 commit 25d19ef
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/assets/v2/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1748,4 +1748,4 @@ div.busyOverlay {
.g-icon__dot-circle:before {
border: 0.25em solid currentColor;
border-radius: 100px;
}
}
6 changes: 6 additions & 0 deletions app/assets/v2/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,9 @@ body {
.btn-expand-token:focus {
color: #007bff;
}

.expired-icon {
font-size: 15px;
padding-right: 0.5em;
vertical-align: text-bottom;
}
11 changes: 7 additions & 4 deletions app/assets/v2/js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,7 @@ function renderBountyRowsFromResults(results, renderForExplorer) {
result['action'] = result['url'];
result['title'] = result['title'] ? result['title'] : result['github_url'];
result['p'] = projectType + (result['experience_level'] ? (result['experience_level'] + ' <span class="separator-bull"></span> ') : '');
result['expired'] = '';

if (result['status'] === 'done') {
result['p'] += 'Done';
Expand All @@ -1163,19 +1164,21 @@ function renderBountyRowsFromResults(results, renderForExplorer) {
} else if (isExpired) {
const timeAgo = timeDifference(dateNow, dateExpires, true);

result['p'] += ('Expired ' + timeAgo + ' ago');
result['expired'] += ('Expired ' + timeAgo + ' ago');
} else {
const openedWhen = timeDifference(dateNow, new Date(result['web3_created']), true);

if (isInfinite) {
const expiredExpires = '<b>Never expires</b>';
const expiredExpires = 'Never expires';

result['p'] += ('Opened ' + openedWhen + ' ago, ' + expiredExpires);
result['p'] += ('Opened ' + openedWhen + ' ago');
result['expired'] += (expiredExpires);
} else {
const timeLeft = timeDifference(dateNow, dateExpires);
const expiredExpires = dateNow < dateExpires ? 'Expires' : 'Expired';

result['p'] += ('Opened ' + openedWhen + ' ago, ' + expiredExpires + ' <b>' + timeLeft + '</b>');
result['p'] += ('Opened ' + openedWhen + ' ago');
result['expired'] += (expiredExpires + ' ' + timeLeft);
}
}

Expand Down
3 changes: 3 additions & 0 deletions app/dashboard/templates/shared/bounty-popover.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
[[/for]]
[[/if]]
</div>
<div class="mt-2">
[[if expired !== ""]]<i class="far fa-clock expired-icon"></i>[[/if]][[:expired]]
</div>
</div>
[[if activities.length]]
<div class="tooltip-bubble__footer">
Expand Down

0 comments on commit 25d19ef

Please sign in to comment.