Started adding a user creation form
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2022-05-23 23:54:16 -04:00
parent ae14d0c0bb
commit 8af370da32
5 changed files with 77 additions and 5 deletions

View File

@ -37,7 +37,9 @@ module.exports = function(grunt) {
twigRender: { twigRender: {
compile: { compile: {
files : [{ files : [{
data: {}, data: {
file_root: __dirname + '/public'
},
expand: true, expand: true,
cwd: 'assets/twig', cwd: 'assets/twig',
src: ['**/*.twig', '!**/_*.twig'], src: ['**/*.twig', '!**/_*.twig'],
@ -60,7 +62,7 @@ module.exports = function(grunt) {
watch: { watch: {
html: { html: {
files: ['assets/twig/*.twig'], files: ['assets/twig/*.twig', 'assets/twig/**/*.twig'],
tasks: ['twigRender'], tasks: ['twigRender'],
options: { options: {
atBegin: true, atBegin: true,

View File

@ -0,0 +1,9 @@
userCreateFormSubmit = (e) ->
e.preventDefault()
user_uid = document.forms.createUserForm.user_username.value
console.log(user_uid)
window.onload = ->
document.getElementById('createUserForm').addEventListener('submit', userCreateFormSubmit)
return

View File

@ -17,6 +17,12 @@
</div> </div>
</section> </section>
<section id="userActions" class="row">
<div class="columns twelve">
<p><a href="user/create.html">Create new user</a></p>
</div>
</section>
<section id="ldapObjectTable" class="row"> <section id="ldapObjectTable" class="row">
<table> <table>
<thead> <thead>

View File

@ -4,10 +4,10 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"> <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<link rel="stylesheet" href="./styles/skeleton-2.0.4.min.css"> <link rel="stylesheet" href="{{ file_root }}/styles/skeleton-2.0.4.min.css">
<link rel="stylesheet" href="./styles/archon.css"> <link rel="stylesheet" href="{{ file_root }}//styles/archon.css">
<title>Hello World!</title> <title>Hello World!</title>
<script src="./js/archon.js" charset="utf-8"></script> <script src="{{ file_root }}/js/archon.js" charset="utf-8"></script>
{% block scripts %}{% endblock %} {% block scripts %}{% endblock %}
</head> </head>
<body> <body>

View File

@ -0,0 +1,55 @@
{% extends '../layout.twig' %}
{% block scripts %}
<script src="../js/user.js" charset="utf-8"></script>
{% endblock %}
{% block content %}
<div class="row">
<div class="twelve columns">
<h1 class="u-text-center">Create new LDAP user</h1>
</div>
</div>
<section class="row">
<form id="createUserForm" class="twelve-columns">
<div class="row">
<label class="columns six">
Username (uid):
<input class="u-full-width" type="text" name="user_username" placeholder="myuser">
</label>
<label class="columns six">
Email address:
<input class="u-full-width" type="text" name="user_email" placeholder="myuser@example.com">
</label>
</div>
<div class="row">
<label class="columns six">
First name:
<input class="u-full-width" type="text" name="user_first_name" placeholder="my">
</label>
<label class="columns six">
Last name:
<input class="u-full-width" type="text" name="user_last_name" placeholder="user">
</label>
</div>
<div class="row">
<div class="columns twelve u-text-center">
<input type="submit" name="user_submit" value="Create user">
</div>
</div>
</form>
</section>
<div class="row">
<div class="twelve columns">
<p><a href="../index.html">Back</a></p>
</div>
</div>
{% endblock %}