https://github.com/eden-js/admin
https://github.com/eden-js/admin
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/eden-js/admin
- Owner: eden-js
- Created: 2018-11-01T03:24:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-31T17:27:31.000Z (about 4 years ago)
- Last Synced: 2025-01-26T18:17:26.884Z (4 months ago)
- Language: Riot
- Size: 216 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EdenJS - Admin
[](https://travis-ci.com/eden-js/admin)
[](https://github.com/eden-js/admin/issues)
[](https://github.com/eden-js/admin)
[](https://github.com/eden-js/admin)
[](https://discord.gg/5u3f3up)Administrator base logic component for [EdenJS](https://github.com/edenjs-cli)
`@edenjs/admin` creates all the base administrator logic that any normal system should require. This module also creates configuratble dashboards.
## Setup
### Install
```
npm i --save @edenjs/admin
```### Configure
No configuration is required for this module
## Models
### `Dashboard` _[Usage](https://github.com/eden-js/admin/blob/master/bundles/dashboard/models/dashboard.js)_
Dashboard model consists of a single configurable dashboard instance. These are created in the frontend through the api.
#### Example
```js
// load model
const Dashboard = model('dashboard');// get first dashboard
const dashboard = await Dashboard.findOne();// dashboard used in frontend
const data = await dashboard.sanitise();
```## Hooks
No hooks created in this module
## Views
### `` _[Usage](https://github.com/eden-js/admin/blob/master/bundles/dashboard/views/dashboard.tag)_
The dashboard view creates an instance of a dashboard container, this provides a fully configurable dashboard area.
#### Example
In the controller _[Usage](https://github.com/eden-js/admin/blob/master/bundles/admin/controllers/admin.js#L45)_
```jsx
// require helper
const blockHelper = helper('cms/block');// get dashboards
const dashboards = await Dashboard.find();// sanitise data
const data = await Promise.all(dashboards.map(dash => dash.sanitise()));// render dashboard/home.tag view
res.render('dashboard/home', {
blocks : blockHelper.renderBlocks('admin'), // render blocks can be namespaced
dashboards : data,
});
```In the view `dashboard/home.tag` _[Usage](https://github.com/eden-js/admin/blob/master/bundles/admin/views/admin.tag#L6)_
```jsx
```
### `` _[Usage](https://github.com/eden-js/admin/blob/master/bundles/admin/views/admin/header.tag)_
The admin header view creates a common admin header component for use in admin layout pages.
#### Example
In the view
```jsx
```