Ilaro.Admin creates for you admin panel using only POCO classes.
Demo - using Northwind DB (with small modifications, removed multiple primary keys)
Project was inspired by Django admin site.
Please keep in mind this is still an alpha version.
Get it from nuget:
If you are using Unity install:
Install-Package Ilaro.Admin.Unity
Or if you using Ninject install:
Install-Package Ilaro.Admin.Ninject
Or you can just install:
Install-Package Ilaro.Admin
And register by yourself all needed stuff.
##TODO I don't plan milestones, so I will do things in random order. Maybe some of them I'll skip, and I'll probably back to them after release v1.
I moved TODO to wiki pages, because here, it is doing a mess in commits, and I rather would simple list than an issues pages.
##Requirements:
- POCO classes (or pseudo POCO)
- ASP MVC 4
##Initialisation:
In global.asax you must do three things:
-
Register routes
// prefix is optional, by default = IlaroAdmin AdminInitialise.RegisterRoutes(RouteTable.Routes, prefix: "Admin"); AdminInitialise.RegisterResourceRoutes(RouteTable.Routes);
It should be put before register default routes because you lose a friendly urls
-
Add entities
Entity<Customer>.Add(); Entity<Product>.Add();
Add method create a Entity object with all info from attributes. In future I want add fluent configuration of entity so, there will be no need to configure entity with attributes.
-
Specify access to Ilaro.Admin
Admin.Authorize = new AuthorizeAttribute(){ Roles = "Admin" };
If you don't do that everyone with proper link will have access to Ilaro.Admin.
-
Initialise Ilaro.Admin
Admin.Initialise("NorthwindEntities");
This line initialise UnityContainer, and bind foreign entity and tries set primary key for each entity who has not defeined it. If you have only one ConnectionString there is no need to specify it.
-
Register areas
AreaRegistration.RegisterAllAreas();
This step should be added by default during creating asp mvc project. Ilaro.Admin is created as area, so it needs registration.
-
Go to wiki pages for more info. Entity configuration Property configuration
And after that when you go to ~/IlaroAdmin url (if you don't define other prefix) you should see something like that: ####Dashboard ####Records list ####Create new record
##What I use Here I will try write all libraries, and part of code I use in project.
- Massive - for db access. I Removed lots methods I left only read methods, thanks that I have much better control on created commands, and in future I want to completely removed massive.
- ImageResizer - for resizing image. There's no much need to use this library, you can easy get rid off it, but I like it :)
- RazorGenerator and extension - for generating source code from views, thanks that you don't have add views into your project, just simply add dll. Of cource if you want you can add views files which overrides compiled views
- Twitter bootstrap
- Chosen and bootstrap style for it https://gist.github.com/koenpunt/6424137
- Bootstrap-DateTimePicker - for DateTime picker, Date picker and Time picker
- Bootstrap-SpinEdit - for numeric editor
- Bootstrap-Markdown - for markdown editor
- Marked - for parsing markdown
- Summernote - for html wysiwyg editor
- Bootstrap Dual Listbox - for one to many editor
- Bootstrap-file-input - file input
- Cake - for build script