From 276420175acb836cb7f14d881cffb64602736099 Mon Sep 17 00:00:00 2001 From: neon_arch Date: Sat, 2 Nov 2024 21:38:53 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20feat(UI):=20add=20buttons=20for?= =?UTF-8?q?=20exporting=20&=20importing=20json=20preferences=20file=20(#42?= =?UTF-8?q?7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/templates/partials/settings_tabs/general.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/templates/partials/settings_tabs/general.rs b/src/templates/partials/settings_tabs/general.rs index 7736667..ff894d6 100644 --- a/src/templates/partials/settings_tabs/general.rs +++ b/src/templates/partials/settings_tabs/general.rs @@ -37,6 +37,21 @@ pub fn general(safe_search_level: u8) -> Markup { option value=(SAFE_SEARCH_LEVELS[2].0){(SAFE_SEARCH_LEVELS[2].1)} } } + h3{"Restore preferences from file"} + p class="description"{ + "Select a json file to restore preferences for the search engine." + } + form method="post" enctype="multipart/form-data" onsubmit="setTimeout(function () { window.location.reload(); }, 10)" action="/settings" target="_self"{ + input type="file" name="file" accept="application/json"; + button type="submit" {"Submit"} + } + h3{"Export preferences to a file"} + p class="description"{ + "Export all the settings saved as a cookie as a json file." + } + a class="export_btn" href="./download" download="settings.json" { + button type="submit" {"Export"} + } } ) }