Commit 1fd76eb2 authored by Evren Kutar's avatar Evren Kutar

on click user info popover

parent b66cd988
......@@ -1071,7 +1071,7 @@ table.dataTable thead .sorting:after {
margin-right: -5px;
}
.dashboard-main-search .fa {
.bordered-fa-icon {
padding: 10px 15px;
border: 1px solid #e0e0e0;
border-bottom-right-radius: 3px;
......
......@@ -7,12 +7,16 @@
<div class="text-center">
<h3>ÖĞRENCİ</h3>
<input type="text" placeholder="Öğrenci ara" ng-model="student_kw" ng-keyup="search('ogrenci')">
<span class="fa fa-search" ng-click="search('ogrenci')"></span>
<span class="bordered-fa-icon fa fa-search" ng-click="search('ogrenci')"></span>
</div>
<div class="dashboard-search-results">
<ul ng-if="students.length > 0">
<li ng-repeat="student in students">
<a role="button" ng-click="select(student, 'ogrenci')">{{student[0]}}</a>
<a role="button">
<span ng-click="select(student, 'ogrenci')">{{student[0]}}</span>
<i class="fa fa-fw fa-info-circle pull-right" popover-placement="bottom"
uib-popover-template="userPopover.templateUrl"
ng-click="get_info('Ogrenci', student[2])"></i></a>
</li>
</ul>
</div>
......@@ -24,12 +28,17 @@
<div class="text-center">
<h3>PERSONEL</h3>
<input type="text" placeholder="Personel ara" ng-model="staff_kw" ng-keyup="search('personel')">
<span class="fa fa-search" ng-click="search('personel')"></span>
<span class="bordered-fa-icon fa fa-search" ng-click="search('personel')"></span>
</div>
<div class="dashboard-search-results">
<ul ng-if="staffs.length > 0">
<li ng-repeat="staff in staffs">
<a role="button" ng-click="select(staff, 'personel')">{{staff[0]}}</a>
<a role="button">
<span ng-click="select(staff, 'personel')">{{staff[0]}}</span>
<i class="fa fa-fw fa-info-circle pull-right"
popover-placement="bottom"
uib-popover-template="userPopover.templateUrl"
ng-click="get_info('Personel', staff[2])"></i></a>
</li>
</ul>
</div>
......
......@@ -8,9 +8,12 @@
'use strict';
angular.module('ulakbus.dashboard', ['ngRoute'])
angular.module('ulakbus.dashboard', [])
.config(function ($uibTooltipProvider) {
$uibTooltipProvider.setTriggers({'click': 'mouseleave'});
})
.controller('DashCtrl', function ($scope, $rootScope, $timeout, $http, $cookies, RESTURL) {
.controller('DashCtrl', function ($scope, $rootScope, $timeout, $http, $cookies, RESTURL, Generator) {
$scope.section = function (section_index) {
$rootScope.section = section_index;
};
......@@ -50,6 +53,18 @@ angular.module('ulakbus.dashboard', ['ngRoute'])
return $http.get(RESTURL.url + 'ara/' + where + '/' + what);
};
$scope.userPopover = {templateUrl: 'components/dashboard/user-info.html'};
$scope.get_info = function (type, key) {
Generator.get_list({url: 'crud', form_params: {model: type, object_id: key, cmd: 'show'}})
.then(function (data) {
$scope.userPopover.name = data.data.object.unicode;
$scope.userPopover.tcno = data.data.object.tckn;
//debugger;
})
};
$scope.select = function (who, type) {
$rootScope.$broadcast('selectedUser', {name: who[0], tcno: who[1], key: who[2]});
// get 'who's related transactions and manipulate sidebar menu
......
<div style="width:400px;">
<div class="row">
<div class="col-md-6">
<img src="img/sample-profile-pic.jpg" alt="{{userPopover.name}}" class="img-thumbnail">
</div>
</div>
<div class="row">
<div class="col-md-6">
<table class="table table-condensed">
<tbody>
<tr>
<td>Ad Soyad:</td>
<td>{{userPopover.name}}</td>
</tr>
<tr>
<td>TC Kimlik No:</td>
<td>{{userPopover.tcno}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
\ No newline at end of file
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