Merged the search box to the action button group in the base account list and account list.

This commit is contained in:
依瑪貓 2023-02-01 19:43:47 +08:00
parent 9b22331a5a
commit 9f63db174c
3 changed files with 36 additions and 35 deletions

View File

@ -24,6 +24,16 @@
.clickable { .clickable {
cursor: pointer; cursor: pointer;
} }
.btn-group .btn .search-input {
min-height: calc(1em + .5rem + 2px);
padding: 0 0.5rem;
}
.btn-group .btn .search-label button {
border: none;
background-color: transparent;
color: inherit;
padding-right: 0;
}
/** The account management */ /** The account management */
.account { .account {

View File

@ -25,14 +25,25 @@ First written: 2023/1/30
{% block content %} {% block content %}
<div class="btn-group mb-2">
{% if can_edit_accounting() %} {% if can_edit_accounting() %}
<div class="btn-group mb-3 d-none d-md-block"> <a class="btn btn-primary text-nowrap d-none d-md-block" href="{{ url_for("accounting.account.create")|append_next }}">
<a class="btn btn-primary" href="{{ url_for("accounting.account.create")|append_next }}">
<i class="fa-solid fa-user-plus"></i> <i class="fa-solid fa-user-plus"></i>
{{ A_("New") }} {{ A_("New") }}
</a> </a>
{% endif %}
<form class="btn btn-primary d-flex input-group" action="{{ url_for("accounting.account.list") }}" method="get" role="search">
<input id="search-input" class="form-control form-control-sm search-input" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search">
<label for="search-input" class="search-label">
<button type="submit">
<i class="fa-solid fa-magnifying-glass"></i>
{{ A_("Search") }}
</button>
</label>
</form>
</div> </div>
{% if can_edit_accounting() %}
<div class="d-md-none material-fab"> <div class="d-md-none material-fab">
<a class="btn btn-primary" href="{{ url_for("accounting.account.create")|append_next }}"> <a class="btn btn-primary" href="{{ url_for("accounting.account.create")|append_next }}">
<i class="fa-solid fa-plus"></i> <i class="fa-solid fa-plus"></i>
@ -40,22 +51,6 @@ First written: 2023/1/30
</div> </div>
{% endif %} {% endif %}
<form action="{{ url_for("accounting.account.list") }}" method="get" role="search">
<div class="row">
<div class="col-sm-3">
<div class="input-group mb-2">
<input id="query" class="form-control form-control-sm" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search">
<button class="input-group-text" type="submit">
<label for="query">
<i class="fa-solid fa-magnifying-glass"></i>
{{ A_("Search") }}
</label>
</button>
</div>
</div>
</div>
</form>
{% if list %} {% if list %}
{% include "accounting/include/pagination.html" %} {% include "accounting/include/pagination.html" %}

View File

@ -25,21 +25,17 @@ First written: 2023/1/26
{% block content %} {% block content %}
<form action="{{ url_for("accounting.base-account.list") }}" method="get" role="search"> <div class="btn-group mb-2">
<div class="row"> <form class="btn btn-primary d-flex input-group" action="{{ url_for("accounting.base-account.list") }}" method="get" role="search">
<div class="col-sm-3"> <input id="search-input" class="form-control form-control-sm search-input" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search">
<div class="input-group mb-2"> <label for="search-input" class="search-label">
<input id="query" class="form-control form-control-sm" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search"> <button type="submit">
<button class="input-group-text" type="submit">
<label for="query">
<i class="fa-solid fa-magnifying-glass"></i> <i class="fa-solid fa-magnifying-glass"></i>
{{ A_("Search") }} {{ A_("Search") }}
</label>
</button> </button>
</div> </label>
</div>
</div>
</form> </form>
</div>
{% if list %} {% if list %}
{% include "accounting/include/pagination.html" %} {% include "accounting/include/pagination.html" %}