Skip to content

Commit

Permalink
Merge pull request #1995 from nekodex/legacy-modding-links
Browse files Browse the repository at this point in the history
Add links to legacy forum threads on beatmapset pages that don't use moddingv2
  • Loading branch information
nanaya committed Dec 15, 2017
2 parents 406b04b + 448f31b commit 7d9d026
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/Transformers/BeatmapsetTransformer.php
Expand Up @@ -71,6 +71,7 @@ public function transform(Beatmapset $beatmapset = null)
'has_scores' => $beatmapset->hasScores(),
'discussion_enabled' => $beatmapset->discussion_enabled,
'is_watched' => BeatmapsetWatch::check($beatmapset, Auth::user()),
'legacy_thread_url' => $beatmapset->thread_id !== 0 ? osu_url('legacy-forum-thread-prefix').$beatmapset->thread_id : null,
];
}

Expand Down
1 change: 1 addition & 0 deletions config/osu.php
Expand Up @@ -81,6 +81,7 @@
'base' => 'https://osu.ppy.sh',
'dev' => 'https://discord.gg/ppy',
'installer' => 'https://m1.ppy.sh/r/osu!install.exe',
'legacy-forum-thread-prefix' => '/forum/t/',
'smilies' => '/forum/images/smilies',
'support-the-game' => '/p/support#transactionarea',

Expand Down
8 changes: 8 additions & 0 deletions resources/assets/coffee/react/beatmapset-page/header.coffee
Expand Up @@ -195,6 +195,14 @@ class BeatmapsetPage.Header extends React.Component
icon: 'comments-o'
props:
href: laroute.route 'beatmapsets.discussion', beatmapset: @props.beatmapset.id
else if @props.beatmapset.legacy_thread_url
el BigButton,
modifiers: ['beatmapset-header']
text:
top: osu.trans 'beatmapsets.show.discussion'
icon: 'comments-o'
props:
href: @props.beatmapset.legacy_thread_url

div className: 'beatmapset-header__box beatmapset-header__box--stats',
el BeatmapsetPage.Stats,
Expand Down

0 comments on commit 7d9d026

Please sign in to comment.