Spaces:
Running
Running
neon_arch
commited on
π feat(UI): add buttons for exporting & importing json preferences file (#427)
Browse files
src/templates/partials/settings_tabs/general.rs
CHANGED
@@ -37,6 +37,21 @@ pub fn general(safe_search_level: u8) -> Markup {
|
|
37 |
option value=(SAFE_SEARCH_LEVELS[2].0){(SAFE_SEARCH_LEVELS[2].1)}
|
38 |
}
|
39 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
)
|
42 |
}
|
|
|
37 |
option value=(SAFE_SEARCH_LEVELS[2].0){(SAFE_SEARCH_LEVELS[2].1)}
|
38 |
}
|
39 |
}
|
40 |
+
h3{"Restore preferences from file"}
|
41 |
+
p class="description"{
|
42 |
+
"Select a json file to restore preferences for the search engine."
|
43 |
+
}
|
44 |
+
form method="post" enctype="multipart/form-data" onsubmit="setTimeout(function () { window.location.reload(); }, 10)" action="/settings" target="_self"{
|
45 |
+
input type="file" name="file" accept="application/json";
|
46 |
+
button type="submit" {"Submit"}
|
47 |
+
}
|
48 |
+
h3{"Export preferences to a file"}
|
49 |
+
p class="description"{
|
50 |
+
"Export all the settings saved as a cookie as a json file."
|
51 |
+
}
|
52 |
+
a class="export_btn" href="./download" download="settings.json" {
|
53 |
+
button type="submit" {"Export"}
|
54 |
+
}
|
55 |
}
|
56 |
)
|
57 |
}
|