Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Jan 10, 2020
2 parents a516408 + bd34762 commit 045bfa1
Show file tree
Hide file tree
Showing 474 changed files with 2,396 additions and 1,100 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ jobs:
- pip install codecov
# Fetch and Install GeoIP database files.
- sudo apt-get update && sudo apt-get install -y libmaxminddb-dev
- wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
- wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
- gunzip GeoLite2-City.mmdb.gz && gunzip GeoLite2-Country.mmdb.gz
- wget --output-document GeoLite2-City.mmdb.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&date=20191231&license_key=7PZQgKNxgqTRhkWy&suffix=tar.gz"
- wget --output-document GeoLite2-Country.mmdb.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&date=20191231&license_key=7PZQgKNxgqTRhkWy&suffix=tar.gz"
- gunzip GeoLite2-City.mmdb.tar.gz && gunzip GeoLite2-Country.mmdb.tar.gz
- tar -xvf GeoLite2-City.mmdb.tar && tar -xvf GeoLite2-Country.mmdb.tar
- sudo mkdir -p /opt/GeoIP/
- sudo mv *.mmdb /opt/GeoIP/
- sudo mv GeoLite2-City_20191231/*.mmdb /opt/GeoIP/
- sudo mv GeoLite2-Country_20191231/*.mmdb /opt/GeoIP/
# Install libvips dependencies.
- sudo apt-get install -y libvips libvips-dev
# Install Node and Python dependencies.
Expand Down
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ RUN apt-get install -y python3-pip

# GeoIP2 Data Files
RUN mkdir -p /usr/share/GeoIP/ && \
wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz && \
wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz && \
gunzip GeoLite2-City.mmdb.gz && \
gunzip GeoLite2-Country.mmdb.gz && \
mv *.mmdb /usr/share/GeoIP/
wget --output-document GeoLite2-City.mmdb.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&date=20191231&license_key=7PZQgKNxgqTRhkWy&suffix=tar.gz" && \
wget --output-document GeoLite2-Country.mmdb.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&date=20191231&license_key=7PZQgKNxgqTRhkWy&suffix=tar.gz" && \
gunzip GeoLite2-City.mmdb.tar.gz && \
gunzip GeoLite2-Country.mmdb.tar.gz && \
tar -xvf GeoLite2-City.mmdb.tar && \
tar -xvf GeoLite2-Country.mmdb.tar && \
mv GeoLite2-City_20191231/*.mmdb /usr/share/GeoIP/ && \
mv GeoLite2-Country_20191231/*.mmdb /usr/share/GeoIP/

# Upgrade package essentials.
RUN pip3 install --upgrade pip setuptools wheel dumb-init pipenv
Expand Down
22 changes: 21 additions & 1 deletion app/app/context.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Define additional context data to be passed to any request.
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down Expand Up @@ -91,10 +91,30 @@ def preprocess(request):
callback = request.GET.get('cb')
handle_marketing_callback(callback, request)

chat_unread_messages = False

if profile and profile.chat_id:
try:
from chat.tasks import get_driver
chat_driver = get_driver()

chat_unreads_request = chat_driver.teams.get_team_unreads_for_user(
profile.chat_id
)

if 'message' not in chat_unreads_request:
for teams in chat_unreads_request:
if teams['msg_count'] > 0 or teams['mention_count'] > 0:
chat_unread_messages = True
break
except Exception as e:
logger.error(str(e))

context = {
'STATIC_URL': settings.STATIC_URL,
'MEDIA_URL': settings.MEDIA_URL,
'num_slack': num_slack,
'chat_unread_messages' : chat_unread_messages,
'github_handle': request.user.username if user_is_authenticated else False,
'email': request.user.email if user_is_authenticated else False,
'name': request.user.get_full_name() if user_is_authenticated else False,
Expand Down
2 changes: 1 addition & 1 deletion app/app/log_filters.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Define custom log filters for Gitcoin logging.
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion app/app/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Define authentication pipeline functions and logic.
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
15 changes: 11 additions & 4 deletions app/app/settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Define the Gitcoin project settings.
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down Expand Up @@ -91,6 +91,7 @@
'health_check.contrib.s3boto3_storage',
'app',
'avatar',
'chat',
'retail',
'rest_framework',
'marketing',
Expand Down Expand Up @@ -120,7 +121,8 @@
'event_ethdenver2019',
'inbox',
'feeswapper',
'oauth2_provider'
'oauth2_provider',
'compliance'
]

MIDDLEWARE = [
Expand Down Expand Up @@ -467,6 +469,8 @@
CELERY_TASK_SERIALIZER = 'json'
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-result_serializer
CELERY_RESULT_SERIALIZER = 'json'
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-result_backend
CELERY_RESULT_BACKEND = env('CELERY_RESULT_BACKEND', default=CACHEOPS_REDIS)

DJANGO_REDIS_IGNORE_EXCEPTIONS = env.bool('REDIS_IGNORE_EXCEPTIONS', default=True)
DJANGO_REDIS_LOG_IGNORED_EXCEPTIONS = env.bool('REDIS_LOG_IGNORED_EXCEPTIONS', default=True)
Expand Down Expand Up @@ -541,8 +545,11 @@
GITHUB_APP_NAME = env('GITHUB_APP_NAME', default='gitcoin-local')

# Chat
CHAT_URL = env('CHAT_DRIVER_USER', default='') # location of where mattermost is hosted

CHAT_PORT = env('CHAT_PORT', default=8065) # port of where mattermost is hosted
CHAT_URL = env('CHAT_URL', default='http://localhost') # location of where mattermost is hosted
CHAT_DRIVER_TOKEN = env('CHAT_DRIVER_TOKEN', default='') # driver token
GITCOIN_HACK_CHAT_TEAM_ID = env('GITCOIN_HACK_CHAT_TEAM_ID', default='')
GITCOIN_CHAT_TEAM_ID = env('GITCOIN_CHAT_TEAM_ID', default='')
# Social Auth
LOGIN_URL = 'gh_login'
LOGOUT_URL = 'logout'
Expand Down
2 changes: 1 addition & 1 deletion app/app/templates/shared/messages.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% comment %}
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion app/app/templates/shared/rain.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% comment %}
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion app/app/templates/shared/sentry.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% comment %}
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion app/app/tests/test_app_urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Handle app url related tests.
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion app/app/thumbnail_processors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Define the EthOS thumbnail processors.
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
7 changes: 4 additions & 3 deletions app/app/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down Expand Up @@ -146,8 +146,9 @@
url(r'^api/v0.1/choose_persona/', dashboard.views.choose_persona, name='choose_persona'),

# chat
url(r'^chat/', chat.views.embed, name='chat'),
url(r'^chat', chat.views.embed, name='chat2'),
url(r'^chat/web', chat.views.embed, name='web_chat'),
url(r'^chat/web/', chat.views.embed, name='web_chat2'),
re_path(r'^chat/?', chat.views.chat, name='chat'),
# Health check endpoint
re_path(r'^health/', include('health_check.urls')),
re_path(r'^lbcheck/?', healthcheck.views.lbcheck, name='lbcheck'),
Expand Down
2 changes: 1 addition & 1 deletion app/app/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8
"""Define the application WSGI.
Copyright (C) 2018 Gitcoin Core
Copyright (C) 2020 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
4 changes: 4 additions & 0 deletions app/assets/v2/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ a {
color: #3E00FF;
}

.cursor-pointer {
cursor: pointer !important;
}

.nav_avatar {
width: 40px;
height: 40px;
Expand Down
43 changes: 43 additions & 0 deletions app/assets/v2/css/chat.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.banner {
background-color: #0d023b;
background-size: cover;
background-position: 0px 0px;
background-repeat: no-repeat;
position: relative;
color: #fff;
padding-top: 5rem;
padding-bottom: 5rem;
}

.sub-headline {
line-height: 48px;
}

.online {
color: #25e899;
}

.dot {
background-color: #25e899;
display: none;
width: 9px;
height: 9px;
border-radius: 50%;
position: absolute;
top: 0.5em;
right: 0.9em;
}

.open-app {
background-color: #0D001A;
}

img.feature {
border-radius: 80px;
}

@media (max-width: 1024px) {
.chat-img {
display: none;
}
}
7 changes: 7 additions & 0 deletions app/assets/v2/css/grants/detail.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
.grant_details .box {
width: 20px;
height: 20px;
margin-right: 10px;
padding: 0px;
}

@media (min-width: 1200px) {
.grant-detail .container {
max-width: 85vw
Expand Down
1 change: 1 addition & 0 deletions app/assets/v2/css/grants/grant.css
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
cursor: pointer;
}

.grant-partners .nav-link,
.grant-partners .nav-link:hover {
border: none;
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/v2/css/grants/new.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}

.select2-container--default .select2-selection--multiple {
height: 2.75rem;
height: 2rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
Expand Down
20 changes: 18 additions & 2 deletions app/assets/v2/css/profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
background: #E8F0FA;
padding: 4px;
border-radius: 2px;
font-size: 12px;
font-size: 11px;
color: #6487AE;
display: inline-block;
margin-bottom: 2px;
Expand Down Expand Up @@ -215,8 +215,11 @@
display: none;
}

}
.transaction-history.bounty_row .avatar {
max-width: 100% !important;
}

}

.profile-header__stats {
border: none;
Expand All @@ -239,6 +242,19 @@
padding: 0.7rem;
}


.bounty_row {
border-bottom: 1px solid #EFEFEF;
}

.bounty_row:hover {
background: none;
}

#earn_dataviz {
max-width: 100%;
}

@media (min-width: 992px) and (max-width: 1199.98px) {

.profile-header__stats .card-header {
Expand Down
Binary file added app/assets/v2/images/chat/android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/v2/images/chat/apple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/v2/images/chat/chat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/v2/images/chat/desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/v2/images/chat/feature_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/v2/images/chat/feature_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/v2/images/chat/feature_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/v2/images/chat/mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/v2/images/chat/web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/v2/images/chat/windows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/assets/v2/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,7 @@ const gitcoinUpdates = (force) => {
if (document.contxt.github_handle) {
gitcoinUpdates();
}

if (document.contxt.chat_unread_messages) {
$('#chat-notification-dot').addClass('notification__dot__active');
}
4 changes: 2 additions & 2 deletions app/assets/v2/js/grants/detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ $(document).ready(function() {
setInterval (() => {
notifyOwnerAddressMismatch(
$('#grant-admin').text(),
$('#grant_contract_owner_address').text(),
$('#contract_owner_address').text(),
'#cancel_grant',
'Looks like your grant has been created with ' +
$('#grant_contract_owner_address').text() + '. Switch to take action on your grant.'
$('#contract_owner_address').text() + '. Switch to take action on your grant.'
);

if ($('#cancel_grant').attr('disabled')) {
Expand Down
Loading

0 comments on commit 045bfa1

Please sign in to comment.