Added Outstanding applications page

This commit also includes Chart.js for the whole project using Webpack. It also updates NPM packages to support ChartJS, and suppresses locale.js warnings from Webpack builds.
Gitignore removes the webpack bundle file since that file should be built each time dependencies/js code are modified.
This commit is contained in:
Miguel Nogueira 2020-05-01 05:42:19 +01:00
parent c802908bf3
commit b5e6a4a94b
10 changed files with 210 additions and 14 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/public/js/app.js
/node_modules /node_modules
/public/hot /public/hot
/public/storage /public/storage

View File

@ -22,4 +22,9 @@ class ApplicationController extends Controller
return view('dashboard.user.approvedapplications'); return view('dashboard.user.approvedapplications');
} }
public function showAllPendingApps()
{
return view('dashboard.appmanagement.outstandingapps');
}
} }

46
package-lock.json generated
View File

@ -2092,6 +2092,32 @@
"integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=",
"dev": true "dev": true
}, },
"chart.js": {
"version": "2.9.3",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.9.3.tgz",
"integrity": "sha512-+2jlOobSk52c1VU6fzkh3UwqHMdSlgH1xFv9FKMqHiNCpXsGPQa/+81AFa+i3jZ253Mq9aAycPwDjnn1XbRNNw==",
"requires": {
"chartjs-color": "^2.1.0",
"moment": "^2.10.2"
}
},
"chartjs-color": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.4.1.tgz",
"integrity": "sha512-haqOg1+Yebys/Ts/9bLo/BqUcONQOdr/hoEr2LLTRl6C5LXctUdHxsCYfvQVg5JIxITrfCNUDr4ntqmQk9+/0w==",
"requires": {
"chartjs-color-string": "^0.6.0",
"color-convert": "^1.9.3"
}
},
"chartjs-color-string": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/chartjs-color-string/-/chartjs-color-string-0.6.0.tgz",
"integrity": "sha512-TIB5OKn1hPJvO7JcteW4WY/63v6KwEdt6udfnDE9iCAZgy+V4SrbSxoIbTw/xkUIapjEI4ExGtD0+6D3KyFd7A==",
"requires": {
"color-name": "^1.0.0"
}
},
"chokidar": { "chokidar": {
"version": "2.1.8", "version": "2.1.8",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz",
@ -2280,7 +2306,6 @@
"version": "1.9.3", "version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": { "requires": {
"color-name": "1.1.3" "color-name": "1.1.3"
} }
@ -2288,8 +2313,7 @@
"color-name": { "color-name": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
"dev": true
}, },
"color-string": { "color-string": {
"version": "1.5.3", "version": "1.5.3",
@ -3181,6 +3205,12 @@
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true "dev": true
}, },
"empty-module": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/empty-module/-/empty-module-0.0.2.tgz",
"integrity": "sha1-E7TdjUr+3dNeUMGNzXiMUQh/FUU=",
"dev": true
},
"encodeurl": { "encodeurl": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
@ -5678,6 +5708,11 @@
} }
} }
}, },
"locale-js": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/locale-js/-/locale-js-1.1.1.tgz",
"integrity": "sha1-pUtQtNFYDIKxd1Y7Eb24+DF9m3w="
},
"locate-path": { "locate-path": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
@ -6118,6 +6153,11 @@
"minimist": "^1.2.5" "minimist": "^1.2.5"
} }
}, },
"moment": {
"version": "2.25.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.25.0.tgz",
"integrity": "sha512-vbrf6kJGpevOxmDRvCCvGuCSXvRj93264WcFzjm3Z3pV4lfjrXll8rvSP+EbmCte64udj1LkJMILxQnjXAQBzg=="
},
"move-concurrently": { "move-concurrently": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",

View File

@ -13,6 +13,7 @@
"axios": "^0.19", "axios": "^0.19",
"bootstrap": "^4.0.0", "bootstrap": "^4.0.0",
"cross-env": "^7.0", "cross-env": "^7.0",
"empty-module": "0.0.2",
"jquery": "^3.2", "jquery": "^3.2",
"laravel-mix": "^5.0.1", "laravel-mix": "^5.0.1",
"lodash": "^4.17.13", "lodash": "^4.17.13",
@ -22,5 +23,10 @@
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vue": "^2.5.17", "vue": "^2.5.17",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"
},
"dependencies": {
"chart.js": "^2.9.3",
"locale-js": "^1.1.1",
"moment": "^2.25.0"
} }
} }

10
public/css/app.css vendored
View File

@ -44,11 +44,6 @@
box-sizing: border-box; box-sizing: border-box;
} }
.view {
background: url("/slides/06.png")no-repeat center center;
background-size: cover;
}
html { html {
font-family: sans-serif; font-family: sans-serif;
line-height: 1.15; line-height: 1.15;
@ -4532,11 +4527,6 @@ input[type=button].btn-block {
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
} }
.navbar-style {
background: rgb(132,235,173);
background: linear-gradient(90deg, rgba(132,235,173,1) 10%, rgba(110,182,207,1) 29%, rgba(109,146,255,1) 92%);
}
.navbar .container, .navbar .container,
.navbar .container-fluid, .navbar .container-fluid,
.navbar .container-sm, .navbar .container-sm,

1
resources/js/app.js vendored
View File

@ -4,6 +4,7 @@
* building robust, powerful web applications using Vue and Laravel. * building robust, powerful web applications using Vue and Laravel.
*/ */
require('chart.js');
require('./bootstrap'); require('./bootstrap');
window.Vue = require('vue'); window.Vue = require('vue');

45
resources/js/application_charts.js vendored Normal file
View File

@ -0,0 +1,45 @@
var ctx = document.getElementById('appOverviewChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
label: 'Approved Apps.',
backgroundColor: 'rgb(26,246,40)',
borderColor: 'rgb(26,246,40)',
data: [0, 10, 5, 2, 20, 30, 45],
fill: false
},
{
label: 'Denied Apps.',
backgroundColor: 'rgb(247, 43, 43)',
borderColor: 'rgb(247, 43, 43)',
data: [0, 10, 20, 0, 20, 14, 10],
fill: false
}]
},
// Configuration options go here
options: {
elements: {
point:{
radius: 0
}
},
scales: {
xAxes: [{
gridLines: {
display:false
}
}],
yAxes: [{
gridLines: {
display:false
}
}]
}
}
});

View File

@ -0,0 +1,96 @@
@extends('adminlte::page')
@section('title', 'Raspberry Network | Profile')
@section('content_header')
<h4>Application Management / Outstanding Applications</h4>
@stop
@section('js')
<script type="text/javascript" src="/js/app.js"></script>
@stop
@section('content')
<div class="row">
<div class="col">
<div class="card">
<div class="card-header">
<div class="card-title"><h4>Outstanding Applications</h4></div>
</div>
<div class="card-body">
<table class="table" style="white-space: nowrap">
<thead>
<tr>
<th>#</th>
<th>Applicant Name</th>
<th>Status</th>
<th>Applied On</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Jonathan Smith</td>
<td><span class="badge badge-info">Under Review</span></td>
<td>2020-04-20</td>
<td>
<button type="button" class="btn btn-warning btn-sm"><i class="fas fa-clipboard-check"></i> Review</button>
<button type="button" class="btn btn-warning btn-sm"><i class="fas fa-dumpster-fire"></i> Spam</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title">Applications at a Glance</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-minus"></i>
</button>
</div>
</div>
<div class="card-body" style="display: block;">
<div class="chart"><div class="chartjs-size-monitor"><div class="chartjs-size-monitor-expand"><div class=""></div></div><div class="chartjs-size-monitor-shrink"><div class=""></div></div></div>
<canvas id="appOverviewChart" style="min-height: 250px; height: 250px; max-height: 250px; max-width: 100%; display: block; width: 456px;" width="456" height="250" class="chartjs-render-monitor"></canvas>
</div>
</div>
<!-- /.card-body -->
</div>
</div>
</div>
@stop

View File

@ -38,6 +38,12 @@ Route::group(['middleware' => 'auth'], function(){
}); });
Route::group(['prefix' => '/applications'], function (){
Route::get('/staff/outstanding', 'ApplicationController@showAllPendingApps');
});
}); });
//Route::get('/dashboard/login', ''); //Route::get('/dashboard/login', '');

8
webpack.mix.js vendored
View File

@ -11,5 +11,11 @@ const mix = require('laravel-mix');
| |
*/ */
mix.js('resources/js/app.js', 'public/js') mix.js(['resources/js/app.js', 'resources/js/application_charts.js'], 'public/js')
.sass('resources/sass/app.scss', 'public/css'); .sass('resources/sass/app.scss', 'public/css');
mix.webpackConfig({
stats: {
warnings: false
}
});