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

Show tournament supporter banner in profile page #3091

Merged
merged 19 commits into from May 9, 2018

Conversation

3 participants
@nanaya
Collaborator

nanaya commented Apr 26, 2018

Fixes #2535. Not sure if linking to tournament page is useful.

Copypasta of required .env variables:

TOURNAMENT_BANNER_CURRENT_ID=
# Image path/url for tournament supporter banner.
# Will be appended with country abbreviation and `.jpg`. `@2x` version is also required (prepended before `.jpg`).
# Example:
#   prefix: https://assets.ppy.sh/tournament-banners/official/twc2018_banner_
#   image path: https://assets.ppy.sh/tournament-banners/official/twc2018_banner_JP.jpg
#   image path @2x: https://assets.ppy.sh/tournament-banners/official/twc2018_banner_JP@2x.jpg
TOURNAMENT_BANNER_CURRENT_PREFIX=

TOURNAMENT_BANNER_PREVIOUS_ID=
# Same as `_CURRENT_PREFIX`.
TOURNAMENT_BANNER_PREVIOUS_PREFIX=
# Winning country code
TOURNAMENT_BANNER_PREVIOUS_WINNER_ID=
@@ -42,4 +43,44 @@ public function country()
{
return $this->belongsTo(Country::class, 'country_acronym');
}
public function macroVisible()

This comment has been minimized.

@nekodex

nekodex Apr 27, 2018

Collaborator

Maybe call this current or something instead of visible? Kinda ambiguous.

This comment has been minimized.

@nanaya

nanaya Apr 27, 2018

Collaborator

Went with active because it might be for either current or previous tournament.

@@ -93,6 +93,17 @@
'notice' => presence(str_replace('\n', "\n", env('STORE_NOTICE'))),
],
'twitch_client_id' => env('TWITCH_CLIENT_ID'),
'tournament_support' => [

This comment has been minimized.

@nekodex

nekodex Apr 27, 2018

Collaborator

Hrm, maybe tournament_banner(s) for these variables makes more sense than tournament_support?

@@ -43,6 +43,7 @@ class UserTransformer extends Fractal\TransformerAbstract
'statistics',
'unranked_beatmapset_count',
'user_achievements',
'visible_banner',

This comment has been minimized.

@nekodex

nekodex Apr 27, 2018

Collaborator

tournament_banner, tournament_support_banner or something instead? visible_banner feels way too ambiguous at the UserTransformer level

className: 'profile-header__info profile-header__info--top'
if @props.user.visible_banner.id?
a
href: laroute.route('tournaments.show', tournament: @props.user.visible_banner.tournament_id)

This comment has been minimized.

@nekodex

nekodex Apr 27, 2018

Collaborator

Yeah, I do wonder if linking to that page is even useful in its current state...

href: laroute.route('tournaments.show', tournament: @props.user.visible_banner.tournament_id)
el Img2x,
src: @props.user.visible_banner.image
className: 'profile-header__tournament-support'

This comment has been minimized.

@nekodex

nekodex Apr 27, 2018

Collaborator

See other comment about tournament_support naming.

@nekodex

nekodex approved these changes May 9, 2018

@nekodex nekodex merged commit 16abe2a into ppy:master May 9, 2018

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@nanaya nanaya deleted the nanaya:user_tournament_support branch May 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment