feat: signups can now be enabled/disabled from portal settings
This commit is contained in:
@@ -146,7 +146,6 @@ function resetEditor(value: string, resetHistory = false) {
|
||||
value = getModelValue()
|
||||
aceEditor?.setValue(value)
|
||||
aceEditor?.clearSelection()
|
||||
console.log(isDark.value)
|
||||
aceEditor?.setTheme(isDark.value ? 'ace/theme/twilight' : 'ace/theme/chrome')
|
||||
props.autofocus && aceEditor?.focus()
|
||||
if (resetHistory) {
|
||||
|
||||
@@ -328,19 +328,26 @@ const tabsStructure = computed(() => {
|
||||
icon: 'LogIn',
|
||||
fields: [
|
||||
{
|
||||
label: 'Custom Content',
|
||||
label: 'Identify User Persona',
|
||||
name: 'user_category',
|
||||
type: 'checkbox',
|
||||
description:
|
||||
'Enable this option to identify the user persona during signup.',
|
||||
},
|
||||
{
|
||||
label: 'Disable signup',
|
||||
name: 'disable_signup',
|
||||
type: 'checkbox',
|
||||
description:
|
||||
'New users will have to be manually registered by Admins.',
|
||||
},
|
||||
{
|
||||
label: 'Signup Consent HTML',
|
||||
name: 'custom_signup_content',
|
||||
type: 'Code',
|
||||
mode: 'htmlmixed',
|
||||
rows: 10,
|
||||
},
|
||||
{
|
||||
label: 'Ask for Occupation',
|
||||
name: 'user_category',
|
||||
type: 'checkbox',
|
||||
description:
|
||||
'Enable this option to ask users to select their occupation during the signup process.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { FormControl, FileUploader, Button, Switch } from 'frappe-ui'
|
||||
import { computed } from 'vue'
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { getFileSize, validateFile } from '@/utils'
|
||||
import { X } from 'lucide-vue-next'
|
||||
import Link from '@/components/Controls/Link.vue'
|
||||
|
||||
@@ -27,8 +27,9 @@
|
||||
"signup_settings_tab",
|
||||
"signup_settings_section",
|
||||
"column_break_9",
|
||||
"custom_signup_content",
|
||||
"user_category",
|
||||
"disable_signup",
|
||||
"custom_signup_content",
|
||||
"sidebar_tab",
|
||||
"items_in_sidebar_section",
|
||||
"courses",
|
||||
@@ -104,7 +105,7 @@
|
||||
"default": "0",
|
||||
"fieldname": "user_category",
|
||||
"fieldtype": "Check",
|
||||
"label": "Ask User Category during Signup"
|
||||
"label": "Identify User Persona"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
@@ -365,12 +366,19 @@
|
||||
"fieldtype": "Link",
|
||||
"label": "Payment Reminder Template",
|
||||
"options": "Email Template"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "disable_signup",
|
||||
"fieldtype": "Check",
|
||||
"label": "Disable Signup"
|
||||
}
|
||||
],
|
||||
"grid_page_length": 50,
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2025-02-11 11:29:43.412897",
|
||||
"modified": "2025-04-07 18:05:52.000651",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Settings",
|
||||
@@ -394,8 +402,9 @@
|
||||
"share": 1
|
||||
}
|
||||
],
|
||||
"row_format": "Dynamic",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ from frappe.utils import get_url_to_list
|
||||
class LMSSettings(Document):
|
||||
def validate(self):
|
||||
self.validate_google_settings()
|
||||
self.validate_signup()
|
||||
|
||||
def validate_google_settings(self):
|
||||
if self.send_calendar_invite_for_evaluations:
|
||||
@@ -40,6 +41,10 @@ class LMSSettings(Document):
|
||||
)
|
||||
)
|
||||
|
||||
def validate_signup(self):
|
||||
if self.has_value_changed("disable_signup"):
|
||||
frappe.db.set_single_value("Website Settings", "disable_signup", self.disable_signup)
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def check_payments_app():
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<label class="form-label sr-only"> {{ _("User Category") }} </label>
|
||||
<div class="control-input-wrapper">
|
||||
<div class="control-input flex align-center">
|
||||
<select type="text" id="user_category" data-fieldname="user_category" style="color: var(--text-muted)"
|
||||
<select type="text" id="user_category" data-fieldname="user_category" style="color: var(--text-light)"
|
||||
class="input-with-feedback form-control ellipsis" data-fieldtype="Select" required>
|
||||
<option value=""> {{ _("Category") }} </option>
|
||||
<option value="Business Owner"> {{ _("Business Owner") }} </option>
|
||||
|
||||
Reference in New Issue
Block a user