Set default theme and images when installing

also prompt for user full name
This commit is contained in:
Lance Edgar 2022-03-04 16:43:48 -06:00
parent db0b58d45c
commit 211b55647f
3 changed files with 27 additions and 2 deletions

View file

@ -135,6 +135,28 @@ class Install(commands.Subcommand):
subprocess.check_call(cmd)
schema_installed = True
rattail = os.path.join(bindir, 'rattail')
# set falafel theme
cmd = [rattail, '-c', quiet_conf, '--no-versioning',
'setting-put', 'tailbone.theme', 'falafel']
subprocess.check_call(cmd)
# set main image
cmd = [rattail, '-c', quiet_conf, '--no-versioning',
'setting-put', 'tailbone.main_image_url', '/messkit/img/messkit.png']
subprocess.check_call(cmd)
# set header image
cmd = [rattail, '-c', quiet_conf, '--no-versioning',
'setting-put', 'tailbone.header_image_url', '/messkit/img/messkit-small.png']
subprocess.check_call(cmd)
# set favicon image
cmd = [rattail, '-c', quiet_conf, '--no-versioning',
'setting-put', 'tailbone.favicon_url', '/messkit/img/messkit-small.png']
subprocess.check_call(cmd)
rprint("\n\tdb schema installed to: [bold green]{}[/bold green]".format(
obfuscate_url_pw(dburl)))
@ -150,6 +172,7 @@ class Install(commands.Subcommand):
if not confirm or confirm != password:
rprint("[bold yellow]passwords did not match[/bold yellow]")
password = None
fullname = self.basic_prompt('full name')
rprint()
@ -157,10 +180,12 @@ class Install(commands.Subcommand):
rattail = os.path.join(bindir, 'rattail')
cmd = [rattail, '-c', quiet_conf, 'make-user', '-A', username,
'--password', password]
if fullname:
cmd.extend(['--full-name', fullname])
subprocess.check_call(cmd)
rprint("\n\tadmin user created: [bold green]{}[/bold green]".format(
username))
rprint("\n\tadmin user created: [bold green]{}[/bold green]".format(
username))
if self.basic_prompt("make poser dir?", True, is_bool=True):
rprint()

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 KiB