1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 01:05:36 +00:00

Follow/Unfollow button in followers/ing lists

Signed-off-by: Marcin Mikołajczak <me@m4sk.in>
This commit is contained in:
Marcin Mikołajczak 2018-06-01 17:59:53 +02:00
parent 9511988ddd
commit 8107f64eec
2 changed files with 8 additions and 8 deletions

View file

@ -57,12 +57,12 @@
{{$user->name}} {{$user->name}}
</span> </span>
@if(Auth::check() && Auth::id() != $user->user_id) @if(Auth::check() && Auth::id() != $user->user_id)
@if($user->followedBy(Auth::user()->profile) == false) @if ($user->followedBy(Auth::user()->profile) == true)
<span class="float-right notification-action"> <span class="float-right notification-action">
<form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="follow"> <form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="unfollow">
@csrf @csrf
<input type="hidden" name="item" value="{{$user->id}}"> <input type="hidden" name="item" value="{{$user->id}}">
<button class="btn btn-primary font-weight-bold px-4 py-0" type="submit">Follow</button> <button class="btn btn-outline-secondary font-weight-bold px-4 py-0" type="submit">Unfollow</button>
</form> </form>
</span> </span>
@else @else
@ -70,7 +70,7 @@
<form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="follow"> <form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="follow">
@csrf @csrf
<input type="hidden" name="item" value="{{$user->id}}"> <input type="hidden" name="item" value="{{$user->id}}">
<button class="btn btn-outline-secondary font-weight-bold px-4 py-0" type="submit">Unfollow</button> <button class="btn btn-primary font-weight-bold px-4 py-0" type="submit">Follow</button>
</form> </form>
</span> </span>
@endif @endif

View file

@ -57,12 +57,12 @@
{{$user->name}} {{$user->name}}
</span> </span>
@if(Auth::check() && Auth::id() != $user->user_id) @if(Auth::check() && Auth::id() != $user->user_id)
@if($user->followedBy(Auth::user()->profile) == false) @if ($user->followedBy(Auth::user()->profile) == true)
<span class="float-right notification-action"> <span class="float-right notification-action">
<form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="follow"> <form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="unfollow">
@csrf @csrf
<input type="hidden" name="item" value="{{$user->id}}"> <input type="hidden" name="item" value="{{$user->id}}">
<button class="btn btn-primary font-weight-bold px-4 py-0" type="submit">Follow</button> <button class="btn btn-outline-secondary font-weight-bold px-4 py-0" type="submit">Unfollow</button>
</form> </form>
</span> </span>
@else @else
@ -70,7 +70,7 @@
<form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="follow"> <form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="follow">
@csrf @csrf
<input type="hidden" name="item" value="{{$user->id}}"> <input type="hidden" name="item" value="{{$user->id}}">
<button class="btn btn-outline-secondary font-weight-bold px-4 py-0" type="submit">Unfollow</button> <button class="btn btn-primary font-weight-bold px-4 py-0" type="submit">Follow</button>
</form> </form>
</span> </span>
@endif @endif