Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
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
laravel-adminpanel
Commits
7967d475
Commit
7967d475
authored
Apr 03, 2018
by
cygnet
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/viralsolani/laravel-adminpanel
into develop
parents
6a894e7f
a8dfa718
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
390 additions
and
234 deletions
+390
-234
README.md
README.md
+1
-1
composer.lock
composer.lock
+19
-19
admin.js
public/js/backend/admin.js
+222
-2
app.js
resources/assets/js/backend/app.js
+13
-1
bootstrap.js
resources/assets/js/bootstrap.js
+7
-1
Flash.vue
resources/assets/js/components/backend/Flash.vue
+46
-0
app.blade.php
resources/views/backend/layouts/app.blade.php
+2
-1
form.blade.php
resources/views/backend/menus/form.blade.php
+2
-168
messages.blade.php
resources/views/includes/partials/messages.blade.php
+77
-41
webpack.mix.js
webpack.mix.js
+1
-0
No files found.
README.md
View file @
7967d475
...
...
@@ -93,7 +93,7 @@ You can now access the server at http://localhost:8000
npm install
npm run development
php artisan key:generate
php artisan jwt:
generate
php artisan jwt:
secret
php artisan vendor:publish --tag=lfm_public
## Logging In
...
...
composer.lock
View file @
7967d475
...
...
@@ -199,12 +199,12 @@
"source": {
"type": "git",
"url": "https://github.com/creativeorange/gravatar.git",
"reference": "
a0e84f0c8e8922ad151168d6ebd8db6a1b2d8cd2
"
"reference": "
9affd46be10f1ebb11d5d9f03440f804c09f2b59
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/creativeorange/gravatar/zipball/
a0e84f0c8e8922ad151168d6ebd8db6a1b2d8cd2
",
"reference": "
a0e84f0c8e8922ad151168d6ebd8db6a1b2d8cd2
",
"url": "https://api.github.com/repos/creativeorange/gravatar/zipball/
9affd46be10f1ebb11d5d9f03440f804c09f2b59
",
"reference": "
9affd46be10f1ebb11d5d9f03440f804c09f2b59
",
"shasum": ""
},
"require": {
...
...
@@ -1414,16 +1414,16 @@
},
{
"name": "laravel/framework",
"version": "v5.6.1
1
",
"version": "v5.6.1
2
",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "
195ba6a67bdad2a23105c7ab410cd43e0f20bb73
"
"reference": "
82d8165d1ea86bdd81ddfa1db9343fa19e7d1450
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/
195ba6a67bdad2a23105c7ab410cd43e0f20bb73
",
"reference": "
195ba6a67bdad2a23105c7ab410cd43e0f20bb73
",
"url": "https://api.github.com/repos/laravel/framework/zipball/
82d8165d1ea86bdd81ddfa1db9343fa19e7d1450
",
"reference": "
82d8165d1ea86bdd81ddfa1db9343fa19e7d1450
",
"shasum": ""
},
"require": {
...
...
@@ -1432,7 +1432,7 @@
"erusev/parsedown": "~1.7",
"ext-mbstring": "*",
"ext-openssl": "*",
"league/flysystem": "
~1.0
",
"league/flysystem": "
^1.0.8
",
"monolog/monolog": "~1.12",
"nesbot/carbon": "^1.24.1",
"php": "^7.1.3",
...
...
@@ -1548,7 +1548,7 @@
"framework",
"laravel"
],
"time": "2018-03-
09T16:53:27
+00:00"
"time": "2018-03-
14T17:29:38
+00:00"
},
{
"name": "laravel/socialite",
...
...
@@ -3935,16 +3935,16 @@
"packages-dev": [
{
"name": "barryvdh/laravel-debugbar",
"version": "v3.1.
3
",
"version": "v3.1.
4
",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-debugbar.git",
"reference": "
664fa434e26febf04d60df0368303cf0fe14f63a
"
"reference": "
7a91480cc6e597caed5117a3c5d685f06d35c5a1
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/
664fa434e26febf04d60df0368303cf0fe14f63a
",
"reference": "
664fa434e26febf04d60df0368303cf0fe14f63a
",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/
7a91480cc6e597caed5117a3c5d685f06d35c5a1
",
"reference": "
7a91480cc6e597caed5117a3c5d685f06d35c5a1
",
"shasum": ""
},
"require": {
...
...
@@ -3999,7 +3999,7 @@
"profiler",
"webprofiler"
],
"time": "2018-0
2-25T13:31:58
+00:00"
"time": "2018-0
3-06T08:35:31
+00:00"
},
{
"name": "bvipul/generator",
...
...
@@ -4352,16 +4352,16 @@
},
{
"name": "laravel/browser-kit-testing",
"version": "v4.0.
0
",
"version": "v4.0.
1
",
"source": {
"type": "git",
"url": "https://github.com/laravel/browser-kit-testing.git",
"reference": "
3ea22c4da537ca8af83746d583360e8e00081a01
"
"reference": "
d70283fd29ee9ec09d07a9c94cc5518b569cfeaf
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/browser-kit-testing/zipball/
3ea22c4da537ca8af83746d583360e8e00081a01
",
"reference": "
3ea22c4da537ca8af83746d583360e8e00081a01
",
"url": "https://api.github.com/repos/laravel/browser-kit-testing/zipball/
d70283fd29ee9ec09d07a9c94cc5518b569cfeaf
",
"reference": "
d70283fd29ee9ec09d07a9c94cc5518b569cfeaf
",
"shasum": ""
},
"require": {
...
...
@@ -4396,7 +4396,7 @@
"laravel",
"testing"
],
"time": "2018-0
2-08T16:44:18
+00:00"
"time": "2018-0
3-13T18:07:36
+00:00"
},
{
"name": "maximebf/debugbar",
...
...
public/js/backend/admin.js
View file @
7967d475
This diff is collapsed.
Click to expand it.
resources/assets/js/backend/app.js
View file @
7967d475
...
...
@@ -735,4 +735,16 @@ function _init() {
}
});
};
}(
jQuery
));
\ No newline at end of file
}(
jQuery
));
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
Vue
.
component
(
'
flash
'
,
require
(
'
../components/backend/Flash.vue
'
));
const
app
=
new
Vue
({
el
:
'
#app
'
});
\ No newline at end of file
resources/assets/js/bootstrap.js
View file @
7967d475
...
...
@@ -50,4 +50,10 @@ window.axios.defaults.headers.common = {
// var glob = require( 'glob' )
// , path = require( 'path' );
require
(
'
tinymce/tinymce
'
);
\ No newline at end of file
require
(
'
tinymce/tinymce
'
);
window
.
events
=
new
Vue
();
window
.
flash
=
function
(
message
,
type
)
{
window
.
events
.
$emit
(
'
flash
'
,
message
,
type
);
}
\ No newline at end of file
resources/assets/js/components/backend/Flash.vue
0 → 100644
View file @
7967d475
<
template
>
<div
:class=
"typeClass"
v-show=
"show"
>
{{
body
}}
</div>
</
template
>
<
script
>
export
default
{
props
:
[
'
message
'
,
'
type
'
],
data
()
{
return
{
body
:
''
,
typeClass
:
''
,
show
:
false
}
},
created
()
{
var
context
=
this
;
if
(
this
.
message
&&
this
.
type
)
{
this
.
flash
(
this
.
message
,
this
.
type
);
}
window
.
events
.
$on
(
'
flash
'
,
function
(
message
,
type
)
{
context
.
flash
(
message
,
type
);
});
},
methods
:
{
flash
(
message
,
type
)
{
this
.
body
=
message
;
this
.
typeClass
=
"
alert alert-
"
+
type
;
this
.
show
=
true
;
this
.
hide
();
},
hide
()
{
setTimeout
(()
=>
{
this
.
show
=
false
;
},
3000
);
}
}
}
</
script
>
resources/views/backend/layouts/app.blade.php
View file @
7967d475
...
...
@@ -42,9 +42,10 @@
</script>
</head>
<body
class=
"skin-{{ config('backend.theme') }} {{ config('backend.layout') }}"
>
<div
class=
"loading"
style=
"display:none"
></div>
@include('includes.partials.logged-in-as')
<div
class=
"wrapper"
>
<div
class=
"wrapper"
id=
"app"
>
@include('backend.includes.header')
@include('backend.includes.sidebar-dynamic')
...
...
resources/views/backend/menus/form.blade.php
View file @
7967d475
...
...
@@ -56,173 +56,7 @@
@section("after-scripts")
{{ Html::script('js/nestable2/jquery.nestable.js') }}
<script
type=
"text/javascript"
>
var
formName
=
'
_add_custom_url_form
'
;
var
lastId
=
null
;
$
(
'
#menu-items
'
).
nestable
({
callback
:
function
(
l
,
e
){
$
(
"
.menu-items-field
"
).
val
(
JSON
.
stringify
(
$
(
l
).
nestable
(
'
serialise
'
)));
},
json
:
$
(
"
.menu-items-field
"
).
val
(),
includeContent
:
true
,
scroll
:
false
,
maxDepth
:
10
});
$
(
"
.show-modal
"
).
click
(
function
(){
$
(
"
#showMenuModal
"
).
find
(
"
.modal-dialog .modal-content .modal-header .modal-title
"
).
html
(
$
(
this
).
attr
(
"
data-header
"
));
formName
=
$
(
this
).
attr
(
"
data-form
"
);
$
(
"
#showMenuModal
"
).
modal
(
"
show
"
);
setTimeout
(
function
()
{
$
(
document
).
find
(
"
#showMenuModal .view-permission-block
"
).
remove
();
$
(
document
).
find
(
"
#menu-add-custom-url
"
).
removeClass
(
"
hidden
"
);
},
500
);
});
$
(
"
#showMenuModal
"
).
on
(
'
show.bs.modal
'
,
function
()
{
$
.
get
(
"
{{ route('admin.menus.getform') }}/
"
+
formName
,
function
(
data
,
status
){
if
(
status
==
"
success
"
)
{
$
(
"
#showMenuModal
"
).
find
(
"
.modal-dialog .modal-content .modal-body
"
).
html
(
data
);
}
else
{
$
(
"
#showMenuModal
"
).
find
(
"
.modal-dialog .modal-content .modal-body
"
).
html
(
"
Something went wrong! Please try again later.
"
);
}
});
});
var
getNewId
=
function
(
str
)
{
var
arr
=
str
.
match
(
/"id":
[
0-9
]
+/gi
);
if
(
arr
)
{
$
.
each
(
arr
,
function
(
index
,
item
)
{
arr
[
index
]
=
parseInt
(
item
.
replace
(
'
"id":
'
,
''
));
});
return
Math
.
max
.
apply
(
Math
,
arr
)
+
1
;
}
return
1
;
}
var
addMenuItem
=
function
(
obj
)
{
$
(
'
#menu-items
'
).
nestable
(
'
add
'
,
{
"
id
"
:
getNewId
(
$
(
"
.menu-items-field
"
).
val
()),
"
content
"
:
obj
.
name
,
"
name
"
:
obj
.
name
,
"
url
"
:
obj
.
url
,
"
url_type
"
:
obj
.
url_type
,
"
open_in_new_tab
"
:
obj
.
open_in_new_tab
,
"
icon
"
:
obj
.
icon
,
"
view_permission_id
"
:
obj
.
view_permission_id
});
$
(
"
.menu-items-field
"
).
val
(
JSON
.
stringify
(
$
(
'
#menu-items
'
).
nestable
(
'
serialise
'
)));
}
var
editMenuItem
=
function
(
obj
)
{
var
newObject
=
{
"
id
"
:
obj
.
id
,
"
content
"
:
obj
.
name
,
"
name
"
:
obj
.
name
,
"
url
"
:
obj
.
url
,
"
url_type
"
:
obj
.
url_type
,
"
open_in_new_tab
"
:
obj
.
open_in_new_tab
,
"
icon
"
:
obj
.
icon
,
"
view_permission_id
"
:
obj
.
view_permission_id
};
var
menuItems
=
$
(
"
#menu-items
"
).
nestable
(
'
serialise
'
);
var
itemData
;
$
.
each
(
menuItems
,
function
(
index
,
item
){
itemData
=
findItemById
(
item
,
id
);
if
(
itemData
)
{
return
false
;
}
});
if
(
itemData
.
children
)
{
newObject
.
children
=
itemData
.
children
;
}
$
(
'
#menu-items
'
).
nestable
(
'
replace
'
,
newObject
);
$
(
"
.menu-items-field
"
).
val
(
JSON
.
stringify
(
$
(
'
#menu-items
'
).
nestable
(
'
serialise
'
)));
}
$
(
document
).
on
(
"
submit
"
,
"
#menu-add-custom-url
"
,
function
(
e
){
e
.
preventDefault
();
var
formData
=
$
(
this
).
serializeArray
().
reduce
(
function
(
obj
,
item
)
{
obj
[
item
.
name
]
=
item
.
value
;
return
obj
;
},
{});
if
(
formData
.
name
.
length
>
0
)
{
if
(
formData
.
id
.
length
>
0
)
{
editMenuItem
(
formData
);
}
else
{
addMenuItem
(
formData
);
}
$
(
"
#showMenuModal
"
).
modal
(
"
hide
"
);
}
});
$
(
document
).
on
(
"
click
"
,
"
.add-module-to-menu
"
,
function
(){
var
dataObj
=
{
id
:
$
(
this
).
attr
(
"
data-id
"
),
name
:
$
(
this
).
attr
(
"
data-name
"
),
url
:
$
(
this
).
attr
(
"
data-url
"
),
url_type
:
$
(
this
).
attr
(
"
data-url_type
"
),
open_in_new_tab
:
$
(
this
).
attr
(
"
data-open_in_new_tab
"
),
view_permission_id
:
$
(
this
).
attr
(
"
data-view_permission_id
"
),
}
addMenuItem
(
dataObj
);
});
var
findItemById
=
function
(
item
,
id
)
{
if
(
item
.
id
==
id
)
{
return
item
;
}
var
found
=
false
;
var
foundItem
;
if
(
item
.
children
){
$
.
each
(
item
.
children
,
function
(
index
,
childItem
){
foundItem
=
findItemById
(
childItem
,
id
);
if
(
foundItem
)
{
console
.
log
(
foundItem
);
found
=
true
;
return
false
;
}
});
}
if
(
found
)
{
return
foundItem
;
}
return
null
;
};
$
(
document
).
ready
(
function
(){
$
(
document
).
on
(
"
click
"
,
"
.edit-menu-item
"
,
function
()
{
id
=
$
(
this
).
parents
(
"
.dd-item
"
).
first
().
attr
(
"
data-id
"
);
$
(
"
#showMenuModal
"
).
modal
(
"
show
"
);
var
menuItems
=
$
(
"
#menu-items
"
).
nestable
(
'
serialise
'
);
var
itemData
;
$
.
each
(
menuItems
,
function
(
index
,
item
){
itemData
=
findItemById
(
item
,
id
);
//console.log(itemData);
if
(
itemData
)
{
return
false
;
}
});
if
(
itemData
.
id
!=
undefined
&&
itemData
.
id
==
id
)
{
setTimeout
(
function
()
{
$
(
"
#showMenuModal
"
).
find
(
"
.modal-dialog .modal-content .modal-header .modal-title
"
).
html
(
"
Edit:
"
+
itemData
.
name
);
$
(
document
).
find
(
"
#showMenuModal .mi-id
"
).
val
(
itemData
.
id
);
$
(
document
).
find
(
"
#showMenuModal .mi-name
"
).
val
(
itemData
.
name
);
$
(
document
).
find
(
"
#showMenuModal .mi-url
"
).
val
(
itemData
.
url
);
$
(
document
).
find
(
"
#showMenuModal .mi-url_type_
"
+
itemData
.
url_type
).
prop
(
"
checked
"
,
true
);
if
(
itemData
.
open_in_new_tab
==
1
)
{
$
(
document
).
find
(
"
#showMenuModal .mi-open_in_new_tab
"
).
prop
(
"
checked
"
,
true
);
}
$
(
document
).
find
(
"
#showMenuModal .mi-icon
"
).
val
(
itemData
.
icon
);
if
(
itemData
.
view_permission_id
)
{
$
(
document
).
find
(
"
#showMenuModal .mi-view_permission_id
"
).
val
(
itemData
.
view_permission_id
);
}
else
{
$
(
document
).
find
(
"
#showMenuModal .view-permission-block
"
).
remove
();
}
$
(
document
).
find
(
"
#menu-add-custom-url
"
).
removeClass
(
"
hidden
"
);
},
500
);
return
;
}
});
$
(
document
).
on
(
"
click
"
,
"
.remove-menu-item
"
,
function
()
{
$
(
"
#menu-items
"
).
nestable
(
'
remove
'
,
$
(
this
).
parents
(
"
.dd-item
"
).
first
().
attr
(
"
data-id
"
));
$
(
"
.menu-items-field
"
).
val
(
JSON
.
stringify
(
$
(
"
#menu-items
"
).
nestable
(
'
serialise
'
)));
});
});
Backend
.
Menu
.
selectors
.
formUrl
=
"
{{route('admin.menus.getform')}}
"
;
Backend
.
Menu
.
init
();
</script>
@endsection
resources/views/includes/partials/messages.blade.php
View file @
7967d475
@
php
$message
=
''
;
$type
=
''
;
@
endphp
@
if
(
$errors
->
any
())
<
div
class
="
alert
alert
-
danger
">
@foreach (
$errors->all
() as
$error
)
{!!
$error
!!}<br/>
@endforeach
</div>
@
php
$type
=
'danger'
;
@
endphp
@
foreach
(
$errors
->
all
()
as
$error
)
@
php
$message
.=
$error
.
'<br/>'
;
@
endphp
@
endforeach
@
elseif
(
session
()
->
get
(
'flash_success'
))
<div class="
alert
alert
-
success
">
@if(is_array(json_decode(session()->get('flash_success'), true)))
{!! implode('', session()->get('flash_success')->all(':message<br/>')) !!}
@else
{!! session()->get('flash_success') !!}
@endif
</div>
@
php
$type
=
'success'
;
@
endphp
@
if
(
is_array
(
json_decode
(
session
()
->
get
(
'flash_success'
),
true
)))
@
php
$message
=
implode
(
''
,
session
()
->
get
(
'flash_success'
)
->
all
(
':message<br/>'
));
@
endphp
@
else
@
php
$message
=
session
()
->
get
(
'flash_success'
);
@
endphp
@
endif
@
elseif
(
session
()
->
get
(
'flash_warning'
))
<div class="
alert
alert
-
warning
">
@if(is_array(json_decode(session()->get('flash_warning'), true)))
{!! implode('', session()->get('flash_warning')->all(':message<br/>')) !!}
@else
{!! session()->get('flash_warning') !!}
@endif
</div>
@
php
$type
=
'warning'
;
@
endphp
@
if
(
is_array
(
json_decode
(
session
()
->
get
(
'flash_warning'
),
true
)))
@
php
$message
=
implode
(
''
,
session
()
->
get
(
'flash_warning'
)
->
all
(
':message<br/>'
));
@
endphp
@
else
@
php
$message
=
session
()
->
get
(
'flash_warning'
);
@
endphp
@
endif
@
elseif
(
session
()
->
get
(
'flash_info'
))
<div class="
alert
alert
-
info
">
@if(is_array(json_decode(session()->get('flash_info'), true)))
{!! implode('', session()->get('flash_info')->all(':message<br/>')) !!}
@else
{!! session()->get('flash_info') !!}
@endif
</div>
@
php
$type
=
'info'
;
@
endphp
@
if
(
is_array
(
json_decode
(
session
()
->
get
(
'flash_info'
),
true
)))
@
php
$message
=
implode
(
''
,
session
()
->
get
(
'flash_info'
)
->
all
(
':message<br/>'
));
@
endphp
@
else
@
php
$message
=
session
()
->
get
(
'flash_info'
);
@
endphp
@
endif
@
elseif
(
session
()
->
get
(
'flash_danger'
))
<div class="
alert
alert
-
danger
">
@if(is_array(json_decode(session()->get('flash_danger'), true)))
{!! implode('', session()->get('flash_danger')->all(':message<br/>')) !!}
@else
{!! session()->get('flash_danger') !!}
@endif
</div>
@
php
$type
=
'danger'
;
@
endphp
@
if
(
is_array
(
json_decode
(
session
()
->
get
(
'flash_danger'
),
true
)))
@
php
$message
=
implode
(
''
,
session
()
->
get
(
'flash_danger'
)
->
all
(
':message<br/>'
));
@
endphp
@
else
@
php
$message
=
session
()
->
get
(
'flash_danger'
);
@
endphp
@
endif
@
elseif
(
session
()
->
get
(
'flash_message'
))
<div class="
alert
alert
-
info
">
@if(is_array(json_decode(session()->get('flash_message'), true)))
{!! implode('', session()->get('flash_message')->all(':message<br/>')) !!}
@else
{!! session()->get('flash_message') !!}
@endif
</div>
@endif
\ No newline at end of file
@
php
$type
=
'info'
;
@
endphp
@
if
(
is_array
(
json_decode
(
session
()
->
get
(
'flash_message'
),
true
)))
@
php
$message
=
implode
(
''
,
session
()
->
get
(
'flash_message'
)
->
all
(
':message<br/>'
));
@
endphp
@
else
@
php
$message
=
session
()
->
get
(
'flash_message'
);
@
endphp
@
endif
@
endif
<!--
Flash
Message
Vue
component
-->
<
flash
message
=
"{!!
$message
!!}"
type
=
"{{
$type
}}"
></
flash
>
\ No newline at end of file
webpack.mix.js
View file @
7967d475
...
...
@@ -21,6 +21,7 @@ mix.sass('resources/assets/sass/frontend/app.scss', 'public/css/frontend.css')
'
public/js/select2/select2.css
'
,
'
public/css/bootstrap.min.css
'
,
'
public/css/custom-style.css
'
,
'
public/css/loader.css
'
,
'
public/css/bootstrap-datetimepicker.min.css
'
],
'
public/css/backend-custom.css
'
)
.
js
([
...
...
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