mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Merge pull request #105 from m4sk1n/follow-in-lists
Follow/Unfollow button in followers/ing lists
This commit is contained in:
commit
136d39e32e
2 changed files with 40 additions and 2 deletions
|
@ -56,6 +56,25 @@
|
|||
<span class="following-name text-muted">
|
||||
{{$user->name}}
|
||||
</span>
|
||||
@if(Auth::check() && Auth::id() != $user->user_id)
|
||||
@if ($user->followedBy(Auth::user()->profile) == true)
|
||||
<span class="float-right notification-action">
|
||||
<form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="unfollow">
|
||||
@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>
|
||||
@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-primary font-weight-bold px-4 py-0" type="submit">Follow</button>
|
||||
</form>
|
||||
</span>
|
||||
@endif
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
@ -75,4 +94,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
|
|
@ -56,6 +56,25 @@
|
|||
<span class="following-name text-muted">
|
||||
{{$user->name}}
|
||||
</span>
|
||||
@if(Auth::check() && Auth::id() != $user->user_id)
|
||||
@if ($user->followedBy(Auth::user()->profile) == true)
|
||||
<span class="float-right notification-action">
|
||||
<form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="unfollow">
|
||||
@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>
|
||||
@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-primary font-weight-bold px-4 py-0" type="submit">Follow</button>
|
||||
</form>
|
||||
</span>
|
||||
@endif
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
@ -75,4 +94,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
|
Loading…
Reference in a new issue