So in this section of the course, we want to manage users to add the ability to have additional admin
users, to modify them, to delete them, so on and so forth.
So let's start by creating some menu items in our base layout HTML.
So I open that up and I'll find the section where I have my admin menu right here.
So if you're authenticated, then you can see this stuff.
So we'll just add something right here.
So add a lot and I'll give it an A with a class of dropdown item and an I will point to a route that
doesn't exist yet.
Slash admin, slash all dash users and we'll call this all users.
Close the tag and close the.
And I will just put a spacer right here, because it looks better this way, so I'll copy this, paste
it in here, start my back and make start underscore back.
And run air.
So air is running.
Let's go to our Web browser and a login
at example, dot com with the password password log in.
OK, so now I have an all users menu item.
Of course, we need to create a root, a hamburger and a template.
And we also will need a template to add or edit users.
So let's get started with that back to work code.
I'll hide my terminal window and I will, first of all create the template.
So my templates folder will create a new file called All Dash Users Dot page to go to.
And we'll just make it a really simple one to start with, you'll use the base template and it will
receive data and we'll have a title defined title, which I'll call all users
and close up
and a content section.
Define content, and I'll do the same thing I've done right along to class equals margin top five,
all admin users and close my age, too, and I'll put it in there.
Now, I'm also going to want a button that allows me to add a user's this page will list all the admin
users and we'll just put a button in here with div class equals float and move it to the right and I'll
put in a in there a class equals button say button at one secondary and we'll give it an F to a non-existent
path.
Slash admin, slash all users slash zero.
So user ID zero means we're going to be adding a user and we'll get to that soon and user and close
the tag and close the div.
And now because we floated we have to clear fixed div class equals clear fix because if we don't it
will mess things up.
Now put a table in here table and I'll give it an idea of user table and I'll give it a class of bootstraps
table class and say table straight and I'll give it a T head and a tier and just to teach the user close
to each and say their email to each email close to each, close my row, close my head and add an empty
body
and close my table
and we'll end our content section.
And we're also going to have JavaScript, of course, because we'll use that to populate the table with
our users.
So let's define
jazz
and we'll close up and inside of that for right now, I'll just put in a script tag, a closing script
tag, and I'll get a reference to the table because I don't want to need that at some point.
But Tebaldi equal document don't get element by idea.
And I'm looking for user Dasch table
and then get elements by tag name Tebaldi
at index zero.
OK, so that's one template.
Now we need to make another one.
So I'm just going to copy this whole thing and I'll create another template, new file called one user
dot page dot go each html and I'll post this in here and get rid of this stuff inside the defined.
Just get rid of the entire table and the button and I'll change the title.
Just say admin user.
Admin user.
OK, so we have our templates, we have a menu item.
The next step is to create stub handlers and stub routes that allow us to get to these pages and display
them and we'll take care of that in the next lecture.