diff --git a/bukuserver/README.md b/bukuserver/README.md index b3b8f849..c8dc92e5 100644 --- a/bukuserver/README.md +++ b/bukuserver/README.md @@ -118,7 +118,7 @@ The following are os env config variables available for bukuserver. | DISABLE_FAVICON | disable bookmark [favicons](https://wikipedia.org/wiki/Favicon) | boolean [default: `true`] ([here's why](#why-favicons-are-disabled-by-default))| | OPEN_IN_NEW_TAB | url link open in new tab | boolean [default: `false`] | | REVERSE_PROXY_PATH | reverse proxy path | string | -| THEME | [GUI theme](https://bootswatch.com/3) | string [default: `default`] (`slate` is a good pick for dark mode) | +| THEME | [GUI theme](https://bootswatch.com/4) | string [default: `default`] (`slate` is a good pick for dark mode) | | LOCALE | GUI language (partial support) | string [default: `en`] | Note: `BUKUSERVER_` is the common prefix (_every variable starts with it_). diff --git a/bukuserver/server.py b/bukuserver/server.py index 205c3273..cbbb62fa 100644 --- a/bukuserver/server.py +++ b/bukuserver/server.py @@ -120,7 +120,7 @@ def shell_context(): app.jinja_env.filters['netloc'] = lambda x: urlparse(x).netloc # pylint: disable=no-member admin = Admin( - app, name='buku server', template_mode='bootstrap3', + app, name='buku server', template_mode='bootstrap4', index_view=views.CustomAdminIndexView( template='bukuserver/home.html', url='/' ) diff --git a/bukuserver/static/bukuserver/css/list.css b/bukuserver/static/bukuserver/css/list.css new file mode 100644 index 00000000..96ff9cb2 --- /dev/null +++ b/bukuserver/static/bukuserver/css/list.css @@ -0,0 +1,4 @@ +/* overriding icon-button text color with theme color */ +form.icon button { + color: inherit; +} diff --git a/bukuserver/static/bukuserver/css/modal.css b/bukuserver/static/bukuserver/css/modal.css index 20de439b..764e50d9 100644 --- a/bukuserver/static/bukuserver/css/modal.css +++ b/bukuserver/static/bukuserver/css/modal.css @@ -5,7 +5,7 @@ body.modal-open { /* limit dialog height with a scrollbox */ .modal-content { - max-height: calc(100vh - 60px); + max-height: calc(100vh - 3.5rem); display: flex; flex-direction: column; } diff --git a/bukuserver/static/bukuserver/js/page_size.js b/bukuserver/static/bukuserver/js/page_size.js index 23612d36..98ae3d81 100644 --- a/bukuserver/static/bukuserver/js/page_size.js +++ b/bukuserver/static/bukuserver/js/page_size.js @@ -1,20 +1,18 @@ $(document).ready(function() { const SIZES = [20, 50, 100]; // hardcoded list; see page_size_form in admin/model/layout.html let pageSize = url => new URL(url || location.host).searchParams.get('page_size'); - $(`.actions-nav .dropdown-menu`).each(function () { - let _sizes = $(`li a`, this).map(function () {return pageSize(this.href)}).get(); + $(`.nav.nav-tabs .dropdown-menu`).each(function () { + let _sizes = $(`a.dropdown-item`, this).map(function () {return pageSize(this.href)}).get(); if (SIZES.every((x, i) => x == _sizes[i])) - $(`li`, this).last().clone().each(function () { - $('a', this).text("custom").attr('href', `#`).on('click', () => { - let page = prompt(`Set custom page size (empty for default)`, pageSize(location) || ''); - if (Number(page) || (page == "")) { - let search = new URL(location).searchParams; - (page ? search.set('page_size', page) : search.delete('page_size')); - location.search = search; - } else if (page != null) - alert(`Invalid page size: "${page}"`); - return false; - }); + $('a', this).last().clone().text("custom").attr('href', `#`).on('click', () => { + let page = prompt(`Set custom page size (empty for default)`, pageSize(location) || ''); + if (Number(page) || (page == "")) { + let search = new URL(location).searchParams; + (page ? search.set('page_size', page) : search.delete('page_size')); + location.search = search; + } else if (page != null) + alert(`Invalid page size: "${page}"`); + return false; }).appendTo(this); }) }); diff --git a/bukuserver/templates/bukuserver/bookmark_create.html b/bukuserver/templates/bukuserver/bookmark_create.html index 974da099..8906a686 100644 --- a/bukuserver/templates/bukuserver/bookmark_create.html +++ b/bukuserver/templates/bukuserver/bookmark_create.html @@ -6,6 +6,7 @@ {{ buku.limit_navigation_if_popup() }} {{ buku.script('bookmark.js') }} {{ buku.fetch_checkbox() }} + {{ buku.horizontal_form(excluding_popups=True) }} {{ buku.focus() }} {{ buku.link_saved() }} {% endblock %} diff --git a/bukuserver/templates/bukuserver/bookmark_create_modal.html b/bukuserver/templates/bukuserver/bookmark_create_modal.html index 30c6e45f..645c3680 100644 --- a/bukuserver/templates/bukuserver/bookmark_create_modal.html +++ b/bukuserver/templates/bukuserver/bookmark_create_modal.html @@ -10,6 +10,7 @@ {% block tail %} {{ super() }} {{ buku.script('bookmark.js') }} - {{ buku.fetch_checkbox() }} + {{ buku.fetch_checkbox(modal=True) }} + {{ buku.horizontal_form() }} {{ buku.focus('.modal-body') }} {% endblock %} diff --git a/bukuserver/templates/bukuserver/bookmark_edit.html b/bukuserver/templates/bukuserver/bookmark_edit.html index 82d5ff89..f8824f9e 100644 --- a/bukuserver/templates/bukuserver/bookmark_edit.html +++ b/bukuserver/templates/bukuserver/bookmark_edit.html @@ -7,7 +7,7 @@ {% block edit_form %} {{ super() }} -