mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-06 05:26:22 -07:00
Use generic page header for manage pages, add login template
This commit is contained in:
parent
c8d8af077b
commit
b2318af7a3
12 changed files with 132 additions and 44 deletions
22
build.py
22
build.py
|
@ -189,7 +189,7 @@ def docker(option = "guestdb", attached = False):
|
|||
if status != 0:
|
||||
print("Failed starting a docker container, exited with status code", status)
|
||||
|
||||
def install(prefix = "/usr", document_root = "/srv/gochan", js_only = False, css_only = False):
|
||||
def install(prefix = "/usr", document_root = "/srv/gochan", js_only = False, css_only = False, templates_only = False):
|
||||
if gcos == "windows" or gcos == "darwin":
|
||||
print("Installation is not currently supported for Windows and macOS, use the respective directory created by running `python build.py release`")
|
||||
exit(1)
|
||||
|
@ -208,6 +208,20 @@ def install(prefix = "/usr", document_root = "/srv/gochan", js_only = False, css
|
|||
css_install_dir = path.join(document_root, "css")
|
||||
fs_action("copy", "html/css", css_install_dir)
|
||||
done = True
|
||||
if templates_only:
|
||||
print("Installing template files")
|
||||
print(document_root)
|
||||
templates_install_dir = path.join(document_root, "templates")
|
||||
if not path.exists(templates_install_dir):
|
||||
fs_action("mkdir", templates_install_dir)
|
||||
template_files = os.listdir("templates")
|
||||
for template in template_files:
|
||||
if template == "override":
|
||||
continue
|
||||
fs_action("copy",
|
||||
path.join("templates", template),
|
||||
path.join(document_root, "templates", template))
|
||||
done = True
|
||||
if done:
|
||||
print("done.")
|
||||
return
|
||||
|
@ -346,6 +360,10 @@ if __name__ == "__main__":
|
|||
action = "store_true",
|
||||
help = "only install CSS"
|
||||
)
|
||||
parser.add_argument("--templates",
|
||||
action = "store_true",
|
||||
help = "install the template files"
|
||||
)
|
||||
parser.add_argument("--prefix",
|
||||
default = "/usr",
|
||||
help = "install gochan to this directory and its subdirectories",
|
||||
|
@ -355,7 +373,7 @@ if __name__ == "__main__":
|
|||
help = "install files in ./html/ to this directory to be requested by a browser"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
install(args.prefix, args.documentroot, args.js, args.css)
|
||||
install(args.prefix, args.documentroot, args.js, args.css, args.templates)
|
||||
elif action == "js":
|
||||
parser.add_argument("--minify", action = "store_true", help = "create a minified gochan.js")
|
||||
parser.add_argument("--watch", action = "store_true", help = "automatically rebuild when you change a file (keeps running)")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue