Skip to content

Commit

Permalink
Merge branch 'stable' of github.com:gitcoinco/web into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Apr 10, 2020
2 parents 59237a3 + 7f7834f commit c039e2c
Show file tree
Hide file tree
Showing 9 changed files with 382 additions and 11 deletions.
1 change: 1 addition & 0 deletions app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
name='profile_job_opportunity'
),
url(r'^api/v0.1/profile/(?P<handle>.*)', dashboard.views.profile_details, name='profile_details'),
url(r'^api/v0.1/user_card/(?P<handle>.*)', dashboard.views.user_card, name='user_card'),
url(r'^api/v0.1/banners', dashboard.views.load_banners, name='load_banners'),
url(
r'^api/v0.1/get_suggested_contributors',
Expand Down
15 changes: 15 additions & 0 deletions app/assets/v2/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,21 @@ div.busyOverlay {
padding: 1.4em 1.3em 1.3em;
}

.popover-user-card {
background-color: #FFF;
padding: 0;
width: 100%;
max-width: 30em;
font-size: 12px;
}

.user-card_donut-chart {
width: 56px;
}
.user-card_pie-chart {
width: 30px;
}

.big-popover {
max-width: 482px;
}
Expand Down
16 changes: 8 additions & 8 deletions app/assets/v2/js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(document).ready(function() {

var linkify = function(new_text) {
new_text = new_text.replace(/(?:^|\s)#([a-zA-Z\d-]+)/g, ' <a href="/?tab=search-$1">#$1</a>');
new_text = new_text.replace(/\B@([a-zA-Z0-9_-]*)/g, ' <a href="/profile/$1">@$1</a>');
new_text = new_text.replace(/\B@([a-zA-Z0-9_-]*)/g, ' <a data-usercard="$1" href="/profile/$1">@$1</a>');
return new_text;
};
// inserts links into the text where there are URLS detected
Expand Down Expand Up @@ -58,9 +58,9 @@ $(document).ready(function() {
const $target = $(this).parents('.activity_detail_content');
const html = `
<p class='float-right p-0 m-0 video_options_container'>
<a href=# class='full_screen'>Full Screen <i class="fas fa-expand-arrows-alt"></i></a> |
<a href=# class='popout_screen'>Pop Out <i class="fas fa-sign-out-alt"></i></a> |
<a href=# class='new_tab'>Open in New Tab <i class="fas fa-external-link-square-alt"></i></i></a> |
<a href=# class='full_screen'>Full Screen <i class="fas fa-expand-arrows-alt"></i></a> |
<a href=# class='popout_screen'>Pop Out <i class="fas fa-sign-out-alt"></i></a> |
<a href=# class='new_tab'>Open in New Tab <i class="fas fa-external-link-square-alt"></i></i></a> |
<a href=# class=' leave_video_call'>Leave Video Call <i class="far fa-times-circle"></i></a>
</p>`;

Expand Down Expand Up @@ -669,7 +669,7 @@ $(document).ready(function() {
${show_more_box}
<div class="row comment_row mx-auto ${is_hidden ? 'hidden' : ''}" data-id=${comment['id']}>
<div class="col-1 activity-avatar my-auto">
<a href="/profile/${comment['profile_handle']}" data-toggle="tooltip" title="@${comment['profile_handle']}">
<a href="/profile/${comment['profile_handle']}" data-usercard="${comment['profile_handle']}">
<img src="/dynamic/avatar/${comment['profile_handle']}">
</a>
</div>
Expand All @@ -680,9 +680,9 @@ $(document).ready(function() {
<span class="indicator" data-toggle="tooltip" title="Gitcoin Chat: ${comment['last_chat_status_title']}">
</span>
</span>
</span>
<b>${comment['name']}</b>
<span class="grey"><a class=grey href="/profile/${comment['profile_handle']}">
<span class="grey"><a class=grey href="/profile/${comment['profile_handle']}" data-usercard="${comment['profile_handle']}">
@${comment['profile_handle']}
</a></span>
${comment['match_this_round'] ? `
Expand Down Expand Up @@ -950,7 +950,7 @@ function throttle(fn, wait) {
}
};
}


window.addEventListener('scroll', throttle(function() {
var offset = 800;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/v2/js/grants/fund.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ $(document).ready(function() {

let realTokenAmount = Number(data.amount_per_period * Math.pow(10, decimals));
let realApproval;

const approve_buffer = 100000;

if (data.contract_version == 1 || data.num_periods == 1) {

realApproval = Number(((grant_amount + gitcoin_grant_amount) * data.num_periods * Math.pow(10, decimals)) + approve_buffer);
Expand Down
17 changes: 17 additions & 0 deletions app/assets/v2/js/pages/join_tribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ const joinTribeDirect = (elem) => {
};


const followRequest = (handle, elem, cb, cbError) => {
if (!document.contxt.github_handle) {
_alert('Please login first.', 'error');
return;
}

const url = `/tribe/${handle}/join/`;
const sendJoin = fetchData (url, 'POST', {}, {'X-CSRFToken': $("input[name='csrfmiddlewaretoken']").val()});

$.when(sendJoin).then(function(response) {
return cb(handle, elem, response);
}).fail(function(error) {
return cbError(error);
});
};


const tribeLeader = () => {
$('[data-tribeleader]').each(function(index, elem) {

Expand Down
Loading

0 comments on commit c039e2c

Please sign in to comment.