mirror of https://github.com/pixelfed/pixelfed.git
Follow/Unfollow button in followers/ing lists
Signed-off-by: Marcin Mikołajczak <me@m4sk.in>
This commit is contained in:
parent
9fbc5d0902
commit
9511988ddd
|
@ -56,6 +56,25 @@
|
||||||
<span class="following-name text-muted">
|
<span class="following-name text-muted">
|
||||||
{{$user->name}}
|
{{$user->name}}
|
||||||
</span>
|
</span>
|
||||||
|
@if(Auth::check() && Auth::id() != $user->user_id)
|
||||||
|
@if($user->followedBy(Auth::user()->profile) == false)
|
||||||
|
<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">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" name="item" value="{{$user->id}}">
|
||||||
|
<button class="btn btn-primary font-weight-bold px-4 py-0" type="submit">Follow</button>
|
||||||
|
</form>
|
||||||
|
</span>
|
||||||
|
@else
|
||||||
|
<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">
|
||||||
|
@csrf
|
||||||
|
<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>
|
||||||
|
</form>
|
||||||
|
</span>
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -56,6 +56,25 @@
|
||||||
<span class="following-name text-muted">
|
<span class="following-name text-muted">
|
||||||
{{$user->name}}
|
{{$user->name}}
|
||||||
</span>
|
</span>
|
||||||
|
@if(Auth::check() && Auth::id() != $user->user_id)
|
||||||
|
@if($user->followedBy(Auth::user()->profile) == false)
|
||||||
|
<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">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" name="item" value="{{$user->id}}">
|
||||||
|
<button class="btn btn-primary font-weight-bold px-4 py-0" type="submit">Follow</button>
|
||||||
|
</form>
|
||||||
|
</span>
|
||||||
|
@else
|
||||||
|
<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">
|
||||||
|
@csrf
|
||||||
|
<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>
|
||||||
|
</form>
|
||||||
|
</span>
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue