Skip to content

Commit

Permalink
Merge pull request #5360 from thelostone-mc/stb
Browse files Browse the repository at this point in the history
stable -> master
  • Loading branch information
thelostone-mc authored Oct 23, 2019
2 parents aa5f7c2 + 8cf0c8c commit a4adc5f
Show file tree
Hide file tree
Showing 36 changed files with 536 additions and 188 deletions.
34 changes: 33 additions & 1 deletion app/app/sitemaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from django.urls import reverse

from dashboard.models import Bounty, Profile
from grants.models import Grant
from kudos.models import Token
from quests.models import Quest


class StaticViewSitemap(sitemaps.Sitemap):
Expand All @@ -15,7 +17,7 @@ def items(self):
return [
'dashboard', 'new_funding', 'tip', 'terms', 'privacy', 'cookie', 'prirp', 'apitos', 'about', 'index',
'help', 'whitepaper', 'whitepaper_access', '_leaderboard', 'faucet', 'mission', 'slack', 'labs', 'results',
'activity', 'kudos_main', 'kudos_marketplace', 'grants', 'funder_bounties'
'activity', 'kudos_main', 'kudos_marketplace', 'grants', 'funder_bounties', 'quests_index', 'newquest'
]

def location(self, item):
Expand Down Expand Up @@ -100,11 +102,41 @@ def location(self, item):
return f'/results/{item}'


class GrantsSitemap(Sitemap):
changefreq = "weekly"
priority = 0.6

def items(self):
return Grant.objects.filter(hidden=False).cache()

def lastmod(self, obj):
return obj.modified_on

def location(self, item):
return item.url


class QuestsSitemap(Sitemap):
changefreq = "weekly"
priority = 0.6

def items(self):
return Quest.objects.filter(visible=True).cache()

def lastmod(self, obj):
return obj.modified_on

def location(self, item):
return item.url


sitemaps = {
'landers': ContributorLandingPageSitemap,
'results': ResultsSitemap,
'static': StaticViewSitemap,
'issues': IssueSitemap,
'orgs': ProfileSitemap,
'kudos': KudosSitemap,
'quests': QuestsSitemap,
'grants': GrantsSitemap,
}
3 changes: 2 additions & 1 deletion app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import linkshortener.views
import marketing.views
import marketing.webhookviews
import perftools.views
import quests.views
import retail.emails
import retail.views
Expand Down Expand Up @@ -542,7 +543,7 @@

# for robots
url(r'^robots.txt/?', retail.views.robotstxt, name='robotstxt'),
url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'),
url(r'^sitemap.xml/?', perftools.views.sitemap, name='django.contrib.sitemaps.views.sitemap'),
# Interests
path('interest/modal', dashboard.views.get_interest_modal, name='get_interest_modal'),
path('actions/bounty/<int:bounty_id>/interest/new/', dashboard.views.new_interest, name='express-interest'),
Expand Down
127 changes: 124 additions & 3 deletions app/assets/v2/css/quests.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
}
.demo {
max-width: 100%;
cursor: pointer;
border: 1px solid #0b57a6;
}
.difficulty_tab{
display: block;
Expand Down Expand Up @@ -278,7 +278,7 @@ body.quest_battle div,
body.quest_battle p{
color: white;
}
._hj_poll_container{
#_hj_poll_container{
display: none;
}
.character .info p{
Expand Down Expand Up @@ -443,6 +443,10 @@ body.quest_battle p{
#cta_button a{
margin-top: 10%;
text-transform: uppercase;
line-height: 66px;
}
a.button{
line-height: 66px;
}
body.stage_1 #cta_button{
margin-top: 25%;
Expand Down Expand Up @@ -481,6 +485,9 @@ body.stage_4 #header{
body.stage_4 #cta_button{
margin-top: 25%;
}
body.winner #cta_button{
margin-top: 5%;
}
body.stage_4 #desc{
margin-top: -2%;
}
Expand Down Expand Up @@ -602,6 +609,22 @@ body.back5.quest_battle{
background: url('/static/v2/images/quests/backs/back5.png') repeat;
background-size: 160%;
}
body.back6.quest_battle{
background: url('/static/v2/images/quests/backs/back6.jpg') repeat;
background-size: 110%;
}
body.back7.quest_battle{
background: url('/static/v2/images/quests/backs/back7.png') repeat;
background-size: 110%;
}
body.back8.quest_battle{
background: url('/static/v2/images/quests/backs/back8.png') repeat;
background-size: 120%;
}
body.back9.quest_battle{
background: url('/static/v2/images/quests/backs/back9.png') repeat;
background-size: 120%;
}
#background {
position: absolute;
z-index: -999999;
Expand Down Expand Up @@ -736,6 +759,36 @@ body.back5.quest_battle{
#desc li:hover {
background-color: #0c0861;
}
body.back1 #desc li:hover {
background-color: #102945;
}
body.back2 #desc li:hover {
background-color: #102945;
}
body.back3 #desc li:hover {
background-color: #f6126e;
}
body.back4 #desc li:hover {
background-color: #17366d;
}
body.back5 #desc li:hover {
background-color: #101061;
}
body.back6 #desc li:hover {
background-color: #8ab2b2;
}
body.back7 #desc li:hover {
background-color: #0e151e;
}
body.back8 #desc li:hover {
background-color: #0a061e;
}
body.back9 #desc li:hover {
background-color: #1c1135;
}
body.stage_1 #desc li:hover {
background-color: #102945;
}
#desc li.selected{
background-color: #3E00FF !important;
}
Expand Down Expand Up @@ -770,11 +823,45 @@ body.back3 .br,
body.back3 .tl{
background-color:rgb(239,72,134, 0.6);
}
body.back6 #header,
body.back6 #desc,
body.back6 .br,
body.back6 .tl{
background-color:rgb(129, 166, 178, 0.6);
}
body.back7 #header,
body.back7 #desc,
body.back7 .br,
body.back7 .tl{
background-color:rgb(14, 21, 30, 0.6);
}
body.back8 #header,
body.back8 #desc,
body.back8 .br,
body.back8 .tl{
background-color:rgb(10, 6, 30, 0.6);
}
body.back9 #header,
body.back9 #desc,
body.back9 .br,
body.back9 .tl{
background-color:rgb(28, 17, 53, 0.6);
}

@media (max-width: 1110px) {
body.quest_battle{
background-size: 250% !important;
}
body.back6.quest_battle,
body.back7.quest_battle,
body.back8.quest_battle,
body.back9.quest_battle{
background-size: 120% !important;
}
#cta_button a, a.button{
line-height: 46px;
padding: 10px;
}
.refer_friend .top_img{
margin-top: -230px;
}
Expand All @@ -799,7 +886,11 @@ body.back3 .tl{
margin-top: 20%;
}
#enemy img{
max-width: 130px;
margin-top: 40px;
margin-right: 50px;
max-height: 150px;
max-width: 150px;
border-radius: 30px;
}
#enemy.character .info{
left: 0px;
Expand Down Expand Up @@ -827,6 +918,9 @@ body.back3 .tl{
body.stage_4 #cta_button{
margin-top: 38%;
}
body.winner #cta_button{
margin-top: 10%;
}
body.stage_4 #desc{
margin-top: 5%;
font-size: 12px;
Expand All @@ -850,6 +944,12 @@ body.back3 .tl{
body.quest_battle{
background-size: 250% !important;
}
body.back6.quest_battle,
body.back7.quest_battle,
body.back8.quest_battle,
body.back9.quest_battle{
background-size: 120% !important;
}
#leaderboard_hero{
background-size: 130%;
}
Expand All @@ -862,6 +962,12 @@ body.back3 .tl{
body.quest_battle{
background-size: 250% !important;
}
body.back6.quest_battle,
body.back7.quest_battle,
body.back8.quest_battle,
body.back9.quest_battle{
background-size: 140% !important;
}
#leaderboard_hero .inner_row {
width: 32%;
height: 350px;
Expand Down Expand Up @@ -906,6 +1012,12 @@ body.back3 .tl{
body.quest_battle{
background-size: 350% !important;
}
body.back6.quest_battle,
body.back7.quest_battle,
body.back8.quest_battle,
body.back9.quest_battle{
background-size: 200% !important;
}
.hide_on_mobile{
display: none;
}
Expand Down Expand Up @@ -974,6 +1086,15 @@ body.back3 .tl{
body.quest_battle{
background-size: 400% !important;
}
body.back6.quest_battle,
body.back7.quest_battle,
body.back8.quest_battle,
body.back9.quest_battle{
background-size: 250% !important;
}
.quest-card{
margin-left: 20% !important;
}
.back_gradient {
background-size: 100% 600px !important;
}
Expand Down
Binary file added app/assets/v2/images/quests/backs/back6.jpg
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/quests/backs/back7.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/quests/backs/back8.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/quests/backs/back9.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/quests/hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/v2/js/kudos-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ $('document').ready(function() {
$('body').on('click', '.kudos_autocomplete', function(e) {
var search_term = $(this).text();

select2Search($('.kudos-search'), search_term);
select2Search($(this).parents('.kudos-module').find('.kudos-search'), search_term);
e.preventDefault();
});

Expand Down
9 changes: 6 additions & 3 deletions app/assets/v2/js/pages/quests.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,13 @@ $(document).ready(function() {
});

$('#cta_button a').on('click', function(e) {
e.preventDefault();
$('#cta_button').addClass('hidden');
advance_to_state(document.quest_state + 1);
var target = $(this).attr('href');

if (target == '#') {
e.preventDefault();
$('#cta_button').addClass('hidden');
advance_to_state(document.quest_state + 1);
}
});

$('.music_toggle').on('click', function(e) {
Expand Down
15 changes: 15 additions & 0 deletions app/assets/v2/js/pages/quests.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ $(document).ready(function() {
$('.demo').attr('src', src);
});
});

var random_attn_effect = function(ele) {
if (ele.data('effect')) {
return;
Expand Down Expand Up @@ -53,6 +54,20 @@ $(document).ready(function() {
});
});

$('#leaderboard_tabs a').click(function(e) {
e.preventDefault();
var target = $(this).data('href');

$('.leaderboard_tab').addClass('hidden');
$('.nav-link').removeClass('active');
$(this).addClass('active');
$('.' + target).removeClass('hidden');

$('html,body').animate({
scrollTop: '+=1px'
});
});

$('.quest-card.available').click(function(e) {
e.preventDefault();
document.location.href = $(this).find('a').attr('href');
Expand Down
11 changes: 10 additions & 1 deletion app/assets/v2/js/pages/quests.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,20 @@ $(document).ready(function() {

ele.remove();
});
$(document).on('click', '.remove', function(e) {
e.preventDefault();
$(this).parents('.form-group').find('.hidden').removeClass('hidden');
$(this).parents('.form-group').find('.default_kudos').remove();
$(this).parents('.form-group').find('input[name=enemy]').remove();
$(this).parents('.form-group').find('[name=enemy2]').attr('name', 'enemy');
$(this).parents('.form-group').find('[name=reward2]').attr('name', 'reward');
$(this).remove();
});


$(document).on('click', '.close_question', function(e) {
e.preventDefault();
if ($(this).parents('div.question').length <= 1) {
if ($('div.question').length <= 1) {
alert('you cannot have 0 questsions');
return;
}
Expand Down
Loading

0 comments on commit a4adc5f

Please sign in to comment.