Add supporter status to the supporter page #2896
Merged
Conversation
@@ -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"> |
nanaya
Apr 4, 2018
•
Collaborator
the stray element doesn't do anything?
the stray element doesn't do anything?
nekodex
Apr 11, 2018
Author
Collaborator
which? the theme modifier?
which? the theme modifier?
nanaya
Apr 11, 2018
Collaborator
stg-block__top
stg-block__top
<!-- why support --> | ||
<div class="stg-block"> | ||
<div class="stg-block{{ empty($supporterStatus) ? ' stg-block__top' : ''}}"> |
nanaya
Apr 4, 2018
Collaborator
The __top
more like a modifier.
The __top
more like a modifier.
</div> | ||
<div class="stg-status__text"> | ||
{!! trans('community.support.supporter_status.contribution', [ | ||
'dollars' => "<strong>\${$supporterStatus['dollars']}</strong>", |
nanaya
Apr 4, 2018
Collaborator
number formatted somewhere else and then prefixed with dollar here? Sounds smart 👍
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>", |
nanaya
Apr 4, 2018
Collaborator
see other comment about number format and prefix.
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 |
nanaya
Apr 4, 2018
Collaborator
does .own-layer()
work as well?
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 |
nanaya
Apr 4, 2018
•
Collaborator
summing booleans
summing booleans
$current = $expiration !== null ? $expiration->isFuture() : false; | ||
|
||
// purchased | ||
$tagPurchases = $user->supporterTagPurchases()->get(); |
nanaya
Apr 4, 2018
Collaborator
()->get()
optional?
()->get()
optional?
notbakaneko
Apr 4, 2018
Collaborator
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
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
nekodex
Apr 11, 2018
Author
Collaborator
what notbakaneko said 👍
what notbakaneko said
nanaya
Apr 11, 2018
Collaborator
but $user->supporterTagPurchases()->get()
and $user->supporterTagPurchases
are same thing...?
but $user->supporterTagPurchases()->get()
and $user->supporterTagPurchases
are same thing...?
nanaya
Apr 11, 2018
Collaborator
(note the missing ()
)
(note the missing ()
)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
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