Skip to content

Commit

Permalink
Merge branch 'kevin/profile-v2' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Sep 23, 2019
2 parents 03698cc + 74b993e commit 4103fea
Show file tree
Hide file tree
Showing 72 changed files with 3,168 additions and 896 deletions.
8 changes: 7 additions & 1 deletion app/app/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
import json
import logging

from django.conf import settings
from django.utils import timezone
Expand All @@ -31,6 +32,8 @@

RECORD_VISIT_EVERY_N_SECONDS = 60 * 60

logger = logging.getLogger(__name__)


def preprocess(request):
"""Handle inserting pertinent data into the current context."""
Expand Down Expand Up @@ -61,7 +64,10 @@ def preprocess(request):
if record_visit:
ip_address = get_ip(request)
profile.last_visit = timezone.now()
profile.save()
try:
profile.save()
except Exception as e:
logger.exception(e)
metadata = {'useragent': request.META['HTTP_USER_AGENT'], }
UserAction.objects.create(
user=request.user,
Expand Down
1 change: 1 addition & 0 deletions app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
IS_DEBUG_ENV = ENV in DEBUG_ENVS
HOSTNAME = env('HOSTNAME', default=socket.gethostname())
BASE_URL = env('BASE_URL', default='http://localhost:8000/')
OVERRIDE_NETWORK = env('OVERRIDE_NETWORK', default=None)
SECRET_KEY = env('SECRET_KEY', default='YOUR-SupEr-SecRet-KeY')
ADMINS = (env.tuple('ADMINS', default=('TODO', '[email protected]')))
BASE_DIR = root()
Expand Down
7 changes: 7 additions & 0 deletions app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@

# api views
url(r'^api/v0.1/profile/(.*)?/keywords', dashboard.views.profile_keywords, name='profile_keywords'),
url(r'^api/v0.1/profile/(.*)?/activity.json', dashboard.views.profile_activity, name='profile_activity'),
url(r'^api/v0.1/profile/(.*)?/earnings.csv', dashboard.views.profile_earnings, name='profile_earnings'),
url(r'^api/v0.1/profile/(.*)?/viewers.csv', dashboard.views.profile_viewers, name='profile_viewers'),
url(r'^api/v0.1/profile/(.*)?/spent.csv', dashboard.views.profile_spent, name='profile_spent'),
url(r'^api/v0.1/profile/banner', dashboard.views.change_user_profile_banner, name='change_user_profile_banner'),
url(r'^api/v0.1/activity', retail.views.create_status_update, name='create_status_update'),
url(
r'^api/v0.1/profile/(.*)?/jobopportunity',
dashboard.views.profile_job_opportunity,
Expand Down Expand Up @@ -136,6 +141,7 @@
# dashboard views
re_path(r'^onboard/(?P<flow>\w+)/$', dashboard.views.onboard, name='onboard'),
re_path(r'^onboard/contributor/avatar/?$', dashboard.views.onboard_avatar, name='onboard_avatar'),
re_path(r'^onboard/?$', dashboard.views.onboard, name='onboard'),
url(r'^postcomment/', dashboard.views.post_comment, name='post_comment'),
url(r'^explorer/?', dashboard.views.dashboard, name='explorer'),

Expand Down Expand Up @@ -270,6 +276,7 @@
re_path(r'^users/?', dashboard.views.users_directory, name='users_directory'),

# Alpha functionality
re_path(r'^profile/(.*)/(.*)?', dashboard.views.profile, name='profile_by_tab'),
re_path(r'^profile/(.*)?', dashboard.views.profile, name='profile'),
re_path(r'^toolbox/?', dashboard.views.toolbox, name='toolbox'),
path('actions/tool/<int:tool_id>/voteUp', dashboard.views.vote_tool_up, name='vote_tool_up'),
Expand Down
14 changes: 14 additions & 0 deletions app/assets/v2/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1633,3 +1633,17 @@ div.busyOverlay {
.daterangepicker .ranges li.active {
background-color: #5b24ff !important;
}

.admin_only {
background-color: #f2f5ea !important;
border-radius: 3px;
}

.only_visible_to_me_color {
background-color: #d3e3f7;
}

.only_visible_to_me {
padding: 3px 5px;
border-radius: 3px;
}
10 changes: 10 additions & 0 deletions app/assets/v2/css/gitcoin.css
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,16 @@ div.button-pink {
margin-right: 0.5rem;
}

#tabs .nav-link span {
position: relative;
font-size: 0.3rem;
font-weight: bold;
background-color: #ddd;
border-radius: 10px;
padding: 3px 5px;
top: -5px;
}

.nav-link:visited {
color: #eff4ee;
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/v2/css/grants/fund.css
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
padding: 1rem 15px;
position: absolute;
top: 0px;
left: 0px;
left: 130px;
}

.clr_estimate.extraleft {
Expand Down
102 changes: 62 additions & 40 deletions app/assets/v2/css/profile.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@

.tab-projects__item img {
width: 50px;
height: 50px;
}

.tag-list .tag-list__item {
background: #E8F0FA;
padding: 4px;
border-radius: 2px;
font-size: 14px;
color: #6487AE;
}

.review-comment {
background: #E4E6E7;
border-radius: 5px;
padding: 5px 7px;
font-size: 12px;
color: #666666;
}

.mh-150{
min-height: 150px;
}
Expand Down Expand Up @@ -89,13 +111,13 @@

.avatar_edit {
text-align: center;
background: linear-gradient(to top,rgba(255,255,255,0.6),rgba(255,255,255,0.0));
background: #000;
opacity: 0.7;
border-radius: 0% 0% 50% 50% / 0% 0% 100% 100%;
color: black;
height: 90px;
width: 180px;
height: 60px;
width: 173px;
position: absolute;
top: 93px;
top: 122px;
margin: auto;
right: 0;
left: 0;
Expand All @@ -104,33 +126,27 @@

.avatar_edit_text {
position: absolute;
top: 50%;
color: black;
top: 40%;
color: #ffffff;
font-weight: bold;
font-size: 20px;
font-size: 14px;
margin: auto;
width: 100%;
height: 40px;
}

.is_my_profile a:hover .profile-header__avatar{
border: 3px solid #0fce7c;
.odd{
background-color: #f9f9f9;
border-top: #eeeeee 1px solid;
border-bottom: #eeeeee 1px solid;
}

.is_my_profile{
cursor: pointer;
.profile_details .nav-link {
padding: 0.5rem;
}

a:hover .avatar_edit {
background-color: rgba(255, 255, 255, 0.7);
height: 180px;
width: 180px;
top: 3px;
border-radius: 50%;
}

a:hover .avatar_edit .avatar_edit_text {
top: 40%;
.is_editable{
cursor: pointer;
}

.picky img {
Expand All @@ -139,7 +155,6 @@ a:hover .avatar_edit .avatar_edit_text {
vertical-align: middle;
}


.profile-organizations .organization {
display: inline-block;
}
Expand All @@ -148,15 +163,14 @@ a:hover .avatar_edit .avatar_edit_text {
min-height: 200px;
}

.profile-organizations .organization img{
.profile-organizations .organization img {
max-height: 4rem;
max-width: 4rem;
margin-right: 0.5rem;
margin-bottom: 0.5rem;
border-radius: 50%;
}


@media (max-width: 1200px) {
.profile-header{
min-height: 350px;
Expand Down Expand Up @@ -389,6 +403,19 @@ a:hover .avatar_edit .avatar_edit_text {
transform: scale(1.1);
}

#kudos_header {
position: absolute;
top: -95px;
right: 0px;
background-color: rgba(255, 255, 255, 0.2);
border-radius: 5px;
padding: 5px;
}
#kudos_header img{
box-shadow: none;
background: none;
}

.no-profile-button {
background-color: #3E00FF;
color: #FFFFFF;
Expand All @@ -402,26 +429,17 @@ a:hover .avatar_edit .avatar_edit_text {
.profile-banner {
display: flex;
top: 0;
bottom: 0;
color: #ffffff;
z-index: 1;
width: 100vw;
cursor: pointer;
}

.profile-banner:hover {
background: linear-gradient(to top,rgba(255,255,255,0.6),rgba(255,255,255,0.0));
}

.profile-banner .h4 {
font-weight: bold;
text-shadow: 1px 1px 1px #000;
opacity: 0.5;
padding: 5px;
}

.profile-banner:hover .h4 {
opacity: 1;
.profile-banner-cta {
background-color: #000;
padding: 6px 10px;
border-radius: 2px;
cursor: pointer;
}

.picky {
Expand All @@ -440,4 +458,8 @@ nav.navbar.navbar-dark{
background-image: url(/static/v2/images/header-bg.png);
}


#rank_link{
font-size: 12px;
color: black;
text-decoration: underline;
}
Binary file added app/assets/v2/images/project_logos/eth_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 17 additions & 8 deletions app/assets/v2/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ if ($('#is-authenticated').val() === 'True' && !localStorage['notify_policy_upda
$('#notify_policy_update').bootstrapModal('show');
}

if (document.contxt.github_handle && !document.contxt.persona_is_funder && !document.contxt.persona_is_hunter) {

var show_persona_modal = function(e) {
const content = $.parseHTML(
`<div id="persona_modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
Expand All @@ -272,6 +271,14 @@ if (document.contxt.github_handle && !document.contxt.persona_is_funder && !docu

$(content).appendTo('body');
$('#persona_modal').bootstrapModal('show');
};

if (
document.contxt.github_handle &&
!document.contxt.persona_is_funder &&
!document.contxt.persona_is_hunter
) {
show_persona_modal();
}

$('body').on('click', '[data-persona]', function(e) {
Expand All @@ -287,20 +294,23 @@ const sendPersonal = (persona) => {
if (statusCode.status != 200) {
return _alert(response.msg, 'error');
}

$('#persona_modal').bootstrapModal('hide');

const urls = [
{
url: '/hackathon/onboard'
},
{
url: '/profile'
}
];

const checkUrlRedirect = (arr, val) => {
return arr.some(arrObj => {
if (val.indexOf(arrObj.url) >= 0) {
return false;
return arr.all(arrObj => {
if (val.indexOf(arrObj.url) == -1) {
return true;
}
return true;
return false;
});
};

Expand All @@ -319,7 +329,6 @@ const sendPersonal = (persona) => {
}
}


});
};

Expand Down
Loading

0 comments on commit 4103fea

Please sign in to comment.