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
9afb4586
Commit
9afb4586
authored
Jun 18, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new link on index page & bower.json edit
parent
712c7ddf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
13 deletions
+22
-13
app_routes.js
app/app_routes.js
+1
-1
student_controller.js
app/components/student/student_controller.js
+7
-5
index.html
app/index.html
+1
-1
form_service.js
app/zetalib/forms/form_service.js
+7
-0
bower.json
bower.json
+6
-6
No files found.
app/app_routes.js
View file @
9afb4586
...
@@ -23,7 +23,7 @@ app.config(['$routeProvider', function ($routeProvider) {
...
@@ -23,7 +23,7 @@ app.config(['$routeProvider', function ($routeProvider) {
})
})
.
when
(
'/student_add'
,
{
.
when
(
'/student_add'
,
{
templateUrl
:
'components/student/student_add_template.html'
,
templateUrl
:
'components/student/student_add_template.html'
,
controller
:
'StudentAddCtrl'
,
controller
:
'StudentAdd
Edit
Ctrl'
,
resolve
:
{
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'components/student/student_controller.js'
);
return
$ocLazyLoad
.
load
(
'components/student/student_controller.js'
);
...
...
app/components/student/student_controller.js
View file @
9afb4586
...
@@ -18,11 +18,15 @@ var student = angular.module('zaerp.student.add', ['ngRoute', 'schemaForm', 'for
...
@@ -18,11 +18,15 @@ var student = angular.module('zaerp.student.add', ['ngRoute', 'schemaForm', 'for
* to add student, provide form with form generator
* to add student, provide form with form generator
*/
*/
student
.
controller
(
'StudentAddCtrl'
,
function
(
$scope
,
$http
,
$log
,
Generator
,
$routeParams
){
student
.
controller
(
'StudentAdd
Edit
Ctrl'
,
function
(
$scope
,
$http
,
$log
,
Generator
,
$routeParams
){
Generator
.
get_form
(
'add_student'
,
$routeParams
).
then
(
function
(
d
){
Generator
.
get_form
(
'add_student'
,
$routeParams
).
then
(
function
(
d
){
$scope
.
schema
=
d
.
schema
;
$scope
.
schema
=
d
.
schema
;
$scope
.
form
=
d
.
form
;
$scope
.
form
=
d
.
form
;
// model is the init data of the form or in edit templates
$scope
.
model
=
{};
// for email validation add asyncvalidator
$scope
.
form
[
0
].
$asyncValidators
=
Generator
.
asyncValidators
;
$scope
.
form
[
0
].
$asyncValidators
=
Generator
.
asyncValidators
;
// add submit button to the form todo: move this to form service
$scope
.
form
.
push
(
$scope
.
form
.
push
(
{
{
type
:
"submit"
,
type
:
"submit"
,
...
@@ -33,10 +37,8 @@ student.controller('StudentAddCtrl', function($scope, $http, $log, Generator, $r
...
@@ -33,10 +37,8 @@ student.controller('StudentAddCtrl', function($scope, $http, $log, Generator, $r
$scope
.
onSubmit
=
function
(
form
)
{
$scope
.
onSubmit
=
function
(
form
)
{
$scope
.
$broadcast
(
'schemaFormValidate'
);
$scope
.
$broadcast
(
'schemaFormValidate'
);
if
(
form
.
$valid
)
{
if
(
form
.
$valid
)
{
$log
.
info
(
form
);
// todo: implement form diff here
}
$log
.
info
(
$scope
);
else
{
$log
.
info
(
"not valid"
);
}
}
}
}
});
});
\ No newline at end of file
app/index.html
View file @
9afb4586
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<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
class=
"active"
><a
href=
"#"
>
Overview
<span
class=
"sr-only"
>
(current)
</span></a></li>
<li
class=
"active"
><a
href=
"#"
>
Overview
<span
class=
"sr-only"
>
(current)
</span></a></li>
<li><a
href=
"#
"
>
Reports
</a></li>
<li><a
href=
"#
/student_add"
>
New Student
</a></li>
<li><a
href=
"#"
>
Analytics
</a></li>
<li><a
href=
"#"
>
Analytics
</a></li>
<li><a
href=
"#"
>
Export
</a></li>
<li><a
href=
"#"
>
Export
</a></li>
</ul>
</ul>
...
...
app/zetalib/forms/form_service.js
View file @
9afb4586
...
@@ -53,5 +53,12 @@ form_generator.factory('Generator', function ($http, $q, $timeout, RESTURL) {
...
@@ -53,5 +53,12 @@ form_generator.factory('Generator', function ($http, $q, $timeout, RESTURL) {
return
deferred
.
promise
;
return
deferred
.
promise
;
}
}
};
};
generator
.
submit
=
function
(
form
,
$scope
,
$log
)
{
$scope
.
$broadcast
(
'schemaFormValidate'
);
if
(
form
.
$valid
)
{
// todo: implement form diff here
$log
.
info
(
$scope
.
model
);
}
};
return
generator
;
return
generator
;
});
});
\ No newline at end of file
bower.json
View file @
9afb4586
{
{
"name"
:
"
angular-seed
"
,
"name"
:
"
zaerp-ui
"
,
"description"
:
"
A starter project for AngularJS
"
,
"description"
:
"
UI project for ZAERP
"
,
"version"
:
"0.0.
0
"
,
"version"
:
"0.0.
1
"
,
"homepage"
:
"https://github.com/
angular/angular-seed
"
,
"homepage"
:
"https://github.com/
zetaops/zaerp-ui
"
,
"license"
:
"
MIT
"
,
"license"
:
"
GPL
"
,
"private"
:
tru
e
,
"private"
:
fals
e
,
"dependencies"
:
{
"dependencies"
:
{
"angular"
:
"1.4.x"
,
"angular"
:
"1.4.x"
,
"angular-mocks"
:
"1.4.x"
,
"angular-mocks"
:
"1.4.x"
,
...
...
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