-
Notifications
You must be signed in to change notification settings - Fork 386
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 leave team button #11757
Merged
Merged
Add leave team button #11757
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
27717a1
Add leave team button
nanaya c19fadc
Remove impossible case
nanaya bb8c420
Unused message
nanaya 70ff502
Actually prevent leader from leaving team
nanaya 6f6e6a8
Fix indentation
nanaya a4d8a2a
Use OsuAuthorize for leaving team check
nanaya 8ba9d57
Unused key
nanaya 0b720a1
Lint fix
nanaya d63acb9
Merge branch 'master' into team-leave
notbakaneko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
.team-action-button { | ||
.reset-input(); | ||
.link-plain(); | ||
.link-white(); | ||
.center-content(); | ||
.default-text-shadow(); | ||
display: flex; | ||
width: auto; | ||
height: 100%; | ||
padding: 10px 30px; | ||
border-radius: 10000px; | ||
text-align: center; | ||
font-weight: bold; | ||
font-size: @font-size--title-small; | ||
background: var(--bg); | ||
|
||
--bg: hsl(var(--hsl-b5)); | ||
--bg-hover: hsl(var(--hsl-b6)); | ||
|
||
&:hover { | ||
background: var(--bg-hover); | ||
} | ||
|
||
&--part { | ||
--bg: hsl(var(--hsl-red-3)); | ||
--bg-hover: hsl(var(--hsl-red-2)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,12 @@ | |
$teamMembers['member'] ??= []; | ||
$teamMembers['leader'] ??= $toJson([$team->members()->make(['user_id' => $team->leader_id])->userOrDeleted()]); | ||
$headerUrl = $team->header()->url(); | ||
|
||
$currentUser = Auth::user(); | ||
$buttons = new Ds\Set(); | ||
if ($currentUser !== null && $currentUser->team?->getKey() === $team->getKey() && $currentUser->getKey() !== $team->leader_id) { | ||
$buttons->add('part'); | ||
} | ||
@endphp | ||
|
||
@extends('master', [ | ||
|
@@ -69,6 +75,21 @@ class="btn-circle btn-circle--page-toggle" | |
</div> | ||
</div> | ||
</div> | ||
@if (!$buttons->isEmpty()) | ||
<div class="profile-detail-bar profile-detail-bar--team"> | ||
@if ($buttons->contains('part')) | ||
<form | ||
action="{{ route('teams.part') }}" | ||
data-turbo-confirm="{{ osu_trans('common.confirmation') }}" | ||
method="POST" | ||
> | ||
<button class="team-action-button team-action-button--part"> | ||
{{ osu_trans('teams.show.bar.part') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. too many idents btw |
||
</button> | ||
</form> | ||
@endif | ||
</div> | ||
@endif | ||
<div class="user-profile-pages user-profile-pages--no-tabs"> | ||
<div class="page-extra u-fancy-scrollbar"> | ||
<div class="team-summary"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there more buttons coming 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why yes 👀