Przeglądaj źródła

Ajusting welcome module

ahwelp 3 lat temu
rodzic
commit
1bbfcb3a89

+ 18 - 3
app/core/welcome/Routes.php

@@ -1,8 +1,23 @@
 <?php
 
-use RR\Response;
- use App\Core\Template\Output as Output;
+use App\Core\Template\Output as Output;
 use Routes\RouteCollection as RouteCollection;
 
-RouteCollection::add('get', '/', '\App\Core\Welcome\WelcomeController@welcome');
+//Menu itens
+RouteCollection::get('*', function() {
+
+    Output::headAdd('/', 'Dashboard');
+    // Output::addMenu('/', 'Dashboard', "<i class='fa fa-dashboard'></i>", ['class' => 'nav-link']);
+    Output::addSubMenu('dashboard', 'Dashboard', "<i class='fa fa-dashboard'></i>", ['class' => 'nav-link']);
+    Output::addOnSubMenu('dashboard', '/',      'Dashboard', "<i class='fa fa-dashboard'></i>", ['class' => 'nav-link']);
+    Output::addOnSubMenu('dashboard', '/teste', 'Test',      "<i class='fa fa-dashboard'></i>", ['class' => 'nav-link']);
+
+}, -10)->doIgnore();
+
+RouteCollection::onHttpError('404', function($code){
+    Output::setView(404)->render();
+});
+
+RouteCollection::add('get', '/', '\App\Core\Welcome\WelcomeController@welcome');//->middlewareIgnore('auth');
+RouteCollection::add('get', '/teste', '\App\Core\Welcome\WelcomeController@teste');
 //RouteCollection::add('get', '/welcome', 'WellcomeController@welcome');

+ 5 - 1
app/core/welcome/WelcomeController.php

@@ -2,7 +2,7 @@
 
 namespace App\Core\Welcome;
 
-use App\Core\Template\Output;
+use App\Core\Template\Output as Output;
 
 class WelcomeController {
 
@@ -10,4 +10,8 @@ class WelcomeController {
         Output::render();
     }
 
+    function teste(){
+        echo 'saddsaadsdsa';
+    }
+
 }

+ 1 - 0
app/core/welcome/views/404.mustache

@@ -0,0 +1 @@
+404

+ 28 - 0
app/core/welcome/views/index.mustache

@@ -0,0 +1,28 @@
+<a href='auth/form' >Adicionar </a>
+<div class="table-responsive">
+    <table class='table'>
+
+        <thead>
+           <tr>
+              <th>Id</th>
+              <th>Value</th>
+              <th>Description</th>
+              <th>Actions</th>
+           </tr>
+        </thead>
+
+        {{#list}}
+           <tr class="table-dark" data-id='{{id}}'>
+              <td>{{id}}</td>
+              <td>{{value}}</td>
+              <td>{{description}}</td>
+              <td>
+                 <a href="auth/edit"> <i class="fa fa-pencil"></i></a>
+                 <a href="auth/purge"> <i class="fa fa-fire"></i></a>
+                 <a href="auth/"> <i class="fa fa-plus"></i></a>
+                 <a href="auth/destroy"> <i class="fa fa-trash-o"></i></a>
+              </td>
+           </tr>
+        {{/list}}
+    </table>
+</div>