allow date_format customization on the user level

This commit is contained in:
sadnub
2022-04-02 12:12:14 -04:00
parent 5a1c1964fd
commit bea8d48b68
2 changed files with 12 additions and 1 deletions

View File

@@ -88,6 +88,11 @@
class="col-8"
/>
</q-card-section>
<q-card-section class="row">
<div class="col-2">Date Format:</div>
<div class="col-2"></div>
<q-input outlined dense v-model="date_format" class="col-8" />
</q-card-section>
<q-card-section class="row">
<q-checkbox
v-model="clear_search_when_switching"
@@ -127,6 +132,7 @@ export default {
loading_bar_color: "",
urlActions: [],
clear_search_when_switching: true,
date_format: "",
clientTreeSortOptions: [
{
label: "Sort alphabetically, moving failing clients to the top",
@@ -201,6 +207,7 @@ export default {
this.clientTreeSort = r.data.client_tree_sort;
this.loading_bar_color = r.data.loading_bar_color;
this.clear_search_when_switching = r.data.clear_search_when_switching;
this.date_format = r.data.date_format;
})
.catch(e => {});
},
@@ -216,6 +223,7 @@ export default {
client_tree_sort: this.clientTreeSort,
loading_bar_color: this.loading_bar_color,
clear_search_when_switching: this.clear_search_when_switching,
date_format: this.date_format,
};
this.$axios
.patch("/accounts/users/ui/", data)

View File

@@ -193,7 +193,10 @@ export default function () {
context.commit("SET_URL_ACTION", data.url_action);
context.commit("setShowCommunityScripts", data.show_community_scripts);
context.commit("SET_HOSTED", data.hosted);
context.commit("setDateFormat", data.date_format)
if (data.date_format && data.date_format !== "") context.commit("setDateFormat", data.date_format)
else context.commit("setDateFormat", data.default_date_format)
},
loadTree({ commit, state }) {
axios.get("/clients/").then(r => {