KodeStar
7 years ago
32 changed files with 5533 additions and 37 deletions
@ -0,0 +1,189 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\Http\Controllers; |
||||
|
|
||||
|
use Illuminate\Http\Request; |
||||
|
use App\Item; |
||||
|
use DB; |
||||
|
|
||||
|
class TagController extends Controller |
||||
|
{ |
||||
|
/** |
||||
|
* Display a listing of the resource. |
||||
|
* |
||||
|
* @return \Illuminate\Http\Response |
||||
|
*/ |
||||
|
public function index(Request $request) |
||||
|
{ |
||||
|
$trash = (bool)$request->input('trash'); |
||||
|
|
||||
|
$data['apps'] = Item::ofType('tag')->orderBy('title', 'asc')->get(); |
||||
|
$data['trash'] = Item::ofType('tag')->onlyTrashed()->get(); |
||||
|
if($trash) { |
||||
|
return view('tags.trash', $data); |
||||
|
} else { |
||||
|
return view('tags.list', $data); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Show the form for creating a new resource. |
||||
|
* |
||||
|
* @return \Illuminate\Http\Response |
||||
|
*/ |
||||
|
public function create() |
||||
|
{ |
||||
|
$data = []; |
||||
|
return view('tags.create', $data); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Store a newly created resource in storage. |
||||
|
* |
||||
|
* @param \Illuminate\Http\Request $request |
||||
|
* @return \Illuminate\Http\Response |
||||
|
*/ |
||||
|
public function store(Request $request) |
||||
|
{ |
||||
|
$validatedData = $request->validate([ |
||||
|
'title' => 'required|max:255', |
||||
|
]); |
||||
|
|
||||
|
if($request->hasFile('file')) { |
||||
|
$path = $request->file('file')->store('icons'); |
||||
|
$request->merge([ |
||||
|
'icon' => $path |
||||
|
]); |
||||
|
} |
||||
|
|
||||
|
$slug = str_slug($request->title, '-'); |
||||
|
|
||||
|
// set item type to tag |
||||
|
$request->merge([ |
||||
|
'type' => '1', |
||||
|
'url' => $slug |
||||
|
]); |
||||
|
//die(print_r($request->all())); |
||||
|
Item::create($request->all()); |
||||
|
|
||||
|
return redirect()->route('dash') |
||||
|
->with('success', __('app.alert.success.tag_created')); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Display the specified resource. |
||||
|
* |
||||
|
* @param int $id |
||||
|
* @return \Illuminate\Http\Response |
||||
|
*/ |
||||
|
public function show($slug) |
||||
|
{ |
||||
|
$item = Item::whereUrl($slug)->first(); |
||||
|
//print_r($item); |
||||
|
$data['apps'] = $item->children()->pinned()->orderBy('order', 'asc')->get(); |
||||
|
$data['all_apps'] = $item->children; |
||||
|
return view('welcome', $data); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Show the form for editing the specified resource. |
||||
|
* |
||||
|
* @param int $id |
||||
|
* @return \Illuminate\Http\Response |
||||
|
*/ |
||||
|
public function edit($id) |
||||
|
{ |
||||
|
// Get the item |
||||
|
$item = Item::find($id); |
||||
|
|
||||
|
// show the edit form and pass the nerd |
||||
|
return view('tags.edit') |
||||
|
->with('item', $item); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Update the specified resource in storage. |
||||
|
* |
||||
|
* @param \Illuminate\Http\Request $request |
||||
|
* @param int $id |
||||
|
* @return \Illuminate\Http\Response |
||||
|
*/ |
||||
|
public function update(Request $request, $id) |
||||
|
{ |
||||
|
$validatedData = $request->validate([ |
||||
|
'title' => 'required|max:255', |
||||
|
]); |
||||
|
|
||||
|
if($request->hasFile('file')) { |
||||
|
$path = $request->file('file')->store('icons'); |
||||
|
$request->merge([ |
||||
|
'icon' => $path |
||||
|
]); |
||||
|
} |
||||
|
|
||||
|
$slug = str_slug($request->title, '-'); |
||||
|
// set item type to tag |
||||
|
$request->merge([ |
||||
|
'url' => $slug |
||||
|
]); |
||||
|
|
||||
|
Item::find($id)->update($request->all()); |
||||
|
|
||||
|
return redirect()->route('dash') |
||||
|
->with('success',__('app.alert.success.tag_updated')); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Remove the specified resource from storage. |
||||
|
* |
||||
|
* @param int $id |
||||
|
* @return \Illuminate\Http\Response |
||||
|
*/ |
||||
|
public function destroy(Request $request, $id) |
||||
|
{ |
||||
|
// |
||||
|
$force = (bool)$request->input('force'); |
||||
|
if($force) { |
||||
|
Item::withTrashed() |
||||
|
->where('id', $id) |
||||
|
->forceDelete(); |
||||
|
} else { |
||||
|
Item::find($id)->delete(); |
||||
|
} |
||||
|
|
||||
|
return redirect()->route('tags.index') |
||||
|
->with('success',__('app.alert.success.item_deleted')); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Restore the specified resource from soft deletion. |
||||
|
* |
||||
|
* @param int $id |
||||
|
* @return \Illuminate\Http\Response |
||||
|
*/ |
||||
|
public function restore($id) |
||||
|
{ |
||||
|
// |
||||
|
Item::withTrashed() |
||||
|
->where('id', $id) |
||||
|
->restore(); |
||||
|
return redirect()->route('tags.index') |
||||
|
->with('success',__('app.alert.success.item_restored')); |
||||
|
} |
||||
|
|
||||
|
public function add($tag, $item) |
||||
|
{ |
||||
|
$output = 0; |
||||
|
$tag = Item::find($tag); |
||||
|
$item = Item::find($item); |
||||
|
if($tag && $item) { |
||||
|
// only add items, not cats |
||||
|
if((int)$item->type === 0) { |
||||
|
$tag->children()->attach($item); |
||||
|
return 1; |
||||
|
} |
||||
|
} |
||||
|
return $output; |
||||
|
} |
||||
|
|
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,32 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use Illuminate\Support\Facades\Schema; |
||||
|
use Illuminate\Database\Schema\Blueprint; |
||||
|
use Illuminate\Database\Migrations\Migration; |
||||
|
|
||||
|
class AddColumnsToItemsForGroups extends Migration |
||||
|
{ |
||||
|
/** |
||||
|
* Run the migrations. |
||||
|
* |
||||
|
* @return void |
||||
|
*/ |
||||
|
public function up() |
||||
|
{ |
||||
|
Schema::table('items', function (Blueprint $table) { |
||||
|
$table->integer('type')->default(0)->index(); // 0 = item, 1 = category |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Reverse the migrations. |
||||
|
* |
||||
|
* @return void |
||||
|
*/ |
||||
|
public function down() |
||||
|
{ |
||||
|
Schema::table('items', function (Blueprint $table) { |
||||
|
$table->dropColumn(['type']); |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use Illuminate\Support\Facades\Schema; |
||||
|
use Illuminate\Database\Schema\Blueprint; |
||||
|
use Illuminate\Database\Migrations\Migration; |
||||
|
|
||||
|
class ItemTag extends Migration |
||||
|
{ |
||||
|
/** |
||||
|
* Run the migrations. |
||||
|
* |
||||
|
* @return void |
||||
|
*/ |
||||
|
public function up() |
||||
|
{ |
||||
|
Schema::create('item_tag', function (Blueprint $table) { |
||||
|
$table->integer('item_id')->unsigned()->index(); |
||||
|
$table->foreign('item_id')->references('id')->on('items')->onDelete('cascade'); |
||||
|
|
||||
|
$table->integer('tag_id')->unsigned()->index(); |
||||
|
$table->foreign('tag_id')->references('id')->on('items')->onDelete('cascade'); |
||||
|
$table->timestamps(); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Reverse the migrations. |
||||
|
* |
||||
|
* @return void |
||||
|
*/ |
||||
|
public function down() |
||||
|
{ |
||||
|
Schema::dropIfExists('item_tag'); |
||||
|
} |
||||
|
} |
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"/css/app.css": "/css/app.css" |
||||
|
} |
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@ |
|||||
{ |
{ |
||||
"/css/app.css": "/css/app.css?id=8ecb24c3817ea7885f13", |
"/css/app.css": "/css/app.css?id=098a3a1a2e45b2715547", |
||||
"/js/app.js": "/js/app.js?id=8dfc323d4d8919d6f3bf" |
"/js/app.js": "/js/app.js?id=aca509074429685069a4" |
||||
} |
} |
@ -0,0 +1,484 @@ |
|||||
|
.select2-container { |
||||
|
box-sizing: border-box; |
||||
|
display: inline-block; |
||||
|
margin: 0; |
||||
|
position: relative; |
||||
|
vertical-align: middle; } |
||||
|
.select2-container .select2-selection--single { |
||||
|
box-sizing: border-box; |
||||
|
cursor: pointer; |
||||
|
display: block; |
||||
|
height: 28px; |
||||
|
user-select: none; |
||||
|
-webkit-user-select: none; } |
||||
|
.select2-container .select2-selection--single .select2-selection__rendered { |
||||
|
display: block; |
||||
|
padding-left: 8px; |
||||
|
padding-right: 20px; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
white-space: nowrap; } |
||||
|
.select2-container .select2-selection--single .select2-selection__clear { |
||||
|
position: relative; } |
||||
|
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { |
||||
|
padding-right: 8px; |
||||
|
padding-left: 20px; } |
||||
|
.select2-container .select2-selection--multiple { |
||||
|
box-sizing: border-box; |
||||
|
cursor: pointer; |
||||
|
display: block; |
||||
|
min-height: 39px; |
||||
|
user-select: none; |
||||
|
-webkit-user-select: none; } |
||||
|
.select2-container .select2-selection--multiple .select2-selection__rendered { |
||||
|
display: inline-block; |
||||
|
overflow: hidden; |
||||
|
padding-left: 8px; |
||||
|
text-overflow: ellipsis; |
||||
|
white-space: nowrap; } |
||||
|
.select2-container .select2-search--inline { |
||||
|
float: left; } |
||||
|
.select2-container .select2-search--inline .select2-search__field { |
||||
|
box-sizing: border-box; |
||||
|
border: none; |
||||
|
font-size: 100%; |
||||
|
margin-top: 5px; |
||||
|
padding: 0; } |
||||
|
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button { |
||||
|
-webkit-appearance: none; } |
||||
|
|
||||
|
.select2-dropdown { |
||||
|
background-color: white; |
||||
|
border: 1px solid #aaa; |
||||
|
border-radius: 4px; |
||||
|
box-sizing: border-box; |
||||
|
display: block; |
||||
|
position: absolute; |
||||
|
left: -100000px; |
||||
|
width: 100%; |
||||
|
z-index: 1051; } |
||||
|
|
||||
|
.select2-results { |
||||
|
display: block; } |
||||
|
|
||||
|
.select2-results__options { |
||||
|
list-style: none; |
||||
|
margin: 0; |
||||
|
padding: 0; } |
||||
|
|
||||
|
.select2-results__option { |
||||
|
padding: 6px; |
||||
|
user-select: none; |
||||
|
-webkit-user-select: none; } |
||||
|
.select2-results__option[aria-selected] { |
||||
|
cursor: pointer; } |
||||
|
|
||||
|
.select2-container--open .select2-dropdown { |
||||
|
left: 0; } |
||||
|
|
||||
|
.select2-container--open .select2-dropdown--above { |
||||
|
border-bottom: none; |
||||
|
border-bottom-left-radius: 0; |
||||
|
border-bottom-right-radius: 0; } |
||||
|
|
||||
|
.select2-container--open .select2-dropdown--below { |
||||
|
border-top: none; |
||||
|
border-top-left-radius: 0; |
||||
|
border-top-right-radius: 0; } |
||||
|
|
||||
|
.select2-search--dropdown { |
||||
|
display: block; |
||||
|
padding: 4px; } |
||||
|
.select2-search--dropdown .select2-search__field { |
||||
|
padding: 4px; |
||||
|
width: 100%; |
||||
|
box-sizing: border-box; } |
||||
|
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button { |
||||
|
-webkit-appearance: none; } |
||||
|
.select2-search--dropdown.select2-search--hide { |
||||
|
display: none; } |
||||
|
|
||||
|
.select2-close-mask { |
||||
|
border: 0; |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
display: block; |
||||
|
position: fixed; |
||||
|
left: 0; |
||||
|
top: 0; |
||||
|
min-height: 100%; |
||||
|
min-width: 100%; |
||||
|
height: auto; |
||||
|
width: auto; |
||||
|
opacity: 0; |
||||
|
z-index: 99; |
||||
|
background-color: #fff; |
||||
|
filter: alpha(opacity=0); } |
||||
|
|
||||
|
.select2-hidden-accessible { |
||||
|
border: 0 !important; |
||||
|
clip: rect(0 0 0 0) !important; |
||||
|
-webkit-clip-path: inset(50%) !important; |
||||
|
clip-path: inset(50%) !important; |
||||
|
height: 1px !important; |
||||
|
overflow: hidden !important; |
||||
|
padding: 0 !important; |
||||
|
position: absolute !important; |
||||
|
width: 1px !important; |
||||
|
white-space: nowrap !important; } |
||||
|
|
||||
|
.select2-container--default .select2-selection--single { |
||||
|
background-color: #fff; |
||||
|
border: 1px solid #aaa; |
||||
|
border-radius: 4px; } |
||||
|
.select2-container--default .select2-selection--single .select2-selection__rendered { |
||||
|
color: #444; |
||||
|
line-height: 28px; } |
||||
|
.select2-container--default .select2-selection--single .select2-selection__clear { |
||||
|
cursor: pointer; |
||||
|
float: right; |
||||
|
font-weight: bold; } |
||||
|
.select2-container--default .select2-selection--single .select2-selection__placeholder { |
||||
|
color: #999; } |
||||
|
.select2-container--default .select2-selection--single .select2-selection__arrow { |
||||
|
height: 26px; |
||||
|
position: absolute; |
||||
|
top: 1px; |
||||
|
right: 1px; |
||||
|
width: 20px; } |
||||
|
.select2-container--default .select2-selection--single .select2-selection__arrow b { |
||||
|
border-color: #888 transparent transparent transparent; |
||||
|
border-style: solid; |
||||
|
border-width: 5px 4px 0 4px; |
||||
|
height: 0; |
||||
|
left: 50%; |
||||
|
margin-left: -4px; |
||||
|
margin-top: -2px; |
||||
|
position: absolute; |
||||
|
top: 50%; |
||||
|
width: 0; } |
||||
|
|
||||
|
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear { |
||||
|
float: left; } |
||||
|
|
||||
|
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow { |
||||
|
left: 1px; |
||||
|
right: auto; } |
||||
|
|
||||
|
.select2-container--default.select2-container--disabled .select2-selection--single { |
||||
|
background-color: #eee; |
||||
|
cursor: default; } |
||||
|
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear { |
||||
|
display: none; } |
||||
|
|
||||
|
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { |
||||
|
border-color: transparent transparent #888 transparent; |
||||
|
border-width: 0 4px 5px 4px; } |
||||
|
|
||||
|
.select2-container--default .select2-selection--multiple { |
||||
|
background-color: white; |
||||
|
border: 1px solid #dedfe2; |
||||
|
border-radius: 4px; |
||||
|
cursor: text; } |
||||
|
.select2-container--default .select2-selection--multiple .select2-selection__rendered { |
||||
|
box-sizing: border-box; |
||||
|
list-style: none; |
||||
|
margin: 0; |
||||
|
padding: 0 5px; |
||||
|
width: 100%; } |
||||
|
.select2-container--default .select2-selection--multiple .select2-selection__rendered li { |
||||
|
list-style: none; } |
||||
|
.select2-container--default .select2-selection--multiple .select2-selection__placeholder { |
||||
|
color: #999; |
||||
|
margin-top: 5px; |
||||
|
float: left; } |
||||
|
.select2-container--default .select2-selection--multiple .select2-selection__clear { |
||||
|
cursor: pointer; |
||||
|
float: right; |
||||
|
font-weight: bold; |
||||
|
margin-top: 5px; |
||||
|
margin-right: 10px; } |
||||
|
.select2-container--default .select2-selection--multiple .select2-selection__choice { |
||||
|
background-color: #e4e4e4; |
||||
|
border: 1px solid #aaa; |
||||
|
border-radius: 4px; |
||||
|
cursor: default; |
||||
|
float: left; |
||||
|
margin-right: 5px; |
||||
|
margin-top: 5px; |
||||
|
padding: 0 5px; } |
||||
|
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { |
||||
|
color: #999; |
||||
|
cursor: pointer; |
||||
|
display: inline-block; |
||||
|
font-weight: bold; |
||||
|
margin-right: 2px; } |
||||
|
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { |
||||
|
color: #333; } |
||||
|
|
||||
|
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline { |
||||
|
float: right; } |
||||
|
|
||||
|
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { |
||||
|
margin-left: 5px; |
||||
|
margin-right: auto; } |
||||
|
|
||||
|
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { |
||||
|
margin-left: 2px; |
||||
|
margin-right: auto; } |
||||
|
|
||||
|
.select2-container--default.select2-container--focus .select2-selection--multiple { |
||||
|
border: solid #dedfe2 1px; |
||||
|
outline: 0; } |
||||
|
|
||||
|
.select2-container--default.select2-container--disabled .select2-selection--multiple { |
||||
|
background-color: #eee; |
||||
|
cursor: default; } |
||||
|
|
||||
|
.select2-container--default.select2-container--disabled .select2-selection__choice__remove { |
||||
|
display: none; } |
||||
|
|
||||
|
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple { |
||||
|
border-top-left-radius: 0; |
||||
|
border-top-right-radius: 0; } |
||||
|
|
||||
|
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple { |
||||
|
border-bottom-left-radius: 0; |
||||
|
border-bottom-right-radius: 0; } |
||||
|
|
||||
|
.select2-container--default .select2-search--dropdown .select2-search__field { |
||||
|
border: 1px solid #aaa; } |
||||
|
|
||||
|
.select2-container--default .select2-search--inline .select2-search__field { |
||||
|
background: transparent; |
||||
|
border: none; |
||||
|
outline: 0; |
||||
|
box-shadow: none; |
||||
|
-webkit-appearance: textfield; } |
||||
|
|
||||
|
.select2-container--default .select2-results > .select2-results__options { |
||||
|
max-height: 200px; |
||||
|
overflow-y: auto; } |
||||
|
|
||||
|
.select2-container--default .select2-results__option[role=group] { |
||||
|
padding: 0; } |
||||
|
|
||||
|
.select2-container--default .select2-results__option[aria-disabled=true] { |
||||
|
color: #999; } |
||||
|
|
||||
|
.select2-container--default .select2-results__option[aria-selected=true] { |
||||
|
background-color: #ddd; } |
||||
|
|
||||
|
.select2-container--default .select2-results__option .select2-results__option { |
||||
|
padding-left: 1em; } |
||||
|
.select2-container--default .select2-results__option .select2-results__option .select2-results__group { |
||||
|
padding-left: 0; } |
||||
|
.select2-container--default .select2-results__option .select2-results__option .select2-results__option { |
||||
|
margin-left: -1em; |
||||
|
padding-left: 2em; } |
||||
|
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option { |
||||
|
margin-left: -2em; |
||||
|
padding-left: 3em; } |
||||
|
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { |
||||
|
margin-left: -3em; |
||||
|
padding-left: 4em; } |
||||
|
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { |
||||
|
margin-left: -4em; |
||||
|
padding-left: 5em; } |
||||
|
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { |
||||
|
margin-left: -5em; |
||||
|
padding-left: 6em; } |
||||
|
|
||||
|
.select2-container--default .select2-results__option--highlighted[aria-selected] { |
||||
|
background-color: #5897fb; |
||||
|
color: white; } |
||||
|
|
||||
|
.select2-container--default .select2-results__group { |
||||
|
cursor: default; |
||||
|
display: block; |
||||
|
padding: 6px; } |
||||
|
|
||||
|
.select2-container--classic .select2-selection--single { |
||||
|
background-color: #f7f7f7; |
||||
|
border: 1px solid #aaa; |
||||
|
border-radius: 4px; |
||||
|
outline: 0; |
||||
|
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%); |
||||
|
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%); |
||||
|
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%); |
||||
|
background-repeat: repeat-x; |
||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); } |
||||
|
.select2-container--classic .select2-selection--single:focus { |
||||
|
border: 1px solid #5897fb; } |
||||
|
.select2-container--classic .select2-selection--single .select2-selection__rendered { |
||||
|
color: #444; |
||||
|
line-height: 28px; } |
||||
|
.select2-container--classic .select2-selection--single .select2-selection__clear { |
||||
|
cursor: pointer; |
||||
|
float: right; |
||||
|
font-weight: bold; |
||||
|
margin-right: 10px; } |
||||
|
.select2-container--classic .select2-selection--single .select2-selection__placeholder { |
||||
|
color: #999; } |
||||
|
.select2-container--classic .select2-selection--single .select2-selection__arrow { |
||||
|
background-color: #ddd; |
||||
|
border: none; |
||||
|
border-left: 1px solid #aaa; |
||||
|
border-top-right-radius: 4px; |
||||
|
border-bottom-right-radius: 4px; |
||||
|
height: 26px; |
||||
|
position: absolute; |
||||
|
top: 1px; |
||||
|
right: 1px; |
||||
|
width: 20px; |
||||
|
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%); |
||||
|
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%); |
||||
|
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%); |
||||
|
background-repeat: repeat-x; |
||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); } |
||||
|
.select2-container--classic .select2-selection--single .select2-selection__arrow b { |
||||
|
border-color: #888 transparent transparent transparent; |
||||
|
border-style: solid; |
||||
|
border-width: 5px 4px 0 4px; |
||||
|
height: 0; |
||||
|
left: 50%; |
||||
|
margin-left: -4px; |
||||
|
margin-top: -2px; |
||||
|
position: absolute; |
||||
|
top: 50%; |
||||
|
width: 0; } |
||||
|
|
||||
|
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { |
||||
|
float: left; } |
||||
|
|
||||
|
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { |
||||
|
border: none; |
||||
|
border-right: 1px solid #aaa; |
||||
|
border-radius: 0; |
||||
|
border-top-left-radius: 4px; |
||||
|
border-bottom-left-radius: 4px; |
||||
|
left: 1px; |
||||
|
right: auto; } |
||||
|
|
||||
|
.select2-container--classic.select2-container--open .select2-selection--single { |
||||
|
border: 1px solid #5897fb; } |
||||
|
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow { |
||||
|
background: transparent; |
||||
|
border: none; } |
||||
|
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b { |
||||
|
border-color: transparent transparent #888 transparent; |
||||
|
border-width: 0 4px 5px 4px; } |
||||
|
|
||||
|
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single { |
||||
|
border-top: none; |
||||
|
border-top-left-radius: 0; |
||||
|
border-top-right-radius: 0; |
||||
|
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%); |
||||
|
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%); |
||||
|
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%); |
||||
|
background-repeat: repeat-x; |
||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); } |
||||
|
|
||||
|
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single { |
||||
|
border-bottom: none; |
||||
|
border-bottom-left-radius: 0; |
||||
|
border-bottom-right-radius: 0; |
||||
|
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%); |
||||
|
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%); |
||||
|
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%); |
||||
|
background-repeat: repeat-x; |
||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); } |
||||
|
|
||||
|
.select2-container--classic .select2-selection--multiple { |
||||
|
background-color: white; |
||||
|
border: 1px solid #aaa; |
||||
|
border-radius: 4px; |
||||
|
cursor: text; |
||||
|
outline: 0; } |
||||
|
.select2-container--classic .select2-selection--multiple:focus { |
||||
|
border: 1px solid #5897fb; } |
||||
|
.select2-container--classic .select2-selection--multiple .select2-selection__rendered { |
||||
|
list-style: none; |
||||
|
margin: 0; |
||||
|
padding: 0 5px; } |
||||
|
.select2-container--classic .select2-selection--multiple .select2-selection__clear { |
||||
|
display: none; } |
||||
|
.select2-container--classic .select2-selection--multiple .select2-selection__choice { |
||||
|
background-color: #e4e4e4; |
||||
|
border: 1px solid #aaa; |
||||
|
border-radius: 4px; |
||||
|
cursor: default; |
||||
|
float: left; |
||||
|
margin-right: 5px; |
||||
|
margin-top: 5px; |
||||
|
padding: 0 5px; } |
||||
|
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove { |
||||
|
color: #888; |
||||
|
cursor: pointer; |
||||
|
display: inline-block; |
||||
|
font-weight: bold; |
||||
|
margin-right: 2px; } |
||||
|
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover { |
||||
|
color: #555; } |
||||
|
|
||||
|
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { |
||||
|
float: right; |
||||
|
margin-left: 5px; |
||||
|
margin-right: auto; } |
||||
|
|
||||
|
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { |
||||
|
margin-left: 2px; |
||||
|
margin-right: auto; } |
||||
|
|
||||
|
.select2-container--classic.select2-container--open .select2-selection--multiple { |
||||
|
border: 1px solid #5897fb; } |
||||
|
|
||||
|
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple { |
||||
|
border-top: none; |
||||
|
border-top-left-radius: 0; |
||||
|
border-top-right-radius: 0; } |
||||
|
|
||||
|
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple { |
||||
|
border-bottom: none; |
||||
|
border-bottom-left-radius: 0; |
||||
|
border-bottom-right-radius: 0; } |
||||
|
|
||||
|
.select2-container--classic .select2-search--dropdown .select2-search__field { |
||||
|
border: 1px solid #aaa; |
||||
|
outline: 0; } |
||||
|
|
||||
|
.select2-container--classic .select2-search--inline .select2-search__field { |
||||
|
outline: 0; |
||||
|
box-shadow: none; } |
||||
|
|
||||
|
.select2-container--classic .select2-dropdown { |
||||
|
background-color: white; |
||||
|
border: 1px solid transparent; } |
||||
|
|
||||
|
.select2-container--classic .select2-dropdown--above { |
||||
|
border-bottom: none; } |
||||
|
|
||||
|
.select2-container--classic .select2-dropdown--below { |
||||
|
border-top: none; } |
||||
|
|
||||
|
.select2-container--classic .select2-results > .select2-results__options { |
||||
|
max-height: 200px; |
||||
|
overflow-y: auto; } |
||||
|
|
||||
|
.select2-container--classic .select2-results__option[role=group] { |
||||
|
padding: 0; } |
||||
|
|
||||
|
.select2-container--classic .select2-results__option[aria-disabled=true] { |
||||
|
color: grey; } |
||||
|
|
||||
|
.select2-container--classic .select2-results__option--highlighted[aria-selected] { |
||||
|
background-color: #3875d7; |
||||
|
color: white; } |
||||
|
|
||||
|
.select2-container--classic .select2-results__group { |
||||
|
cursor: default; |
||||
|
display: block; |
||||
|
padding: 6px; } |
||||
|
|
||||
|
.select2-container--classic.select2-container--open .select2-dropdown { |
||||
|
border-color: #5897fb; } |
@ -0,0 +1,12 @@ |
|||||
|
@extends('app') |
||||
|
|
||||
|
@section('content') |
||||
|
|
||||
|
{!! Form::open(array('route' => 'tags.store', 'id' => 'itemform', 'files' => true, 'method'=>'POST')) !!} |
||||
|
@include('tags.form') |
||||
|
{!! Form::close() !!} |
||||
|
|
||||
|
@endsection |
||||
|
@section('scripts') |
||||
|
@include('tags.scripts') |
||||
|
@endsection |
@ -0,0 +1,12 @@ |
|||||
|
@extends('app') |
||||
|
|
||||
|
@section('content') |
||||
|
|
||||
|
{!! Form::model($item, ['method' => 'PATCH', 'id' => 'itemform', 'files' => true, 'route' => ['tags.update', $item->id]]) !!} |
||||
|
@include('tags.form') |
||||
|
{!! Form::close() !!} |
||||
|
|
||||
|
@endsection |
||||
|
@section('scripts') |
||||
|
@include('tags.scripts') |
||||
|
@endsection |
@ -0,0 +1,76 @@ |
|||||
|
<section class="module-container"> |
||||
|
<header> |
||||
|
<div class="section-title">{{ __('app.apps.add_tag') }}</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('tags.index') }}" 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.apps.tag_name') }} *</label> |
||||
|
{!! Form::text('title', null, array('placeholder' => __('app.apps.title'), 'id' => 'appname', 'class' => 'form-control')) !!} |
||||
|
<hr /> |
||||
|
<label>{{ __('app.apps.pinned') }}</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')) !!} |
||||
|
<hr /> |
||||
|
</div> |
||||
|
<div class="input"> |
||||
|
<label>{{ __('app.apps.icon') }}</label> |
||||
|
<div class="icon-container"> |
||||
|
<div id="appimage"> |
||||
|
@if(isset($item->icon) && !empty($item->icon) || old('icon')) |
||||
|
<?php |
||||
|
if(isset($item->icon)) $icon = $item->icon; |
||||
|
else $icon = old('icon'); |
||||
|
?> |
||||
|
<img src="{{ asset('storage/'.$icon) }}" /> |
||||
|
{!! Form::hidden('icon', $icon, ['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> |
||||
|
|
||||
|
@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('tags.index') }}" class="button"><i class="fa fa-ban"></i><span>{{ __('app.buttons.cancel') }}</span></a> |
||||
|
</div> |
||||
|
</footer> |
||||
|
|
||||
|
</section> |
||||
|
|
||||
|
|
@ -0,0 +1,55 @@ |
|||||
|
@extends('app') |
||||
|
|
||||
|
@section('content') |
||||
|
<section class="module-container"> |
||||
|
<header> |
||||
|
<div class="section-title"> |
||||
|
{{ __('app.apps.tag_list') }} |
||||
|
@if( isset($trash) && $trash->count() > 0 ) |
||||
|
<a class="trashed" href="{{ route('tags.index', ['trash' => true]) }}">{{ __('app.apps.view_trash') }} ({{ $trash->count() }})</a> |
||||
|
@endif |
||||
|
|
||||
|
</div> |
||||
|
<div class="module-actions"> |
||||
|
<a href="{{ route('tags.create') }}" title="" class="button"><i class="fa fa-plus"></i><span>{{ __('app.buttons.add') }}</span></a> |
||||
|
</div> |
||||
|
</header> |
||||
|
|
||||
|
<table class="table table-hover"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>{{ __('app.title') }}</th> |
||||
|
<th>{{ __('app.url') }}</th> |
||||
|
<th class="text-center" width="100">{{ __('app.settings.edit') }}</th> |
||||
|
<th class="text-center" width="100">{{ __('app.delete') }}</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
@if($apps->first()) |
||||
|
@foreach($apps as $app) |
||||
|
<tr> |
||||
|
<td>{{ $app->title }}</td> |
||||
|
<td><a{{ $app->target }} href="{{ $app->url }}">{{ $app->link }}</a></td> |
||||
|
<td class="text-center"><a href="{!! route('tags.edit', $app->id) !!}" title="{{ __('app.settings.edit') }} {!! $app->title !!}"><i class="fas fa-edit"></i></a></td> |
||||
|
<td class="text-center"> |
||||
|
{!! Form::open(['method' => 'DELETE','route' => ['tags.destroy', $app->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.settings.no_items') }}</strong> |
||||
|
</td> |
||||
|
</tr> |
||||
|
@endif |
||||
|
|
||||
|
|
||||
|
</tbody> |
||||
|
</table> |
||||
|
</section> |
||||
|
|
||||
|
|
||||
|
@endsection |
@ -0,0 +1,34 @@ |
|||||
|
<script> |
||||
|
$( function() { |
||||
|
|
||||
|
var elem = $('.color-picker')[0]; |
||||
|
var hueb = new Huebee( elem, { |
||||
|
// options |
||||
|
}); |
||||
|
|
||||
|
var availableTags = [ |
||||
|
<?php |
||||
|
$supported = App\Item::supportedOptions(); |
||||
|
foreach($supported as $sapp) { |
||||
|
echo '"'.$sapp.'",'; |
||||
|
} |
||||
|
?> |
||||
|
]; |
||||
|
$( "#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"); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
</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('tags.index') }}" 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('tags.restore', $app->id) !!}" title="{{ __('app.restore') }} {!! $app->title !!}"><i class="fas fa-undo"></i></a></td> |
||||
|
<td class="text-center"> |
||||
|
{!! Form::open(['method' => 'DELETE','route' => ['tags.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 |
Loading…
Reference in new issue