-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fonts, async component, fixed modals, Link panel
- Loading branch information
Jan Loufek
committed
Jan 20, 2020
1 parent
187c0d7
commit 57f129b
Showing
18 changed files
with
193 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Chap\AdminLTE\Components\LazyScreen; | ||
|
||
use Nette\Application\UI\Control; | ||
use Nette\Bridges\ApplicationLatte\Template; | ||
use Nette\ComponentModel\IComponent; | ||
|
||
class LazyScreen extends Control | ||
{ | ||
/** | ||
* @var bool | ||
*/ | ||
public $loaded = false; | ||
|
||
/** | ||
* @var callable | ||
*/ | ||
private $factoryCallback; | ||
|
||
/** | ||
* @param callable $factory | ||
*/ | ||
public function __construct(callable $factory) | ||
{ | ||
$this->factoryCallback = $factory; | ||
} | ||
|
||
public function handleLoad(): void | ||
{ | ||
$this->loaded = true; | ||
$this->redrawControl('async'); | ||
} | ||
|
||
/** | ||
* @return IComponent|null | ||
*/ | ||
protected function createComponentAsync(): ?IComponent | ||
{ | ||
return call_user_func($this->factoryCallback); | ||
} | ||
|
||
public function render(): void | ||
{ | ||
/** @var Template $template */ | ||
$template = $this->getTemplate(); | ||
$template->render(__DIR__ . DIRECTORY_SEPARATOR . 'template.latte', ['isLoaded' => $this->loaded]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{snippet async} | ||
<div class="well"> | ||
{if $isLoaded} | ||
{control async} | ||
{else} | ||
<a n:href="load!" class="async-load ajax"></a> | ||
<div class="spinner-border" role="status"><span class="sr-only">Loading...</span></div> | ||
{/if} | ||
</div> | ||
{/snippet} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Chap\AdminLTE\Notifications; | ||
|
||
class LinkPanel extends BasePanel | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->setIcon('envelope') | ||
->setIsDropdown(false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
$("[modal]").unbind("click"); | ||
|
||
$("[modal]").click(function(e) { | ||
e.preventDefault(); | ||
$.ajax({ | ||
type: 'GET', | ||
url: $(this).attr("href"), | ||
data: {lte_no_layout: 1}, | ||
success: function (r) { | ||
$("#modal .modal-content").html('<div class="mdl">'+r+'</div>'); | ||
$("#modal").modal("show"); | ||
} | ||
function initModals() { | ||
$("[modal]").not(".modal-init").click(function(e) { | ||
e.preventDefault(); | ||
$.ajax({ | ||
type: 'GET', | ||
url: $(this).attr("href"), | ||
data: {lte_no_layout: 1}, | ||
success: function (r) { | ||
$("#modal .modal-content").html('<div class="mdl">'+r+'</div>'); | ||
$("#modal").modal("show"); | ||
} | ||
}); | ||
}); | ||
$("[modal]").not(".modal-init").addClass("modal-init"); | ||
} | ||
|
||
initModals(); | ||
$(document).ajaxComplete(function() { | ||
console.log(111); | ||
initModals(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
$(function () { | ||
$.nette.init(); | ||
}); | ||
|
||
$( document ).ready(function() { | ||
$("a.async-load").each(function () { | ||
$.nette.ajax({ off: ['unique'], "url": this.getAttribute("href")}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$('.sidebar-toggle').click(function(event) { | ||
event.preventDefault(); | ||
if (Boolean(sessionStorage.getItem('sidebar-toggle-collapsed'))) { | ||
sessionStorage.setItem('sidebar-toggle-collapsed', ''); | ||
document.cookie = "sidebar-toggle-collapsed=0;path=/"; | ||
} else { | ||
sessionStorage.setItem('sidebar-toggle-collapsed', '1'); | ||
document.cookie = "sidebar-toggle-collapsed=1;path=/"; | ||
} | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,37 @@ | ||
<body class="skin-{$skin} hold-transition sidebar-mini"> | ||
<body class="skin-{$skin} hold-transition sidebar-mini {if $collapsedMenu}sidebar-collapse{/if}"> | ||
<div class="wrapper"> | ||
|
||
{include "header.latte"} | ||
|
||
<aside class="main-sidebar sidebar-dark-primary"> | ||
<a href="{plink Homepage:}" class="brand-link"> | ||
<span class="brand-text"><b>Admin</b>LTE</span> | ||
<span class="brand-text">{$brand|noescape}</span> | ||
</a> | ||
<div class="sidebar"> | ||
{if $search === 'sidebar'} | ||
{form search class=>"form-inline"} | ||
<div class="input-group"> | ||
{input q class=> "form-control", placeholder=> "Search ..."} | ||
<span class="input-group-btn">{input submit class=>"btn btn-sidebar"}</span> | ||
{if $search === 'sidebar'} | ||
{form search class=>"form-inline"} | ||
<div class="input-group"> | ||
{input q class=> "form-control form-control-sidebar", placeholder=> "Search ...", type => "search"} | ||
<div class="input-group-append"> | ||
{input submit class=>"btn btn-sidebar"} | ||
</div> | ||
{/form} | ||
{/if} | ||
|
||
</div> | ||
{/form} | ||
{/if} | ||
<div class="sidebar"> | ||
{control menu:menu} | ||
</div> | ||
</aside> | ||
<div class="content-wrapper px-4 py-2"> | ||
{control menu:breadcrumb} | ||
<div class="container-fluid"> | ||
{snippet flash} | ||
<div n:foreach="$presenter->template->flashes as $flash" class="alert alert-{$flash->type}" n:block="flashes"> | ||
<div n:foreach="$presenter->template->flashes as $flash" | ||
class="alert alert-{$flash->type}" n:block="flashes"> | ||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||
{$flash->message|translate} | ||
</div> | ||
{/snippet} | ||
{$content|noescape} | ||
</div> | ||
</div> | ||
|
||
{include "footer.latte"} | ||
|
||
</div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<section class="content"> | ||
<section class="modal-body"> | ||
{$content|noescape} | ||
</section> |