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
73e8ad29
Commit
73e8ad29
authored
Sep 23, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding start of create and edit user view
parent
74be5453
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
139 additions
and
2 deletions
+139
-2
UserController.php
Http/Controllers/Admin/UserController.php
+7
-2
CreateUserRequest.php
Http/Requests/CreateUserRequest.php
+22
-0
create.blade.php
Resources/views/admin/create.blade.php
+55
-0
edit.blade.php
Resources/views/admin/edit.blade.php
+55
-0
No files found.
Http/Controllers/Admin/UserController.php
View file @
73e8ad29
<?php
namespace
Modules\User\Http\Controllers\Admin
;
use
Cartalyst\Sentinel\Laravel\Facades\Sentinel
;
use
Illuminate\Support\Facades\Redirect
;
use
Illuminate\Support\Facades\View
;
use
Modules\Core\Http\Controllers\Admin\AdminBaseController
;
...
...
@@ -37,7 +38,7 @@ class UserController extends AdminBaseController
*/
public
function
create
()
{
return
\View
::
make
(
'collectio
n.create'
);
return
View
::
make
(
'user::admi
n.create'
);
}
/**
...
...
@@ -69,7 +70,11 @@ class UserController extends AdminBaseController
*/
public
function
edit
(
$id
)
{
return
\View
::
make
(
'collection.edit'
);
if
(
!
$user
=
$this
->
users
->
createModel
()
->
find
(
$id
))
{
return
Redirect
::
route
(
'dashboard.user.index'
);
}
return
View
::
make
(
'user::admin.edit'
,
compact
(
'user'
));
}
/**
...
...
Http/Requests/CreateUserRequest.php
0 → 100644
View file @
73e8ad29
<?php
namespace
Modules\User\Http\Requests
;
use
Illuminate\Foundation\Http\FormRequest
;
class
CreateUserRequest
extends
FormRequest
{
public
function
rules
()
{
return
[
];
}
public
function
authorize
()
{
return
true
;
}
public
function
messages
()
{
return
[];
}
}
\ No newline at end of file
Resources/views/admin/create.blade.php
0 → 100644
View file @
73e8ad29
@extends('core::layouts.master')
@section('content-header')
<h1>
New User
</h1>
<ol
class=
"breadcrumb"
>
<li><a
href=
"{{ URL::route('dashboard.index') }}"
><i
class=
"fa fa-dashboard"
></i>
Home
</a></li>
<li
class=
""
><a
href=
"{{ URL::route('dashboard.user.index') }}"
>
Users
</a></li>
<li
class=
"active"
>
New
</li>
</ol>
@stop
@section('content')
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"box box-
<?php
echo
$errors
->
first
()
?
'danger'
:
'info'
;
?>
"
>
{!! Form::open(['route' => 'dashboard.user.store', 'method' => 'post']) !!}
<div
class=
"box-body"
>
<div
class=
"row"
>
@include('flash::message')
</div>
<div
class=
"row"
>
<div
class=
"col-sm-4"
>
<div
class=
"form-group{{ $errors->has('first_name') ? ' has-error' : '' }}"
>
{!! Form::label('first_name', 'First name:') !!}
{!! Form::text('first_name', Input::old('first_name'), ['class' => 'form-control', 'placeholder' => 'First name']) !!}
{!! $errors->first('first_name', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
<div
class=
"col-sm-4"
>
<div
class=
"form-group{{ $errors->has('last_name') ? ' has-error' : '' }}"
>
{!! Form::label('last_name', 'Last name:') !!}
{!! Form::text('last_name', Input::old('last_name'), ['class' => 'form-control', 'placeholder' => 'Last name']) !!}
{!! $errors->first('last_name', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
<div
class=
"col-sm-4"
>
<div
class=
"form-group{{ $errors->has('email') ? ' has-error' : '' }}"
>
{!! Form::label('email', 'Email:') !!}
{!! Form::email('email', Input::old('email'), ['class' => 'form-control', 'placeholder' => 'Email address']) !!}
{!! $errors->first('email', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
</div>
</div>
<div
class=
"box-footer"
>
<button
type=
"submit"
class=
"btn btn-primary btn-flat"
>
Create
</button>
<a
class=
"btn btn-danger pull-right btn-flat"
href=
"{{ URL::route('dashboard.user.index')}}"
><i
class=
"fa fa-times"
></i>
Cancel
</a>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@stop
Resources/views/admin/edit.blade.php
0 → 100644
View file @
73e8ad29
@
extends
(
'core::layouts.master'
)
@
section
(
'content-header'
)
<
h1
>
Edit
User
<
small
>
{{
$user
->
present
()
->
fullname
()
}}
</
small
>
</
h1
>
<
ol
class
="
breadcrumb
">
<li><a href="
{{
URL
::
route
(
'dashboard.index'
)
}}
"><i class="
fa
fa
-
dashboard
"></i> Home</a></li>
<li class=""><a href="
{{
URL
::
route
(
'dashboard.user.index'
)
}}
">Users</a></li>
<li class="
active
">Editing user</li>
</ol>
@stop
@section('content')
<div class="
row
">
<div class="
col
-
md
-
12
">
<div class="
box
box
-<?
php
echo
$errors
->
first
()
?
'danger'
:
'info'
;
?>
">
{!! Form::open(['route' => ['dashboard.user.update', $user->id], 'method' => 'put']) !!}
<div
class=
"box-body"
>
<div
class=
"row"
>
@include('flash::message')
</div>
<div
class=
"row"
>
<div
class=
"col-sm-4"
>
<div
class=
"form-group{{ $errors->has('first_name') ? ' has-error' : '' }}"
>
{!! Form::label('first_name', 'First name:') !!}
{!! Form::text('first_name', Input::old('first_name', $user->first_name), ['class' => 'form-control', 'placeholder' => 'First name']) !!}
{!! $errors->first('first_name', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
<div
class=
"col-sm-4"
>
<div
class=
"form-group{{ $errors->has('last_name') ? ' has-error' : '' }}"
>
{!! Form::label('last_name', 'Last name:') !!}
{!! Form::text('last_name', Input::old('last_name', $user->last_name), ['class' => 'form-control', 'placeholder' => 'Last name']) !!}
{!! $errors->first('last_name', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
<div
class=
"col-sm-4"
>
<div
class=
"form-group{{ $errors->has('email') ? ' has-error' : '' }}"
>
{!! Form::label('email', 'Email:') !!}
{!! Form::email('email', Input::old('email', $user->email), ['class' => 'form-control', 'placeholder' => 'Email address']) !!}
{!! $errors->first('email', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
</div>
</div>
</div>
<div
class=
"box-footer"
>
<button
type=
"submit"
class=
"btn btn-primary btn-flat"
>
Update
</button>
<a
class=
"btn btn-danger pull-right btn-flat"
href=
"{{ URL::route('dashboard.user.index')}}"
><i
class=
"fa fa-times"
></i>
Cancel
</a>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@stop
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