Commit 8becd820 authored by Evren Kutar's avatar Evren Kutar

selected user popover

icons for menu items
parent 685aef41
......@@ -16,7 +16,7 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
* Crud Utility is a service to provide functionality for Crud controllers
* @returns {object}
*/
.service('CrudUtility', function ($log) {
.service('CrudUtility', function ($log, $rootScope) {
return {
/**
* @name generateParam
......@@ -50,6 +50,8 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
if (scope.param_id) {
scope.form_params.filters.push({field: scope.param, values: [scope.param_id], type: 'check'});
// do not use selected user, get and broadcast data of user in param_id
$rootScope.$broadcast('selectedUserTrigger', [scope.param, scope.param_id]);
}
scope.model = scope.form_params.model;
......
......@@ -51,25 +51,12 @@ angular.module('ulakbus.dashboard', ['ngRoute'])
};
$scope.select = function (who, type) {
$rootScope.selectedUser = {name: who[0], tcno: who[1], key: who[2]};
$rootScope.$broadcast('selectedUser', {name: who[0], tcno: who[1], key: who[2]});
// get 'who's related transactions and manipulate sidebar menu
$rootScope.$broadcast("menuitems", type);
// save selected user and type to cookie
// its a development issue and will be deleted todo: remove at production
//$cookies.put("selectedUserName", who[0]);
//$cookies.put("selectedUserTcNo", who[1]);
//$cookies.put("selectedUserKey", who[2]);
//$cookies.put("selectedUserType", type);
};
// if selected user in cookie, set selectedUser
//if ($cookies.getAll()["selectedUser"]) {
// $rootScope.selectedUser = {name: $cookies.get("selectedUserName"), tcno: $cookies.get("selectedUserTcNo"), key: $cookies.get("selectedUserKey")};
//}
$scope.$on("notifications", function (event, data) {
$scope.notifications = data;
});
......
......@@ -30,12 +30,12 @@
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0" ng-if="$root.loggedInUser">
<collapse-menu></collapse-menu>
<ul class="header-menu">
<li><a href="">Mesajlar</a></li>
<li><a href="">Görevler</a></li>
<li><a href="">Raporlar</a></li>
<li><a href="">Ayarlar</a></li>
</ul>
<!--<ul class="header-menu">-->
<!--<li><a href="">Mesajlar</a></li>-->
<!--<li><a href="">Görevler</a></li>-->
<!--<li><a href="">Raporlar</a></li>-->
<!--<li><a href="">Ayarlar</a></li>-->
<!--</ul>-->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
......
......@@ -37,12 +37,12 @@
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0" ng-if="$root.loggedInUser">
<collapse-menu></collapse-menu>
<ul class="header-menu">
<li><a href="">Mesajlar</a></li>
<li><a href="">Görevler</a></li>
<li><a href="">Raporlar</a></li>
<li><a href="">Ayarlar</a></li>
</ul>
<!--<ul class="header-menu">-->
<!--<li><a href="">Mesajlar</a></li>-->
<!--<li><a href="">Görevler</a></li>-->
<!--<li><a href="">Raporlar</a></li>-->
<!--<li><a href="">Ayarlar</a></li>-->
<!--</ul>-->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
......
......@@ -97,7 +97,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
"x-schema-form": {placeholder: "Arama kriteri giriniz..."}
}
},
required: ['searchbox']
required: []
};
$scope.searchModel = {searchbox: ''};
......@@ -255,13 +255,31 @@ app.directive('logout', function ($http, $location, RESTURL) {
* selected user directive
*/
.directive('selectedUser', function () {
.directive('selectedUser', function ($http, RESTURL) {
return {
templateUrl: 'shared/templates/directives/selected-user.html',
restrict: 'E',
replace: false,
replace: true,
link: function ($scope, $rootScope) {
$scope.selectedUser = $rootScope.selectedUser;
$scope.$on('selectedUser', function ($event, data) {
$scope.selectedUser = data;
$scope.dynamicPopover = {
content: '',
name: data.name,
tcno: data.tcno,
key: data.key,
templateUrl: 'shared/templates/directives/selectedUserPopover.html',
title: 'İşlem Yapılan Kişi'
};
});
$scope.$on('selectedUserTrigger', function ($event, data) {
var postToApi = {model: 'Personel', cmd: 'show', id: data[1]};
//postToApi[data[0]]=data[1];
$http.get(RESTURL.url + 'ara/personel/'+ data[1]).success(
function (data) {
}
);
})
}
};
})
......@@ -324,7 +342,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
//}
$timeout(function () {
sidebarmenu.metisMenu()
sidebarmenu.metisMenu();
});
});
......@@ -340,6 +358,10 @@ app.directive('logout', function ($http, $location, RESTURL) {
});
});
$scope.$on('selectedUser', function ($event, data) {
$scope.selectedUser = data;
});
$scope.openSidebar = function () {
if ($window.innerWidth > '768') {
if ($rootScope.sidebarPinned === 0) {
......
<a href="#" data-toggle="tooltip" data-placement="bottom" title="Tooltip on left">İşlem: {{$root.selectedUser.name}}</a>
<!-- sidebar-person-info -->
<!--<div class="tooltip" role="tooltip">-->
<!--&lt;!&ndash;<button class="btn btn-primary close-sidebar-person-info">Profili Kapat</button>&ndash;&gt;-->
<!--<div class="identity">-->
<!--<div class="identity-header clearfix">-->
<!--<img src="../../../img/sample-profile-pic.jpg">-->
<!--<div class="pull-left">-->
<!--<p class="identity-name">{{$root.selectedUser.name}}</p>-->
<!--&lt;!&ndash;<p class="identity-surname">Öğümsöğütlü</p>&ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; end of identity-header &ndash;&gt;-->
<!--<div class="identity-info">-->
<!--<div class="clearfix">-->
<!--<span class="fa fa-phone"></span> <div>539 241 65 08</div>-->
<!--</div>-->
<!--<div class="clearfix">-->
<!--<span class="fa fa-envelope"></span>-->
<!--<div>erkanogum@gmail.com</div>-->
<!--</div>-->
<!--<div class="clearfix">-->
<!--<span class="fa fa-home"></span>-->
<!--<div>İşçi Blokları Mah. 1524. sokak B Blok 6. Kat A Kanat 27 numara</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; end of identity &ndash;&gt;-->
<!--<div class="person-actions">-->
<!--<ul>-->
<!--<li><a href="#"><span class="fa fa-trash"></span> Action 1</a></li>-->
<!--<li><a href="#"><span class="fa fa-trash"></span> Action 2</a></li>-->
<!--<li><a href="#"><span class="fa fa-trash"></span> Action 3</a></li>-->
<!--<li><a href="#"><span class="fa fa-trash"></span> Action 4</a></li>-->
<!--<li><a href="#"><span class="fa fa-trash"></span> Action 5</a></li>-->
<!--</ul>-->
<!--</div>-->
<!--&lt;!&ndash; end of person-actions &ndash;&gt;-->
<!--</div>-->
<!-- end of sidebar-person-info -->
\ No newline at end of file
<span uib-popover-template="dynamicPopover.templateUrl"
popover-title="{{dynamicPopover.title}}"
popover-trigger="click"
popover-placement="bottom"
type="button"
ng-if="selectedUser"
class="">İşlem yapılan kişi: <i class="fa fa-fw fa-user"></i> <b>{{selectedUser.name}}</b> <i
class="fa fa-caret-down"></i></span>
\ No newline at end of file
<div style="width:400px;">
<div class="row">
<div class="col-md-6">
<img src="img/sample-profile-pic.jpg" alt="{{dynamicPopover.name}}" class="img-thumbnail">
</div>
</div>
<div class="row">
<div class="col-md-6">
<table class="table table-condensed">
<tbody>
<tr>
<td>Ad:</td>
<td>{{dynamicPopover.name}}</td>
</tr>
<tr>
<td>TC Kimlik No:</td>
<td>{{dynamicPopover.tcno}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
\ No newline at end of file
......@@ -15,11 +15,14 @@
<li ng-repeat="(key, item) in menuItems" ng-class="{active: collapseVar == $index+1}">{{dropDown}}
<a href="" ng-click="check($index+1)">
<i class="fa fa-fw fa-cogs"
<i class="fa fa-fw"
ng-class="{
'other': 'fa fa-fw fa-wrench',
'ogrenci': 'fa fa-fw fa-university',
'personel': 'fa fa-fwkey-users'}[item[0].baseCategory]"></i>
'Admin': 'fa fa-fw fa-terminal',
'Genel': 'fa fa-fw fa-graduation-cap',
'Alt Kategori': 'fa fa-fw fa-tags',
'Kadro Islemleri': 'fa fa-fw fa-users',
'Seçime Uygun Görevler':'fa fa-fw fa-users'
}[item[0].kategori]"></i>
<span class="menu-text" ng-class="{hidden: $root.collapsed}">{{ key }}</span>
<span class="fa arrow" ng-class="{hidden: $root.collapsed}"></span>
</a>
......@@ -27,7 +30,7 @@
<li ng-repeat="(k, v) in item">
<!--<a ng-if="v.model" ng-href="#{{v.url}}" ng- -->
<!--ng-click="breadcrumb([key, v.text], $event)">{{v.text}}</a>-->
<a ng-href="#/{{v.wf}}/{{v.model}}?{{v.param}}={{$root.selectedUser.key}}"
<a ng-href="#/{{v.wf}}/{{v.model}}?{{v.param}}={{selectedUser.key}}"
ng-click="breadcrumb([key, v.text], $event)">{{v.text}}</a>
</li>
</ul>
......
......@@ -83,7 +83,7 @@ app.config(['$httpProvider', function ($httpProvider) {
'</div>'+
'</div>' +
'<div class="modal-footer">' +
'<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>' +
'<button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button>' +
'</div>' +
'</div>' +
'</div>' +
......@@ -91,7 +91,9 @@ app.config(['$httpProvider', function ($httpProvider) {
};
if (rejection.status === -1) {
rejection.data = {title: "error", description : 'connection failed'};
rejection.status = 'Sunucu hatası'
rejection.data = {title: "", description : 'Sunucu bağlantısında bir hata oluştu.' +
'Lütfen yetkili personelle iletişime geçiniz.'};
errorModal();
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -23,12 +23,12 @@
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0" ng-if="$root.loggedInUser">
<collapse-menu></collapse-menu>
<ul class="header-menu">
<li><a href="">Mesajlar</a></li>
<li><a href="">Görevler</a></li>
<li><a href="">Raporlar</a></li>
<li><a href="">Ayarlar</a></li>
</ul>
<!--<ul class="header-menu">-->
<!--<li><a href="">Mesajlar</a></li>-->
<!--<li><a href="">Görevler</a></li>-->
<!--<li><a href="">Raporlar</a></li>-->
<!--<li><a href="">Ayarlar</a></li>-->
<!--</ul>-->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment