{% extends 'base.html.twig' %}
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{{ asset('bundles/atechnetcore/css/main.css')|appendAssetCache }}">
<style>
.breadcrumb {
margin-bottom: 6px;
padding: 5px 15px;
}
.navbar {
margin-bottom: 6px;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu .dropdown-menu {
top: 0;
left: 100%;
margin-top: -1px;
}
.dropdown-inline-submenu {
list-style: none;
width: max-content;
padding-left: 1em;
}
#notification-icon {
cursor: pointer;
}
#notification-icon .label {
font-size: 100%;
font-weight: normal;
padding-top: 0.3em;
}
#notification-panel {
position: absolute;
display: none;
width: 380px;
background-color: #fff;
top: 40px;
right: 5%;
border: 1px solid #bbb;
border-radius: 4px;
}
#notification-panel .notification-list {
max-height: 312px;
overflow-y: scroll;
padding: 0 5px;
}
#notification-panel .show-all-notification {
text-align:center;
background-color: inherit;
width: 100%;
border-top: 1px solid #dedede;
padding: 8px 0px;
border-radius: 0 0 4px 4px;
z-index: 99;
position: absolute;
}
#notification-panel a {
display: block;
padding: 5px 10px;
color: #222;
max-height: 280px;
}
#notification-panel a:hover {
background-color: #eef;
text-decoration: none;
}
#notification-panel a.active {
font-weight: bold;
color: #000;
}
#notification-panel a small {
color: #555;
}
#page-refresh-block {
display: none;
position:relative;
float:right;
top:-31px;
right:15px;
}
#breadcrumb-and-page-refresh {
height:36px;
}
.main-navbar-prod {
border-bottom: 3px solid #00bb00;
}
.main-navbar-dev {
border-bottom: 3px solid #d267ff;
}
</style>
{% endblock %}
{% block title %}
{% apply spaceless %}
{{- parent() -}}
{% if page_title is defined %}
{{- page_title -}}
{% endif %}
{% endapply %}
{% endblock %}
{% block body %}
<nav class="navbar navbar-inverse navbar-static-top main-navbar main-navbar-{{ app.environment }}">
<div class="container-fluid" style="height:36px;">
<div class="navbar-header">
{% if "now"|date('d.m') == '04.05' %}
<a href="{{ path('atech_net_core_dashboard') }}" class="navbar-brand" style="padding-top:8px;"><img src="{{ asset('bundles/atechnetcore/images/darth-vader.png')|appendAssetCache }}" title="May the 4th be with you!" /></a>
{% else %}
<a href="{{ path('atech_net_core_dashboard') }}" class="navbar-brand"><i class="glyphicon glyphicon-home"></i></a>
{% endif %}
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="navbar" class="collapse navbar-collapse" aria-expanded="false">
{{ render(controller('App\\AtechNet\\CoreBundle\\Controller\\BaseController::getMenuAction')) }}
<ul class="nav navbar-nav navbar-right">
{% if "now"|date('md') == 214 %}<li><div class="heart" title="Boldog Valentint!"></div></li>{% endif %}
<li>
<div id="notification-icon" class="navbar-text">
<div class="label label-default"><i class="glyphicon glyphicon-envelope"></i> <span id="notification-value">?</span></div>
</div>
<div id="notification-panel"></div>
</li>
<li class="dropdown">
<a href="{{ path('account_edit') }}" class="dropdown-title">
<span class="name">{% trans %}Hello{% endtrans %} <strong>{{ app.user.nickName }}</strong></span>
<i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu">
<li><a href="{{ path('account_edit') }}" data-teszt="profileAccountEditButton">{{ 'Profile' |trans }}</a></li>
<li><a href="{{ path('atech_net_core_user_absence_list') }}" data-teszt="profileUserAbsenceButton">{{ 'User absence' |trans }}</a></li>
<li><a href="{{ path('atech_net_core_user_product_notifications') }}" data-teszt="profileProductNotificationsButton">{{ 'Product notifications' |trans }}</a></li>
<li><a href="{{ path('atech_net_core_signature_generator') }}" data-teszt="profileSignatureGeneratorButton">{{ 'Signature generator' |trans }}</a></li>
<li class="divider"></li>
<li><a href="{{ path('atech_net_core_logout') }}" id="log-out" data-teszt="logoutButton">{% trans %}admin.logout{% endtrans %}</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div id="breadcrumb-and-page-refresh" class="container-fluid">
{{ wo_render_breadcrumbs() }}
<div id="page-refresh-block">
<i class="glyphicon glyphicon-time"></i> <a href="#"><i class="glyphicon glyphicon-pause"></i></a> {% trans %}Page refresh is{% endtrans %} <strong><span id="page-refresh-in">0</span></strong>s
</div>
</div>
<div id="content" class="container-fluid">
{% block content %}
<div id="sidebar">
{% block sidebar %}
<div id="navigation">
{{ render(controller('AtechNetCoreBundle/Default/navigation', {'current_page': current_page})) }}
</div>
{% endblock %}
</div>
<div id="section-wrapper">
{% block section_wrapper %}
<div id="section-nav">
{% block section_nav %}
{% if section_title is defined %}<span
class="title">{{ section_title|trans }}</span>{% endif %}
<div class="section-nav-action">{% block section_nav_action %}{% endblock %}</div>
{% endblock %}
</div>
<div id="sections">
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="flash-notice">{{ flashMessage|trans }}</div>
{% endfor %}
{% block sections %}
{% endblock %}
</div>
{% endblock %}{#section_wrapper#}
</div>
{% endblock %}{#content#}
</div>
<div id="modal-page-refresh" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body text-center text-danger" style="padding: 0;">
<div class="alert alert-info" role="alert" style="margin: 0;"><strong>{{ 'The page will refresh automatically, please wait' |trans }}...</strong></div>
</div>
</div>
</div>
</div>
{% include 'AtechNetCoreBundle/Common/progressBar.html.twig' %}
{% endblock %}{#body#}
{% block javascripts %}
<script>
var progressBarEndpoint = "{{ path('background_jobs-get-job') }}"
var progressBarResetEndpoint = "{{ path('reset_wizard_job') }}"
</script>
<script src="{{ asset('bundles/atechnetcore/js/backgrounJob/progressBar.js')|appendAssetCache }}"></script>
<script src="{{ asset('bundles/atechnetcore/js/ajax-native.js')|appendAssetCache }}"></script>
<script src="{{ asset('bundles/atechnetcore/js/jquery-1.11.2.min.js')|appendAssetCache }}"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
{% if app.environment == 'prod' %}
<script src="https://cdn.ravenjs.com/3.14.2/raven.min.js" crossorigin="anonymous"></script>
<script>Raven.config('https://0a0726bbeb7149c2bfb0c39431121d51@sentry.io/167350').install();</script>
{% endif %}
<script>
$('#navbar > .nav > li.dropdown > a > .fa-caret-down').on('click', function(e) {
if ( $(this).closest('.dropdown').hasClass('clicked') ) {
$(this).closest('.dropdown').removeClass('clicked');
} else {
$(this).closest('.dropdown').addClass('clicked');
}
return false;
});
$('#navbar .dropdown-submenu .fa-caret-down').on('click', function(e) {
if ( $(this).closest('.dropdown-submenu').hasClass('clicked') ) {
$(this).closest('.dropdown-submenu').removeClass('clicked');
} else {
$(this).closest('.dropdown-submenu').addClass('clicked');
}
return false;
});
const addBreadcrumbsWikiPage = (link) => {
let breadcrumbs = document.getElementById('wo-breadcrumbs');
if ( breadcrumbs != null ) {
let li = document.createElement('li');
li.classList.add('item-help', 'pull-right');
li.innerHTML = '<a href="' + link + '" target="_BLANK"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></a>';
breadcrumbs.appendChild(li);
}
};
var notificationUrl = '{{ path('atech_net_core_notification') }}';
var notificationListUrl = '{{ path('atech_net_core_notification_list') }}';
var notificationInactivateUrl = '{{ path('atech_net_core_notification_inactivate', {'id':0}) }}';
var maxNotifications = 10;
let notificationIndexLabel = '{{ "Show all" | trans }}'
$(document).ready(function(){
$('.dropdown-submenu a.dropdown-title').mouseenter( function(e){
$(this).next('ul').show();
}).parent().mouseleave(function(e) {
$(this).children('ul').hide();
});
initNotifications();
$('#notification-icon').click(function() {
var top = $('#notification-icon').position().top + 40;
$('#notification-panel').toggle().css("top", top + "px");
return false;
})
});
function initNotifications() {
$.get(notificationListUrl).done(function(data){
$('#notification-value').text(data.count > maxNotifications ? maxNotifications + '+' : data.count);
if (data.count !== '' && data.count > 0) {
$('#notification-icon > span.label').removeClass('label-default').addClass('label-info');
}
var html ='<div class="notification-list">';
for(var i in data.result) {
if (i >= maxNotifications) {
break;
}
var d = data.result[i];
html += '<a data-id="' + d.id + '" href="'+ d.url + '"'
+ (d.active == '1' ? ' class="active" onclick="inactivateNotification(this)"' : '')
+ '>' + d.text
+ '<br/><small><i class="glyphicon glyphicon-time"></i> '
+ d.created +'</small></a>';
}
html +='</div>';
$('#notification-panel').html(html);
$('#notification-panel').append('<a href="' + notificationUrl + '" class="show-all-notification"><b>' + notificationIndexLabel + '</b></a>');
});
}
function inactivateNotification(element) {
var e = $(element);
var id = e.data('id');
var url = notificationInactivateUrl.replace('0', id);
$.get(url).done(function(data) {
e.removeClass('active');
e.removeAttr('onclick');
var nv = $('#notification-value');
if (nv.text() != (maxNotifications + '+')) {
nv.text(nv.text() - 1);
} else {
initNotifications();
}
});
}
function areYouSure(){
return confirm('{{ 'Are you sure?'|trans }}');
}
function copyUrlToClipboard(el) {
var textArea = document.createElement("textarea");
textArea.style.position = 'fixed';
textArea.style.top = 0;
textArea.style.left = 0;
textArea.style.width = '2em';
textArea.style.height = '2em';
textArea.style.padding = 0;
textArea.style.border = 'none';
textArea.style.outline = 'none';
textArea.style.boxShadow = 'none';
textArea.style.background = 'transparent';
textArea.value = el.getAttribute("href");
document.body.appendChild(textArea);
textArea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'Copied' : 'Failed';
el.innerHTML = msg;
setTimeout(() => {
el.innerHTML = '<i class="glyphicon glyphicon-copy"></i>';
}, 5000);
} catch (err) {
alert('Oops, unable to copy');
}
document.body.removeChild(textArea);
}
// Set the name of the hidden property and the change event for visibility
var hidden, visibilityChange;
if ( typeof document.hidden !== "undefined" ) { // Opera 12.10 and Firefox 18 and later support
hidden = "hidden";
visibilityChange = "visibilitychange";
} else if ( typeof document.msHidden !== "undefined" ) {
hidden = "msHidden";
visibilityChange = "msvisibilitychange";
} else if ( typeof document.webkitHidden !== "undefined" ) {
hidden = "webkitHidden";
visibilityChange = "webkitvisibilitychange";
}
function handleVisibilityChange() {
if ( document[hidden] ) {
$('#page-refresh-block a').removeClass('online').addClass('offline');
} else {
$('#page-refresh-block a').removeClass('offline').addClass('online');
}
}
var refreshInterval;
var refreshTime = 0;
var refreshElement = null;
/**
* Counts back from a given time in seconds, adds current value to a given container, than refreshes page
* Timer is reset on mousemove and keypress
* Usage:
* $(document).ready(function(){ countAndRefresh(120); });
*
* @param time
* @param textAreas one or mupltiple text areas, which if has value the timer does not tick
*/
function countAndRefresh(time, textAreas) {
let appEnvironment = '{{ app.environment }}';
if (appEnvironment == 'dev' || window.location.href.includes(['web/document']) || window.location.href.includes(['web/billingo-document'])) {
return;
}
//Zero the idle timer on mouse movement.
$(this).mousemove(function (e) {
refreshTime = time;
$('#page-refresh-block a').removeClass('online').removeClass('offline');
}).keypress(function (e) {
refreshTime = time;
$('#page-refresh-block a').removeClass('online').removeClass('offline');
}).scroll(function (e) {
refreshTime = time;
$('#page-refresh-block a').removeClass('online').removeClass('offline');
});
var $refreshBlockControl = $('#page-refresh-block a');
if(textAreas !== undefined){
if(Array.isArray(textAreas)){
textAreas.forEach(function (value, index, array) {
$(value).bind('input propertychange', function() {
if(this.value.trim() !== ""){
$refreshBlockControl.addClass('paused');
}else{
$refreshBlockControl.removeClass('paused');
}
});
})
}else{
$(textAreas).bind('input propertychange', function() {
if(this.value.trim() !== ""){
$refreshBlockControl.addClass('paused');
}else{
$refreshBlockControl.removeClass('paused');
}
});
}
}
$('#page-refresh-block').show();
refreshElement = $('#page-refresh-in');
refreshTime = time;
refreshIfIdle();
}
function refreshIfIdle() {
if ( typeof document.addEventListener === "undefined" || hidden === undefined ) {
console.log("This browser does not supports the Page Visibility API.");
} else {
// Handle page visibility change
document.addEventListener(visibilityChange, handleVisibilityChange, false);
}
refreshElement.html(refreshTime);
// if (!$('#page-refresh-block a').hasClass('paused')) {
if (!$('#page-refresh-block a').hasClass('paused') && ($('#searchtext').length == 0 || $('#searchtext').val() == '')) {
refreshTime--;
}
// }
if (refreshTime > -1){
setTimeout(function(){
refreshIfIdle();
}, 1000);
} else {
refreshInterval = setInterval(function() {
if ( $('#page-refresh-block a').hasClass('online') ) {
clearInterval(refreshInterval);
setTimeout(function() {
$('#modal-page-refresh').modal({
backdrop: 'static',
keyboard: false
});
window.location.href = window.location.href.replace('?print_label=1','').replace('print_billingo_invoice=1&','').replace('print_invoice=1&','').replace('?print-packeta-label=1','').replace(window.location.hash, '');
}, 900);
} else if ( !$('#page-refresh-block a').hasClass('offline') ) {
clearInterval(refreshInterval);
window.location.href = window.location.href.replace('?print_label=1','').replace('print_billingo_invoice=1&','').replace('print_invoice=1&','').replace('?print-packeta-label=1','').replace(window.location.hash, '');
}
}, 100);
}
}
$('#page-refresh-block a').click(function(){
if (!$(this).hasClass('paused')) {
$(this).addClass('paused');
$(this).find('i').removeClass('glyphicon-pause').addClass('glyphicon-play');
} else {
$(this).removeClass('paused');
$(this).find('i').removeClass('glyphicon-play').addClass('glyphicon-pause');
}
return false;
});
{% if app.request.server.get("HTTP_HOST") == 'www.atechcomp.eu' %}
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-26412246-8', {'siteSpeedSampleRate': 60});
{% if app.user is not null %}
ga('set', 'dimension1', '{{ app.user.nickName }}');
ga('set', 'userId', '{{ app.user.id }}');
{% endif %}
ga('send', 'pageview');
{% endif %}
</script>
{% endblock %}