add save/load configuration
This commit is contained in:
@@ -33,6 +33,8 @@ class GenerateForm(forms.Form):
|
|||||||
#Visual
|
#Visual
|
||||||
iconfile = forms.FileField(label="Custom App Icon (in .png format)", required=False, widget=forms.FileInput(attrs={'accept': 'image/png'}))
|
iconfile = forms.FileField(label="Custom App Icon (in .png format)", required=False, widget=forms.FileInput(attrs={'accept': 'image/png'}))
|
||||||
logofile = forms.FileField(label="Custom App Logo (in .png format)", required=False, widget=forms.FileInput(attrs={'accept': 'image/png'}))
|
logofile = forms.FileField(label="Custom App Logo (in .png format)", required=False, widget=forms.FileInput(attrs={'accept': 'image/png'}))
|
||||||
|
iconbase64 = forms.CharField(required=False)
|
||||||
|
logobase64 = forms.CharField(required=False)
|
||||||
theme = forms.ChoiceField(choices=[
|
theme = forms.ChoiceField(choices=[
|
||||||
('light', 'Light'),
|
('light', 'Light'),
|
||||||
('dark', 'Dark'),
|
('dark', 'Dark'),
|
||||||
|
|||||||
@@ -205,6 +205,8 @@
|
|||||||
|
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<h2><i class="fas fa-paint-brush"></i> Visual</h2>
|
<h2><i class="fas fa-paint-brush"></i> Visual</h2>
|
||||||
|
{{ form.iconbase64.as_hidden }}
|
||||||
|
{{ form.logobase64.as_hidden }}
|
||||||
<label for="{{ form.iconfile.id_for_label }}">Custom App Icon (in .png format)</label>
|
<label for="{{ form.iconfile.id_for_label }}">Custom App Icon (in .png format)</label>
|
||||||
{{ form.iconfile }}<br><br>
|
{{ form.iconfile }}<br><br>
|
||||||
<!-- <input type="file" name="iconfile" id="iconfile" accept="image/png"> -->
|
<!-- <input type="file" name="iconfile" id="iconfile" accept="image/png"> -->
|
||||||
@@ -407,9 +409,11 @@
|
|||||||
|
|
||||||
// Handle image previews (as before)
|
// Handle image previews (as before)
|
||||||
if (key === 'iconfile' && formData[key]) {
|
if (key === 'iconfile' && formData[key]) {
|
||||||
|
document.getElementById('id_iconbase64').value = formData[key]
|
||||||
document.getElementById('icon-preview').innerHTML = `<img src="${formData[key]}" style="max-width: 300px; max-height: 60px;">`;
|
document.getElementById('icon-preview').innerHTML = `<img src="${formData[key]}" style="max-width: 300px; max-height: 60px;">`;
|
||||||
}
|
}
|
||||||
if (key === 'logofile' && formData[key]) {
|
if (key === 'logofile' && formData[key]) {
|
||||||
|
document.getElementById('id_logobase64').value = formData[key]
|
||||||
document.getElementById('logo-preview').innerHTML = `<img src="${formData[key]}" style="max-width: 300px; max-height: 60px;">`;
|
document.getElementById('logo-preview').innerHTML = `<img src="${formData[key]}" style="max-width: 300px; max-height: 60px;">`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user