diff --git a/advlabdb/templates/admin/model/list.html b/advlabdb/templates/admin/model/list.html old mode 100644 new mode 100755 diff --git a/advlabdb/templates/admin/model/modals/details.html b/advlabdb/templates/admin/model/modals/details.html old mode 100644 new mode 100755 diff --git a/cli/maintain/copy_admin_templates.py b/cli/maintain/copy_admin_templates.py new file mode 100644 index 0000000..242b2ad --- /dev/null +++ b/cli/maintain/copy_admin_templates.py @@ -0,0 +1,50 @@ +from pathlib import Path +from shutil import copytree, rmtree + +import click +from flask_admin import __file__ as flask_admin_path + + +def _copy_admin_templates(): + src = Path(flask_admin_path).parent / "templates/bootstrap4/admin" + if not src.is_dir(): + click.echo(click.style(f"Templates could not be found at {src}", fg="red")) + return + + dist = Path("advlabdb/templates/admin") + if dist.is_dir(): + if not click.confirm( + click.style(f"The directory {dist} already exists! Do you want to overwrite it?", fg="yellow") + ): + return + + rmtree(dist) + click.echo(click.style("Old templates deleted!", fg="yellow")) + + copytree(src, dist) + click.echo(click.style(f"Copied {src} -> {dist}", fg="green")) + + click.echo( + click.style( + f""" +_________ +| WARNING +| ------- +| You might have to edit the file {dist}/base.html +| by adding nav in the following way: +| This line:\t