Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
43f7b2e4
Commit
43f7b2e4
authored
Sep 27, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a generate module UI
parent
09eee38c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
0 deletions
+95
-0
SidebarViewComposer.php
Composers/SidebarViewComposer.php
+6
-0
WorkbenchController.php
Http/Controllers/WorkbenchController.php
+26
-0
GenerateModuleRequest.php
Http/Requests/GenerateModuleRequest.php
+21
-0
routes.php
Http/routes.php
+3
-0
index.blade.php
Resources/views/admin/workbench/index.blade.php
+39
-0
No files found.
Composers/SidebarViewComposer.php
View file @
43f7b2e4
...
...
@@ -20,6 +20,12 @@ class SidebarViewComposer
'route'
=>
'dashboard.modules.index'
,
'icon-class'
=>
'fa fa-cog'
,
'title'
=>
'Modules'
,
],
[
'request'
=>
"
{
$view
->
prefix
}
/workshop/workbench*"
,
'route'
=>
'dashboard.workbench.index'
,
'icon-class'
=>
'fa fa-cog'
,
'title'
=>
'Workbench'
,
]
]));
}
...
...
Http/Controllers/WorkbenchController.php
0 → 100644
View file @
43f7b2e4
<?php
namespace
Modules\Workshop\Http\Controllers
;
use
Illuminate\Support\Facades\Artisan
;
use
Illuminate\Support\Facades\Redirect
;
use
Illuminate\Support\Facades\View
;
use
Laracasts\Flash\Flash
;
use
Modules\Core\Http\Controllers\Admin\AdminBaseController
;
use
Modules\Workshop\Http\Requests\GenerateModuleRequest
;
use
Symfony\Component\Console\Output\BufferedOutput
;
class
WorkbenchController
extends
AdminBaseController
{
public
function
index
()
{
return
View
::
make
(
'workshop::admin.workbench.index'
);
}
public
function
generate
(
GenerateModuleRequest
$request
)
{
$output
=
new
BufferedOutput
;
Artisan
::
call
(
'module:make'
,
[
'name'
=>
$request
->
name
],
$output
);
Flash
::
message
(
$output
->
fetch
());
return
Redirect
::
route
(
'dashboard.workbench.index'
);
}
}
\ No newline at end of file
Http/Requests/GenerateModuleRequest.php
0 → 100644
View file @
43f7b2e4
<?php
namespace
Modules\Workshop\Http\Requests
;
use
Illuminate\Foundation\Http\FormRequest
;
class
GenerateModuleRequest
extends
FormRequest
{
public
function
rules
()
{
return
[];
}
public
function
authorize
()
{
return
true
;
}
public
function
messages
()
{
return
[];
}
}
\ No newline at end of file
Http/routes.php
View file @
43f7b2e4
...
...
@@ -4,5 +4,8 @@ Route::group(['prefix' => Config::get('core::core.admin-prefix').'/workshop', 'n
function
()
{
Route
::
get
(
'modules'
,
[
'as'
=>
'dashboard.modules.index'
,
'uses'
=>
'ModulesController@index'
]);
Route
::
post
(
'modules'
,
[
'as'
=>
'dashboard.modules.store'
,
'uses'
=>
'ModulesController@store'
]);
# Workbench
Route
::
get
(
'workbench'
,
[
'as'
=>
'dashboard.workbench.index'
,
'uses'
=>
'WorkbenchController@index'
]);
Route
::
post
(
'generate'
,
[
'as'
=>
'dashboard.workbench.generate.index'
,
'uses'
=>
'WorkbenchController@generate'
]);
}
);
\ No newline at end of file
Resources/views/admin/workbench/index.blade.php
0 → 100644
View file @
43f7b2e4
@
extends
(
'core::layouts.master'
)
@
section
(
'content-header'
)
<
h1
>
Module
helpers
</
h1
>
<
ol
class
="
breadcrumb
">
<li><a href="
{{
URL
::
route
(
'dashboard.index'
)
}}
"><i class="
fa
fa
-
dashboard
"></i> Home</a></li>
<li class="
active
">Workbench</li>
</ol>
@stop
@section('content')
<div class="
row
">
<div class="
col
-
md
-
12
">
<div class="
nav
-
tabs
-
custom
">
<ul class="
nav
nav
-
tabs
">
<li class="
active
"><a href="
#tab_1-1" data-toggle="tab">Generator</a></li>
</
ul
>
<
div
class
="
tab
-
content
">
<div class="
tab
-
pane
active
" id="
tab_1
-
1
">
@include('flash::message')
{!! Form::open(['route' => 'dashboard.workbench.generate.index', 'method' => 'post']) !!}
<div class="
box
-
body
">
<div class='form-group'>
{!! Form::label('name', 'Module Name:') !!}
{!! Form::text('name', Input::old('name'), ['class' => 'form-control', 'placeholder' => 'Module Name']) !!}
</div>
</div>
<div class="
box
-
footer
">
<button type="
submit
" class="
btn
btn
-
primary
btn
-
flat
">Generate new module</button>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</div>
@stop
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment