Skip to content

Commit

Permalink
[#] 新增后台搜索开关
Browse files Browse the repository at this point in the history
  • Loading branch information
WangNingkai committed Jan 15, 2021
1 parent a082bac commit 694701e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 19 deletions.
13 changes: 13 additions & 0 deletions resources/views/admin/config.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@
</div>
</div>

<div class="form-group mb-3 ">
<label class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="open_search"
@if( setting('open_search',0)) checked
@endif onchange="$('input[name=\'open_search\']').val(Number(this.checked))">
<span class="form-check-label">开启目录搜索</span>
<input type="hidden" name="open_search"
value="{{ setting('open_search', 0) }}">
</label>
<span class="form-hint text-danger">目录搜索仅为当前目录资源搜索,不适用全局搜索</span>
</div>


<div class="form-group mb-3 ">
<label class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="open_short_url"
Expand Down
16 changes: 9 additions & 7 deletions resources/views/default/one.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
</div>
</div>
@endif
<form class="form-inline mb-0 mr-2 my-1">
<label class="mb-0 mr-2 my-1">
<input class="form-control form-control-sm" type="text" name="keywords"
placeholder="搜索" value="{{ $keywords }}">
</label>
<button class="btn btn-primary btn-sm mr-2 my-1" type="submit">搜索</button>
</form>
@if(setting('open_search', 0))
<form class="form-inline mb-0 mr-2 my-1">
<label class="mb-0 mr-2 my-1">
<input class="form-control form-control-sm" type="text" name="keywords"
placeholder="搜索" value="{{ $keywords }}">
</label>
<button class="btn btn-primary btn-sm mr-2 my-1" type="submit">搜索</button>
</form>
@endif
</div>
<div class="card-body table-responsive">
<table class="table table-sm table-hover table-borderless">
Expand Down
25 changes: 13 additions & 12 deletions resources/views/mdui/one.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,20 @@
</div>
</div>
</li>
@if(setting('open_search', 0))
<li class="mdui-list-item mdui-ripple">
<div class="mdui-col-sm-12">
<form action="" method="get">
<div class="mdui-textfield">
<i class="mdui-icon material-icons">search</i>

<li class="mdui-list-item mdui-ripple">
<div class="mdui-col-sm-12">
<form action="" method="get">
<div class="mdui-textfield">
<i class="mdui-icon material-icons">search</i>

<input class="mdui-textfield-input" type="text" id="keywords"
name="keywords" placeholder="搜索目录资源"/>
</div>
</form>
</div>
</li>
<input class="mdui-textfield-input" type="text" id="keywords"
name="keywords" placeholder="搜索目录资源"/>
</div>
</form>
</div>
</li>
@endif
@if(!blank($path))
<li class="mdui-list-item mdui-ripple"
data-route="{{ route('drive.query', ['hash' => $hash, 'query' => url_encode(\App\Helpers\Tool::fetchGoBack($path))]) }}">
Expand Down

0 comments on commit 694701e

Please sign in to comment.