New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supporter status to the supporter page #2896

Merged
merged 10 commits into from Apr 11, 2018

Conversation

4 participants
@nekodex
Collaborator

nekodex commented Apr 3, 2018

The supporter page might end up being merged with the store/purchase page later, but for the time being the status can go here.

fixes #2782, fixes #2027

nekodex added some commits Apr 3, 2018

@MegaApplePi

This comment has been minimized.

Contributor

MegaApplePi commented Apr 3, 2018

also resolves #2027 ...? #2782 was a duplicate

@@ -54,8 +54,54 @@
</div>
<div class="osu-page osu-page--small osu-page--stg-block">
@if (!empty($supporterStatus))
<!-- supporter status -->
<div class="stg-status{{ $supporterStatus['current'] ? ' stg-status--active' : '' }} stg-block__top">

This comment has been minimized.

@nanaya

nanaya Apr 4, 2018

Collaborator

the stray element doesn't do anything?

This comment has been minimized.

@nekodex

nekodex Apr 11, 2018

Collaborator

which? the theme modifier?

This comment has been minimized.

@nanaya

nanaya Apr 11, 2018

Collaborator

stg-block__top

<!-- why support -->
<div class="stg-block">
<div class="stg-block{{ empty($supporterStatus) ? ' stg-block__top' : ''}}">

This comment has been minimized.

@nanaya

nanaya Apr 4, 2018

Collaborator

The __top more like a modifier.

</div>
<div class="stg-status__text">
{!! trans('community.support.supporter_status.contribution', [
'dollars' => "<strong>\${$supporterStatus['dollars']}</strong>",

This comment has been minimized.

@nanaya

nanaya Apr 4, 2018

Collaborator

number formatted somewhere else and then prefixed with dollar here? Sounds smart 👍

@if ($supporterStatus['giftedTags'] > 0)
<div class="stg-status__text">
{!! trans('community.support.supporter_status.gifted', [
'giftedDollars' => "<strong>\${$supporterStatus['giftedDollars']}</strong>",

This comment has been minimized.

@nanaya

nanaya Apr 4, 2018

Collaborator

see other comment about number format and prefix.

background: @link-gray-light;
opacity: 0.5;
overflow: hidden;
-webkit-mask-image: -webkit-radial-gradient(white, black); // this fixes child content overflowing beyond a parent's rounded corners in safari

This comment has been minimized.

@nanaya

nanaya Apr 4, 2018

Collaborator

does .own-layer() work as well?

// gifted
$gifted = $tagPurchases->where('target_user_id', '<>', $user->user_id);
$giftedDollars = $gifted->sum('amount');
$canceledGifts = $gifted->sum('cancel') * 2; // 1 for purchase transaction and 1 for cancel transaction

This comment has been minimized.

@nanaya

nanaya Apr 4, 2018

Collaborator

summing booleans

$current = $expiration !== null ? $expiration->isFuture() : false;
// purchased
$tagPurchases = $user->supporterTagPurchases()->get();

This comment has been minimized.

@nanaya

nanaya Apr 4, 2018

Collaborator

()->get() optional?

This comment has been minimized.

@notbakaneko

notbakaneko Apr 4, 2018

Contributor

Would depend if you want to use the methods defined by Collection to filter through the existing collection as opposed to running more queries when called through Builder

This comment has been minimized.

@nekodex

nekodex Apr 11, 2018

Collaborator

what notbakaneko said 👍

This comment has been minimized.

@nanaya

nanaya Apr 11, 2018

Collaborator

but $user->supporterTagPurchases()->get() and $user->supporterTagPurchases are same thing...?

This comment has been minimized.

@nanaya

nanaya Apr 11, 2018

Collaborator

(note the missing ())

nekodex added some commits Apr 11, 2018

@nanaya

nanaya approved these changes Apr 11, 2018

@nanaya nanaya merged commit ab09672 into ppy:master Apr 11, 2018

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment