mirror of
https://github.com/linuxserver/Heimdall.git
synced 2026-02-21 12:10:34 +09:00
fixes to alerts and soft deleting
This commit is contained in:
18
resources/assets/js/app.js
vendored
18
resources/assets/js/app.js
vendored
@@ -1,7 +1,14 @@
|
||||
$.when( $.ready ).then(function() {
|
||||
|
||||
|
||||
|
||||
if($('.message-container').length) {
|
||||
setTimeout(
|
||||
function()
|
||||
{
|
||||
$('.message-container').fadeOut();
|
||||
}, 3500);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$( "#sortable" ).sortable({
|
||||
stop: function (event, ui) {
|
||||
@@ -41,12 +48,17 @@ $.when( $.ready ).then(function() {
|
||||
}, 350);
|
||||
|
||||
}
|
||||
}).on('click', '#add-item', function(e) {
|
||||
}).on('click', '#add-item, #pin-item', function(e) {
|
||||
e.preventDefault();
|
||||
var app = $('#app');
|
||||
var active = (app.hasClass('sidebar'));
|
||||
app.toggleClass('sidebar');
|
||||
|
||||
}).on('click', '.close-sidenav', function(e) {
|
||||
e.preventDefault();
|
||||
var app = $('#app');
|
||||
app.removeClass('sidebar');
|
||||
|
||||
});
|
||||
$('#pinlist').on('click', 'a', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
63
resources/assets/sass/_app.scss
vendored
63
resources/assets/sass/_app.scss
vendored
@@ -96,11 +96,52 @@ body {
|
||||
}
|
||||
.message-container {
|
||||
width: 100%;
|
||||
.alert {
|
||||
margin: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
padding: 10px 20px;
|
||||
}
|
||||
.message-container2 {
|
||||
width: 100%;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
.alert {
|
||||
margin: 30px auto;
|
||||
text-align: center;
|
||||
max-width: 800px;
|
||||
background: #f1f4f7;
|
||||
padding: 5px 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-left: 80px;
|
||||
box-shadow: 0 0 15px 3px rgba(0,0,0,0.3);
|
||||
&.alert-success, &.alert-danger {
|
||||
position: relative;
|
||||
&:before {
|
||||
content: "\f00c";
|
||||
font-family: 'Font Awesome 5 Pro';
|
||||
font-weight: 900;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 60px;
|
||||
background: #1cd41c;
|
||||
text-align: center;
|
||||
color: white;
|
||||
line-height: 57px;
|
||||
font-size: 24px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
&.alert-danger {
|
||||
&:before {
|
||||
content: "\f00d";
|
||||
background: #c00;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#app {
|
||||
&.header {
|
||||
.appheader {
|
||||
@@ -343,9 +384,18 @@ div.create {
|
||||
}
|
||||
|
||||
.sidenav {
|
||||
position: relative;
|
||||
.close-sidenav {
|
||||
position: absolute;
|
||||
top:20px;
|
||||
right: 20px;
|
||||
font-size: 24px;
|
||||
color: #ccc;
|
||||
}
|
||||
h2 {
|
||||
font-weight: 300;
|
||||
padding: 20px;
|
||||
margin: 0;
|
||||
}
|
||||
ul {
|
||||
list-style: none;
|
||||
@@ -363,4 +413,9 @@ div.create {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.trashed {
|
||||
font-size: 11px;
|
||||
color: #91a1b3;
|
||||
margin-left: 20px;
|
||||
}
|
||||
@@ -13,6 +13,7 @@
|
||||
<body>
|
||||
<div id="app">
|
||||
<nav class="sidenav">
|
||||
<a class="close-sidenav" href=""><i class="fas fa-times-circle"></i></a>
|
||||
@if(isset($all_apps))
|
||||
<h2>Pinned Items</h2>
|
||||
<ul id="pinlist">
|
||||
@@ -41,7 +42,7 @@
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if (count($errors) < 0)
|
||||
@if (count($errors) > 0)
|
||||
<div class="message-container">
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
|
||||
@@ -3,7 +3,13 @@
|
||||
@section('content')
|
||||
<section class="module-container">
|
||||
<header>
|
||||
<div class="section-title">Application list</div>
|
||||
<div class="section-title">
|
||||
Application list
|
||||
@if( isset($trash) && $trash->count() > 0 )
|
||||
<a class="trashed" href="{{ route('items.index', ['trash' => true]) }}">View trash ({{ $trash->count() }})</a>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<div class="module-actions">
|
||||
<a href="{{ route('items.create') }}" title="" class="button"><i class="fa fa-plus"></i><span>Add</span></a>
|
||||
</div>
|
||||
|
||||
54
resources/views/items/trash.blade.php
Normal file
54
resources/views/items/trash.blade.php
Normal file
@@ -0,0 +1,54 @@
|
||||
@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') }}" title="" class="button"><i class="fa fa-ban"></i><span>Cancel</span></a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Description</th>
|
||||
<th>Url</th>
|
||||
<th class="text-center" width="100">Restore</th>
|
||||
<th class="text-center" width="100">Delete</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($trash->first())
|
||||
@foreach($trash as $app)
|
||||
<tr>
|
||||
<td>{{ $app->title }}</td>
|
||||
<td>{{ $app->description }}</td>
|
||||
<td>{{ $app->url }}</td>
|
||||
<td class="text-center"><a href="{!! route('items.restore', $app->id) !!}" title="Restore {!! $app->title !!}"><i class="fas fa-edit"></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>No items found</strong>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
|
||||
@endsection
|
||||
@@ -4,8 +4,15 @@
|
||||
@if($apps->first())
|
||||
@include('sortable')
|
||||
@else
|
||||
There are currently no Applications, <a href="{{ route('items.create') }}">add one here</a>
|
||||
<div class="message-container2">
|
||||
<div class="alert alert-danger">
|
||||
<p>There are currently no pinned Applications, <a href="{{ route('items.create') }}">Add an application here</a> or <a id="pin-item" href="">Pin an item to the dash</a></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="sortable">
|
||||
@include('add')
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user