Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbexiv committed Oct 1, 2017
0 parents commit 0145041
Show file tree
Hide file tree
Showing 11 changed files with 195 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/app/bundle/*
/node_modules
*.zip
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## 1.0.0 (October 1st, 2017)

### Added
- Dashboard widget for notes.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017 Tobbe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Pagekit Dashboard Widgets

This extension provides additional widgets for the admin dashboard. You can find it in the [pagekit marketplace](https://pagekit.com/marketplace/package/tobbe/dashboard-widgets).

## Features

- Note widget for the dashboard.

## How to work with the extension

1. Install this extension in your environment using the built in marketplace. The extension and all its dependancies will be installed automatically.
2. Ensure that the required users/roles have the necessary rights to use the extension.
3. Create the widgets in your dashboard.

## Issues and feature requests

Please use the [issues section](https://github.com/tobbexiv/pagekit-dashboard-widgets/issues) to file any bugs or feature requests.
53 changes: 53 additions & 0 deletions app/components/dashboard-notes.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<template>

<form class="pk-panel-teaser uk-form uk-form-stacked" v-if="editing">

<div class="uk-form-row">
<label class="uk-form-label">{{ 'Title' | trans }}</label>
<div class="uk-form-controls">
<input class="uk-width-1-1" type="text" v-model="widget.title">
</div>
</div>

<div class="uk-form-row">
<label class="uk-form-label">{{ 'Notes' | trans }}</label>
<div class="uk-form-controls">
<textarea class="uk-width-1-1" rows="6" v-model="widget.note"></textarea>
</div>
</div>

</form>

<div v-else>

<h3>{{ widget.title }}</h3>
<p>{{ widget.note }}</p>

</div>

</template>

<script>
module.exports = {
type: {
id: 'notes',
label: 'Notes',
defaults: {
title: '',
notes: ''
}
},
replace: false,
props: ['widget', 'editing']
}
window.Dashboard.components['hello'] = module.exports;
</script>
5 changes: 5 additions & 0 deletions app/components/dashboard-widgets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* Collection of all dashboard widgets.
*/

window.Dashboard.components['tobbe-dasboard-notes'] = Vue.expand(require('./dashboard-notes.vue'));
24 changes: 24 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "tobbe/dashboard-widgets",
"module": "tobbe/dashboard-widgets",
"version": "1.0.0",
"type": "pagekit-extension",
"title": "Dashboard widgets",
"description": "Provide additional widgets for the dashboard.",
"license": "MIT",
"authors": [
{
"name": "Tobbe",
"email": "[email protected]",
"homepage": "https://github.com/tobbexiv/pagekit-dashboard-widgets"
}
],
"extra": {
"icon": "icon.png"
},
"archive": {
"exclude": [
"node_modules"
]
}
}
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [

'name' => 'tobbe/dashboard-widgets',

'type' => 'extension',

'main' => function ($app) {},

'resources' => [
'tobbe/dasboard-widgets:' => ''
],

'events' => [
'view.scripts' => function ($event, $scripts) use ($app) {

$packageVersion = $app->config('system')->get('packages.tobbe/dashboard-widgets');
$packageVersionHash = substr(sha1($app->system()->config('secret') . $packageVersion), 0, 4);

$scripts->register('tobbe-dashboard-widgets', 'tobbe/dashboard-widgets:app/bundle/dashboard-widgets.js', ['~dashboard'], ['version' => $packageVersionHash]);

}
]

];

?>
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "dashboard-widgets",
"devDependencies": {
"babel-core": "^6.9.1",
"babel-loader": "^6.2.4",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-es2015": "^6.9.0",
"babel-runtime": "^6.9.2",
"bower": "*",
"css-loader": "^0.23.1",
"gulp": "*",
"gulp-less": "*",
"gulp-rename": "*",
"gulp-header": "*",
"vue-hot-reload-api": "^1.3.2",
"vue-html-loader": "^1.2.2",
"vue-loader": "^8.5.2",
"vue-style-loader": "^1.0.0",
"webpack": "^1.13.1"
}
}
17 changes: 17 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = [

{
entry: {
"dashboard-widgets": "./app/components/dashboard-widgets.js"
},
output: {
filename: "./app/bundle/[name].js",
},
module: {
loaders: [
{ test: /\.vue$/, loader: "vue" }
]
}
}

];

0 comments on commit 0145041

Please sign in to comment.