Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
6346f0cb
Commit
6346f0cb
authored
Nov 03, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post object id for edit and show views
parent
3b830989
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
50 deletions
+54
-50
crud_controller.js
app/components/crud/crud_controller.js
+9
-7
list.html
app/components/crud/templates/list.html
+4
-3
selected-user.html
app/shared/templates/directives/selected-user.html
+37
-37
sidebar.html
app/shared/templates/directives/sidebar.html
+1
-1
form_service.js
app/zetalib/forms/form_service.js
+3
-2
No files found.
app/components/crud/crud_controller.js
View file @
6346f0cb
...
@@ -20,7 +20,7 @@ crud.controller('CRUDAddEditCtrl', function ($scope, $rootScope, $location, $htt
...
@@ -20,7 +20,7 @@ crud.controller('CRUDAddEditCtrl', function ($scope, $rootScope, $location, $htt
$scope
.
url
=
'crud/'
;
$scope
.
url
=
'crud/'
;
$scope
.
form_params
=
{
'model'
:
$routeParams
.
model
,
param
:
$routeParams
.
param
,
id
:
$routeParams
.
id
};
$scope
.
form_params
=
{
'model'
:
$routeParams
.
model
,
param
:
$routeParams
.
param
,
id
:
$routeParams
.
id
};
if
(
$routeParams
.
key
)
{
if
(
$routeParams
.
key
)
{
$scope
.
form_params
[
'
key
'
]
=
$routeParams
.
key
;
$scope
.
form_params
[
'
object_id
'
]
=
$routeParams
.
key
;
$scope
.
form_params
[
'cmd'
]
=
'edit'
;
$scope
.
form_params
[
'cmd'
]
=
'edit'
;
}
}
else
{
else
{
...
@@ -75,7 +75,8 @@ crud.controller('CRUDListCtrl', function ($scope, $rootScope, Generator, $routeP
...
@@ -75,7 +75,8 @@ crud.controller('CRUDListCtrl', function ($scope, $rootScope, Generator, $routeP
crud
.
controller
(
'CRUDShowCtrl'
,
function
(
$scope
,
$rootScope
,
$location
,
Generator
,
$routeParams
)
{
crud
.
controller
(
'CRUDShowCtrl'
,
function
(
$scope
,
$rootScope
,
$location
,
Generator
,
$routeParams
)
{
$scope
.
url
=
'crud/'
;
$scope
.
url
=
'crud/'
;
$scope
.
form_params
=
{
$scope
.
form_params
=
{
"object_id"
:
$routeParams
.
id
,
"id"
:
$routeParams
.
id
,
"object_id"
:
$routeParams
.
key
,
"cmd"
:
"show"
,
"cmd"
:
"show"
,
param
:
$routeParams
.
param
,
param
:
$routeParams
.
param
,
"model"
:
$routeParams
.
model
"model"
:
$routeParams
.
model
...
@@ -84,9 +85,9 @@ crud.controller('CRUDShowCtrl', function ($scope, $rootScope, $location, Generat
...
@@ -84,9 +85,9 @@ crud.controller('CRUDShowCtrl', function ($scope, $rootScope, $location, Generat
Generator
.
get_single_item
(
$scope
).
then
(
function
(
res
)
{
Generator
.
get_single_item
(
$scope
).
then
(
function
(
res
)
{
console
.
log
(
res
.
data
.
nobjects
);
console
.
log
(
res
.
data
.
nobjects
);
// if no data to show redirect to add/edit view
// if no data to show redirect to add/edit view
if
(
res
.
data
.
nobjects
[
0
]
===
"-1"
)
{
//
if (res.data.nobjects[0] === "-1") {
$location
.
path
(
'crud/'
+
$scope
.
form_params
.
model
+
'/'
+
$scope
.
form_params
.
param
+
'/'
+
$scope
.
form_params
.
object_id
+
'/edit'
);
//
$location.path('crud/' + $scope.form_params.model + '/' + $scope.form_params.param + '/' + $scope.form_params.object_id + '/edit');
}
//
}
$scope
.
listobjects
=
{};
$scope
.
listobjects
=
{};
$scope
.
object
=
res
.
data
.
object
;
$scope
.
object
=
res
.
data
.
object
;
...
@@ -95,8 +96,9 @@ crud.controller('CRUDShowCtrl', function ($scope, $rootScope, $location, Generat
...
@@ -95,8 +96,9 @@ crud.controller('CRUDShowCtrl', function ($scope, $rootScope, $location, Generat
$scope
.
listobjects
[
key
]
=
value
;
$scope
.
listobjects
[
key
]
=
value
;
delete
$scope
.
object
[
key
];
delete
$scope
.
object
[
key
];
}
}
});
});
debugger
;
$scope
.
model
=
$routeParams
.
model
;
$scope
.
model
=
$routeParams
.
model
;
})
})
;
});
});
\ No newline at end of file
app/components/crud/templates/list.html
View file @
6346f0cb
...
@@ -33,15 +33,16 @@
...
@@ -33,15 +33,16 @@
</td>
</td>
<th
scope=
"row"
style=
"text-align:center"
>
{{$index}}
</th>
<th
scope=
"row"
style=
"text-align:center"
>
{{$index}}
</th>
<td
ng-repeat=
"k in object track by $index"
ng-if=
"nobjects[0]=='-1' && $index>0"
>
<td
ng-repeat=
"k in object track by $index"
ng-if=
"nobjects[0]=='-1' && $index>0"
>
<a
ng-href=
"#/crud/
edit/{{model}}/{{form_params.param}}/{{form_params.id}}
{{object[0]}}"
>
{{object[1]}}
</a>
<a
ng-href=
"#/crud/
detail/{{model}}/{{form_params.param}}/{{form_params.id}}/
{{object[0]}}"
>
{{object[1]}}
</a>
</td>
</td>
<td
ng-repeat=
"(key,value) in object track by $index"
ng-if=
"nobjects[0]!='-1' && $index>0"
>
<td
ng-repeat=
"(key,value) in object track by $index"
ng-if=
"nobjects[0]!='-1' && $index>0"
>
<a
ng-href=
"#/crud/edit/{{model}}/{{form_params.param}}/{{form_params.id}}{{object[0]}}"
ng-if=
"$index==1"
>
{{object[key]}}
</a>
<a
ng-href=
"#/crud/detail/{{model}}/{{form_params.param}}/{{form_params.id}}/{{object[0]}}"
ng-if=
"$index==1"
>
{{object[key]}}
</a>
<span
ng-if=
"$index!=1"
>
{{object[key]}}
</span>
<span
ng-if=
"$index!=1"
>
{{object[key]}}
</span>
</td>
</td>
<td>
<td>
<a
ng-href=
"#/crud/edit/{{model}}/{{form_params.param}}/{{form_params.id}}{{object[0]}}"
>
Edit
</a>
<a
ng-href=
"#/crud/edit/{{model}}/{{form_params.param}}/{{form_params.id}}
/
{{object[0]}}"
>
Edit
</a>
<br>
<br>
</td>
</td>
</tr>
</tr>
...
...
app/shared/templates/directives/selected-user.html
View file @
6346f0cb
<a
href=
"#"
data-toggle=
"tooltip"
data-placement=
"bottom"
title=
"Tooltip on left"
>
İşlem: {{$root.selectedUser.name}}
</a>
<a
href=
"#"
data-toggle=
"tooltip"
data-placement=
"bottom"
title=
"Tooltip on left"
>
İşlem: {{$root.selectedUser.name}}
</a>
<!-- sidebar-person-info -->
<!-- sidebar-person-info -->
<
div
class=
"tooltip"
role=
"tooltip"
>
<
!--<div class="tooltip" role="tooltip">--
>
<!--
<button class="btn btn-primary close-sidebar-person-info">Profili Kapat</button>
-->
<!--
<!–<button class="btn btn-primary close-sidebar-person-info">Profili Kapat</button>–>
-->
<
div
class=
"identity"
>
<
!--<div class="identity">--
>
<
div
class=
"identity-header clearfix"
>
<
!--<div class="identity-header clearfix">--
>
<
img
src=
"../../../img/sample-profile-pic.jpg"
>
<
!--<img src="../../../img/sample-profile-pic.jpg">--
>
<
div
class=
"pull-left"
>
<
!--<div class="pull-left">--
>
<
p
class=
"identity-name"
>
{{$root.selectedUser.name}}
</p
>
<
!--<p class="identity-name">{{$root.selectedUser.name}}</p>--
>
<!--
<p class="identity-surname">Öğümsöğütlü</p>
-->
<!--
<!–<p class="identity-surname">Öğümsöğütlü</p>–>
-->
<
/div
>
<
!--</div>--
>
<
/div
>
<
!--</div>--
>
<!--
end of identity-header
-->
<!--
<!– end of identity-header –>
-->
<
div
class=
"identity-info"
>
<
!--<div class="identity-info">--
>
<
div
class=
"clearfix"
>
<
!--<div class="clearfix">--
>
<
span
class=
"fa fa-phone"
></span>
<div>
539 241 65 08
</div
>
<
!--<span class="fa fa-phone"></span> <div>539 241 65 08</div>--
>
<
/div
>
<
!--</div>--
>
<
div
class=
"clearfix"
>
<
!--<div class="clearfix">--
>
<
span
class=
"fa fa-envelope"
></span
>
<
!--<span class="fa fa-envelope"></span>--
>
<
div>
erkanogum@gmail.com
</div
>
<
!--<div>erkanogum@gmail.com</div>--
>
<
/div
>
<
!--</div>--
>
<
div
class=
"clearfix"
>
<
!--<div class="clearfix">--
>
<
span
class=
"fa fa-home"
></span
>
<
!--<span class="fa fa-home"></span>--
>
<
div>
İşçi Blokları Mah. 1524. sokak B Blok 6. Kat A Kanat 27 numara
</div
>
<
!--<div>İşçi Blokları Mah. 1524. sokak B Blok 6. Kat A Kanat 27 numara</div>--
>
<
/div
>
<
!--</div>--
>
<
/div
>
<
!--</div>--
>
<
/div
>
<
!--</div>--
>
<!--
end of identity
-->
<!--
<!– end of identity –>
-->
<
div
class=
"person-actions"
>
<
!--<div class="person-actions">--
>
<
ul
>
<
!--<ul>--
>
<
li><a
href=
"#"
><span
class=
"fa fa-trash"
></span>
Action 1
</a></li
>
<
!--<li><a href="#"><span class="fa fa-trash"></span> Action 1</a></li>--
>
<
li><a
href=
"#"
><span
class=
"fa fa-trash"
></span>
Action 2
</a></li
>
<
!--<li><a href="#"><span class="fa fa-trash"></span> Action 2</a></li>--
>
<
li><a
href=
"#"
><span
class=
"fa fa-trash"
></span>
Action 3
</a></li
>
<
!--<li><a href="#"><span class="fa fa-trash"></span> Action 3</a></li>--
>
<
li><a
href=
"#"
><span
class=
"fa fa-trash"
></span>
Action 4
</a></li
>
<
!--<li><a href="#"><span class="fa fa-trash"></span> Action 4</a></li>--
>
<
li><a
href=
"#"
><span
class=
"fa fa-trash"
></span>
Action 5
</a></li
>
<
!--<li><a href="#"><span class="fa fa-trash"></span> Action 5</a></li>--
>
<
/ul
>
<
!--</ul>--
>
<
/div
>
<
!--</div>--
>
<!--
end of person-actions
-->
<!--
<!– end of person-actions –>
-->
<
/div
>
<
!--</div>--
>
<!-- end of sidebar-person-info -->
<!-- end of sidebar-person-info -->
\ No newline at end of file
app/shared/templates/directives/sidebar.html
View file @
6346f0cb
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<a
ng-if=
"key == 'other'"
ng-href=
"#{{v.url}}/{{$root.selectedUser.key}}"
<a
ng-if=
"key == 'other'"
ng-href=
"#{{v.url}}/{{$root.selectedUser.key}}"
ng-click=
"breadcrumb([key, v.text], $event)"
>
{{v.text}}
</a>
ng-click=
"breadcrumb([key, v.text], $event)"
>
{{v.text}}
</a>
<a
ng-if=
"key == 'ogrenci' || key == 'personel'"
<a
ng-if=
"key == 'ogrenci' || key == 'personel'"
ng-href=
"#{{v.url}}{{v.param}}/{{$root.selectedUser.key}}"
ng-href=
"#{{v.url}}
/
{{v.param}}/{{$root.selectedUser.key}}"
ng-click=
"breadcrumb([key, v.text], $event)"
>
{{v.text}}
</a>
ng-click=
"breadcrumb([key, v.text], $event)"
>
{{v.text}}
</a>
</li>
</li>
</ul>
</ul>
...
...
app/zetalib/forms/form_service.js
View file @
6346f0cb
...
@@ -82,6 +82,7 @@ form_generator.factory('Generator', function ($http, $q, $timeout, RESTURL, Form
...
@@ -82,6 +82,7 @@ form_generator.factory('Generator', function ($http, $q, $timeout, RESTURL, Form
if
(
v
.
type
===
'int'
||
v
.
type
===
'float'
)
{
if
(
v
.
type
===
'int'
||
v
.
type
===
'float'
)
{
v
.
type
=
'number'
;
v
.
type
=
'number'
;
scope
.
model
[
k
]
=
parseInt
(
scope
.
model
[
k
]);
}
}
if
(
v
.
type
===
'text_general'
)
{
if
(
v
.
type
===
'text_general'
)
{
...
@@ -184,7 +185,7 @@ form_generator.factory('Generator', function ($http, $q, $timeout, RESTURL, Form
...
@@ -184,7 +185,7 @@ form_generator.factory('Generator', function ($http, $q, $timeout, RESTURL, Form
// generically change _id fields model value
// generically change _id fields model value
if
(
k
==
=
scope
.
form_params
.
param
+
'_id'
)
{
if
(
k
==
scope
.
form_params
.
param
)
{
scope
.
model
[
k
]
=
scope
.
form_params
.
id
;
scope
.
model
[
k
]
=
scope
.
form_params
.
id
;
scope
.
form
.
splice
(
scope
.
form
.
indexOf
(
k
),
1
);
scope
.
form
.
splice
(
scope
.
form
.
indexOf
(
k
),
1
);
}
}
...
@@ -219,7 +220,7 @@ form_generator.factory('Generator', function ($http, $q, $timeout, RESTURL, Form
...
@@ -219,7 +220,7 @@ form_generator.factory('Generator', function ($http, $q, $timeout, RESTURL, Form
};
};
generator
.
get_single_item
=
function
(
scope
)
{
generator
.
get_single_item
=
function
(
scope
)
{
return
$http
return
$http
.
get
(
generator
.
makeUrl
(
scope
)
)
.
post
(
generator
.
makeUrl
(
scope
),
scope
.
form_params
)
.
then
(
function
(
res
)
{
.
then
(
function
(
res
)
{
//generator.dateformatter(res);
//generator.dateformatter(res);
return
res
;
return
res
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment