-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader-main-nav.php
167 lines (155 loc) · 9.68 KB
/
header-main-nav.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php if($app->getConfig('auth.provider') === 'Fake' && $app->user->id !== 1): ob_start(); ?>
<style>
span.fake-dummy{
white-space:nowrap; padding: 0.5rem 0 0 0.5rem; cursor:default;
}
span.fake-dummy a{
display:inline !important; font-weight:bold !important; vertical-align: baseline !important;
}
</style>
<span class="fake-dummy">
Admin:
<a onclick="jQuery.get('<?php echo $app->createUrl('auth', 'fakeLogin') ?>/?fake_authentication_user_id=1',
function(){
console.info(<?php \MapasCulturais\i::_e('Logado como Admin');?>);
MapasCulturais.Messages.success(<?php \MapasCulturais\i::_e('Logado como Admin.');?>);
})">
Login
</a>
<a onclick="jQuery.get('<?php echo $app->createUrl('auth', 'fakeLogin') ?>/?fake_authentication_user_id=1',
function(){ location.reload();})">
Reload
</a>
</span>
<?php $fake_options = ob_get_clean(); endif; ?>
<nav id="main-nav" class="clearfix">
<ul class="menu entities-menu clearfix">
<?php if($app->isEnabled('events')): ?>
<?php $this->applyTemplateHook('nav.main.events','before'); ?>
<li id="entities-menu-event"
ng-class="{'active':data.global.filterEntity === 'event',
'current-entity-parent':'<?php echo $this->controller->id;?>' == 'event'}"
ng-click="tabClick('event')">
<a href="<?php if ($this->controller->action !== 'search') echo $app->createUrl('site', 'search') . '##(global:(enabled:(event:!t),filterEntity:event))'; ?>">
<div class="icon icon-event"></div>
<div class="menu-item-label"><?php $this->dict('entities: Events') ?></div>
</a>
</li>
<?php $this->applyTemplateHook('nav.main.events','after'); ?>
<?php endif; ?>
<?php if($app->isEnabled('spaces')): ?>
<?php $this->applyTemplateHook('nav.main.spaces','before'); ?>
<li id="entities-menu-space"
ng-class="{'active':data.global.filterEntity === 'space',
'current-entity-parent':'<?php echo $this->controller->id;?>' == 'space'}"
ng-click="tabClick('space')">
<a href="<?php if ($this->controller->action !== 'search') echo $app->createUrl('site', 'search') . '##(global:(enabled:(space:!t),filterEntity:space))'; ?>">
<div class="icon icon-space"></div>
<div class="menu-item-label"><?php $this->dict('entities: Spaces') ?></div>
</a>
</li>
<?php $this->applyTemplateHook('nav.main.spaces','after'); ?>
<?php endif; ?>
<?php if($app->isEnabled('agents')): ?>
<?php $this->applyTemplateHook('nav.main.agents','before'); ?>
<li id="entities-menu-agent"
ng-class="{'active':data.global.filterEntity === 'agent',
'current-entity-parent':'<?php echo $this->controller->id;?>' == 'agent'}"
ng-click="tabClick('agent')">
<a href="<?php if ($this->controller->action !== 'search') echo $app->createUrl('site', 'search') . '##(global:(enabled:(agent:!t),filterEntity:agent))'; ?>">
<div class="icon icon-agent"></div>
<div class="menu-item-label"><?php $this->dict('entities: Agents') ?></div>
</a>
</li>
<?php $this->applyTemplateHook('nav.main.agents','after'); ?>
<?php endif; ?>
<?php if($app->isEnabled('projects')): ?>
<?php $this->applyTemplateHook('nav.main.projects','before'); ?>
<li id="entities-menu-project"
ng-class="{'active':data.global.filterEntity === 'project',
'current-entity-parent':'<?php echo $this->controller->id;?>' == 'project'}"
ng-click="tabClick('project')">
<a href="<?php if ($this->controller->action !== 'search') echo $app->createUrl('site', 'search') . '##(global:(enabled:(project:!t),filterEntity:project,viewMode:list))'; ?>">
<div class="icon icon-project"></div>
<div class="menu-item-label"><?php $this->dict('entities: Projects') ?></div>
</a>
</li>
<?php $this->applyTemplateHook('nav.main.projects','after'); ?>
<?php endif; ?>
<?php if($app->isEnabled('opportunities')): ?>
<?php $this->applyTemplateHook('nav.main.opportunities','before'); ?>
<li id="entities-menu-opportunity"
ng-class="{'active':data.global.filterEntity === 'opportunity',
'current-entity-parent':'<?php echo $this->controller->id;?>' == 'opportunity'}"
ng-click="tabClick('opportunity')">
<a href="<?php if ($this->controller->action !== 'search') echo $app->createUrl('site', 'search') . '##(global:(enabled:(opportunity:!t),filterEntity:opportunity,viewMode:list))'; ?>">
<div class="icon icon-opportunity"></div>
<div class="menu-item-label"><?php $this->dict('entities: Opportunities') ?></div>
</a>
</li>
<?php $this->applyTemplateHook('nav.main.opportunities','after'); ?>
<?php endif; ?>
</ul>
<!--.menu.entities-menu-->
<ul class="menu session-menu clearfix">
<?php if ($app->auth->isUserAuthenticated()): ?>
<?php $this->applyTemplateHook('nav.main.notifications','before'); ?>
<li class="notifications" ng-controller="NotificationController" style="display:none" ng-class="{'visible': data.length > 0}">
<a class="js-submenu-toggle" data-submenu-target="$(this).parent().find('.submenu')" rel='noopener noreferrer'>
<div class="icon icon-notifications"></div>
<div class="menu-item-label"><?php \MapasCulturais\i::_e("Notificações");?></div>
</a>
<ul class="submenu hidden">
<li>
<div class="clearfix">
<h6 class="alignleft"><?php \MapasCulturais\i::_e("Notificações");?></h6>
<a href="#" style="display:none" class="staging-hidden hltip icon icon-check_alt" title="<?php \MapasCulturais\i::esc_attr_e("Marcar todas como lidas");?>"></a>
</div>
<ul>
<li ng-repeat="notification in data" on-last-repeat="adjustScroll();">
<p class="notification clearfix">
<span ng-bind-html="notification.message"></span>
<br>
<a ng-if="notification.request.permissionTo.approve" class="btn btn-small btn-success" ng-click="approve(notification.id)" rel='noopener noreferrer'><?php \MapasCulturais\i::_e("aceitar");?></a>
<span ng-if="notification.request.permissionTo.reject">
<span ng-if="notification.request.requesterUser === MapasCulturais.userId">
<a class="btn btn-small btn-default" ng-click="reject(notification.id)" rel='noopener noreferrer'><?php \MapasCulturais\i::_e("cancelar");?></a>
<a class="btn btn-small btn-success" ng-click="delete(notification.id)" rel='noopener noreferrer'><?php \MapasCulturais\i::_e("ok");?></a>
</span>
<span ng-if="notification.request.requesterUser !== MapasCulturais.userId">
<a class="btn btn-small btn-danger" ng-click="reject(notification.id)" rel='noopener noreferrer'><?php \MapasCulturais\i::_e("rejeitar");?></a>
</span>
</span>
<span ng-if="!notification.request">
<a class="btn btn-small btn-success" ng-click="delete(notification.id)" rel='noopener noreferrer'><?php \MapasCulturais\i::_e("ok");?></a>
</span>
</p>
</li>
</ul>
<a href="<?php echo $app->createUrl('panel'); ?>">
<?php \MapasCulturais\i::_e("Ver todas atividades");?>
</a>
</li>
</ul>
<!--.submenu-->
</li>
<!--.notifications-->
<?php $this->applyTemplateHook('nav.main.notifications','after'); ?>
<?php $this->part('nav-main-user') ?>
<?php else: ?>
<?php $this->applyTemplateHook('nav.main.login','before'); ?>
<li class="login">
<a ng-click="setRedirectUrl()" <?php echo $this->getLoginLinkAttributes() ?> >
<div class="icon icon-login"></div>
<div class="menu-item-label"><?php \MapasCulturais\i::_e("Entrar");?></div>
</a>
<?php if(!empty($fake_options)): ?>
<ul class="submenu" style="margin: 2px 0 0 -12px"><li><?php echo str_ireplace("Login\n </a>", 'Login</a> |', $fake_options) ?></li></ul>
<?php endif; ?>
</li>
<!--.login-->
<?php $this->applyTemplateHook('nav.main.login','after'); ?>
<?php endif; ?>
</ul>
<!--.menu.session-menu-->
</nav>