Chris
6 years ago
21 changed files with 571 additions and 20 deletions
@ -0,0 +1,88 @@ |
|||
<?php |
|||
|
|||
namespace App\Http\Controllers; |
|||
|
|||
use Illuminate\Http\Request; |
|||
use App\Http\Controllers\Controller; |
|||
use App\User; |
|||
|
|||
class UserController extends Controller |
|||
{ |
|||
/** |
|||
* Display a listing of the resource. |
|||
* |
|||
* @return \Illuminate\Http\Response |
|||
*/ |
|||
public function index() |
|||
{ |
|||
$data['users'] = User::all(); |
|||
return view('users.index', $data); |
|||
} |
|||
|
|||
/** |
|||
* Show the form for creating a new resource. |
|||
* |
|||
* @return \Illuminate\Http\Response |
|||
*/ |
|||
public function create() |
|||
{ |
|||
$data = []; |
|||
return view('users.create', $data); |
|||
} |
|||
|
|||
/** |
|||
* Store a newly created resource in storage. |
|||
* |
|||
* @param \Illuminate\Http\Request $request |
|||
* @return \Illuminate\Http\Response |
|||
*/ |
|||
public function store(Request $request) |
|||
{ |
|||
// |
|||
} |
|||
|
|||
/** |
|||
* Display the specified resource. |
|||
* |
|||
* @param int $id |
|||
* @return \Illuminate\Http\Response |
|||
*/ |
|||
public function show($id) |
|||
{ |
|||
// |
|||
} |
|||
|
|||
/** |
|||
* Show the form for editing the specified resource. |
|||
* |
|||
* @param int $id |
|||
* @return \Illuminate\Http\Response |
|||
*/ |
|||
public function edit($id) |
|||
{ |
|||
// |
|||
} |
|||
|
|||
/** |
|||
* Update the specified resource in storage. |
|||
* |
|||
* @param \Illuminate\Http\Request $request |
|||
* @param int $id |
|||
* @return \Illuminate\Http\Response |
|||
*/ |
|||
public function update(Request $request, $id) |
|||
{ |
|||
// |
|||
} |
|||
|
|||
/** |
|||
* Remove the specified resource from storage. |
|||
* |
|||
* @param int $id |
|||
* @return \Illuminate\Http\Response |
|||
*/ |
|||
public function destroy($id) |
|||
{ |
|||
// |
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Support\Facades\Schema; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Database\Migrations\Migration; |
|||
|
|||
class CreateUsersTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('users', function (Blueprint $table) { |
|||
$table->increments('id'); |
|||
$table->string('name'); |
|||
$table->string('email')->unique(); |
|||
$table->string('avatar')->nullable(); |
|||
$table->string('password')->nullable(); |
|||
$table->boolean('public_front')->default(false); |
|||
$table->rememberToken(); |
|||
$table->timestamps(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('users'); |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Support\Facades\Schema; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Database\Migrations\Migration; |
|||
|
|||
class CreatePasswordResetsTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('password_resets', function (Blueprint $table) { |
|||
$table->string('email')->index(); |
|||
$table->string('token'); |
|||
$table->timestamp('created_at')->nullable(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('password_resets'); |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Support\Facades\Schema; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Database\Migrations\Migration; |
|||
|
|||
class AddUserIdToItemsTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::table('items', function (Blueprint $table) { |
|||
$table->integer('user_id')->default(1)->index(); // 0 = item, 1 = category |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::table('items', function (Blueprint $table) { |
|||
$table->dropColumn(['user_id']); |
|||
}); |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Seeder; |
|||
use App\User; |
|||
|
|||
class UsersSeeder extends Seeder |
|||
{ |
|||
/** |
|||
* Run the database seeds. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function run() |
|||
{ |
|||
// Groups |
|||
if(!$user = User::find(1)) { |
|||
$user = new User; |
|||
$user->id = 1; |
|||
$user->name = 'User'; |
|||
$user->email = 'test@test.com'; |
|||
$user->save(); |
|||
} else { |
|||
//$user->save(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,11 @@ |
|||
@extends('app') |
|||
|
|||
@section('content') |
|||
|
|||
{!! Form::open(array('route' => 'users.store', 'id' => 'itemform', 'files' => true, 'method'=>'POST')) !!} |
|||
@include('users.form') |
|||
{!! Form::close() !!} |
|||
|
|||
@endsection |
|||
@section('scripts') |
|||
@endsection |
@ -0,0 +1,11 @@ |
|||
@extends('app') |
|||
|
|||
@section('content') |
|||
|
|||
{!! Form::model($item, ['method' => 'PATCH', 'id' => 'itemform', 'files' => true, 'route' => ['users.update', $item->id]]) !!} |
|||
@include('users.form') |
|||
{!! Form::close() !!} |
|||
|
|||
@endsection |
|||
@section('scripts') |
|||
@endsection |
@ -0,0 +1,98 @@ |
|||
<section class="module-container"> |
|||
<header> |
|||
<div class="section-title">{{ __('app.user.add_user') }}</div> |
|||
<div class="module-actions"> |
|||
<button type="submit"class="button"><i class="fa fa-save"></i><span>{{ __('app.buttons.save') }}</span></button> |
|||
<a href="{{ route('items.index', [], false) }}" class="button"><i class="fa fa-ban"></i><span>{{ __('app.buttons.cancel') }}</span></a> |
|||
</div> |
|||
</header> |
|||
<div id="create" class="create"> |
|||
{!! csrf_field() !!} |
|||
|
|||
<div class="input"> |
|||
<label>{{ __('app.user.name') }} *</label> |
|||
{!! Form::text('name', null, array('placeholder' => __('app.user.name'), 'id' => 'appname', 'class' => 'form-control')) !!} |
|||
<hr /> |
|||
<label>{{ __('app.user.name') }} *</label> |
|||
{!! Form::text('title', null, array('placeholder' => __('app.apps.title'), 'id' => 'appname', 'class' => 'form-control')) !!} |
|||
<hr /> |
|||
|
|||
</div> |
|||
<div class="input"> |
|||
<label>{{ __('app.user.email') }} *</label> |
|||
{!! Form::text('email', null, array('placeholder' => 'email@test.com','class' => 'form-control')) !!} |
|||
<hr /> |
|||
<label>{{ __('app.user.email') }} *</label> |
|||
{!! Form::text('colour', null, array('placeholder' => __('app.apps.hex'),'class' => 'form-control color-picker')) !!} |
|||
<hr /> |
|||
</div> |
|||
<div class="input"> |
|||
<label>{{ __('app.user.avatar') }}</label> |
|||
<div class="icon-container"> |
|||
<div id="appimage"> |
|||
@if(isset($item->avatar) && !empty($item->avatar) || old('avatar')) |
|||
<?php |
|||
if(isset($item->avatar)) $avatar = $item->avatar; |
|||
else $avatar = old('avatar'); |
|||
?> |
|||
<img src="{{ asset('storage/'.$avatar) }}" /> |
|||
{!! Form::hidden('avatar', $avatar, ['class' => 'form-control']) !!} |
|||
@else |
|||
<img src="/img/heimdall-icon-small.png" /> |
|||
@endif |
|||
</div> |
|||
<div class="upload-btn-wrapper"> |
|||
<button class="btn">{{ __('app.buttons.upload')}} </button> |
|||
<input type="file" id="upload" name="file" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div style="margin-top: -40px; width: 100%; padding: 0" class="create"> |
|||
<div class="input"> |
|||
<label>{{ __('app.user.name') }} *</label> |
|||
{!! Form::text('title', null, array('placeholder' => __('app.apps.title'), 'id' => 'appname', 'class' => 'form-control')) !!} |
|||
<hr /> |
|||
<label>{{ __('app.user.secure_front') }}</label> |
|||
{!! Form::hidden('pinned', '0') !!} |
|||
<label class="switch"> |
|||
<?php |
|||
$checked = false; |
|||
if(isset($item->pinned) && (bool)$item->pinned === true) $checked = true; |
|||
$set_checked = ($checked) ? ' checked="checked"' : ''; |
|||
?> |
|||
<input type="checkbox" name="pinned" value="1"<?php echo $set_checked;?> /> |
|||
<span class="slider round"></span> |
|||
</label> |
|||
|
|||
</div> |
|||
<div class="input"> |
|||
<label>{{ __('app.apps.colour') }} *</label> |
|||
{!! Form::text('colour', null, array('placeholder' => __('app.apps.hex'),'class' => 'form-control color-picker')) !!} |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
@if(isset($item) && isset($item->config->view)) |
|||
<div id="sapconfig" style="display: block;"> |
|||
@if(isset($item)) |
|||
@include('supportedapps.'.$item->config->view) |
|||
@endif |
|||
</div> |
|||
@else |
|||
<div id="sapconfig"></div> |
|||
@endif |
|||
|
|||
</div> |
|||
<footer> |
|||
<div class="section-title"> </div> |
|||
<div class="module-actions"> |
|||
<button type="submit"class="button"><i class="fa fa-save"></i><span>{{ __('app.buttons.save') }}</span></button> |
|||
<a href="{{ route('items.index', [], false) }}" class="button"><i class="fa fa-ban"></i><span>{{ __('app.buttons.cancel') }}</span></a> |
|||
</div> |
|||
</footer> |
|||
|
|||
</section> |
|||
|
|||
|
@ -0,0 +1,56 @@ |
|||
@extends('app') |
|||
|
|||
@section('content') |
|||
<section class="module-container"> |
|||
<header> |
|||
<div class="section-title"> |
|||
{{ __('app.user.user_list') }} |
|||
@if( isset($trash) && $trash->count() > 0 ) |
|||
<a class="trashed" href="{{ route('users.index', ['trash' => true], false) }}">{{ __('app.apps.view_trash') }} ({{ $trash->count() }})</a> |
|||
@endif |
|||
|
|||
</div> |
|||
<div class="module-actions"> |
|||
<a href="{{ route('users.create', [], false) }}" title="" class="button"><i class="fa fa-plus"></i><span>{{ __('app.buttons.add') }}</span></a> |
|||
<a href="{{ route('dash', [], false) }}" class="button"><i class="fa fa-ban"></i><span>{{ __('app.buttons.cancel') }}</span></a> |
|||
</div> |
|||
</header> |
|||
|
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th>{{ __('app.user.name') }}</th> |
|||
<th>{{ __('app.apps.password') }}</th> |
|||
<th class="text-center" width="100">{{ __('app.settings.edit') }}</th> |
|||
<th class="text-center" width="100">{{ __('app.delete') }}</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
@if($users->first()) |
|||
@foreach($users as $user) |
|||
<tr> |
|||
<td>{{ $user->name }}</td> |
|||
<td><i class="fa {{ (!is_null($user->password) ? 'fa-check' : 'fa-times') }}" /></td> |
|||
<td class="text-center"><a{{ $user->target }} href="{!! route('users.edit', [$user->id], false) !!}" title="{{ __('user.settings.edit') }} {!! $user->title !!}"><i class="fas fa-edit"></i></a></td> |
|||
<td class="text-center"> |
|||
{!! Form::open(['method' => 'DELETE','route' => ['users.destroy', $user->id],'style'=>'display:inline']) !!} |
|||
<button class="link" type="submit"><i class="fa fa-trash-alt"></i></button> |
|||
{!! Form::close() !!} |
|||
</td> |
|||
</tr> |
|||
@endforeach |
|||
@else |
|||
<tr> |
|||
<td colspan="4" class="form-error text-center"> |
|||
<strong>{{ __('app.user.settings.no_items') }}</strong> |
|||
</td> |
|||
</tr> |
|||
@endif |
|||
|
|||
|
|||
</tbody> |
|||
</table> |
|||
</section> |
|||
|
|||
|
|||
@endsection |
@ -0,0 +1,32 @@ |
|||
<script src="/js/select2.min.js"></script> |
|||
<script> |
|||
$( function() { |
|||
|
|||
var elem = $('.color-picker')[0]; |
|||
var hueb = new Huebee( elem, { |
|||
// options |
|||
}); |
|||
|
|||
var availableTags = @json(App\Item::supportedOptions()); |
|||
|
|||
$( "#appname" ).autocomplete({ |
|||
source: availableTags, |
|||
select: function( event, ui ) { |
|||
$.post('/appload', { app: ui.item.value }, function(data) { |
|||
$('#appimage').html("<img src='/storage/"+data.icon+"' /><input type='hidden' name='icon' value='"+data.icon+"' />"); |
|||
$('input[name=colour]').val(data.colour); |
|||
hueb.setColor( data.colour ); |
|||
$('input[name=pinned]').prop('checked', true); |
|||
if(data.config != null) { |
|||
$.get('/view/'+data.config, function(getdata) { |
|||
$('#sapconfig').html(getdata).show(); |
|||
}); |
|||
} |
|||
}, "json"); |
|||
} |
|||
}); |
|||
|
|||
$('.tags').select2(); |
|||
|
|||
}); |
|||
</script> |
@ -0,0 +1,52 @@ |
|||
@extends('app') |
|||
|
|||
@section('content') |
|||
<section class="module-container"> |
|||
<header> |
|||
<div class="section-title"> |
|||
Showing Deleted Applications |
|||
</div> |
|||
<div class="module-actions"> |
|||
<a href="{{ route('items.index', [], false) }}" title="" class="button"><i class="fa fa-ban"></i><span>{{ __('app.buttons.cancel') }}</span></a> |
|||
</div> |
|||
</header> |
|||
|
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th>{{ __('app.title') }}</th> |
|||
<th>Url</th> |
|||
<th class="text-center" width="100">{{ __('app.restore') }}</th> |
|||
<th class="text-center" width="100">{{ __('app.delete') }}</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
@if($trash->first()) |
|||
@foreach($trash as $app) |
|||
<tr> |
|||
<td>{{ $app->title }}</td> |
|||
<td>{{ __('app.url') }}</td> |
|||
<td class="text-center"><a href="{!! route('items.restore', [$app->id], false) !!}" title="{{ __('app.restore') }} {!! $app->title !!}"><i class="fas fa-undo"></i></a></td> |
|||
<td class="text-center"> |
|||
{!! Form::open(['method' => 'DELETE','route' => ['items.destroy', $app->id],'style'=>'display:inline']) !!} |
|||
<input type="hidden" name="force" value="1" /> |
|||
<button type="submit"><i class="fa fa-trash-alt"></i></button> |
|||
{!! Form::close() !!} |
|||
</td> |
|||
</tr> |
|||
@endforeach |
|||
@else |
|||
<tr> |
|||
<td colspan="5" class="form-error text-center"> |
|||
<strong>{{ __('app.settings.no_items') }}</strong> |
|||
</td> |
|||
</tr> |
|||
@endif |
|||
|
|||
|
|||
</tbody> |
|||
</table> |
|||
</section> |
|||
|
|||
|
|||
@endsection |
@ -1,21 +1,56 @@ |
|||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ |
|||
Upstream-Name: Composer |
|||
Upstream-Contact: Jordi Boggiano <j.boggiano@seld.be> |
|||
Source: https://github.com/composer/composer |
|||
|
|||
Copyright (c) Nils Adermann, Jordi Boggiano |
|||
Files: * |
|||
Copyright: 2016, Nils Adermann <naderman@naderman.de> |
|||
2016, Jordi Boggiano <j.boggiano@seld.be> |
|||
License: Expat |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
of this software and associated documentation files (the "Software"), to deal |
|||
in the Software without restriction, including without limitation the rights |
|||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
copies of the Software, and to permit persons to whom the Software is furnished |
|||
to do so, subject to the following conditions: |
|||
Files: src/Composer/Util/TlsHelper.php |
|||
Copyright: 2016, Nils Adermann <naderman@naderman.de> |
|||
2016, Jordi Boggiano <j.boggiano@seld.be> |
|||
2013, Evan Coury <me@evancoury.com> |
|||
License: Expat and BSD-2-Clause |
|||
|
|||
The above copyright notice and this permission notice shall be included in all |
|||
copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|||
THE SOFTWARE. |
|||
License: BSD-2-Clause |
|||
Redistribution and use in source and binary forms, with or without modification, |
|||
are permitted provided that the following conditions are met: |
|||
. |
|||
* Redistributions of source code must retain the above copyright notice, |
|||
this list of conditions and the following disclaimer. |
|||
. |
|||
* Redistributions in binary form must reproduce the above copyright notice, |
|||
this list of conditions and the following disclaimer in the documentation |
|||
and/or other materials provided with the distribution. |
|||
. |
|||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
|||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
|||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
|||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|||
|
|||
License: Expat |
|||
Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
of this software and associated documentation files (the "Software"), to deal |
|||
in the Software without restriction, including without limitation the rights |
|||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
copies of the Software, and to permit persons to whom the Software is furnished |
|||
to do so, subject to the following conditions: |
|||
. |
|||
The above copyright notice and this permission notice shall be included in all |
|||
copies or substantial portions of the Software. |
|||
. |
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|||
THE SOFTWARE. |
|||
|
Loading…
Reference in new issue