|  | 
| 5 | 5 | @endsection | 
| 6 | 6 | 
 | 
| 7 | 7 | @section('content') | 
| 8 |  | -<script type="text/javascript" src="{{ asset('/js/tinymce/tinymce.min.js') }}"></script> | 
| 9 |  | -<script type="text/javascript"> | 
| 10 |  | -  tinymce.init({ | 
| 11 |  | -    selector : "#new-post-info", | 
| 12 |  | -  });  | 
| 13 |  | -</script> | 
|  | 8 | +<div style="margin-bottom:20px"> | 
|  | 9 | +    <button onClick="$('#admin_new_post').hide();$('#admin_manage_members').hide();$('#admin_manage_info').slideDown();">Manage Project</button> | 
|  | 10 | +    <button onClick="$('#admin_new_post').hide();$('#admin_manage_info').hide();$('#admin_manage_members').slideDown();">Manage Members</button> | 
|  | 11 | +    <button onClick="$('#admin_manage_info').hide();$('#admin_manage_members').hide();$('#admin_new_post').slideDown();">New News Post</button> | 
|  | 12 | +</div> | 
|  | 13 | +     | 
|  | 14 | +<div id="admin_manage_info" style="display: none;"> | 
|  | 15 | +    <div class="well">More to come!</div> | 
|  | 16 | +</div> | 
| 14 | 17 | 
 | 
| 15 |  | -<form action="/write_post/{{ $project->id }}" method="post"> | 
| 16 |  | -   <div class="form-group"> | 
| 17 |  | -       <textarea class="form-control" name="title" id="new-post" rows="1" placeholder="Your Post's Title"></textarea> | 
| 18 |  | -       <textarea class="form-control" name="summary" id="new-post" rows="2" placeholder="Your Post's Summary or Short Description"></textarea> | 
| 19 |  | -       <textarea name="info" id="new-post-info" rows="20"></textarea> | 
| 20 |  | -   </div> | 
| 21 |  | -   <button type="submit" class="btn btn-primary">Create Post</button> | 
| 22 |  | -   <input type="hidden" value="{{ Session::token() }}" name="_token"> | 
| 23 |  | -   {{ csrf_field() }} | 
| 24 |  | -</form> | 
|  | 18 | + | 
|  | 19 | +<div id="admin_manage_members" style="display: none;"> | 
|  | 20 | +    <div class="panel panel-default" style="padding: 10px; width:350px; height:430px; float:left; margin-right:50px;"> | 
|  | 21 | +        <div class="panel-heading"><h4 class="panel-title">Members List</h4></div> | 
|  | 22 | +        <div style="overflow-y: scroll; width:330px; height:370px"> | 
|  | 23 | +            <table class="table table-hover table-striped"> | 
|  | 24 | +            <?php | 
|  | 25 | +                $users = \DB::select('select * from user_projects where project_id = :id', ['id' => $project->id]); | 
|  | 26 | +            ?> | 
|  | 27 | +            @foreach($users as $user) | 
|  | 28 | +                <tr> | 
|  | 29 | +                    <td style="width:50%">{{$user->user_name}}</td> | 
|  | 30 | +                    <td style="width:25%"> | 
|  | 31 | +                        @if($user->level == 0) | 
|  | 32 | +                            Member | 
|  | 33 | +                        @elseif($user->level == 1) | 
|  | 34 | +                            Admin | 
|  | 35 | +                        @elseif($user->level == 2) | 
|  | 36 | +                            Leader | 
|  | 37 | +                        @elseif($user->level == 3) | 
|  | 38 | +                            Creator | 
|  | 39 | +                        @else | 
|  | 40 | +                            {{$user->level}} | 
|  | 41 | +                        @endif | 
|  | 42 | +                    </td> | 
|  | 43 | +                    <td style="width:25%"> | 
|  | 44 | +                        <button onClick="$('#admin_{{$user->user_id}}_form').attr('action', '/promote'); | 
|  | 45 | +                                         $('#admin_{{$user->user_id}}_form').submit();">P</button> | 
|  | 46 | +                        <button onClick="$('#admin_{{$user->user_id}}_form').attr('action', '/demote'); | 
|  | 47 | +                                         $('#admin_{{$user->user_id}}_form').submit();">D</button> | 
|  | 48 | +                        @if($user->user_id != Auth::user()->id) | 
|  | 49 | +                            <button onClick="$('#admin_{{$user->user_id}}_form').attr('action', '/remove'); | 
|  | 50 | +                                             $('#admin_{{$user->user_id}}_form').submit();">X</button> | 
|  | 51 | +                        @endif | 
|  | 52 | +                        <form id="admin_{{$user->user_id}}_form" style="width:0px; height:0px" action="/promote" method="post"> | 
|  | 53 | +                            <input type="hidden" value="{{ $user->user_id }}" name="user"></input> | 
|  | 54 | +                            <input type="hidden" value="{{ $user->project_id }}" name="project"></input> | 
|  | 55 | +                            <input type="hidden" value="{{ Session::token() }}" name="_token"> | 
|  | 56 | +                            {{ csrf_field() }} | 
|  | 57 | +                        </form> | 
|  | 58 | +                    </td> | 
|  | 59 | +                </tr> | 
|  | 60 | +            @endforeach | 
|  | 61 | +            </table> | 
|  | 62 | +        </div> | 
|  | 63 | +    </div> | 
|  | 64 | +         | 
|  | 65 | +    <div class="panel panel-default" style="padding: 10px; width:350px; height:430px; float:left;"> | 
|  | 66 | +        <div class="panel-heading"><h4 class="panel-title">Request List</h4></div> | 
|  | 67 | +        <div style="overflow-y: scroll; width:330px; height:370px"> | 
|  | 68 | +            <table class="table table-hover table-striped"> | 
|  | 69 | +            <?php | 
|  | 70 | +                $users = \DB::select('select * from user_project_requests where project_id = :id', ['id' => $project->id]); | 
|  | 71 | +            ?> | 
|  | 72 | +            @foreach($users as $user) | 
|  | 73 | +                <tr> | 
|  | 74 | +                    <td style="width:50%">{{$user->user_name}}</td> | 
|  | 75 | +                    <td style="width:40%">{{$user->reason}}</td> | 
|  | 76 | +                    <td style="width:10%"> | 
|  | 77 | +                        <button onClick="$('#admin_{{$user->user_id}}_form').attr('action', '/acceptMember'); | 
|  | 78 | +                                         $('#admin_{{$user->user_id}}_form').submit();">Y</button> | 
|  | 79 | +                        <button onClick="$('#admin_{{$user->user_id}}_form').attr('action', '/declineMember'); | 
|  | 80 | +                                         $('#admin_{{$user->user_id}}_form').submit();">N</button> | 
|  | 81 | +                        <form id="admin_{{$user->user_id}}_form" style="width:0px; height:0px" action="/acceptMember" method="post"> | 
|  | 82 | +                            <input type="hidden" value="{{ $user->user_id }}" name="user"></input> | 
|  | 83 | +                            <input type="hidden" value="{{ $user->project_id }}" name="project"></input> | 
|  | 84 | +                            <input type="hidden" value="{{ Session::token() }}" name="_token"> | 
|  | 85 | +                            {{ csrf_field() }} | 
|  | 86 | +                        </form> | 
|  | 87 | +                    </td> | 
|  | 88 | +                </tr> | 
|  | 89 | +            @endforeach | 
|  | 90 | +            </table> | 
|  | 91 | +        </div> | 
|  | 92 | +    </div> | 
|  | 93 | +</div> | 
|  | 94 | +  | 
|  | 95 | + | 
|  | 96 | +<div id="admin_new_post" style="display: none;"> | 
|  | 97 | +    <script type="text/javascript" src="{{ asset('/js/tinymce/tinymce.min.js') }}"></script> | 
|  | 98 | +    <script type="text/javascript"> | 
|  | 99 | +      tinymce.init({ | 
|  | 100 | +        selector : "#new-post-info", | 
|  | 101 | +        plugins : ["advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste"], | 
|  | 102 | +        toolbar : "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image" | 
|  | 103 | +      });  | 
|  | 104 | +    </script> | 
|  | 105 | +     | 
|  | 106 | +    <form action="/write_post" method="post"> | 
|  | 107 | +       <div class="form-group"> | 
|  | 108 | +           <textarea class="form-control" name="title" id="new-post" rows="1" placeholder="Your Post's Title"></textarea> | 
|  | 109 | +           <textarea class="form-control" name="summary" id="new-post" rows="2" placeholder="Your Post's Summary or Short Description"></textarea> | 
|  | 110 | +           <textarea style="height:450px" name="info" id="new-post-info" rows="20"></textarea> | 
|  | 111 | +       </div> | 
|  | 112 | +       <button type="submit" class="btn btn-primary">Create Post</button> | 
|  | 113 | +       <input type="hidden" value="{{ Session::token() }}" name="_token"> | 
|  | 114 | +       {{ csrf_field() }} | 
|  | 115 | +    </form> | 
|  | 116 | +</div> | 
| 25 | 117 | @endsection | 
0 commit comments