소스 검색

Follow/Unfollow button in followers/ing lists

Signed-off-by: Marcin Mikołajczak <me@m4sk.in>
Marcin Mikołajczak 7 년 전
부모
커밋
8107f64eec
2개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. 4 4
      resources/views/profile/followers.blade.php
  2. 4 4
      resources/views/profile/following.blade.php

+ 4 - 4
resources/views/profile/followers.blade.php

@@ -57,12 +57,12 @@
             {{$user->name}}
           </span>
           @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">
-              <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
                 <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>
             </span>
             @else
@@ -70,7 +70,7 @@
               <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>
+                <button class="btn btn-primary font-weight-bold px-4 py-0" type="submit">Follow</button>
               </form>
             </span>
             @endif

+ 4 - 4
resources/views/profile/following.blade.php

@@ -57,12 +57,12 @@
             {{$user->name}}
           </span>
           @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">
-              <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
                 <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>
             </span>
             @else
@@ -70,7 +70,7 @@
               <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>
+                <button class="btn btn-primary font-weight-bold px-4 py-0" type="submit">Follow</button>
               </form>
             </span>
             @endif