public function createTemplate($class = NULL)
{
$template = parent::createTemplate($class);
$template->addFilter('streakBar', function($s, $maxBar = 5, $paramId){
if ($paramId == 1470)
{
$streakBar = \Nette\Utils\Html::el('div')->addClass('streak-bar');
$off = $maxBar - $s;
$on = $s;
for ($i = 1; $i <= $on; $i++)
{
$onBar = \Nette\Utils\Html::el('div')->addClass('bar on');
$streakBar->add($onBar);
}
for ($i = 1; $i <= $off; $i++)
{
$offBar = \Nette\Utils\Html::el('div')->addClass('bar off');
$streakBar->add($offBar);
}
return $streakBar->addTitle($on . '/' . $maxBar);
}
return $s;
});
return $template;
}
<?php
$mpdf = new \mPDF('utf-8','A4','','',12,12,2,2,10,10, 'P');
$mpdf->useOnlyCoreFonts = true;
$mpdf->SetDisplayMode('fullpage');
$this->template->setFile(INDEX_DIR . '/app/FrontModule/templates/ConfigIt/pdf.latte');
$mpdf->WriteHTML((string) $this->template);
$mpdf->Output($name, 'd');
$this->terminate();
(function($, undefined) {
$.nette.ext('spinner', {
init: function () {
spinner = $('<div></div>', { id: "ajax-spinner" });
spinner.appendTo("body");
},
before: function (xhr, settings) {
$("#ajax-spinner").css({
visibility: "visible",
left: settings.nette.e.pageX,
top: settings.nette.e.pageY
});
},
complete: function () {
$("#ajax-spinner").css({
visibility: "hidden"
});
}
});
})(jQuery);
$(document).on('click', function(e){
if ($(e.target).closest('.user-sign-in-form').length === 0)
{
$('.user-sign-in-form').fadeToggle();
}
});
$('li').replaceWith(function(){
return $("<div />").append($(this).contents());
});
$(function(){
var $win = $(window)
var $nav = $('.mytoolbar');
var navTop = $('.mytoolbar').length && $('.mytoolbar').offset().top;
var isFixed=0;
processScroll()
$win.on('scroll', processScroll)
function processScroll() {
var i, scrollTop = $win.scrollTop()
if (scrollTop >= navTop && !isFixed) {
isFixed = 1
$nav.addClass('subnav-fixed')
} else if (scrollTop <= navTop && isFixed) {
isFixed = 0
$nav.removeClass('subnav-fixed')
}
}
/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass
sass: {
dist: {
options: {
style: 'expanded'
},
files: {
'dist/styles/main.css': 'src/styles/main.scss'
}
}
},
// Autoprefix
autoprefixer: {
options: {
browsers: [
'last 2 version'
]
},
dist: {
src: 'dist/styles/main.css'
}
},
// CSS minify
cssmin: {
dist: {
files: {
'dist/styles/main.min.css': 'dist/styles/main.css'
}
}
},
// JShint
jshint: {
files: ['src/scripts/**/*.js'],
options: {
jshintrc: '.jshintrc'
}
},
// Concat
concat: {
js: {
src: ['src/scripts/**/*.js'],
dest: 'dist/scripts/main.js'
},
},
// Uglify
uglify: {
dist: {
src: 'dist/scripts/main.js',
dest: 'dist/scripts/main.min.js'
},
},
// Imagemin
imagemin: {
dist: {
options: {
optimizationLevel: 3,
progressive: true,
interlaced: true
},
files: [{
expand: true,
cwd: 'src/images',
src: ['**/*.{png,jpg,gif}'],
dest: 'dist/images'
}]
}
},
// Clean
clean: {
build: ['dist/styles', 'dist/scripts', 'dist/images']
},
// Notify
notify: {
styles: {
options: {
message: 'Styles task complete',
}
},
scripts: {
options: {
message: 'Scripts task complete',
}
},
images: {
options: {
message: 'Images task complete',
}
},
},
// Watch
watch: {
styles: {
files: 'src/styles/**/*.scss',
tasks: ['sass', 'autoprefixer', 'cssmin', 'notify:styles'],
},
scripts: {
files: 'src/scripts/**/*.js',
tasks: ['concat', 'uglify', 'notify:scripts'],
},
images: {
files: 'src/images/**/*',
tasks: ['imagemin', 'notify:images'],
},
livereload: {
options: { livereload: true },
files: [
'dist/styles/**/*.css',
'dist/scripts/**/*.js',
'dist/images/**/*'
]
}
}
});
// Default task
grunt.registerTask('default', [
'jshint',
'clean',
'concat',
'uglify',
'sass',
'autoprefixer',
'cssmin',
'imagemin'
]);
// Load plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-notify');
};
$this->user->login(new Nette\Security\Identity($row["id"], array(), $row));
$this->redirectUrl($this->link('@homepage'));