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
9ba7a25d
Commit
9ba7a25d
authored
Jul 02, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
templateleri bir klasörde topla
route güncelle index linkleri oluştur fake rest api güncellemesi
parent
3cca2209
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
108 additions
and
10 deletions
+108
-10
app_routes.js
app/app_routes.js
+35
-5
staff_controller.js
app/components/staff/staff_controller.js
+11
-1
add.html
app/components/staff/templates/add.html
+0
-0
edit.html
app/components/staff/templates/edit.html
+7
-0
list.html
app/components/staff/templates/list.html
+13
-0
show.html
app/components/staff/templates/show.html
+1
-0
index.html
app/index.html
+2
-0
fake_rest_server.js
fake_rest_server.js
+39
-4
No files found.
app/app_routes.js
View file @
9ba7a25d
...
@@ -66,8 +66,23 @@ app.config(['$routeProvider', function ($routeProvider) {
...
@@ -66,8 +66,23 @@ app.config(['$routeProvider', function ($routeProvider) {
}]
}]
}
}
})
})
.
when
(
'/student/:id'
,
{
templateUrl
:
'components/student/student_list_template.html'
,
controller
:
'StudentShowCtrl'
,
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'components/student/student_controller.js'
);
}],
loadMyService
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'zetalib/forms/form_service.js'
);
}],
loadMyService2
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'zetalib/general.js'
);
}]
}
})
.
when
(
'/staff/add'
,
{
.
when
(
'/staff/add'
,
{
templateUrl
:
'components/staff/
staff_add_template
.html'
,
templateUrl
:
'components/staff/
templates/add
.html'
,
controller
:
'StaffAddCtrl'
,
controller
:
'StaffAddCtrl'
,
resolve
:
{
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
...
@@ -82,11 +97,11 @@ app.config(['$routeProvider', function ($routeProvider) {
...
@@ -82,11 +97,11 @@ app.config(['$routeProvider', function ($routeProvider) {
}
}
})
})
.
when
(
'/staff/edit/:id'
,
{
.
when
(
'/staff/edit/:id'
,
{
templateUrl
:
'components/staff/
staff_add_template
.html'
,
templateUrl
:
'components/staff/
templates/edit
.html'
,
controller
:
'St
udent
EditCtrl'
,
controller
:
'St
aff
EditCtrl'
,
resolve
:
{
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'components/st
udent/student
_controller.js'
);
return
$ocLazyLoad
.
load
(
'components/st
aff/staff
_controller.js'
);
}],
}],
loadMyService
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
loadMyService
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'zetalib/forms/form_service.js'
);
return
$ocLazyLoad
.
load
(
'zetalib/forms/form_service.js'
);
...
@@ -97,7 +112,7 @@ app.config(['$routeProvider', function ($routeProvider) {
...
@@ -97,7 +112,7 @@ app.config(['$routeProvider', function ($routeProvider) {
}
}
})
})
.
when
(
'/staffs'
,
{
.
when
(
'/staffs'
,
{
templateUrl
:
'components/staff/
staff_list_template
.html'
,
templateUrl
:
'components/staff/
templates/list
.html'
,
controller
:
'StaffListCtrl'
,
controller
:
'StaffListCtrl'
,
resolve
:
{
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
...
@@ -111,6 +126,21 @@ app.config(['$routeProvider', function ($routeProvider) {
...
@@ -111,6 +126,21 @@ app.config(['$routeProvider', function ($routeProvider) {
}]
}]
}
}
})
})
.
when
(
'/staff/:id'
,
{
templateUrl
:
'components/staff/templates/show.html'
,
controller
:
'StaffShowCtrl'
,
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'components/staff/staff_controller.js'
);
}],
loadMyService
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'zetalib/forms/form_service.js'
);
}],
loadMyService2
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'zetalib/general.js'
);
}]
}
})
.
when
(
'/input_types'
,
{
.
when
(
'/input_types'
,
{
templateUrl
:
'components/types/types_template.html'
,
templateUrl
:
'components/types/types_template.html'
,
controller
:
'TypeCtrl'
,
controller
:
'TypeCtrl'
,
...
...
app/components/staff/staff_controller.js
View file @
9ba7a25d
...
@@ -40,7 +40,7 @@ staff.controller('StaffAddCtrl', function ($scope, $http, $log, Generator, $rout
...
@@ -40,7 +40,7 @@ staff.controller('StaffAddCtrl', function ($scope, $http, $log, Generator, $rout
});
});
staff
.
controller
(
'StaffEditCtrl'
,
function
(
$scope
,
$http
,
$log
,
Generator
,
$routeParams
)
{
staff
.
controller
(
'StaffEditCtrl'
,
function
(
$scope
,
$http
,
$log
,
Generator
,
$routeParams
)
{
Generator
.
get_form
(
'
add_staff'
,
$routeParams
.
id
).
then
(
function
(
d
)
{
Generator
.
get_form
(
'
edit_staff'
,
{
id
:
$routeParams
.
id
}
).
then
(
function
(
d
)
{
$scope
.
schema
=
d
.
schema
;
$scope
.
schema
=
d
.
schema
;
$scope
.
form
=
d
.
form
;
$scope
.
form
=
d
.
form
;
$scope
.
model
=
d
.
model
?
d
.
model
:
{};
$scope
.
model
=
d
.
model
?
d
.
model
:
{};
...
@@ -71,3 +71,13 @@ staff.controller('StaffListCtrl', function($scope, $http){
...
@@ -71,3 +71,13 @@ staff.controller('StaffListCtrl', function($scope, $http){
$scope
.
staffs
=
res
.
data
;
$scope
.
staffs
=
res
.
data
;
})
})
});
});
/**
* Staff Show Controller
*/
staff
.
controller
(
'StaffShowCtrl'
,
function
(
$scope
,
$http
,
$routeParams
){
$log
.
info
(
$routeParams
.
id
);
//$http.get('http://127.0.0.1:3000/api/staff/').then(function(res){
$scope
.
staff
=
""
;
//})
});
\ No newline at end of file
app/components/staff/
staff_add_template
.html
→
app/components/staff/
templates/add
.html
View file @
9ba7a25d
File moved
app/components/staff/templates/edit.html
0 → 100644
View file @
9ba7a25d
<div
ng-app=
"zaerp.staff.add"
>
<div
class=
"col-md-6"
>
<h1>
{{ schema.title }}
</h1>
<form
name=
"formgenerated"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
ng-submit=
"onSubmit(formgenerated)"
></form>
</div>
</div>
\ No newline at end of file
app/components/staff/templates/list.html
0 → 100644
View file @
9ba7a25d
<table
class=
"table table-bordered"
>
<thead>
<tr>
<th
ng-repeat=
"(key,value) in staffs[0]"
>
{{ key }}
</th>
</tr>
</thead>
<tbody>
<tr
ng-repeat=
"staff in staffs"
>
<td
ng-repeat=
"(key,value) in staff"
>
{{value}}
</td>
<td><a
ng-href=
"#/staff/edit/{{staff.id}}"
>
Edit
</a></td>
</tr>
</tbody>
</table>
\ No newline at end of file
app/components/staff/templates/show.html
0 → 100644
View file @
9ba7a25d
{{ staff }}
\ No newline at end of file
app/index.html
View file @
9ba7a25d
...
@@ -48,7 +48,9 @@
...
@@ -48,7 +48,9 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-3 col-md-2 sidebar"
>
<div
class=
"col-sm-3 col-md-2 sidebar"
>
<ul
class=
"nav nav-sidebar"
>
<ul
class=
"nav nav-sidebar"
>
<li><a
href=
"#/students"
>
Students
</a></li>
<li
class=
"active"
><a
href=
"#/student/add"
>
New Student
</a></li>
<li
class=
"active"
><a
href=
"#/student/add"
>
New Student
</a></li>
<li><a
href=
"#/staffs"
>
Staffs
</a></li>
<li><a
href=
"#/staff/add"
>
New Staff
</a></li>
<li><a
href=
"#/staff/add"
>
New Staff
</a></li>
<li><a
href=
"#/input_types"
>
Types
</a></li>
<li><a
href=
"#/input_types"
>
Types
</a></li>
</ul>
</ul>
...
...
fake_rest_server.js
View file @
9ba7a25d
...
@@ -10,7 +10,7 @@ var login = new fake.Resource("login")
...
@@ -10,7 +10,7 @@ var login = new fake.Resource("login")
success
:
true
success
:
true
});
});
var
form
=
new
fake
.
Resource
(
"add_student"
)
var
add_student
=
new
fake
.
Resource
(
"add_student"
)
.
add
({
.
add
({
schema
:
{
schema
:
{
title
:
"Add Student"
,
title
:
"Add Student"
,
...
@@ -43,7 +43,7 @@ var form = new fake.Resource("add_student")
...
@@ -43,7 +43,7 @@ var form = new fake.Resource("add_student")
}
}
});
});
var
form2
=
new
fake
.
Resource
(
"add_staff"
)
var
add_staff
=
new
fake
.
Resource
(
"add_staff"
)
.
add
({
.
add
({
schema
:
{
schema
:
{
title
:
"Add Staff"
,
title
:
"Add Staff"
,
...
@@ -73,6 +73,40 @@ var form2 = new fake.Resource("add_staff")
...
@@ -73,6 +73,40 @@ var form2 = new fake.Resource("add_staff")
]
]
});
});
var
edit_staff
=
new
fake
.
Resource
(
"edit_staff"
)
.
add
({
schema
:
{
title
:
"Edit Staff"
,
type
:
"object"
,
properties
:
{
name
:
{
type
:
"string"
,
title
:
"Name"
},
email
:
{
type
:
"email"
,
title
:
"Email"
}
},
required
:
[
"email"
,
"name"
]
},
form
:
[
{
key
:
"email"
,
type
:
"email"
,
validationMessages
:
{
'emailNotValid'
:
'Email is not valid!'
}
},
"name"
],
model
:
{
name
:
"evren kutar"
,
email
:
"evren@zetaops.io"
}
});
var
student
=
new
fake
.
Resource
(
"list_student"
)
var
student
=
new
fake
.
Resource
(
"list_student"
)
.
add
({
.
add
({
'deleted'
:
false
,
'deleted'
:
false
,
...
@@ -278,9 +312,10 @@ var types = new fake.Resource("input_types")
...
@@ -278,9 +312,10 @@ var types = new fake.Resource("input_types")
var
server
=
new
fake
.
Server
()
var
server
=
new
fake
.
Server
()
.
register
(
login
)
.
register
(
login
)
.
register
(
form
)
.
register
(
add_student
)
.
register
(
student
)
.
register
(
student
)
.
register
(
staff
)
.
register
(
staff
)
.
register
(
form2
)
.
register
(
add_staff
)
.
register
(
edit_staff
)
.
register
(
types
)
.
register
(
types
)
.
listen
(
3000
);
.
listen
(
3000
);
\ No newline at end of file
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