Commit bf17a23a authored by Evren Kutar's avatar Evren Kutar

Merge branch 'Feature/issue21'

parents 562f8061 f13aa51b
......@@ -1636,6 +1636,6 @@ table.dataTable thead .sorting:after {
}
/* end page transitions */
.move-to-bottom, .move-to-top {
.move-to-bottom, .move-to-top, .move-to-bottom-modal, .move-to-top-modal {
margin-right: 10px !important;
}
\ No newline at end of file
......@@ -46,6 +46,7 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
wf: routeParams.wf,
object_id: routeParams.key
};
scope.form_params[scope.param] = scope.param_id;
scope.model = scope.form_params.model;
scope.wf = scope.form_params.wf;
scope.param = scope.form_params.param;
......@@ -121,7 +122,7 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
*
* @returns {object}
*/
.controller('CRUDListFormCtrl', function ($scope, $rootScope, $location, $http, $log, $modal, $timeout, Generator, $routeParams, CrudUtility) {
.controller('CRUDListFormCtrl', function ($scope, $rootScope, $location, $http, $log, $uibModal, $timeout, Generator, $routeParams, CrudUtility) {
// reloadData must be a json object
$scope.reload = function (reloadData) {
$scope.form_params.cmd = $scope.reload_cmd;
......@@ -157,6 +158,23 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
return new Array(num);
};
$timeout(function () {
jQuery('.filterDate').datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "dd.mm.yy",
onSelect: function (date, inst) {
//scope.model[k] = date;
//if (scope.modalElements) {
// scope.validateModalDate(k);
//}
//else {
// scope.$broadcast('schemaForm.error.' + k, 'tv4-302', true);
//}
}
}).datepicker("setDate", new Date());
});
//
$scope.showCmd = function () {
CrudUtility.generateParam($scope, $routeParams, $routeParams.cmd);
......@@ -260,4 +278,12 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
scope.$emit('formLocator');
}
}
})
.directive('crudFilters', function() {
return {
templateUrl: 'components/crud/templates/filter.html',
restrict: 'E',
replace: true
};
});
\ No newline at end of file
<crud-show-directive ng-if="object"></crud-show-directive>
<crud-form-directive ng-if="forms"></crud-form-directive>
<crud-list-directive ng-if="objects"></crud-list-directive>
\ No newline at end of file
<div class="row">
<div class="col-md-8">
<crud-show-directive ng-if="object"></crud-show-directive>
<crud-form-directive ng-if="forms"></crud-form-directive>
<crud-list-directive ng-if="objects"></crud-list-directive>
</div>
<crud-filters ng-if="meta.allow_filters === true" class="col-md-4 filtre"></crud-filters>
</div>
\ No newline at end of file
<div>
<h2>Filtrele</h2>
<div class="right-sidebar-box">
<div class="right-sidebar-messages">
<div class="right-sidebar-title clearfix">
<h3>Tarih Aralığı</h3>
</div>
<div class="right-sidebar-message-block">
<div class="col-md-6">
<br>
<label class="control-label" for="startDate">Baslangic</label>
<input type="text" name="startDate" class="form-control filterDate"/>
</div>
<div class="col-md-6">
<br>
<label class="control-label" for="endDate">Bitis</label>
<input type="text" name="endDate" class="form-control filterDate"/>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="right-sidebar-box">
<div class="right-sidebar-messages">
<div class="right-sidebar-title clearfix">
<br><br>
<h3>Filtre basligi</h3>
</div>
<div class="right-sidebar-message-block">
<div class="col-md-12">
<br>
<label class="control-label" for="filterSelect">Secim</label>
<select name="filterSelect" id="filterSelect">
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option 3</option>
<option value="4">option 4</option>
</select>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
<div style="margin-top: 40px;">
<button type="button" class="btn btn-primary">Filtrele</button>
</div>
</div>
\ No newline at end of file
<div class="starter-template container">
<sort-directive ng-if="meta['allow_sort']===true"></sort-directive>
<search-directive ng-if="meta['allow_search']===true"></search-directive>
<div class="clearfix"></div>
<!--<h1>{{form_params.model || form_params.wf}}</h1>-->
......
<div ng-app="ulakbus.dashboard" class="dashboard">
<div class="starter-template">
<!--
<div class="row">
<div class="major-buttons">
<div class="col-md-4">
<a href=""><button type="button" class="btn btn-personnel brand-bg" ng-click="section(2)"><i class="fa fa-user"></i>
PERSONEL İŞLERİ</button></a>
</div>
<div class="col-md-4">
<a href=""><button type="button" class="btn btn-student brand-bg" ng-click="section(0)"><i
class="fa fa-graduation-cap"></i> ÖĞRENCİ İŞLERİ</button></a>
</div>
<div class="col-md-4">
<a href=""><button type="button" class="btn btn-system brand-bg" ng-click="section(3)"><i class="fa fa-gears"></i>
SİSTEM</button></a>
</div>
</div>
</div>
-->
<div class="dashboard-main-search clearfix">
<div class="dashboard-student-search">
<div class="dashboard-student-search" data-step="2"
data-intro="isim veya tcno ile öğrenci araması yapabilirsiniz.">
<center>
<h3>ÖĞRENCİ</h3>
<input type="text" placeholder="Öğrenci ara" ng-model="student_kw" ng-keyup="search('ogrenci')">
......@@ -37,7 +19,8 @@
<!-- end of dashboard-student-search-results -->
</div>
<!-- end of dashboard-student-search -->
<div class="dashboard-personnel-search">
<div class="dashboard-personnel-search" data-step="3"
data-intro="isim veya tcno ile personel araması yapabilirsiniz.">
<center>
<h3>PERSONEL</h3>
<input type="text" placeholder="Personel ara" ng-model="staff_kw" ng-keyup="search('personel')">
......@@ -58,7 +41,8 @@
<div class="right-sidebar">
<div class="right-sidebar-box">
<div class="right-sidebar-box" data-step="4"
data-intro="mesajlar, yapılan görevlerin son durumları, duyurular ve son yapılan işlemleri buradan takip edebilirsiniz.">
<div class="right-sidebar-messages">
<div class="right-sidebar-title clearfix">
......@@ -93,21 +77,6 @@
<h3>Görevler</h3>
<span><a href="javascript:void(0)">Tüm Görevler</a></span>
</div>
<!-- end of right-sidebar-title -->
<!--<div class="right-sidebar-task-block">-->
<!--<div class="task-type">Devam Eden Görevler</div>-->
<!--<a href="javascript:void(0)">-->
<!--<div class="task-title">Öğrenci Kayıt</div>-->
<!--<div class="progress">-->
<!--<div class="progress-bar" role="progressbar" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" style="min-width: 2em; width:25%;">-->
<!--25%-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; end of progress &ndash;&gt;-->
<!--</a>-->
<!--</div>-->
<!-- end of right-sidebar-task-block -->
<div class="right-sidebar-task-block">
<!--<div class="task-type">Onay Bekleyen Görevler</div>-->
......@@ -152,13 +121,6 @@
<h3>Son İşlemler</h3>
<span><a href="javascript:void(0)">Tüm İşlemler</a></span>
</div>
<!-- end of right-sidebar-title -->
<!--<div class="right-sidebar-last-action-block">-->
<!--<a href="javascript:void(0)">Birinci dönem bitimine 10 gün kaldı.</a>-->
<!--<a href="javascript:void(0)">Ders seçimi işlemleri xx tarihinde başlayacaktır.</a>-->
<!--</div>-->
<!-- end of right-sidebar-status-block -->
</div>
<!-- end of right-sidebar-status -->
......
......@@ -22,6 +22,8 @@
<link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
<link rel="stylesheet" href="bower_components/angular-loading-bar/build/loading-bar.min.css">
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css" type="text/css">
<link rel="stylesheet" href="bower_components/intro.js/introjs.css" type="text/css">
<link rel="stylesheet" href="bower_components/intro.js/themes/introjs-nassim.css" type="text/css">
</head>
<body>
......@@ -84,6 +86,7 @@
<!--<script src="bower_components/json3/lib/json3.js"></script>-->
<script src="bower_components/angular-loading-bar/build/loading-bar.min.js"></script>
<script src="bower_components/metisMenu/dist/metisMenu.min.js"></script>
<script src="bower_components/intro.js/intro.js"></script>
<!--<script src="bower_components/Chart.js/Chart.js"></script>-->
<script src="shared/translations.js"></script>
<script src="tmp/templates.js"></script>
......
......@@ -23,6 +23,8 @@
<link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
<link rel="stylesheet" href="bower_components/angular-loading-bar/build/loading-bar.min.css">
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css" type="text/css">
<link rel="stylesheet" href="bower_components/intro.js/introjs.css" type="text/css">
<link rel="stylesheet" href="bower_components/intro.js/themes/introjs-nassim.css" type="text/css">
<!-- @endif -->
<!-- @if NODE_ENV == 'PRODUCTION' -->
......@@ -92,6 +94,7 @@
<!--<script src="bower_components/json3/lib/json3.js"></script>-->
<script src="bower_components/angular-loading-bar/build/loading-bar.min.js"></script>
<script src="bower_components/metisMenu/dist/metisMenu.min.js"></script>
<script src="bower_components/intro.js/intro.js"></script>
<!--<script src="bower_components/Chart.js/Chart.js"></script>-->
<script src="shared/translations.js"></script>
<script src="tmp/templates.js"></script>
......
......@@ -124,6 +124,56 @@ app.directive('logout', function ($http, $location, RESTURL) {
};
})
/**
*
*/
.directive('sortDirective', function (Generator, $log) {
return {
templateUrl: 'shared/templates/directives/sort.html',
restrict: 'E',
replace: true,
link: function ($scope) {
// titleMap will be list
$scope.titleMap = [{ value: "artan", name: "Artan" }, { value: "azalan", name: "Azalan" }];
$scope.sortForm = [
{key: 'sortbox', htmlClass: "pull-left", type: "select", titleMap: $scope.titleMap},
{type: "submit", title: "Sırala", htmlClass: "pull-left"}];
$scope.sortSchema = {
type: "object",
properties: {
sortbox: {
type: "select",
title: "Sırala"
}
},
required: ['sortbox']
};
$scope.sortModel = {sortbox: ''};
$scope.sortSubmit = function (form) {
$scope.$broadcast('schemaFormValidate');
if (form.$valid) {
var sortparams = {
url: $scope.wf,
token: $scope.$parent.token,
object_id: $scope.$parent.object_id,
form_params: {
model: $scope.$parent.form_params.model,
cmd: $scope.$parent.reload_cmd,
flow: $scope.$parent.form_params.flow,
param: 'sort',
id: $scope.sortModel.sortbox
}
};
Generator.submit(sortparams);
}
}
}
};
})
/**
* collapseMenu directive
......@@ -179,8 +229,10 @@ app.directive('logout', function ($http, $location, RESTURL) {
//controller: "CRUDAddEditCtrl",
replace: true,
link: function ($scope) {
$scope.style = 'width:calc(100% - 300px);';
$scope.$on('$routeChangeStart', function () {
$scope.style = $location.path() === '/dashboard' ? 'width:calc(100% - 300px);' : 'width:%100 !important;';
console.log('style of header', $location.path())
});
}
};
......
<form class="form-inline col-md-8" id="search" name="search" sf-schema="searchSchema" sf-form="searchForm"
<form class="form-inline pull-right" id="search" name="search" sf-schema="searchSchema" sf-form="searchForm"
sf-model="searchModel"
ng-submit="searchSubmit(search)"></form>
\ No newline at end of file
......@@ -4,7 +4,8 @@
</div>
<div class="sidebar-nav navbar-collapse">
<ul class="nav in" id="side-menu" ng-class="{hidden: $root.loggedInUser != true}">
<ul class="nav in" id="side-menu" ng-class="{hidden: $root.loggedInUser != true}" data-step="1"
data-intro="seçilen personele veya öğrenciye göre ilgili menüler yer almaktadır. yapılacak işlemi buradan seçebilirsiniz.">
<!--<sidebar-search></sidebar-search>-->
<li ui-sref-active="active">
<a href="#/dashboard" ng-click="breadcrumb(['Panel'])"><i class="fa fa-dashboard fa-fw"></i>
......@@ -24,10 +25,9 @@
</a>
<ul class="nav nav-second-level" ng-class="{hidden: $root.collapsed}">
<li ng-repeat="(k, v) in item">
<a ng-if="v['baseCategory'] == 'other'" ng-href="#{{v.url}}" ng-
ng-click="breadcrumb([key, v.text], $event)">{{v.text}}</a>
<a ng-if="v['baseCategory'] == 'ogrenci' || v['baseCategory'] == 'personel'"
ng-href="#/{{v.wf}}/{{v.model}}?{{v.param}}={{$root.selectedUser.key}}"
<!--<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}}"
ng-click="breadcrumb([key, v.text], $event)">{{v.text}}</a>
</li>
</ul>
......@@ -37,9 +37,10 @@
</div>
<!-- /.sidebar-collapse -->
<footer ng-class="{hidden: $root.collapsed}">
<a class="btn btn-large btn-success" href="javascript:void(0);" onclick="javascript:introJs().setOptions({
'nextLabel': 'Sonraki', 'prevLabel': 'Öncek', 'skipLabel': 'Atla', 'doneLabel': 'Bitir' }).start();">Yardım
Rehberi</a><br>
<span>v <app-version></app-version> &copy; ZetaOps</span>
</footer>
</div>
<form class="form-inline pull-left" id="sort" name="sort" sf-schema="sortSchema" sf-form="sortForm"
sf-model="sortModel"
ng-submit="sortSubmit(sort)"></form>
\ No newline at end of file
......@@ -19,7 +19,7 @@
</span>
<input type="text"
ng-model="$$value$$"
typeahead="item.name for item in form.titleMap"
uib-typeahead="item as item.name for item in form.titleMap | filter:{name:$viewValue}"
typeahead-on-select="form.onSelect($item)"
placeholder="{{form.title}}"
ng-model-options="form.ngModelOptions"
......
<div class="modal-body">
<h3>{{schema.title}}</h3>
<form name="linkedModelForm" sf-schema="schema" sf-form="form" sf-model="model"></form>
<div class="buttons-on-top-modal"></div>
<hr>
<form name="linkedModelForm" sf-schema="schema" sf-form="form" sf-model="model" modal-form-locator></form>
<hr>
<div class="buttons-on-bottom-modal"></div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary" ng-click="onSubmit(linkedModelForm)">OK</button>
<!--<button type="submit" class="btn btn-primary" ng-click="onSubmit(linkedModelForm)">OK</button>-->
<button type="button" class="btn btn-warning" ng-click="cancel()">Cancel</button>
</div>
\ No newline at end of file
<div class="modal-body">
<h3>{{schema.title}}</h3>
<form name="listnodeform" sf-schema="schema" sf-form="form" sf-model="model"></form>
<form name="modalForm" sf-schema="schema" sf-form="form" sf-model="model" modal-form-locator></form>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary" ng-click="onSubmit(listnodeform)">OK</button>
<button type="submit" class="btn btn-primary" ng-click="onNodeSubmit()">OK</button>
<button type="button" class="btn btn-warning" ng-click="cancel()">Cancel</button>
</div>
\ No newline at end of file
<div class="form-group {{form.htmlClass}} schema-form-select col-md-12"
ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess(), 'has-feedback': form.feedback !== false}">
<div class="col-md-8">
<label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">
{{form.title}}
</label>
<div class="row">
<div class="form-group input-group">
<input type="text"
placeholder="{{form.title}} filtrele"
class="form-control {{form.fieldHtmlClass}}"
name="filter-interface"
ng-model="form.filterValue"
ng-keyup="form.appendFiltered(form.filterValue)"
/>
</div>
</div>
<div class="row">
<div class="col-md-5">
<label for="filterItems">{{form.title}} Liste</label>
<select ng-model="selectedItemsModel"
value="$$value$$"
ng-model-options="form.ngModelOptions"
ng-disabled="form.readonly"
sf-changed="form"
class="form-control {{form.fieldHtmlClass}}"
schema-validate="form"
ng-options="item as item.name for item in form.filteredItems"
name="filterItems" multiple>
</select>
</div>
<div class="col-md-1">
<a href="javascript:void(0)" ng-click="form.select(selectedItemsModel)"><i class="fa fa-arrow-right fa-fw"></i></a><br>
<a href="javascript:void(0)" ng-click="form.deselect(selectedFilteredItemsModel)"><i class="fa fa-arrow-left fa-fw"></i></a>
</div>
<div class="col-md-5">
<label for="selectedItems">Seçilenler</label>
<select ng-model="selectedFilteredItemsModel"
value="$$value$$"
ng-model-options="form.ngModelOptions"
ng-disabled="form.readonly"
sf-changed="form"
class="form-control {{form.fieldHtmlClass}}"
schema-validate="form"
ng-options="item as item.name for item in form.selectedFilteredItems"
name="selectedItems" multiple>
</select>
</div>
</div>
<div class="help-block" sf-message="form.description"></div>
</div>
<div class="col-md-4">
<a href="javascript:void(0);" add-modal-for-linked-model>
<i class="fa fa-plus-circle fa-fw"></i>
</a>
</div>
</div>
\ No newline at end of file
<div class="tablescroll">
<table class="table table-bordered" style="background-color:#fff;">
<thead>
<tr ng-if="node.schema.formType=='Node'">
{{node.model}}
<!--<table class="table table-bordered" style="background-color:#fff;">-->
<!--<thead>-->
<!--<tr ng-if="node.schema.formType=='Node'">-->
<!--&lt;!&ndash;<th colspan="2">&ndash;&gt;-->
<!--&lt;!&ndash;<label>&ndash;&gt;-->
<!--&lt;!&ndash;<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">&ndash;&gt;-->
<!--&lt;!&ndash;Hepsini Seç&ndash;&gt;-->
<!--&lt;!&ndash;</label>&ndash;&gt;-->
<!--&lt;!&ndash;</th>&ndash;&gt;-->
<!--<th ng-repeat="(key,value) in node.model">{{ key }}</th>-->
<!--<th>İşlem</th>-->
<!--</tr>-->
<!--<tr ng-if="node.schema.formType=='ListNode'">-->
<!--<th colspan="2">-->
<!--<label>-->
<!--<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">-->
<!--Hepsini Seç-->
<!--</label>-->
<!--</th>-->
<th ng-repeat="(key,value) in node.model">{{ key }}</th>
<th>İşlem</th>
</tr>
<tr ng-if="node.schema.formType=='ListNode'">
<th colspan="2">
<label>
<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">
Hepsini Seç
</label>
</th>
<th ng-repeat="(key,value) in node.model[0]">{{ key }}</th>
<th>İşlem</th>
</tr>
</thead>
<tbody ng-class="{hidden: node.lengthModels < 1}">
<!--<th ng-repeat="(key,value) in node.model[0]">{{ key }}</th>-->
<!--<th>İşlem</th>-->
<!--</tr>-->
<!--</thead>-->
<!--<tbody ng-class="{hidden: node.lengthModels < 1}">-->
<tr ng-if="node.schema.formType=='Node'">
<!--<tr ng-if="node.schema.formType=='Node'">-->
<!--&lt;!&ndash;<td width="60">&ndash;&gt;-->
<!--&lt;!&ndash;<label>&ndash;&gt;-->
<!--&lt;!&ndash;<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">&ndash;&gt;-->
<!--&lt;!&ndash;</label>&ndash;&gt;-->
<!--&lt;!&ndash;</td>&ndash;&gt;-->
<!--&lt;!&ndash;<th scope="row" style="text-align:center">1</th>&ndash;&gt;-->
<!--<td ng-repeat="value in node.model">{{ value }}</td>-->
<!--<td>-->
<!--<button modal-for-nodes="{{node.schema.model_name}},{{node.schema.formType}},edit">Düzenle</button><br>-->
<!--<button>Sil</button>-->
<!--</td>-->
<!--</tr>-->
<!--<tr ng-repeat="listnodemodel in node.model" ng-if="node.schema.formType=='ListNode'">-->
<!--<td width="60">-->
<!--<label>-->
<!--<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">-->
<!--</label>-->
<!--</td>-->
<!--<th scope="row" style="text-align:center">1</th>-->
<td ng-repeat="value in node.model">{{ value }}</td>
<td>
<button modal-for-nodes="{{node.schema.model_name}},{{node.schema.formType}},edit">Düzenle</button><br>
<button>Sil</button>
</td>
</tr>
<tr ng-repeat="listnodemodel in node.model" ng-if="node.schema.formType=='ListNode'">
<td width="60">
<label>
<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">
</label>
</td>
<th scope="row" style="text-align:center">{{$index+1}}</th>
<td ng-repeat="(k, v) in listnodemodel">{{ v }}</td>
<td>
<button modal-for-nodes="{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}">Düzenle</button><br>
<button>Sil</button>
</td>
</tr>
<!--<th scope="row" style="text-align:center">{{$index+1}}</th>-->
<!--<td ng-repeat="(k, v) in listnodemodel">{{ v }}</td>-->
<!--<td>-->
<!--<button modal-for-nodes="{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}">Düzenle</button><br>-->
<!--<button>Sil</button>-->
<!--</td>-->
<!--</tr>-->
</tbody>
</table>
<!--</tbody>-->
<!--</table>-->
</div>
\ No newline at end of file
......@@ -31,7 +31,8 @@ angular.module('formService', ['ui.bootstrap'])
*/
generator.makeUrl = function (scope) {
var getparams = scope.form_params.param ? "?" + scope.form_params.param + "=" + scope.form_params.id : "";
return RESTURL.url + scope.url + '/' + (scope.form_params.model || '') + getparams;
//return RESTURL.url + scope.url + '/' + (scope.form_params.model || '') + getparams;
return RESTURL.url + scope.url + getparams;
};
/**
* @name generate
......@@ -99,6 +100,8 @@ angular.module('formService', ['ui.bootstrap'])
*/
generator.prepareFormItems = function (scope) {
//scope.schema.properties.Permissions ? scope.schema.properties.Permissions['widget']='filter_interface':true;
// todo: remove after backend fix
angular.forEach(scope.form, function (value, key) {
if (value.type === 'select') {
......@@ -132,11 +135,16 @@ angular.module('formService', ['ui.bootstrap'])
if (v.type === 'submit' || v.type === 'button') {
var buttonPositions = {bottom: 'move-to-bottom', top: 'move-to-top', none: ''};
var buttonPositions = scope.modalElements ? scope.modalElements.buttonPositions : {bottom: 'move-to-bottom', top: 'move-to-top', none: ''};
var workOnForm = scope.modalElements ? scope.modalElements.workOnForm : 'formgenerated';
var workOnDiv = scope.modalElements ? scope.modalElements.workOnDiv : '';
var buttonClass = (buttonPositions[v.position] || buttonPositions.bottom);
var redirectTo = scope.modalElements ? false : true;
scope.form[scope.form.indexOf(k)] = {
type: v.type,
title: v.title,
style: "btn-primary hide " + (buttonPositions[v.position] || "move-to-bottom"),
style: "btn-primary hide " + buttonClass,
onClick: function () {
delete scope.form_params.cmd;
delete scope.form_params.flow;
......@@ -148,20 +156,36 @@ angular.module('formService', ['ui.bootstrap'])
}
scope.model[k] = 1;
// todo: test it
scope.$broadcast('schemaFormValidate');
if (scope.formgenerated.$valid) {
generator.submit(scope);
if (scope.modalElements) {
scope.submitModalForm();
} else {
if (v.validation === false) {
generator.submit(scope, redirectTo);
} else {
scope.$broadcast('schemaFormValidate');
if (scope[workOnForm].$valid) {
generator.submit(scope, redirectTo);
scope.$broadcast('disposeModal');
}
}
}
}
};
// replace buttons according to their position values
$timeout(function () {
var buttonsToBottom = angular.element(document.querySelector('.move-to-bottom'));
angular.element(document.querySelector('.buttons-on-bottom')).append(buttonsToBottom);
var buttonsToTop = angular.element(document.querySelector('.move-to-top'));
angular.element(document.querySelector('.buttons-on-bottom')).append(buttonsToTop);
var selectorBottom = '.buttons-on-bottom'+workOnDiv;
//var selectorTop = '.buttons-on-top'+workOnDiv;
var buttonsToBottom = angular.element(document.querySelector('.' + buttonClass));
angular.element(document.querySelector(selectorBottom)).append(buttonsToBottom);
//var buttonsToTop = angular.element(document.querySelector('.' + buttonClass));
//angular.element(document.querySelector(selectorTop)).append(buttonsToTop);
$log.debug(selectorBottom, buttonsToBottom);
$log.debug(angular.element(document.querySelector(selectorBottom)));
buttonsToBottom.removeClass('hide');
buttonsToTop.removeClass('hide');
//buttonsToTop.removeClass('hide');
});
}
......@@ -177,7 +201,12 @@ angular.module('formService', ['ui.bootstrap'])
dateFormat: "dd.mm.yy",
onSelect: function (date, inst) {
scope.model[k] = date;
scope.$broadcast('schemaForm.error.' + k, 'tv4-302', true);
if (scope.modalElements) {
scope.validateModalDate(k);
}
else {
scope.$broadcast('schemaForm.error.' + k, 'tv4-302', true);
}
}
});
});
......@@ -200,7 +229,41 @@ angular.module('formService', ['ui.bootstrap'])
if (v.type === 'model') {
var formitem = scope.form[scope.form.indexOf(k)];
var modelscope = {"url": v.wf, "form_params": {model: v.model_name, cmd: v.list_cmd}};
var modelScope = {"url": v.wf, "form_params": {model: v.model_name, cmd: v.list_cmd}};
//scope.$on('refreshTitleMap', function (event, data) {
// todo: write a function to refresh titleMap after new item add to linkedModel
//});
scope.generateTitleMap = function (modelScope) {
generator.get_list(modelScope).then(function (res) {
formitem.titleMap = [];
angular.forEach(res.data.objects, function (item) {
if (item !== "-1") {
formitem.titleMap.push({
"value": item.key,
"name": item.value
});
}
// get selected item from titleMap using model value
if (item.key === scope.model[k]) {
formitem.selected_item = {value: item.key, name: item.value};
}
});
try {
// after rendering change input value to model value
scope.$watch(document.querySelector('input[name=' + v.model_name + ']'),
function () {
angular.element(document.querySelector('input[name=' + v.model_name + ']')).val(formitem.selected_item.name);
}
);
}
catch (e) {
$log.debug('exception', e);
}
})
};
formitem = {
type: "template",
......@@ -210,7 +273,26 @@ angular.module('formService', ['ui.bootstrap'])
add_cmd: v.add_cmd,
name: v.model_name,
model_name: v.model_name,
titleMap: generator.get_list(modelscope).then(function (res) {
selected_item: {},
titleMap: scope.generateTitleMap(modelScope),
onSelect: function (item) {
scope.model[k] = item.value;
},
onDropdownSelect: function (item, inputname) {
scope.model[k] = item.value;
jQuery('input[name=' + inputname + ']').val(item.name);
}
};
scope.form[scope.form.indexOf(k)] = formitem;
}
if ((v.type === 'ListNode' || v.type === 'Node') && v.widget === 'filter_interface') {
var formitem = scope.form[scope.form.indexOf(k)];
var modelScope = {"url": v.wf || scope.wf, "form_params": {model: v.model_name || v.schema[0].model_name, cmd: v.list_cmd || 'select_list'}};
scope.generateTitleMap = function (modelScope) {
generator.get_list(modelScope).then(function (res) {
formitem.titleMap = [];
angular.forEach(res.data.objects, function (item) {
if (item !== "-1") {
......@@ -220,34 +302,81 @@ angular.module('formService', ['ui.bootstrap'])
});
}
// get selected item from titleMap using model value
if (item.key === scope.model[k]) {formitem.selected_item = {value: item.key, name: item.value};}
if (item.key === scope.model[k]) {
formitem.selected_item = {value: item.key, name: item.value};
}
});
// after rendering change input value to model value
scope.$watch(document.querySelector('input[name='+ v.model_name+']'),
function(){
angular.element(document.querySelector('input[name='+ v.model_name+']')).val(formitem.selected_item.name);
scope.$watch(document.querySelector('input[name=' + v.model_name + ']'),
function () {
angular.element(document.querySelector('input[name=' + v.model_name + ']')).val(formitem.selected_item.name);
}
);
}),
})
};
formitem = {
type: "template",
templateUrl: "shared/templates/multiselect.html",
title: v.title,
wf: v.wf,
add_cmd: v.add_cmd,
name: v.model_name,
model_name: v.model_name,
filterValue: '',
selected_item: {},
filteredItems: [],
selectedFilteredItems: [],
titleMap: scope.generateTitleMap(modelScope),
onSelect: function (item) {
scope.model[k] = item.value;
},
onDropdownSelect: function (item, inputname) {
scope.model[k] = item.value;
jQuery('input[name=' + inputname + ']').val(item.name);
},
appendFiltered: function (filterValue) {
formitem.filteredItems = [];
if (filterValue.length > 2) {
angular.forEach(formitem.titleMap, function (value, key) {
if (value.name.indexOf(filterValue) > -1) {
formitem.filteredItems.push(formitem.titleMap[key]);
}
});
}
formitem.filteredItems = generator.get_diff_array(formitem.filteredItems, formitem.selectedFilteredItems);
},
select: function (selectedItemsModel) {
formitem.selectedFilteredItems = formitem.selectedFilteredItems.concat(selectedItemsModel);
formitem.appendFiltered(formitem.filterValue);
scope.model[k] = formitem.dataToModel(selectedItemsModel);
},
deselect: function (selectedFilteredItemsModel) {
formitem.selectedFilteredItems = generator.get_diff_array(formitem.selectedFilteredItems, selectedFilteredItemsModel);
formitem.appendFiltered(formitem.filterValue);
scope.model[k] = formitem.dataToModel(formitem.selectedFilteredItems);
},
dataToModel: function (data) {
var dataValues = [];
angular.forEach(data, function (value, key) {
var dataKey = {};
dataKey[v.schema[0].name]=value.value;
dataValues.push(dataKey);
});
return dataValues;
}
};
// get model objects from db and add to select list
scope.form[scope.form.indexOf(k)] = formitem;
}
if (v.type === 'ListNode' || v.type === 'Node') {
if ((v.type === 'ListNode' || v.type === 'Node') && v.widget !== 'filter_interface') {
scope[v.type] = scope[v.type] || {};
scope[v.type][k] = {
// no pass by reference
scope[v.type][k] = angular.copy({
title: v.title,
form: [],
schema: {
......@@ -259,13 +388,16 @@ angular.module('formService', ['ui.bootstrap'])
model_name: k
},
url: scope.url
};
});
if (scope.model[k] === null) {
scope[v.type][k].model = v.type === 'Node' ? {} : [];
} else {
scope[v.type][k].model = scope.model[k];
}
//if (scope.model[k] === null) {
// scope[v.type][k].model = v.type === 'Node' ? {} : [];
//} else {
// scope[v.type][k].model = scope.model[k];
//}
scope[v.type][k].model = angular.copy(scope.model[k]) || {};
if (v.type === 'ListNode') {scope[v.type][k].items = [];}
angular.forEach(v.schema, function (item) {
scope[v.type][k].schema.properties[item.name] = item;
......@@ -312,7 +444,7 @@ angular.module('formService', ['ui.bootstrap'])
// tab without modal. 'modal' will use modal to manipulate data and do all actions in that modal. 'new'
// will be open new page with response data
var _do = {
normal: function(){
normal: function () {
$log.debug('normal mode starts');
$scope.form_params.cmd = cmd;
$scope.form_params.object_id = key;
......@@ -321,8 +453,12 @@ angular.module('formService', ['ui.bootstrap'])
$scope.form_params.token = $scope.token;
return generator.get_wf($scope);
},
modal: function(){$log.debug('modal mode is not not ready');},
new: function(){$log.debug('new mode is not not ready');}
modal: function () {
$log.debug('modal mode is not not ready');
},
new: function () {
$log.debug('new mode is not not ready');
}
};
return _do[mode]();
};
......@@ -356,7 +492,16 @@ angular.module('formService', ['ui.bootstrap'])
return $http
.post(generator.makeUrl(scope), scope.form_params)
.then(function (res) {
return generator.pathDecider(res.data.client_cmd, scope, res.data);
if (res.data.client_cmd) {
return generator.pathDecider(res.data.client_cmd, scope, res.data);
}
if (res.data.msgbox) {
scope.msgbox = res.data.msgbox;
var newElement = $compile("<msgbox></msgbox>")(scope);
// this is the default action, which is removing page items and reload page with msgbox
angular.element(document.querySelector('.main.ng-scope')).children().remove();
angular.element(document.querySelector('.main.ng-scope')).append(newElement);
}
});
};
generator.isValidEmail = function (email) {
......@@ -414,7 +559,10 @@ angular.module('formService', ['ui.bootstrap'])
* @param data
*/
generator.pathDecider = function (client_cmd, $scope, data) {
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {$rootScope.$broadcast('reload_cmd', client_cmd[0]); return;}
if (client_cmd[0] === 'reload' || client_cmd[0] === 'reset') {
$rootScope.$broadcast('reload_cmd', client_cmd[0]);
return;
}
/**
* @name redirectTo
* @description
......@@ -474,12 +622,22 @@ angular.module('formService', ['ui.bootstrap'])
return result;
};
generator.get_diff_array = function (array1, array2) {
var result = [];
angular.forEach(array1, function (value, key) {
if (array2.indexOf(value) < 0) {
result.push(value);
}
});
return result;
};
/**
* submit function is general function for submiting forms
* @param $scope
* @returns {*}
*/
generator.submit = function ($scope) {
generator.submit = function ($scope, redirectTo) {
// todo: diff for all submits to recognize form change. if no change returns to view with no submit
angular.forEach($scope.ListNode, function (value, key) {
......@@ -499,15 +657,17 @@ angular.module('formService', ['ui.bootstrap'])
return $http.post(generator.makeUrl($scope), data)
.success(function (data) {
if (data.client_cmd) {
generator.pathDecider(data.client_cmd, $scope, data);
}
if (data.msgbox) {
$scope.msgbox = data.msgbox;
var newElement = $compile("<msgbox></msgbox>")($scope);
// this is the default action, which is removing page items and reload page with msgbox
angular.element(document.querySelector('.main.ng-scope')).children().remove();
angular.element(document.querySelector('.main.ng-scope')).append(newElement);
if (redirectTo === true) {
if (data.client_cmd) {
generator.pathDecider(data.client_cmd, $scope, data);
}
if (data.msgbox) {
$scope.msgbox = data.msgbox;
var newElement = $compile("<msgbox></msgbox>")($scope);
// this is the default action, which is removing page items and reload page with msgbox
angular.element(document.querySelector('.main.ng-scope')).children().remove();
angular.element(document.querySelector('.main.ng-scope')).append(newElement);
}
}
});
};
......@@ -519,27 +679,47 @@ angular.module('formService', ['ui.bootstrap'])
* @description
* controller for listnode, node and linkedmodel modal and save data of it
* @param items
* @requires $scope, $modalInstance, $route
* @requires $scope, $uibModalInstance, $route
* @returns returns value for modal
*/
.controller('ModalCtrl', function ($scope, $modalInstance, Generator, items) {
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) {
$scope[key] = items[key];
});
Generator.prepareFormItems($scope);
$scope.$on('disposeModal', function () {
$scope.cancel();
});
$scope.$on('modalFormLocator', function (event) {
$scope.linkedModelForm = event.targetScope.linkedModelForm;
});
$scope.$on('submitModalForm', function () {
$scope.onSubmit($scope.linkedModelForm);
});
$scope.$on('validateModalDate', function (event, field) {
$scope.$broadcast('schemaForm.error.' + field, 'tv4-302', true);
});
$scope.onSubmit = function (form) {
$scope.$broadcast('schemaFormValidate');
if (form.$valid) {
// send form to modalinstance result function
$modalInstance.close($scope);
$uibModalInstance.close($scope);
}
};
$scope.onNodeSubmit = function () {
$uibModalInstance.close($scope);
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
})
......@@ -547,15 +727,15 @@ angular.module('formService', ['ui.bootstrap'])
* @name modalForNodes
* @description
* add modal directive for nodes
* @param $modal
* @param $uibModal
* @returns openmodal directive
*/
.directive('modalForNodes', function ($modal) {
.directive('modalForNodes', function ($uibModal, Generator) {
return {
link: function (scope, element, attributes) {
element.on('click', function () {
var modalInstance = $modal.open({
var modalInstance = $uibModal.open({
animation: false,
templateUrl: 'shared/templates/listnodeModalContent.html',
controller: 'ModalCtrl',
......@@ -578,24 +758,38 @@ angular.module('formService', ['ui.bootstrap'])
// tell result.then function which item to edit
node.edit = attribs[3];
return node;
scope.node.schema.wf = scope.node.url;
angular.forEach(scope.node.schema.properties, function (value, key) {
scope.node.schema.properties[key].wf = scope.node.url;
scope.node.schema.properties[key].list_cmd = 'select_list';
});
var newscope = {
url: scope.node.url,
form_params: {model: scope.node.schema.model_name}
};
Generator.generate(newscope, {forms:scope.node});
scope.model = {};
return scope.node;
}
}
});
modalInstance.result.then(function (childmodel, key) {
if (childmodel.schema.formType === 'Node') {
scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model = childmodel.model;
}
if (childmodel.schema.formType === 'ListNode') {
if (childmodel.edit) {
scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model[childmodel.edit] = childmodel.model;
} else {
scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model.push(childmodel.model);
}
}
//if (childmodel.schema.formType === 'Node') {
// scope.$parent.model[childmodel.schema.model_name] = childmodel.model;
//}
//
//if (childmodel.schema.formType === 'ListNode') {
// if (childmodel.edit) {
// scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model[childmodel.edit] = childmodel.model;
// } else {
// scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model.push(childmodel.model);
// }
//}
scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].lengthModels += 1;
});
......@@ -609,16 +803,17 @@ angular.module('formService', ['ui.bootstrap'])
* @name addModalForLinkedModel
* @description
* add modal directive for linked models
* @param $modal, Generator
* @param $uibModal, Generator
* @returns openmodal directive
*/
.directive('addModalForLinkedModel', function ($modal, $route, Generator) {
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return {
link: function (scope, element) {
element.on('click', function () {
var modalInstance = $modal.open({
animation: false,
var modalInstance = $uibModal.open({
animation: true,
backdrop:'static',
templateUrl: 'shared/templates/linkedModelModalContent.html',
controller: 'ModalCtrl',
size: 'lg',
......@@ -626,36 +821,55 @@ angular.module('formService', ['ui.bootstrap'])
items: function () {
return Generator.get_form({
url: scope.form.wf,
form_params: {model: scope.form.model_name, cmd: scope.form.add_cmd}
form_params: {model: scope.form.model_name, cmd: scope.form.add_cmd},
modalElements: {
buttonPositions: {bottom: 'move-to-bottom-modal', top: 'move-to-top-modal', none: ''},
workOnForm: 'linkedModelForm',
workOnDiv: '-modal'
},
submitModalForm: function () {
$rootScope.$broadcast('submitModalForm');
},
validateModalDate: function (field) {
$rootScope.$broadcast('validateModalDate', field);
}
});
}
}
});
modalInstance.result.then(function (childscope, key) {
Generator.submit(childscope);
$route.reload();
Generator.submit(childscope, false);
//$route.reload();
});
});
}
};
})
.directive('modalFormLocator', function () {
return {
link: function (scope) {
scope.$emit('modalFormLocator');
}
}
})
/**
* @name editModalForLinkedModel
* @description
* edit modal directive for linked models
* @param $modal, Generator
* @param $uibModal, Generator
* @returns openmodal directive
*/
// todo: useless modal check if any use cases?? and delete if useless
.directive('editModalForLinkedModel', function ($modal, Generator) {
.directive('editModalForLinkedModel', function ($uibModal, Generator) {
return {
link: function (scope, element) {
element.on('click', function () {
var modalInstance = $modal.open({
var modalInstance = $uibModal.open({
animation: false,
templateUrl: 'shared/templates/linkedModelModalContent.html',
controller: 'ModalCtrl',
......
......@@ -14,14 +14,15 @@
"angular-route": "1.4.x",
"angular-resource": "1.4.x",
"angular-cookies": "1.4.x",
"angular-bootstrap": "0.13.1",
"angular-bootstrap": "0.14.3",
"font-awesome": "4.3.0",
"angular-schema-form": "0.8.3",
"angular-loading-bar": "~0.8.0",
"angular-toggle-switch": "~1.2.1",
"metisMenu": "~1.1.3",
"angular-chart.js": "~0.5.2",
"angular-gettext": "2.1.0"
"angular-gettext": "2.1.0",
"intro.js": "1.1.1"
},
"resolutions": {
"angular": "1.4.7"
......
/*! ulakbus-ui 2015-11-25 */
"use strict";var app=angular.module("ulakbus",["ui.bootstrap","angular-loading-bar","ngRoute","ngSanitize","ngCookies","formService","ulakbus.dashboard","ulakbus.auth","ulakbus.error_pages","ulakbus.crud","ulakbus.debug","ulakbus.devSettings","ulakbus.version","gettext","templates-prod"]).constant("RESTURL",function(){var backendurl=location.href.indexOf("nightly")?"//nightly.api.ulakbus.net/":"//api.ulakbus.net/";if(document.cookie.indexOf("backendurl")>-1){var cookiearray=document.cookie.split(";");angular.forEach(cookiearray,function(item){item.indexOf("backendurl")>-1&&(backendurl=item.split("=")[1])})}if(location.href.indexOf("backendurl")>-1){var urlfromqstr=location.href.split("?")[1].split("=")[1];backendurl=decodeURIComponent(urlfromqstr.replace(/\+/g," ")),document.cookie="backendurl="+backendurl,window.location.href=window.location.href.split("?")[0]}return{url:backendurl}}()).constant("USER_ROLES",{all:"*",admin:"admin",student:"student",staff:"staff",dean:"dean"}).constant("AUTH_EVENTS",{loginSuccess:"auth-login-success",loginFailed:"auth-login-failed",logoutSuccess:"auth-logout-success",sessionTimeout:"auth-session-timeout",notAuthenticated:"auth-not-authenticated",notAuthorized:"auth-not-authorized"});app.config(["$routeProvider",function($routeProvider,$route){$routeProvider.when("/login",{templateUrl:"components/auth/login.html",controller:"LoginCtrl"}).when("/dashboard",{templateUrl:"components/dashboard/dashboard.html",controller:"DashCtrl"}).when("/dev/settings",{templateUrl:"components/devSettings/devSettings.html",controller:"DevSettingsCtrl"}).when("/debug/list",{templateUrl:"components/debug/debug.html",controller:"DebugCtrl"}).when("/:wf/",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/:model/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).otherwise({redirectTo:"/dashboard"})}]).run(function($rootScope){$rootScope.loggedInUser=!0,$rootScope.$on("$routeChangeStart",function(event,next,current){})}).config(["$httpProvider",function($httpProvider){$httpProvider.defaults.withCredentials=!0}]).run(function(gettextCatalog){gettextCatalog.setCurrentLanguage("tr"),gettextCatalog.debug=!0}).config(["cfpLoadingBarProvider",function(cfpLoadingBarProvider){cfpLoadingBarProvider.includeBar=!1,cfpLoadingBarProvider.parentSelector="loaderdiv",cfpLoadingBarProvider.spinnerTemplate='<div class="loader">Loading...</div>'}]),app.config(["$httpProvider",function($httpProvider){$httpProvider.interceptors.push(function($q,$rootScope,$location,$timeout){return{request:function(config){return"POST"===config.method&&(config.headers["Content-Type"]="text/plain"),config},response:function(response){return response.data._debug_queries&&response.data._debug_queries.length>0&&($rootScope.debug_queries=$rootScope.debug_queries||[],$rootScope.debug_queries.push({url:response.config.url,queries:response.data._debug_queries})),response.data.is_login===!1&&($rootScope.loggedInUser=response.data.is_login,$location.path("/login")),response.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),response},responseError:function(rejection){var errorModal=function(){var codefield="";rejection.data.error&&(codefield="<p><pre>"+rejection.data.error+"</pre></p>"),$('<div class="modal"><div class="modal-dialog" style="width:1024px;" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" id="exampleModalLabel">'+rejection.status+rejection.data.title+'</h4></div><div class="modal-body"><div class="alert alert-danger"><strong>'+rejection.data.description+"</strong>"+codefield+'</div></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button></div></div></div></div>').modal()};return-1===rejection.status&&(rejection.data={title:"error",description:"connection failed"},errorModal()),400===rejection.status&&$location.reload(),401===rejection.status&&($location.path("/login"),"/login"===$location.path()&&console.log("show errors on login form")),403===rejection.status&&(rejection.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),errorModal()),$rootScope.$broadcast("show_notifications",rejection.data),404===rejection.status&&errorModal(),500===rejection.status&&errorModal(),$q.reject(rejection)}}})}]),app.directive("logout",function($http,$location,RESTURL){return{link:function($scope,$element,$rootScope){$element.on("click",function(){$http.post(RESTURL.url+"logout",{}).then(function(){$rootScope.loggedInUser=!1,$location.path("/login")})})}}}).directive("headerNotification",function($http,$rootScope,$cookies,$interval,RESTURL){return{templateUrl:"shared/templates/directives/header-notification.html",restrict:"E",replace:!0,link:function($scope){$scope.groupNotifications=function(notifications){$scope.notifications={1:[],2:[],3:[],4:[]},angular.forEach(notifications,function(value,key){$scope.notifications[value.type].push(value)})},$scope.getNotifications=function(){$http.get(RESTURL.url+"notify",{ignoreLoadingBar:!0}).success(function(data){$scope.groupNotifications(data.notifications),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.getNotifications(),$interval(function(){"on"==$cookies.get("notificate")&&$scope.getNotifications()},5e3),$scope.markAsRead=function(items){$http.post(RESTURL.url+"notify",{ignoreLoadingBar:!0,read:[items]}).success(function(data){$scope.groupNotifications(data.notifications),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.$on("markasread",function(event,data){$scope.markAsRead(data)})}}}).directive("searchDirective",function(Generator,$log){return{templateUrl:"shared/templates/directives/search.html",restrict:"E",replace:!0,link:function($scope){$scope.searchForm=[{key:"searchbox",htmlClass:"pull-left"},{type:"submit",title:"Ara",htmlClass:"pull-left"}],$scope.searchSchema={type:"object",properties:{searchbox:{type:"string",minLength:2,title:"Ara","x-schema-form":{placeholder:"Arama kriteri giriniz..."}}},required:["searchbox"]},$scope.searchModel={searchbox:""},$scope.searchSubmit=function(form){if($scope.$broadcast("schemaFormValidate"),form.$valid){var searchparams={url:$scope.wf,token:$scope.$parent.token,object_id:$scope.$parent.object_id,form_params:{model:$scope.$parent.form_params.model,cmd:$scope.$parent.reload_cmd,flow:$scope.$parent.form_params.flow,param:"query",id:$scope.searchModel.searchbox}};Generator.submit(searchparams)}}}}}).directive("collapseMenu",function($timeout,$window,$cookies){return{templateUrl:"shared/templates/directives/menuCollapse.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope){$rootScope.collapsed=!1,$rootScope.sidebarPinned=$cookies.get("sidebarPinned")||0,$scope.collapseToggle=function(){$window.innerWidth>"768"&&($rootScope.collapsed===!1?(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0,$rootScope.sidebarPinned=0,$cookies.put("sidebarPinned",0)):(jQuery("span.menu-text, span.arrow, .sidebar footer").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1,$rootScope.sidebarPinned=1,$cookies.put("sidebarPinned",1)))},$timeout(function(){"0"===$cookies.get("sidebarPinned")&&$scope.collapseToggle()})}}}).directive("headerSubMenu",function($location){return{templateUrl:"shared/templates/directives/header-sub-menu.html",restrict:"E",replace:!0,link:function($scope){$scope.$on("$routeChangeStart",function(){$scope.style="/dashboard"===$location.path()?"width:calc(100% - 300px);":"width:%100 !important;"})}}}).directive("headerBreadcrumb",function(){return{templateUrl:"shared/templates/directives/header-breadcrumb.html",restrict:"E",replace:!0}}).directive("selectedUser",function(){return{templateUrl:"shared/templates/directives/selected-user.html",restrict:"E",replace:!1,link:function($scope,$rootScope){$scope.selectedUser=$rootScope.selectedUser}}}).directive("sidebar",["$location",function(){return{templateUrl:"shared/templates/directives/sidebar.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope,$cookies,$route,$http,RESTURL,$location,$window,$timeout){$scope.prepareMenu=function(menuItems){var newMenuItems={};return angular.forEach(menuItems,function(value,key){angular.forEach(value,function(v,k){newMenuItems[k]=v})}),newMenuItems};var sidebarmenu=$("#side-menu");sidebarmenu.metisMenu(),$http.get(RESTURL.url+"menu/").success(function(data){function reGroupMenuItems(items,baseCategory){var newItems={};return angular.forEach(items,function(value,key){newItems[value.kategori]=newItems[value.kategori]||[],value.baseCategory=baseCategory,newItems[value.kategori].push(value)}),newItems}$scope.allMenuItems=angular.copy(data),angular.forEach($scope.allMenuItems,function(value,key){$scope.allMenuItems[key]=reGroupMenuItems(value,key)}),$rootScope.$broadcast("authz",data),$scope.menuItems=$scope.prepareMenu({other:$scope.allMenuItems.other}),$timeout(function(){sidebarmenu.metisMenu()})}),$scope.$on("menuitems",function(event,data){var menu={other:$scope.allMenuItems.other};menu[data]=$scope.allMenuItems[data],$scope.menuItems=$scope.prepareMenu(menu),$timeout(function(){sidebarmenu.metisMenu()})}),$scope.openSidebar=function(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(jQuery("span.menu-text, span.arrow, .sidebar footer, #side-menu").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1)},$scope.closeSidebar=function(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0)},$rootScope.$watch(function($rootScope){return $rootScope.section},function(newindex,oldindex){newindex>-1&&($scope.menuItems=[$scope.allMenuItems[newindex]],$scope.collapseVar=1)}),$scope.selectedMenu=$location.path(),$scope.collapseVar=0,$scope.multiCollapseVar=0,$scope.check=function(x){x===$scope.collapseVar?$scope.collapseVar=0:$scope.collapseVar=x},$scope.breadcrumb=function(itemlist,$event){$rootScope.breadcrumblinks=itemlist,$rootScope.showSaveButton=!1},$scope.multiCheck=function(y){y===$scope.multiCollapseVar?$scope.multiCollapseVar=0:$scope.multiCollapseVar=y}}}}]).directive("stats",function(){return{templateUrl:"shared/templates/directives/stats.html",restrict:"E",replace:!0,scope:{model:"=",comments:"@",number:"@",name:"@",colour:"@",details:"@",type:"@","goto":"@"}}}).directive("notifications",function(){return{templateUrl:"shared/templates/directives/notifications.html",restrict:"E",replace:!0}}).directive("msgbox",function(){return{templateUrl:"shared/templates/directives/msgbox.html",restrict:"E",replace:!1}}).directive("sidebarSearch",function(){return{templateUrl:"shared/templates/directives/sidebar-search.html",restrict:"E",replace:!0,scope:{},controller:function($scope){$scope.selectedMenu="home"}}});var auth=angular.module("ulakbus.auth",["ngRoute","schemaForm","ngCookies"]);auth.controller("LoginCtrl",function($scope,$q,$timeout,$routeParams,Generator,LoginService){$scope.url="login",$scope.form_params={},$scope.form_params.clear_wf=1,Generator.get_form($scope).then(function(data){$scope.form=[{key:"username",type:"string",title:"Kullanıcı Adı"},{key:"password",type:"password",title:"Şifre"},{type:"submit",title:"Giriş Yap"}]}),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid?LoginService.login($scope.url,$scope.model).error(function(data){$scope.message=data.title}):console.log("not valid")}}),auth.factory("LoginService",function($http,$rootScope,$location,$log,Session,RESTURL){var loginService={};return loginService.login=function(url,credentials){return credentials.cmd="do",$http.post(RESTURL.url+url,credentials).success(function(data,status,headers,config){$rootScope.loggedInUser=!0}).error(function(data,status,headers,config){return data})},loginService.logout=function(){return $log.info("logout"),$http.post(RESTURL.url+"logout",{}).success(function(data){$rootScope.loggedInUser=!1,$log.info("loggedout"),$location.path("/login")})},loginService.isAuthenticated=function(){return!!Session.userId},loginService.isAuthorized=function(authorizedRoles){return angular.isArray(authorizedRoles)||(authorizedRoles=[authorizedRoles]),loginService.isAuthenticated()&&-1!==loginService.indexOf(Session.userRole)},loginService.isValidEmail=function(email){var re=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return re.test(email)},loginService}),auth.service("Session",function(){this.create=function(sessionId,userId,userRole){this.id=sessionId,this.userId=userId,this.userRole=userRole},this.destroy=function(){this.id=null,this.userId=null,this.userRole=null}}),angular.module("ulakbus.dashboard",["ngRoute"]).controller("DashCtrl",function($scope,$rootScope,$timeout,$http,$cookies,RESTURL){$scope.section=function(section_index){$rootScope.section=section_index},$scope.$on("authz",function(event,data){$scope.menuitems=data}),$scope.student_kw="",$scope.staff_kw="",$scope.students=[],$scope.staffs=[],$scope.search=function(where){$timeout(function(){"personel"===where&&$scope.staff_kw.length>2&&$scope.getItems(where,$scope.staff_kw).success(function(data){$scope.staffs=data.results}),"ogrenci"===where&&$scope.student_kw.length>2&&$scope.getItems(where,$scope.student_kw).success(function(data){$scope.students=data.results})})},$scope.getItems=function(where,what){return $http.get(RESTURL.url+"ara/"+where+"/"+what)},$scope.select=function(who,type){$rootScope.selectedUser={name:who[0],tcno:who[1],key:who[2]},$rootScope.$broadcast("menuitems",type)},$scope.$on("notifications",function(event,data){$scope.notifications=data}),$scope.markAsRead=function(items){$rootScope.$broadcast("markasread",items)}}).directive("sidebarNotifications",function(){return{templateUrl:"shared/templates/directives/sidebar-notification.html",restrict:"E",replace:!0,link:function($scope){}}}),angular.module("ulakbus.crud",["ui.bootstrap","schemaForm","formService"]).service("CrudUtility",function($log){return{generateParam:function(scope,routeParams,cmd){return scope.url=routeParams.wf,angular.forEach(routeParams,function(value,key){key.indexOf("_id")>-1&&"param_id"!==key&&(scope.param=key,scope.param_id=value)}),scope.form_params={cmd:cmd,model:routeParams.model,param:scope.param||routeParams.param,id:scope.param_id||routeParams.param_id,wf:routeParams.wf,object_id:routeParams.key},scope.model=scope.form_params.model,scope.wf=scope.form_params.wf,scope.param=scope.form_params.param,scope.param_id=scope.form_params.id,scope},listPageItems:function(scope,pageData){angular.forEach(pageData,function(value,key){scope[key]=value}),angular.forEach(scope.objects,function(value,key){if(key>0){var linkIndexes={};angular.forEach(value.actions,function(v,k){"link"===v.show_as&&(linkIndexes=v)}),angular.forEach(value.fields,function(v,k){value.actions.length>0&&linkIndexes.fields?scope.objects[key].fields[k]={type:linkIndexes.fields.indexOf(k)>-1?"link":"str",content:v,cmd:linkIndexes.cmd,mode:linkIndexes.mode}:scope.objects[key].fields[k]={type:"str",content:v}})}}),$log.debug(scope.objects)}}}).controller("CRUDCtrl",function($scope,$routeParams,Generator,CrudUtility){CrudUtility.generateParam($scope,$routeParams),Generator.get_wf($scope)}).controller("CRUDListFormCtrl",function($scope,$rootScope,$location,$http,$log,$modal,$timeout,Generator,$routeParams,CrudUtility){if($scope.reload=function(reloadData){$scope.form_params.cmd=$scope.reload_cmd,$scope.form_params=angular.extend($scope.form_params,reloadData),$log.debug("reload data",$scope),Generator.get_wf($scope)},$scope.$on("reload_cmd",function(event,data){$scope.reload_cmd=data,$scope.reload({})}),$scope.$on("formLocator",function(event){$scope.formgenerated=event.targetScope.formgenerated}),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&Generator.submit($scope)},$scope.do_action=function(key,cmd,mode){Generator.doItemAction($scope,key,cmd,mode)},$scope.getNumber=function(num){return new Array(num)},"show"===$routeParams.cmd){CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd);var createListObjects=function(){angular.forEach($scope.object,function(value,key){"object"==typeof value&&($scope.listobjects[key]=value,delete $scope.object[key])})};$scope.listobjects={};var pageData=Generator.getPageData();pageData.pageData===!0?($scope.object=pageData.object,Generator.setPageData({pageData:!1})):Generator.get_single_item($scope).then(function(res){$scope.object=res.data.object,$scope.model=$routeParams.model}),createListObjects()}if("form"===$routeParams.cmd||"list"===$routeParams.cmd){var setpageobjects=function(data){CrudUtility.listPageItems($scope,data),Generator.generate($scope,data),Generator.setPageData({pageData:!1})},pageData=Generator.getPageData();pageData.pageData===!0&&($log.debug("pagedata",pageData.pageData),CrudUtility.generateParam($scope,pageData,$routeParams.cmd),setpageobjects(pageData,pageData)),(void 0===pageData.pageData||pageData.pageData===!1)&&(CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd),Generator.get_wf($scope))}"reload"===$routeParams.cmd&&$scope.reload({}),"reset"===$routeParams.cmd&&(delete $scope.token,$scope.cmd="reset",Generator.get_wf($scope))}).directive("crudListDirective",function(){return{templateUrl:"components/crud/templates/list.html",restrict:"E",replace:!0}}).directive("crudFormDirective",function(){return{templateUrl:"components/crud/templates/form.html",restrict:"E",replace:!0}}).directive("crudShowDirective",function(){return{templateUrl:"components/crud/templates/show.html",restrict:"E",replace:!0}}).directive("formLocator",function(){return{link:function(scope){scope.$emit("formLocator")}}}),angular.module("ulakbus.debug",["ngRoute"]).controller("DebugCtrl",function($scope,$rootScope,$location){$scope.debug_queries=$rootScope.debug_queries}),angular.module("ulakbus.devSettings",["ngRoute"]).controller("DevSettingsCtrl",function($scope,$cookies,$rootScope,RESTURL){$scope.backendurl=$cookies.get("backendurl"),$scope.notificate=$cookies.get("notificate")||"on",$scope.changeSettings=function(what,set){document.cookie=what+"="+set,$scope[what]=set,$rootScope.$broadcast(what,set)},$scope.switchOnOff=function(pinn){return"on"==pinn?"off":"on"},$scope.setbackendurl=function(){$scope.changeSettings("backendurl",$scope.backendurl),RESTURL.url=$scope.backendurl},$scope.setnotification=function(){$scope.changeSettings("notificate",$scope.switchOnOff($scope.notificate))}}),app.config(["$routeProvider",function($routeProvider){$routeProvider.when("/error/500",{templateUrl:"components/error_pages/500.html",controller:"500Ctrl"}).when("/error/404",{templateUrl:"components/error_pages/404.html",controller:"404Ctrl"})}]),angular.module("ulakbus.error_pages",["ngRoute"]).controller("500Ctrl",function($scope,$rootScope,$location){}).controller("404Ctrl",function($scope,$rootScope,$location){}),angular.module("ulakbus.version",["ulakbus.version.interpolate-filter","ulakbus.version.version-directive"]).value("version","0.4.1"),angular.module("ulakbus.version.interpolate-filter",[]).filter("interpolate",["version",function(version){return function(text){return String(text).replace(/\%VERSION\%/gm,version)}}]),angular.module("ulakbus.version.version-directive",[]).directive("appVersion",["version",function(version){return function(scope,elm,attrs){elm.text(version)}}]);
\ No newline at end of file
/*! ulakbus-ui 2015-12-01 */
"use strict";var app=angular.module("ulakbus",["ui.bootstrap","angular-loading-bar","ngRoute","ngSanitize","ngCookies","formService","ulakbus.dashboard","ulakbus.auth","ulakbus.error_pages","ulakbus.crud","ulakbus.debug","ulakbus.devSettings","ulakbus.version","gettext","templates-prod"]).constant("RESTURL",function(){var backendurl=location.href.indexOf("nightly")>-1?"//nightly.api.ulakbus.net/":"//api.ulakbus.net/";if(document.cookie.indexOf("backendurl")>-1){var cookiearray=document.cookie.split(";");angular.forEach(cookiearray,function(item){item.indexOf("backendurl")>-1&&(backendurl=item.split("=")[1])})}if(location.href.indexOf("backendurl")>-1){var urlfromqstr=location.href.split("?")[1].split("=")[1];backendurl=decodeURIComponent(urlfromqstr.replace(/\+/g," ")),document.cookie="backendurl="+backendurl,window.location.href=window.location.href.split("?")[0]}return{url:backendurl}}()).constant("USER_ROLES",{all:"*",admin:"admin",student:"student",staff:"staff",dean:"dean"}).constant("AUTH_EVENTS",{loginSuccess:"auth-login-success",loginFailed:"auth-login-failed",logoutSuccess:"auth-logout-success",sessionTimeout:"auth-session-timeout",notAuthenticated:"auth-not-authenticated",notAuthorized:"auth-not-authorized"});app.config(["$routeProvider",function($routeProvider,$route){$routeProvider.when("/login",{templateUrl:"components/auth/login.html",controller:"LoginCtrl"}).when("/dashboard",{templateUrl:"components/dashboard/dashboard.html",controller:"DashCtrl"}).when("/dev/settings",{templateUrl:"components/devSettings/devSettings.html",controller:"DevSettingsCtrl"}).when("/debug/list",{templateUrl:"components/debug/debug.html",controller:"DebugCtrl"}).when("/:wf/",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/:model/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).otherwise({redirectTo:"/dashboard"})}]).run(function($rootScope){$rootScope.loggedInUser=!0,$rootScope.$on("$routeChangeStart",function(event,next,current){})}).config(["$httpProvider",function($httpProvider){$httpProvider.defaults.withCredentials=!0}]).run(function(gettextCatalog){gettextCatalog.setCurrentLanguage("tr"),gettextCatalog.debug=!0}).config(["cfpLoadingBarProvider",function(cfpLoadingBarProvider){cfpLoadingBarProvider.includeBar=!1,cfpLoadingBarProvider.parentSelector="loaderdiv",cfpLoadingBarProvider.spinnerTemplate='<div class="loader">Loading...</div>'}]),app.config(["$httpProvider",function($httpProvider){$httpProvider.interceptors.push(function($q,$rootScope,$location,$timeout){return{request:function(config){return"POST"===config.method&&(config.headers["Content-Type"]="text/plain"),config},response:function(response){return response.data._debug_queries&&response.data._debug_queries.length>0&&($rootScope.debug_queries=$rootScope.debug_queries||[],$rootScope.debug_queries.push({url:response.config.url,queries:response.data._debug_queries})),response.data.is_login===!1&&($rootScope.loggedInUser=response.data.is_login,$location.path("/login")),response.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),response},responseError:function(rejection){var errorModal=function(){var codefield="";rejection.data.error&&(codefield="<p><pre>"+rejection.data.error+"</pre></p>"),$('<div class="modal"><div class="modal-dialog" style="width:1024px;" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" id="exampleModalLabel">'+rejection.status+rejection.data.title+'</h4></div><div class="modal-body"><div class="alert alert-danger"><strong>'+rejection.data.description+"</strong>"+codefield+'</div></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button></div></div></div></div>').modal()};return-1===rejection.status&&(rejection.data={title:"error",description:"connection failed"},errorModal()),400===rejection.status&&$location.reload(),401===rejection.status&&($location.path("/login"),"/login"===$location.path()&&console.log("show errors on login form")),403===rejection.status&&(rejection.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),errorModal()),$rootScope.$broadcast("show_notifications",rejection.data),404===rejection.status&&errorModal(),500===rejection.status&&errorModal(),$q.reject(rejection)}}})}]),app.directive("logout",function($http,$location,RESTURL){return{link:function($scope,$element,$rootScope){$element.on("click",function(){$http.post(RESTURL.url+"logout",{}).then(function(){$rootScope.loggedInUser=!1,$location.path("/login")})})}}}).directive("headerNotification",function($http,$rootScope,$cookies,$interval,RESTURL){return{templateUrl:"shared/templates/directives/header-notification.html",restrict:"E",replace:!0,link:function($scope){$scope.groupNotifications=function(notifications){$scope.notifications={1:[],2:[],3:[],4:[]},angular.forEach(notifications,function(value,key){$scope.notifications[value.type].push(value)})},$scope.getNotifications=function(){$http.get(RESTURL.url+"notify",{ignoreLoadingBar:!0}).success(function(data){$scope.groupNotifications(data.notifications),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.getNotifications(),$interval(function(){"on"==$cookies.get("notificate")&&$scope.getNotifications()},5e3),$scope.markAsRead=function(items){$http.post(RESTURL.url+"notify",{ignoreLoadingBar:!0,read:[items]}).success(function(data){$scope.groupNotifications(data.notifications),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.$on("markasread",function(event,data){$scope.markAsRead(data)})}}}).directive("searchDirective",function(Generator,$log){return{templateUrl:"shared/templates/directives/search.html",restrict:"E",replace:!0,link:function($scope){$scope.searchForm=[{key:"searchbox",htmlClass:"pull-left"},{type:"submit",title:"Ara",htmlClass:"pull-left"}],$scope.searchSchema={type:"object",properties:{searchbox:{type:"string",minLength:2,title:"Ara","x-schema-form":{placeholder:"Arama kriteri giriniz..."}}},required:["searchbox"]},$scope.searchModel={searchbox:""},$scope.searchSubmit=function(form){if($scope.$broadcast("schemaFormValidate"),form.$valid){var searchparams={url:$scope.wf,token:$scope.$parent.token,object_id:$scope.$parent.object_id,form_params:{model:$scope.$parent.form_params.model,cmd:$scope.$parent.reload_cmd,flow:$scope.$parent.form_params.flow,param:"query",id:$scope.searchModel.searchbox}};Generator.submit(searchparams)}}}}}).directive("sortDirective",function(Generator,$log){return{templateUrl:"shared/templates/directives/sort.html",restrict:"E",replace:!0,link:function($scope){$scope.titleMap=[{value:"artan",name:"Artan"},{value:"azalan",name:"Azalan"}],$scope.sortForm=[{key:"sortbox",htmlClass:"pull-left",type:"select",titleMap:$scope.titleMap},{type:"submit",title:"Sırala",htmlClass:"pull-left"}],$scope.sortSchema={type:"object",properties:{sortbox:{type:"select",title:"Sırala"}},required:["sortbox"]},$scope.sortModel={sortbox:""},$scope.sortSubmit=function(form){if($scope.$broadcast("schemaFormValidate"),form.$valid){var sortparams={url:$scope.wf,token:$scope.$parent.token,object_id:$scope.$parent.object_id,form_params:{model:$scope.$parent.form_params.model,cmd:$scope.$parent.reload_cmd,flow:$scope.$parent.form_params.flow,param:"sort",id:$scope.sortModel.sortbox}};Generator.submit(sortparams)}}}}}).directive("collapseMenu",function($timeout,$window,$cookies){return{templateUrl:"shared/templates/directives/menuCollapse.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope){$rootScope.collapsed=!1,$rootScope.sidebarPinned=$cookies.get("sidebarPinned")||0,$scope.collapseToggle=function(){$window.innerWidth>"768"&&($rootScope.collapsed===!1?(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0,$rootScope.sidebarPinned=0,$cookies.put("sidebarPinned",0)):(jQuery("span.menu-text, span.arrow, .sidebar footer").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1,$rootScope.sidebarPinned=1,$cookies.put("sidebarPinned",1)))},$timeout(function(){"0"===$cookies.get("sidebarPinned")&&$scope.collapseToggle()})}}}).directive("headerSubMenu",function($location){return{templateUrl:"shared/templates/directives/header-sub-menu.html",restrict:"E",replace:!0,link:function($scope){$scope.style="width:calc(100% - 300px);",$scope.$on("$routeChangeStart",function(){$scope.style="/dashboard"===$location.path()?"width:calc(100% - 300px);":"width:%100 !important;",console.log("style of header",$location.path())})}}}).directive("headerBreadcrumb",function(){return{templateUrl:"shared/templates/directives/header-breadcrumb.html",restrict:"E",replace:!0}}).directive("selectedUser",function(){return{templateUrl:"shared/templates/directives/selected-user.html",restrict:"E",replace:!1,link:function($scope,$rootScope){$scope.selectedUser=$rootScope.selectedUser}}}).directive("sidebar",["$location",function(){return{templateUrl:"shared/templates/directives/sidebar.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope,$cookies,$route,$http,RESTURL,$location,$window,$timeout){$scope.prepareMenu=function(menuItems){var newMenuItems={};return angular.forEach(menuItems,function(value,key){angular.forEach(value,function(v,k){newMenuItems[k]=v})}),newMenuItems};var sidebarmenu=$("#side-menu");sidebarmenu.metisMenu(),$http.get(RESTURL.url+"menu/").success(function(data){function reGroupMenuItems(items,baseCategory){var newItems={};return angular.forEach(items,function(value,key){newItems[value.kategori]=newItems[value.kategori]||[],value.baseCategory=baseCategory,newItems[value.kategori].push(value)}),newItems}$scope.allMenuItems=angular.copy(data),angular.forEach($scope.allMenuItems,function(value,key){$scope.allMenuItems[key]=reGroupMenuItems(value,key)}),$rootScope.$broadcast("authz",data),$scope.menuItems=$scope.prepareMenu({other:$scope.allMenuItems.other}),$timeout(function(){sidebarmenu.metisMenu()})}),$scope.$on("menuitems",function(event,data){var menu={other:$scope.allMenuItems.other};menu[data]=$scope.allMenuItems[data],$scope.menuItems=$scope.prepareMenu(menu),$timeout(function(){sidebarmenu.metisMenu()})}),$scope.openSidebar=function(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(jQuery("span.menu-text, span.arrow, .sidebar footer, #side-menu").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1)},$scope.closeSidebar=function(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0)},$rootScope.$watch(function($rootScope){return $rootScope.section},function(newindex,oldindex){newindex>-1&&($scope.menuItems=[$scope.allMenuItems[newindex]],$scope.collapseVar=1)}),$scope.selectedMenu=$location.path(),$scope.collapseVar=0,$scope.multiCollapseVar=0,$scope.check=function(x){x===$scope.collapseVar?$scope.collapseVar=0:$scope.collapseVar=x},$scope.breadcrumb=function(itemlist,$event){$rootScope.breadcrumblinks=itemlist,$rootScope.showSaveButton=!1},$scope.multiCheck=function(y){y===$scope.multiCollapseVar?$scope.multiCollapseVar=0:$scope.multiCollapseVar=y}}}}]).directive("stats",function(){return{templateUrl:"shared/templates/directives/stats.html",restrict:"E",replace:!0,scope:{model:"=",comments:"@",number:"@",name:"@",colour:"@",details:"@",type:"@","goto":"@"}}}).directive("notifications",function(){return{templateUrl:"shared/templates/directives/notifications.html",restrict:"E",replace:!0}}).directive("msgbox",function(){return{templateUrl:"shared/templates/directives/msgbox.html",restrict:"E",replace:!1}}).directive("sidebarSearch",function(){return{templateUrl:"shared/templates/directives/sidebar-search.html",restrict:"E",replace:!0,scope:{},controller:function($scope){$scope.selectedMenu="home"}}});var auth=angular.module("ulakbus.auth",["ngRoute","schemaForm","ngCookies"]);auth.controller("LoginCtrl",function($scope,$q,$timeout,$routeParams,Generator,LoginService){$scope.url="login",$scope.form_params={},$scope.form_params.clear_wf=1,Generator.get_form($scope).then(function(data){$scope.form=[{key:"username",type:"string",title:"Kullanıcı Adı"},{key:"password",type:"password",title:"Şifre"},{type:"submit",title:"Giriş Yap"}]}),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid?LoginService.login($scope.url,$scope.model).error(function(data){$scope.message=data.title}):console.log("not valid")}}),auth.factory("LoginService",function($http,$rootScope,$location,$log,Session,RESTURL){var loginService={};return loginService.login=function(url,credentials){return credentials.cmd="do",$http.post(RESTURL.url+url,credentials).success(function(data,status,headers,config){$rootScope.loggedInUser=!0}).error(function(data,status,headers,config){return data})},loginService.logout=function(){return $log.info("logout"),$http.post(RESTURL.url+"logout",{}).success(function(data){$rootScope.loggedInUser=!1,$log.info("loggedout"),$location.path("/login")})},loginService.isAuthenticated=function(){return!!Session.userId},loginService.isAuthorized=function(authorizedRoles){return angular.isArray(authorizedRoles)||(authorizedRoles=[authorizedRoles]),loginService.isAuthenticated()&&-1!==loginService.indexOf(Session.userRole)},loginService.isValidEmail=function(email){var re=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return re.test(email)},loginService}),auth.service("Session",function(){this.create=function(sessionId,userId,userRole){this.id=sessionId,this.userId=userId,this.userRole=userRole},this.destroy=function(){this.id=null,this.userId=null,this.userRole=null}}),angular.module("ulakbus.dashboard",["ngRoute"]).controller("DashCtrl",function($scope,$rootScope,$timeout,$http,$cookies,RESTURL){$scope.section=function(section_index){$rootScope.section=section_index},$scope.$on("authz",function(event,data){$scope.menuitems=data}),$scope.student_kw="",$scope.staff_kw="",$scope.students=[],$scope.staffs=[],$scope.search=function(where){$timeout(function(){"personel"===where&&$scope.staff_kw.length>2&&$scope.getItems(where,$scope.staff_kw).success(function(data){$scope.staffs=data.results}),"ogrenci"===where&&$scope.student_kw.length>2&&$scope.getItems(where,$scope.student_kw).success(function(data){$scope.students=data.results})})},$scope.getItems=function(where,what){return $http.get(RESTURL.url+"ara/"+where+"/"+what)},$scope.select=function(who,type){$rootScope.selectedUser={name:who[0],tcno:who[1],key:who[2]},$rootScope.$broadcast("menuitems",type)},$scope.$on("notifications",function(event,data){$scope.notifications=data}),$scope.markAsRead=function(items){$rootScope.$broadcast("markasread",items)}}).directive("sidebarNotifications",function(){return{templateUrl:"shared/templates/directives/sidebar-notification.html",restrict:"E",replace:!0,link:function($scope){}}}),angular.module("ulakbus.crud",["ui.bootstrap","schemaForm","formService"]).service("CrudUtility",function($log){return{generateParam:function(scope,routeParams,cmd){return scope.url=routeParams.wf,angular.forEach(routeParams,function(value,key){key.indexOf("_id")>-1&&"param_id"!==key&&(scope.param=key,scope.param_id=value)}),scope.form_params={cmd:cmd,model:routeParams.model,param:scope.param||routeParams.param,id:scope.param_id||routeParams.param_id,wf:routeParams.wf,object_id:routeParams.key},scope.form_params[scope.param]=scope.param_id,scope.model=scope.form_params.model,scope.wf=scope.form_params.wf,scope.param=scope.form_params.param,scope.param_id=scope.form_params.id,scope},listPageItems:function(scope,pageData){angular.forEach(pageData,function(value,key){scope[key]=value}),angular.forEach(scope.objects,function(value,key){if(key>0){var linkIndexes={};angular.forEach(value.actions,function(v,k){"link"===v.show_as&&(linkIndexes=v)}),angular.forEach(value.fields,function(v,k){value.actions.length>0&&linkIndexes.fields?scope.objects[key].fields[k]={type:linkIndexes.fields.indexOf(k)>-1?"link":"str",content:v,cmd:linkIndexes.cmd,mode:linkIndexes.mode}:scope.objects[key].fields[k]={type:"str",content:v}})}}),$log.debug(scope.objects)}}}).controller("CRUDCtrl",function($scope,$routeParams,Generator,CrudUtility){CrudUtility.generateParam($scope,$routeParams),Generator.get_wf($scope)}).controller("CRUDListFormCtrl",function($scope,$rootScope,$location,$http,$log,$uibModal,$timeout,Generator,$routeParams,CrudUtility){$scope.reload=function(reloadData){$scope.form_params.cmd=$scope.reload_cmd,$scope.form_params=angular.extend($scope.form_params,reloadData),$log.debug("reload data",$scope),Generator.get_wf($scope)},$scope.$on("reload_cmd",function(event,data){$scope.reload_cmd=data,$scope.reload({})}),$scope.$on("formLocator",function(event){$scope.formgenerated=event.targetScope.formgenerated}),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&Generator.submit($scope)},$scope.do_action=function(key,cmd,mode){Generator.doItemAction($scope,key,cmd,mode||"normal")},$scope.getNumber=function(num){return new Array(num)},$timeout(function(){jQuery(".filterDate").datepicker({changeMonth:!0,changeYear:!0,dateFormat:"dd.mm.yy",onSelect:function(date,inst){}}).datepicker("setDate",new Date)}),$scope.showCmd=function(){CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd);var createListObjects=function(){angular.forEach($scope.object,function(value,key){"object"==typeof value&&($scope.listobjects[key]=value,delete $scope.object[key])})};$scope.listobjects={};var pageData=Generator.getPageData();pageData.pageData===!0?($scope.object=pageData.object,Generator.setPageData({pageData:!1})):Generator.get_single_item($scope).then(function(res){$scope.object=res.data.object,$scope.model=$routeParams.model}),createListObjects()},$scope.listFormCmd=function(){var setpageobjects=function(data){CrudUtility.listPageItems($scope,data),Generator.generate($scope,data),Generator.setPageData({pageData:!1})},pageData=Generator.getPageData();pageData.pageData===!0&&($log.debug("pagedata",pageData.pageData),CrudUtility.generateParam($scope,pageData,$routeParams.cmd),setpageobjects(pageData,pageData)),(void 0===pageData.pageData||pageData.pageData===!1)&&(CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd),Generator.get_wf($scope))},$scope.reloadCmd=function(){$scope.reload({})},$scope.resetCmd=function(){delete $scope.token,$scope.cmd="reset",Generator.get_wf($scope)};var executeCmd={show:$scope.showCmd,list:$scope.listFormCmd,form:$scope.listFormCmd,reload:$scope.reloadCmd,reset:$scope.resetCmd};return executeCmd[$routeParams.cmd]()}).directive("crudListDirective",function(){return{templateUrl:"components/crud/templates/list.html",restrict:"E",replace:!0}}).directive("crudFormDirective",function(){return{templateUrl:"components/crud/templates/form.html",restrict:"E",replace:!0}}).directive("crudShowDirective",function(){return{templateUrl:"components/crud/templates/show.html",restrict:"E",replace:!0}}).directive("formLocator",function(){return{link:function(scope){scope.$emit("formLocator")}}}).directive("crudFilters",function(){return{templateUrl:"components/crud/templates/filter.html",restrict:"E",replace:!0}}),angular.module("ulakbus.debug",["ngRoute"]).controller("DebugCtrl",function($scope,$rootScope,$location){$scope.debug_queries=$rootScope.debug_queries}),angular.module("ulakbus.devSettings",["ngRoute"]).controller("DevSettingsCtrl",function($scope,$cookies,$rootScope,RESTURL){$scope.backendurl=$cookies.get("backendurl"),$scope.notificate=$cookies.get("notificate")||"on",$scope.changeSettings=function(what,set){document.cookie=what+"="+set,$scope[what]=set,$rootScope.$broadcast(what,set)},$scope.switchOnOff=function(pinn){return"on"==pinn?"off":"on"},$scope.setbackendurl=function(){$scope.changeSettings("backendurl",$scope.backendurl),RESTURL.url=$scope.backendurl},$scope.setnotification=function(){$scope.changeSettings("notificate",$scope.switchOnOff($scope.notificate))}}),app.config(["$routeProvider",function($routeProvider){$routeProvider.when("/error/500",{templateUrl:"components/error_pages/500.html",controller:"500Ctrl"}).when("/error/404",{templateUrl:"components/error_pages/404.html",controller:"404Ctrl"})}]),angular.module("ulakbus.error_pages",["ngRoute"]).controller("500Ctrl",function($scope,$rootScope,$location){}).controller("404Ctrl",function($scope,$rootScope,$location){}),angular.module("ulakbus.version",["ulakbus.version.interpolate-filter","ulakbus.version.version-directive"]).value("version","0.4.1"),angular.module("ulakbus.version.interpolate-filter",[]).filter("interpolate",["version",function(version){return function(text){return String(text).replace(/\%VERSION\%/gm,version)}}]),angular.module("ulakbus.version.version-directive",[]).directive("appVersion",["version",function(version){return function(scope,elm,attrs){elm.text(version)}}]);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1649,7 +1649,7 @@ table.dataTable thead .sorting:after {
}
/* end page transitions */
.move-to-bottom, .move-to-top {
.move-to-bottom, .move-to-top, .move-to-bottom-modal, .move-to-top-modal {
margin-right: 10px !important;
}
......
angular.module('templates-prod', ['components/auth/login.html', 'components/crud/templates/crud.html', 'components/crud/templates/form.html', 'components/crud/templates/list.html', 'components/crud/templates/show.html', 'components/dashboard/dashboard.html', 'components/debug/debug.html', 'components/devSettings/devSettings.html', 'components/error_pages/404.html', 'components/error_pages/500.html', 'components/uitemplates/404.html', 'components/uitemplates/500.html', 'shared/templates/add.html', 'shared/templates/datefield.html', 'shared/templates/directives/chat.html', 'shared/templates/directives/header-breadcrumb.html', 'shared/templates/directives/header-notification.html', 'shared/templates/directives/header-sub-menu.html', 'shared/templates/directives/menuCollapse.html', 'shared/templates/directives/msgbox.html', 'shared/templates/directives/notifications.html', 'shared/templates/directives/search.html', 'shared/templates/directives/selected-user.html', 'shared/templates/directives/sidebar-notification.html', 'shared/templates/directives/sidebar-search.html', 'shared/templates/directives/sidebar.html', 'shared/templates/directives/stats.html', 'shared/templates/directives/timeline.html', 'shared/templates/fieldset.html', 'shared/templates/foreignKey.html', 'shared/templates/linkedModelModalContent.html', 'shared/templates/listnodeModalContent.html', 'shared/templates/modalContent.html', 'shared/templates/multiselect.html', 'shared/templates/nodeTable.html', 'shared/templates/select.html']);
angular.module('templates-prod', ['components/auth/login.html', 'components/crud/templates/crud.html', 'components/crud/templates/filter.html', 'components/crud/templates/form.html', 'components/crud/templates/list.html', 'components/crud/templates/show.html', 'components/dashboard/dashboard.html', 'components/debug/debug.html', 'components/devSettings/devSettings.html', 'components/error_pages/404.html', 'components/error_pages/500.html', 'components/uitemplates/404.html', 'components/uitemplates/500.html', 'shared/templates/add.html', 'shared/templates/datefield.html', 'shared/templates/directives/chat.html', 'shared/templates/directives/header-breadcrumb.html', 'shared/templates/directives/header-notification.html', 'shared/templates/directives/header-sub-menu.html', 'shared/templates/directives/menuCollapse.html', 'shared/templates/directives/msgbox.html', 'shared/templates/directives/notifications.html', 'shared/templates/directives/search.html', 'shared/templates/directives/selected-user.html', 'shared/templates/directives/sidebar-notification.html', 'shared/templates/directives/sidebar-search.html', 'shared/templates/directives/sidebar.html', 'shared/templates/directives/sort.html', 'shared/templates/directives/stats.html', 'shared/templates/directives/timeline.html', 'shared/templates/fieldset.html', 'shared/templates/foreignKey.html', 'shared/templates/linkedModelModalContent.html', 'shared/templates/listnodeModalContent.html', 'shared/templates/modalContent.html', 'shared/templates/multiselect.html', 'shared/templates/nodeTable.html', 'shared/templates/select.html']);
angular.module("components/auth/login.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("components/auth/login.html",
......@@ -22,9 +22,69 @@ angular.module("components/auth/login.html", []).run(["$templateCache", function
angular.module("components/crud/templates/crud.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("components/crud/templates/crud.html",
"<crud-show-directive ng-if=\"object\"></crud-show-directive>\n" +
"<crud-form-directive ng-if=\"forms\"></crud-form-directive>\n" +
"<crud-list-directive ng-if=\"objects\"></crud-list-directive>");
"<div class=\"row\">\n" +
" <div class=\"col-md-8\">\n" +
" <crud-show-directive ng-if=\"object\"></crud-show-directive>\n" +
" <crud-form-directive ng-if=\"forms\"></crud-form-directive>\n" +
" <crud-list-directive ng-if=\"objects\"></crud-list-directive>\n" +
" </div>\n" +
" <crud-filters ng-if=\"meta.allow_filters === true\" class=\"col-md-4 filtre\"></crud-filters>\n" +
"</div>");
}]);
angular.module("components/crud/templates/filter.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("components/crud/templates/filter.html",
"<div>\n" +
" <h2>Filtrele</h2>\n" +
" <div class=\"right-sidebar-box\">\n" +
" <div class=\"right-sidebar-messages\">\n" +
" <div class=\"right-sidebar-title clearfix\">\n" +
" <h3>Tarih Aralığı</h3>\n" +
" </div>\n" +
" <div class=\"right-sidebar-message-block\">\n" +
" <div class=\"col-md-6\">\n" +
" <br>\n" +
" <label class=\"control-label\" for=\"startDate\">Baslangic</label>\n" +
" <input type=\"text\" name=\"startDate\" class=\"form-control filterDate\"/>\n" +
" </div>\n" +
" <div class=\"col-md-6\">\n" +
" <br>\n" +
" <label class=\"control-label\" for=\"endDate\">Bitis</label>\n" +
" <input type=\"text\" name=\"endDate\" class=\"form-control filterDate\"/>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
"\n" +
" <div class=\"clearfix\"></div>\n" +
"\n" +
" <div class=\"right-sidebar-box\">\n" +
" <div class=\"right-sidebar-messages\">\n" +
" <div class=\"right-sidebar-title clearfix\">\n" +
" <br><br>\n" +
" <h3>Filtre basligi</h3>\n" +
" </div>\n" +
" <div class=\"right-sidebar-message-block\">\n" +
" <div class=\"col-md-12\">\n" +
" <br>\n" +
" <label class=\"control-label\" for=\"filterSelect\">Secim</label>\n" +
" <select name=\"filterSelect\" id=\"filterSelect\">\n" +
" <option value=\"1\">option 1</option>\n" +
" <option value=\"2\">option 2</option>\n" +
" <option value=\"3\">option 3</option>\n" +
" <option value=\"4\">option 4</option>\n" +
" </select>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
"\n" +
" <div class=\"clearfix\"></div>\n" +
"\n" +
" <div style=\"margin-top: 40px;\">\n" +
" <button type=\"button\" class=\"btn btn-primary\">Filtrele</button>\n" +
" </div>\n" +
"</div>");
}]);
angular.module("components/crud/templates/form.html", []).run(["$templateCache", function($templateCache) {
......@@ -74,6 +134,7 @@ angular.module("components/crud/templates/form.html", []).run(["$templateCache",
angular.module("components/crud/templates/list.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("components/crud/templates/list.html",
"<div class=\"starter-template container\">\n" +
" <sort-directive ng-if=\"meta['allow_sort']===true\"></sort-directive>\n" +
" <search-directive ng-if=\"meta['allow_search']===true\"></search-directive>\n" +
" <div class=\"clearfix\"></div>\n" +
" <!--<h1>{{form_params.model || form_params.wf}}</h1>-->\n" +
......@@ -238,28 +299,10 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
$templateCache.put("components/dashboard/dashboard.html",
"<div ng-app=\"ulakbus.dashboard\" class=\"dashboard\">\n" +
" <div class=\"starter-template\">\n" +
"\n" +
" <!-- \n" +
" <div class=\"row\">\n" +
" <div class=\"major-buttons\">\n" +
" <div class=\"col-md-4\">\n" +
" <a href=\"\"><button type=\"button\" class=\"btn btn-personnel brand-bg\" ng-click=\"section(2)\"><i class=\"fa fa-user\"></i>\n" +
" PERSONEL İŞLERİ</button></a>\n" +
" </div>\n" +
" <div class=\"col-md-4\">\n" +
" <a href=\"\"><button type=\"button\" class=\"btn btn-student brand-bg\" ng-click=\"section(0)\"><i\n" +
" class=\"fa fa-graduation-cap\"></i> ÖĞRENCİ İŞLERİ</button></a>\n" +
" </div>\n" +
" <div class=\"col-md-4\">\n" +
" <a href=\"\"><button type=\"button\" class=\"btn btn-system brand-bg\" ng-click=\"section(3)\"><i class=\"fa fa-gears\"></i>\n" +
" SİSTEM</button></a>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" -->\n" +
" \n" +
" <div class=\"dashboard-main-search clearfix\">\n" +
" <div class=\"dashboard-student-search\">\n" +
" <div class=\"dashboard-student-search\" data-step=\"2\"\n" +
" data-intro=\"isim veya tcno ile öğrenci araması yapabilirsiniz.\">\n" +
" <center>\n" +
" <h3>ÖĞRENCİ</h3>\n" +
" <input type=\"text\" placeholder=\"Öğrenci ara\" ng-model=\"student_kw\" ng-keyup=\"search('ogrenci')\">\n" +
......@@ -275,7 +318,8 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
" <!-- end of dashboard-student-search-results -->\n" +
" </div>\n" +
" <!-- end of dashboard-student-search -->\n" +
" <div class=\"dashboard-personnel-search\">\n" +
" <div class=\"dashboard-personnel-search\" data-step=\"3\"\n" +
" data-intro=\"isim veya tcno ile personel araması yapabilirsiniz.\">\n" +
" <center>\n" +
" <h3>PERSONEL</h3>\n" +
" <input type=\"text\" placeholder=\"Personel ara\" ng-model=\"staff_kw\" ng-keyup=\"search('personel')\">\n" +
......@@ -296,7 +340,8 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
" \n" +
" <div class=\"right-sidebar\">\n" +
"\n" +
" <div class=\"right-sidebar-box\">\n" +
" <div class=\"right-sidebar-box\" data-step=\"4\"\n" +
" data-intro=\"mesajlar, yapılan görevlerin son durumları, duyurular ve son yapılan işlemleri buradan takip edebilirsiniz.\">\n" +
" <div class=\"right-sidebar-messages\">\n" +
"\n" +
" <div class=\"right-sidebar-title clearfix\">\n" +
......@@ -331,21 +376,6 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
" <h3>Görevler</h3>\n" +
" <span><a href=\"javascript:void(0)\">Tüm Görevler</a></span>\n" +
" </div>\n" +
" <!-- end of right-sidebar-title -->\n" +
"\n" +
" <!--<div class=\"right-sidebar-task-block\">-->\n" +
" <!--<div class=\"task-type\">Devam Eden Görevler</div>-->\n" +
" <!--<a href=\"javascript:void(0)\">-->\n" +
" <!--<div class=\"task-title\">Öğrenci Kayıt</div>-->\n" +
" <!--<div class=\"progress\">-->\n" +
" <!--<div class=\"progress-bar\" role=\"progressbar\" aria-valuenow=\"25\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"min-width: 2em; width:25%;\">-->\n" +
" <!--25%-->\n" +
" <!--</div>-->\n" +
" <!--</div>-->\n" +
" <!--&lt;!&ndash; end of progress &ndash;&gt;-->\n" +
" <!--</a>-->\n" +
" <!--</div>-->\n" +
" <!-- end of right-sidebar-task-block -->\n" +
"\n" +
" <div class=\"right-sidebar-task-block\">\n" +
" <!--<div class=\"task-type\">Onay Bekleyen Görevler</div>-->\n" +
......@@ -390,13 +420,6 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
" <h3>Son İşlemler</h3>\n" +
" <span><a href=\"javascript:void(0)\">Tüm İşlemler</a></span>\n" +
" </div>\n" +
" <!-- end of right-sidebar-title -->\n" +
"\n" +
" <!--<div class=\"right-sidebar-last-action-block\">-->\n" +
" <!--<a href=\"javascript:void(0)\">Birinci dönem bitimine 10 gün kaldı.</a>-->\n" +
" <!--<a href=\"javascript:void(0)\">Ders seçimi işlemleri xx tarihinde başlayacaktır.</a>-->\n" +
" <!--</div>-->\n" +
" <!-- end of right-sidebar-status-block -->\n" +
"\n" +
" </div>\n" +
" <!-- end of right-sidebar-status -->\n" +
......@@ -1061,7 +1084,7 @@ angular.module("shared/templates/directives/notifications.html", []).run(["$temp
angular.module("shared/templates/directives/search.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("shared/templates/directives/search.html",
"<form class=\"form-inline col-md-8\" id=\"search\" name=\"search\" sf-schema=\"searchSchema\" sf-form=\"searchForm\"\n" +
"<form class=\"form-inline pull-right\" id=\"search\" name=\"search\" sf-schema=\"searchSchema\" sf-form=\"searchForm\"\n" +
" sf-model=\"searchModel\"\n" +
" ng-submit=\"searchSubmit(search)\"></form>");
}]);
......@@ -1237,7 +1260,8 @@ angular.module("shared/templates/directives/sidebar.html", []).run(["$templateCa
" </div>\n" +
"\n" +
" <div class=\"sidebar-nav navbar-collapse\">\n" +
" <ul class=\"nav in\" id=\"side-menu\" ng-class=\"{hidden: $root.loggedInUser != true}\">\n" +
" <ul class=\"nav in\" id=\"side-menu\" ng-class=\"{hidden: $root.loggedInUser != true}\" data-step=\"1\"\n" +
" data-intro=\"seçilen personele veya öğrenciye göre ilgili menüler yer almaktadır. yapılacak işlemi buradan seçebilirsiniz.\">\n" +
" <!--<sidebar-search></sidebar-search>-->\n" +
" <li ui-sref-active=\"active\">\n" +
" <a href=\"#/dashboard\" ng-click=\"breadcrumb(['Panel'])\"><i class=\"fa fa-dashboard fa-fw\"></i>\n" +
......@@ -1257,10 +1281,9 @@ angular.module("shared/templates/directives/sidebar.html", []).run(["$templateCa
" </a>\n" +
" <ul class=\"nav nav-second-level\" ng-class=\"{hidden: $root.collapsed}\">\n" +
" <li ng-repeat=\"(k, v) in item\">\n" +
" <a ng-if=\"v['baseCategory'] == 'other'\" ng-href=\"#{{v.url}}\" ng-\n" +
" ng-click=\"breadcrumb([key, v.text], $event)\">{{v.text}}</a>\n" +
" <a ng-if=\"v['baseCategory'] == 'ogrenci' || v['baseCategory'] == 'personel'\"\n" +
" ng-href=\"#/{{v.wf}}/{{v.model}}?{{v.param}}={{$root.selectedUser.key}}\"\n" +
" <!--<a ng-if=\"v.model\" ng-href=\"#{{v.url}}\" ng- -->\n" +
" <!--ng-click=\"breadcrumb([key, v.text], $event)\">{{v.text}}</a>-->\n" +
" <a ng-href=\"#/{{v.wf}}/{{v.model}}?{{v.param}}={{$root.selectedUser.key}}\"\n" +
" ng-click=\"breadcrumb([key, v.text], $event)\">{{v.text}}</a>\n" +
" </li>\n" +
" </ul>\n" +
......@@ -1270,15 +1293,23 @@ angular.module("shared/templates/directives/sidebar.html", []).run(["$templateCa
" </div>\n" +
" <!-- /.sidebar-collapse -->\n" +
"\n" +
"\n" +
" \n" +
" <footer ng-class=\"{hidden: $root.collapsed}\">\n" +
" <a class=\"btn btn-large btn-success\" href=\"javascript:void(0);\" onclick=\"javascript:introJs().setOptions({\n" +
" 'nextLabel': 'Sonraki', 'prevLabel': 'Öncek', 'skipLabel': 'Atla', 'doneLabel': 'Bitir' }).start();\">Yardım\n" +
" Rehberi</a><br>\n" +
" <span>v <app-version></app-version> &copy; ZetaOps</span>\n" +
" </footer>\n" +
"</div>\n" +
"");
}]);
angular.module("shared/templates/directives/sort.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("shared/templates/directives/sort.html",
"<form class=\"form-inline pull-left\" id=\"sort\" name=\"sort\" sf-schema=\"sortSchema\" sf-form=\"sortForm\"\n" +
" sf-model=\"sortModel\"\n" +
" ng-submit=\"sortSubmit(sort)\"></form>");
}]);
angular.module("shared/templates/directives/stats.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("shared/templates/directives/stats.html",
"<div class=\"col-lg-3 col-md-6\">\n" +
......@@ -1450,7 +1481,7 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
" </span>\n" +
" <input type=\"text\"\n" +
" ng-model=\"$$value$$\"\n" +
" typeahead=\"item.name for item in form.titleMap\"\n" +
" uib-typeahead=\"item as item.name for item in form.titleMap | filter:{name:$viewValue}\"\n" +
" typeahead-on-select=\"form.onSelect($item)\"\n" +
" placeholder=\"{{form.title}}\"\n" +
" ng-model-options=\"form.ngModelOptions\"\n" +
......@@ -1458,7 +1489,7 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
" sf-changed=\"form\"\n" +
" class=\"form-control {{form.fieldHtmlClass}}\"\n" +
" schema-validate=\"form\"\n" +
" name=\"{{form.model_name}}\" value=\"{{form.selected_item}}\"/>\n" +
" name=\"{{form.model_name}}\"/>\n" +
" </div>\n" +
"\n" +
" <!--<select ng-model=\"$$value$$\"-->\n" +
......@@ -1486,10 +1517,15 @@ angular.module("shared/templates/linkedModelModalContent.html", []).run(["$templ
$templateCache.put("shared/templates/linkedModelModalContent.html",
"<div class=\"modal-body\">\n" +
" <h3>{{schema.title}}</h3>\n" +
" <form name=\"linkedModelForm\" sf-schema=\"schema\" sf-form=\"form\" sf-model=\"model\"></form>\n" +
" <div class=\"buttons-on-top-modal\"></div>\n" +
" <hr>\n" +
" <form name=\"linkedModelForm\" sf-schema=\"schema\" sf-form=\"form\" sf-model=\"model\" modal-form-locator></form>\n" +
" <hr>\n" +
" <div class=\"buttons-on-bottom-modal\"></div>\n" +
"</div>\n" +
"<div class=\"modal-footer\">\n" +
" <button type=\"submit\" class=\"btn btn-primary\" ng-click=\"onSubmit(linkedModelForm)\">OK</button>\n" +
"\n" +
" <!--<button type=\"submit\" class=\"btn btn-primary\" ng-click=\"onSubmit(linkedModelForm)\">OK</button>-->\n" +
" <button type=\"button\" class=\"btn btn-warning\" ng-click=\"cancel()\">Cancel</button>\n" +
"</div>");
}]);
......@@ -1498,10 +1534,10 @@ angular.module("shared/templates/listnodeModalContent.html", []).run(["$template
$templateCache.put("shared/templates/listnodeModalContent.html",
"<div class=\"modal-body\">\n" +
" <h3>{{schema.title}}</h3>\n" +
" <form name=\"listnodeform\" sf-schema=\"schema\" sf-form=\"form\" sf-model=\"model\"></form>\n" +
" <form name=\"modalForm\" sf-schema=\"schema\" sf-form=\"form\" sf-model=\"model\" modal-form-locator></form>\n" +
"</div>\n" +
"<div class=\"modal-footer\">\n" +
" <button type=\"submit\" class=\"btn btn-primary\" ng-click=\"onSubmit(listnodeform)\">OK</button>\n" +
" <button type=\"submit\" class=\"btn btn-primary\" ng-click=\"onNodeSubmit()\">OK</button>\n" +
" <button type=\"button\" class=\"btn btn-warning\" ng-click=\"cancel()\">Cancel</button>\n" +
"</div>");
}]);
......@@ -1513,84 +1549,129 @@ angular.module("shared/templates/modalContent.html", []).run(["$templateCache",
angular.module("shared/templates/multiselect.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("shared/templates/multiselect.html",
"<div class=\"form-group {{form.htmlClass}} schema-form-select\"\n" +
"<div class=\"form-group {{form.htmlClass}} schema-form-select col-md-12\"\n" +
" ng-class=\"{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess(), 'has-feedback': form.feedback !== false}\">\n" +
" <label class=\"control-label {{form.labelHtmlClass}}\" ng-show=\"showTitle()\">\n" +
" {{form.title}}\n" +
" </label>\n" +
" <select ng-model=\"$$value$$\"\n" +
" ng-model-options=\"form.ngModelOptions\"\n" +
" ng-disabled=\"form.readonly\"\n" +
" sf-changed=\"form\"\n" +
" class=\"form-control {{form.fieldHtmlClass}}\"\n" +
" schema-validate=\"form\"\n" +
" ng-options=\"item.value as item.name for item in form.titleMap\"\n" +
" name=\"{{form.key.slice(-1)[0]}}\"\n" +
" id=\"{{form.key.slice(-1)[0]}}\" multiple>\n" +
" </select>\n" +
" <div class=\"col-md-8\">\n" +
" <label class=\"control-label {{form.labelHtmlClass}}\" ng-show=\"showTitle()\">\n" +
" {{form.title}}\n" +
" </label>\n" +
"\n" +
" <div class=\"help-block\" sf-message=\"form.description\"></div>\n" +
" <div class=\"row\">\n" +
" <div class=\"form-group input-group\">\n" +
" <input type=\"text\"\n" +
" placeholder=\"{{form.title}} filtrele\"\n" +
" class=\"form-control {{form.fieldHtmlClass}}\"\n" +
" name=\"filter-interface\"\n" +
" ng-model=\"form.filterValue\"\n" +
" ng-keyup=\"form.appendFiltered(form.filterValue)\"\n" +
" />\n" +
" </div>\n" +
" </div>\n" +
" <div class=\"row\">\n" +
" <div class=\"col-md-5\">\n" +
" <label for=\"filterItems\">{{form.title}} Liste</label>\n" +
" <select ng-model=\"selectedItemsModel\"\n" +
" value=\"$$value$$\"\n" +
" ng-model-options=\"form.ngModelOptions\"\n" +
" ng-disabled=\"form.readonly\"\n" +
" sf-changed=\"form\"\n" +
" class=\"form-control {{form.fieldHtmlClass}}\"\n" +
" schema-validate=\"form\"\n" +
" ng-options=\"item as item.name for item in form.filteredItems\"\n" +
" name=\"filterItems\" multiple>\n" +
" </select>\n" +
" </div>\n" +
"\n" +
"\n" +
" <div class=\"col-md-1\">\n" +
" <a href=\"javascript:void(0)\" ng-click=\"form.select(selectedItemsModel)\"><i class=\"fa fa-arrow-right fa-fw\"></i></a><br>\n" +
" <a href=\"javascript:void(0)\" ng-click=\"form.deselect(selectedFilteredItemsModel)\"><i class=\"fa fa-arrow-left fa-fw\"></i></a>\n" +
" </div>\n" +
"\n" +
" <div class=\"col-md-5\">\n" +
" <label for=\"selectedItems\">Seçilenler</label>\n" +
" <select ng-model=\"selectedFilteredItemsModel\"\n" +
" value=\"$$value$$\"\n" +
" ng-model-options=\"form.ngModelOptions\"\n" +
" ng-disabled=\"form.readonly\"\n" +
" sf-changed=\"form\"\n" +
" class=\"form-control {{form.fieldHtmlClass}}\"\n" +
" schema-validate=\"form\"\n" +
" ng-options=\"item as item.name for item in form.selectedFilteredItems\"\n" +
" name=\"selectedItems\" multiple>\n" +
" </select>\n" +
" </div>\n" +
" </div>\n" +
"\n" +
" <div class=\"help-block\" sf-message=\"form.description\"></div>\n" +
" </div>\n" +
" <div class=\"col-md-4\">\n" +
" <a href=\"javascript:void(0);\" add-modal-for-linked-model>\n" +
" <i class=\"fa fa-plus-circle fa-fw\"></i>\n" +
" </a>\n" +
" </div>\n" +
"</div>");
}]);
angular.module("shared/templates/nodeTable.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("shared/templates/nodeTable.html",
"<div class=\"tablescroll\">\n" +
"<table class=\"table table-bordered\" style=\"background-color:#fff;\">\n" +
" <thead>\n" +
" <tr ng-if=\"node.schema.formType=='Node'\">\n" +
" {{node.model}}\n" +
"<!--<table class=\"table table-bordered\" style=\"background-color:#fff;\">-->\n" +
" <!--<thead>-->\n" +
" <!--<tr ng-if=\"node.schema.formType=='Node'\">-->\n" +
" <!--&lt;!&ndash;<th colspan=\"2\">&ndash;&gt;-->\n" +
" <!--&lt;!&ndash;<label>&ndash;&gt;-->\n" +
" <!--&lt;!&ndash;<input type=\"checkbox\" style=\"zoom:1.5; margin:5px 0 0 8px;\">&ndash;&gt;-->\n" +
" <!--&lt;!&ndash;Hepsini Seç&ndash;&gt;-->\n" +
" <!--&lt;!&ndash;</label>&ndash;&gt;-->\n" +
" <!--&lt;!&ndash;</th>&ndash;&gt;-->\n" +
" <!--<th ng-repeat=\"(key,value) in node.model\">{{ key }}</th>-->\n" +
" <!--<th>İşlem</th>-->\n" +
" <!--</tr>-->\n" +
" <!--<tr ng-if=\"node.schema.formType=='ListNode'\">-->\n" +
" <!--<th colspan=\"2\">-->\n" +
" <!--<label>-->\n" +
" <!--<input type=\"checkbox\" style=\"zoom:1.5; margin:5px 0 0 8px;\">-->\n" +
" <!--Hepsini Seç-->\n" +
" <!--</label>-->\n" +
" <!--</th>-->\n" +
" <th ng-repeat=\"(key,value) in node.model\">{{ key }}</th>\n" +
" <th>İşlem</th>\n" +
" </tr>\n" +
" <tr ng-if=\"node.schema.formType=='ListNode'\">\n" +
" <th colspan=\"2\">\n" +
" <label>\n" +
" <input type=\"checkbox\" style=\"zoom:1.5; margin:5px 0 0 8px;\">\n" +
" Hepsini Seç\n" +
" </label>\n" +
" </th>\n" +
" <th ng-repeat=\"(key,value) in node.model[0]\">{{ key }}</th>\n" +
" <th>İşlem</th>\n" +
" </tr>\n" +
" </thead>\n" +
" <tbody ng-class=\"{hidden: node.lengthModels < 1}\">\n" +
"\n" +
" <tr ng-if=\"node.schema.formType=='Node'\">\n" +
" <!--<th ng-repeat=\"(key,value) in node.model[0]\">{{ key }}</th>-->\n" +
" <!--<th>İşlem</th>-->\n" +
" <!--</tr>-->\n" +
" <!--</thead>-->\n" +
" <!--<tbody ng-class=\"{hidden: node.lengthModels < 1}\">-->\n" +
"\n" +
" <!--<tr ng-if=\"node.schema.formType=='Node'\">-->\n" +
" <!--&lt;!&ndash;<td width=\"60\">&ndash;&gt;-->\n" +
" <!--&lt;!&ndash;<label>&ndash;&gt;-->\n" +
" <!--&lt;!&ndash;<input type=\"checkbox\" style=\"zoom:1.5; margin:5px 0 0 8px;\">&ndash;&gt;-->\n" +
" <!--&lt;!&ndash;</label>&ndash;&gt;-->\n" +
" <!--&lt;!&ndash;</td>&ndash;&gt;-->\n" +
" <!--&lt;!&ndash;<th scope=\"row\" style=\"text-align:center\">1</th>&ndash;&gt;-->\n" +
" <!--<td ng-repeat=\"value in node.model\">{{ value }}</td>-->\n" +
" <!--<td>-->\n" +
" <!--<button modal-for-nodes=\"{{node.schema.model_name}},{{node.schema.formType}},edit\">Düzenle</button><br>-->\n" +
" <!--<button>Sil</button>-->\n" +
" <!--</td>-->\n" +
" <!--</tr>-->\n" +
"\n" +
" <!--<tr ng-repeat=\"listnodemodel in node.model\" ng-if=\"node.schema.formType=='ListNode'\">-->\n" +
" <!--<td width=\"60\">-->\n" +
" <!--<label>-->\n" +
" <!--<input type=\"checkbox\" style=\"zoom:1.5; margin:5px 0 0 8px;\">-->\n" +
" <!--</label>-->\n" +
" <!--</td>-->\n" +
" <!--<th scope=\"row\" style=\"text-align:center\">1</th>-->\n" +
" <td ng-repeat=\"value in node.model\">{{ value }}</td>\n" +
" <td>\n" +
" <button modal-for-nodes=\"{{node.schema.model_name}},{{node.schema.formType}},edit\">Düzenle</button><br>\n" +
" <button>Sil</button>\n" +
" </td>\n" +
" </tr>\n" +
"\n" +
" <tr ng-repeat=\"listnodemodel in node.model\" ng-if=\"node.schema.formType=='ListNode'\">\n" +
" <td width=\"60\">\n" +
" <label>\n" +
" <input type=\"checkbox\" style=\"zoom:1.5; margin:5px 0 0 8px;\">\n" +
" </label>\n" +
" </td>\n" +
" <th scope=\"row\" style=\"text-align:center\">{{$index+1}}</th>\n" +
" <td ng-repeat=\"(k, v) in listnodemodel\">{{ v }}</td>\n" +
" <td>\n" +
" <button modal-for-nodes=\"{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}\">Düzenle</button><br>\n" +
" <button>Sil</button>\n" +
" </td>\n" +
" </tr>\n" +
"\n" +
" </tbody>\n" +
"</table>\n" +
" <!--<th scope=\"row\" style=\"text-align:center\">{{$index+1}}</th>-->\n" +
" <!--<td ng-repeat=\"(k, v) in listnodemodel\">{{ v }}</td>-->\n" +
" <!--<td>-->\n" +
" <!--<button modal-for-nodes=\"{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}\">Düzenle</button><br>-->\n" +
" <!--<button>Sil</button>-->\n" +
" <!--</td>-->\n" +
" <!--</tr>-->\n" +
"\n" +
" <!--</tbody>-->\n" +
"<!--</table>-->\n" +
"</div>");
}]);
......
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