Changeset e6c1f87 for resources


Ignore:
Timestamp:
10/18/21 19:54:18 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
develop, master
Children:
b9c4a92
Parents:
bd9e8e3
Message:

added pagination, is_important

Location:
resources
Files:
2 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • resources/assets/js/custom.js

    rbd9e8e3 re6c1f87  
    99    $(".edit_document_deparment").change(function() {
    1010        var archId = $("input[name='arch_id']");
    11         var currentArchId = archId.val();
    12         var currentText = currentArchId.split("/")[1];
    13         var selectedId = $(this).find('option:selected').val();
    14 
    15         if(currentText.length) {
     11        var currentText = archId.val().split("/")[1];
     12        var selectedId = $(this).find('option:selected').data('dept-code');
     13        if(currentText)
    1614            archId.val(selectedId + "/" + currentText);
    17         } else {
     15        else
    1816            archId.val(selectedId + "/");
    19         }
    2017    });
    2118
  • resources/views/dashboard/departments/index.blade.php

    rbd9e8e3 re6c1f87  
    6767                                    @endif
    6868                                    <!-- Trigger -->
    69                                     <td id="copy_{{ $department->id }}" value="{{$department->location}}">{{$department->location}}
     69                                    <td>{!! Str::substr($department->location , strlen(Storage::disk('local')->path(''))) !!}
    7070                                            <button class="btn btn-sm btn-primary text-white" data-clipboard-target="#copy_{{ $department->id }}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16">
    7171                                                    <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/>
    7272                                                    <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"/>
    7373                                                </svg></button>
     74                                        <span type="hidden" id="copy_{{$department->id}}"></span>
    7475                                    </td>
    7576                                    <td>
  • resources/views/dashboard/documents/create.blade.php

    rbd9e8e3 re6c1f87  
    3535                                                <label for="exampleFormControlSelect1">Department</label>
    3636                                                @if($departments->count())
    37                                                 <select class="form-control" name="department" required>
    38                                                     <option></option>
     37                                                <select class="form-control edit_document_deparment" name="department" required>
    3938                                                    @foreach ($departments as $department)
    40                                                         <option value="{{ $department->id }}" {{ (old("department") == $department->id ? "selected" : "") }}>{{ $department->name }}</option>
     39                                                        <option value="{{ $department->id }}" data-dept-code="{{ $department->code }}" {{ (old("department") == $department->id ? "selected" : "") }}>{{ $department->name }}</option>
    4140                                                    @endforeach
    4241                                                        @else
     
    4948                                                <div class="form-group">
    5049                                                    <label>Archive ID</label>
    51                                                     <input type="text" name="arch_id" value="{{ old('arch_id') }}" class="form-control" placeholder="Archive ID" required>
     50                                                    <input type="text" name="arch_id" value="{{ old("arch_id") }}" class="form-control" placeholder="Archive ID" required>
    5251                                                </div>
    5352                                            </div>
  • resources/views/dashboard/documents/edit.blade.php

    rbd9e8e3 re6c1f87  
    3737                                                        <select class="form-control edit_document_deparment" name="department" required>
    3838                                                            @foreach ($departments as $department)
    39                                                                 <option value="{{ $department->id }}" {{ old("department", $document->department->id) == $department->id ? "selected" : "" }}>{{ $department->name }}</option>
     39                                                                <option value="{{ $department->id }}" data-dept-code="{{ $department->code }}" {{ old("department", $document->department->id) == $department->id ? "selected" : "" }}>{{ $department->name }}</option>
    4040                                                            @endforeach
    4141                                                        </select>
  • resources/views/dashboard/documents/index.blade.php

    rbd9e8e3 re6c1f87  
    3232                            </a>
    3333                        @endforeach
    34                         <a href="" class="list-group-item">
     34                        <a href="{{ URL::current()."?sort=recent" }}" class="list-group-item">
    3535                            <i data-feather="upload-cloud" class="width-15 height-15 mr-2"></i>
    3636                            Recents
    3737                        </a>
    38                         <a href="" class="list-group-item d-flex align-items-center">
     38                        <a href="{{ URL::current()."?sort=important" }}" class="list-group-item d-flex align-items-center">
    3939                            <i data-feather="star" class="width-15 height-15 mr-2"></i>
    4040                            Important
    41                             <span class="small ml-auto">10</span>
    42                         </a>
    43                         <a href="" class="list-group-item">
    44                             <i data-feather="trash" class="width-15 height-15 mr-2"></i>
    45                             Deleted Files
     41                            <span class="small ml-auto">{{ $countImportant }}</span>
    4642                        </a>
    4743                    </div>
     
    5551                                <div class="progress" style="height: 10px">
    5652                                    <div class="progress-bar progress-bar-striped" role="progressbar"
    57                                          style="width: 40%" aria-valuenow="10" aria-valuemin="0"
     53                                         style="width: {{$diskUse}}" aria-valuenow="10" aria-valuemin="0"
    5854                                         aria-valuemax="100"></div>
    59                                 </div>
    60                                 <div class="line-height-12 small text-muted mt-2">19.5GB used of 25GB</div>
     55                                        <span class="sr-only">{{$diskUse}}</span>
     56                                </div>
     57                                <div class="line-height-12 small text-muted mt-2">{{round($diskUsedSize,2)}} GB /
     58                                    {{round($diskTotalSize,2)}} GB ({{$diskUse}})</div>
    6159                            </div>
    6260                        </div>
     
    9896                            </a>
    9997                            <div class="dropdown-menu">
    100                                 <a class="dropdown-item" href="#">Date</a>
    101                                 <a class="dropdown-item" href="#">Name</a>
    102                                 <a class="dropdown-item" href="#">Size</a>
     98                                @if(Request::get('id'))
     99                                    <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=newest" }}">Date</a>
     100                                    <a class="dropdown-item" href="{{ URL::current()."?id=".Request::get('id')."&sort=name" }}">Name</a>
     101                                    <a class="dropdown-item" href="#">Size</a>
     102                                @else
     103                                    <a class="dropdown-item" href="{{ URL::current()."?sort=newest" }}">Date</a>
     104                                    <a class="dropdown-item" href="{{ URL::current()."?sort=name" }}">Name</a>
     105                                    <a class="dropdown-item" href="#">Size - not done</a>
     106                                @endif
    103107                            </div>
    104108                        </li>
     
    106110                </div>
    107111                <div class="action-right">
    108                     <form class="d-flex mr-3">
    109                         <a href="#" class="app-sidebar-menu-button btn btn-outline-light">
    110                             <i data-feather="menu"></i>
    111                         </a>
     112                    <form action="{{ route("dashboard.documents.index") }}" method="get" class="d-flex mr-3">
    112113                        <div class="input-group">
    113                             <input type="text" class="form-control" placeholder="Search file"
    114                                    aria-describedby="button-addon1">
     114                            <input type="text" name="search" class="form-control" placeholder="Search file"
     115                                   aria-describedby="button-addon1" required>
    115116                            <div class="input-group-append">
    116                                 <button class="btn btn-outline-light" type="button" id="button-addon1">
     117                                <button class="btn btn-outline-light searchSubmitBtn" type="submit" value="Search">
    117118                                    <i data-feather="search"></i>
    118119                                </button>
     
    122123                </div>
    123124            </div>
    124 
    125 
    126125            <p>Documents</p>
    127126            <div class="row">
     
    139138                                        <a href="#" class="dropdown-item">Share</a>
    140139                                        <a href="#" class="dropdown-item">Download</a>
    141                                         <a href="#" class="dropdown-item">Move to</a>
    142                                         <a href="#" class="dropdown-item">Delete</a>
     140                                        <button class="dropdown-item action-dropdown-item"
     141                                           href="javascript:void(0)" onclick="toggleImportant({{$document->id}})">
     142                                            @if($document->is_important)
     143                                                Mark as not important
     144                                            @else
     145                                                Mark as important
     146                                            @endif
     147                                        </button>
     148                                        <a href="javascript:void(0)" class="dropdown-item" data-toggle="modal" data-target="#deleteModal_{{$document->id}}">Delete</a>
    143149                                    </div>
    144150                                </div>
    145151                            </div>
    146152                            <div class="p-2 small">
    147                                 <div>{{$document->name}} - {{$document->arch_id}}</div>
     153                                @if($document->is_important)
     154                                    <div>{{$document->name}} - {{$document->arch_id}} <i class="fa fa-star" style="color:orange"></i></div>
     155                                @else
     156                                    <div>{{$document->name}} - {{$document->arch_id}} </div>
     157                                @endif
     158                                <div>{{$document->created_at}}</div>
    148159                                <div class="text-muted">{{$document->description}}</div>
    149160                                <div class="text-muted">1.2MB</div>
     
    151162                        </div>
    152163                    </div>
     164                    <form id="toggleImportant_{{ $document->id }}"
     165                          action="{{ route("dashboard.documents.toggleImportant", ["id" => $document->id]) }}"
     166                          method="post">
     167                        @csrf
     168                        @method("patch")
     169                    </form>
     170                    <div class="modal fade" id="deleteModal_{{$document->id}}" tabindex="-1" role="dialog" aria-hidden="true">
     171                        <div class="modal-dialog modal-dialog-centered" role="document">
     172                            <div class="modal-content">
     173                                <div class="modal-header">
     174                                    <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
     175                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
     176                                        <i class="ti-close"></i>
     177                                    </button>
     178                                </div>
     179                                <div class="modal-body">
     180                                    <form action="{{ route("dashboard.documents.destroy", $document->id) }}" method="POST">
     181                                        @csrf
     182                                        @method('DELETE')
     183                                        <p>Are you sure you want to delete document {{$document->name}} with Archive ID: {{ $document->arch_id }}?</p>
     184                                        <div class="modal-footer">
     185                                            <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
     186                                            </button>
     187                                            <button type="submit" class="btn btn-primary">Save changes</button>
     188                                        </div>
     189                                    </form>
     190                                </div>
     191
     192                            </div>
     193                        </div>
     194                    </div>
    153195                @empty
    154                     <div>No items found</div>
     196                    <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12">No items found</div>
    155197                @endforelse
    156198
    157199            </div>
     200             @if(!Request::query('search'))
     201             {{$documents->appends($_GET)->links('layouts.pagination') }}
     202                 @endif
    158203    </div>
    159204
     
    162207@section('script')
    163208
    164 
     209<script>
     210    function toggleImportant(id) {
     211        document.getElementById('toggleImportant_' + id).submit();
     212    }
     213</script>
    165214
    166215@endsection
  • resources/views/dashboard/settings/index.blade.php

    rbd9e8e3 re6c1f87  
    2323            <div class="row">
    2424                <div class="col-lg-3 col-md-12 mb-3">
    25                     <div class="nav flex-lg-column flex-sm-row nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
    26                         <a class="nav-link {{ $active_tab == 'account' ? 'active' : '' }}" id="account-tab" data-toggle="pill" href="#account" role="tab" aria-controls="account" aria-selected="true">Account</a>
    27                         <a class="nav-link {{ $active_tab == 'security' ? 'active' : '' }}" id="security-tab" data-toggle="pill" href="#security" role="tab" aria-controls="security" aria-selected="false">Security</a>
    28                         <a class="nav-link " id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Social</a>
     25                    <div class="nav flex-lg-column flex-sm-row nav-pills" id="#tabMenu" role="tablist" aria-orientation="vertical">
     26                        <a class="nav-link {{$active_tab == 'account' ? 'active' : ""}}" id="account-tab" data-toggle="pill" href="#account" role="tab" aria-controls="account" aria-selected="true">Account</a>
     27                        <a class="nav-link {{$active_tab == 'security' ? 'active' : ""}}" id="security-tab" data-toggle="pill" href="#security" role="tab" aria-controls="security" aria-selected="false">Security</a>
     28                        <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Social</a>
    2929                    </div>
    3030                </div>
    3131                <div class="col-lg-9 col-md-12">
    3232                    <div class="tab-content" id="v-pills-tabContent">
    33                         <div class="tab-pane fade show {{ $active_tab == 'account' ? 'active' : '' }}" id="account" role="tabpanel" aria-labelledby="account-tab">
     33                        <div class="tab-pane {{$active_tab == 'account' ? 'active' : ""}}" id="account" role="tabpanel" aria-labelledby="account-tab">
    3434                            <div class="card">
    3535                                <div class="card-body">
     
    8080                            </div>
    8181                        </div>
    82                         <div class="tab-pane {{ $active_tab == 'security' ? 'active' : '' }}" id="security" role="tabpanel" aria-labelledby="security-tab">
     82                        <div class="tab-pane {{$active_tab == 'security' ? 'active' : ""}}" id="security" role="tabpanel" aria-labelledby="security-tab">
    8383                            <div class="card">
    8484                                <div class="card-body">
     
    239239
    240240@endsection
     241
     242@section('script')
     243    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
     244    <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js" integrity="sha512-uto9mlQzrs59VwILcLiRYeLKPPbS/bT71da/OEBYEwcdNUk8jYIy+D176RYoop1Da+f9mvkYrmj5MCLZWEtQuA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
     245    <script>
     246        //redirect to specific tab
     247        $(document).ready(function () {
     248            $('#tabMenu a[href="#{{ old('tab') }}"]').tabs('show')
     249        });
     250    </script>
     251@endsection
Note: See TracChangeset for help on using the changeset viewer.