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
02054713
Commit
02054713
authored
Jun 16, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restructure application phase 3
parent
a2f2b34d
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
76 additions
and
28 deletions
+76
-28
app_routes.js
app/app_routes.js
+8
-8
auth_controller.js
app/components/auth/auth_controller.js
+2
-2
auth_service.js
app/components/auth/auth_service.js
+0
-0
auth_test.js
app/components/auth/auth_test.js
+0
-0
login.html
app/components/auth/login.html
+0
-0
login_form_helpers.js
app/components/auth/login_form_helpers.js
+66
-0
dashboard.html
app/components/dashboard/dashboard.html
+0
-0
dashboard.js
app/components/dashboard/dashboard.js
+0
-0
dashboard_test.js
app/components/dashboard/dashboard_test.js
+0
-0
student_add.js
app/components/student/student_add.js
+0
-0
student_add_template.html
app/components/student/student_add_template.html
+0
-0
test_template.html
app/test_view_for_generator/test_template.html
+0
-6
testfile.js
app/test_view_for_generator/testfile.js
+0
-12
form_service.js
app/zetalib/forms/form_service.js
+0
-0
form_service_template.html
app/zetalib/forms/form_service_template.html
+0
-0
form_service_test.js
app/zetalib/forms/form_service_test.js
+0
-0
No files found.
app/app_routes.js
View file @
02054713
app
.
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
$routeProvider
.
when
(
'/login'
,
{
templateUrl
:
'login/login.html'
,
templateUrl
:
'
components/
login/login.html'
,
controller
:
'LoginCtrl'
,
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'
login/login
.js'
);
return
$ocLazyLoad
.
load
(
'
components/auth/auth_controller
.js'
);
}],
loadMyService
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'
login/login
_service.js'
);
return
$ocLazyLoad
.
load
(
'
components/auth/auth
_service.js'
);
}]
}
})
.
when
(
'/dashboard'
,
{
templateUrl
:
'dashboard/dashboard.html'
,
templateUrl
:
'
components/
dashboard/dashboard.html'
,
controller
:
'DashCtrl'
,
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'dashboard/dashboard.js'
);
return
$ocLazyLoad
.
load
(
'
components/
dashboard/dashboard.js'
);
}]
}
})
.
when
(
'/student_add'
,
{
templateUrl
:
'student/student_add_template.html'
,
templateUrl
:
'
components/
student/student_add_template.html'
,
controller
:
'StudentAddCtrl'
,
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'student/student_add.js'
);
return
$ocLazyLoad
.
load
(
'
components/
student/student_add.js'
);
}],
loadMyService
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'forms/form_service.js'
);
return
$ocLazyLoad
.
load
(
'
zetalib/
forms/form_service.js'
);
}]
}
})
...
...
app/
login/login
.js
→
app/
components/auth/auth_controller
.js
View file @
02054713
...
...
@@ -11,8 +11,8 @@
// TODO: password hash or not??
// TODO: who field can be removed??
var
login
=
angular
.
module
(
'zaerp.login
'
,
[
'ngRoute'
,
'schemaForm'
,
'ngCookies'
]);
login
.
controller
(
'LoginCtrl'
,
function
(
$scope
,
$q
,
$timeout
,
LoginService
)
{
var
auth
=
angular
.
module
(
'zaerp.auth
'
,
[
'ngRoute'
,
'schemaForm'
,
'ngCookies'
]);
auth
.
controller
(
'LoginCtrl'
,
function
(
$scope
,
$q
,
$timeout
,
LoginService
)
{
$scope
.
schema
=
{
title
:
"Login"
,
...
...
app/
login/login
_service.js
→
app/
components/auth/auth
_service.js
View file @
02054713
File moved
app/
login/login
_test.js
→
app/
components/auth/auth
_test.js
View file @
02054713
File moved
app/
login
/login.html
→
app/
components/auth
/login.html
View file @
02054713
File moved
app/components/auth/login_form_helpers.js
0 → 100644
View file @
02054713
/**
* Created by Evren Kutar on 18/05/15.
*/
angular
.
module
(
'zaerp.login.directives'
,
[])
/**
* Simple directive to check password equality
*
* usage:
* <input type="password" ng-model="password" password-match="password2">
* <input type="password" ng-model="password2">
*/
.
directive
(
'passwordMatch'
,
function
()
{
return
{
restrict
:
'A'
,
scope
:
false
,
require
:
'ngModel'
,
link
:
function
(
scope
,
elem
,
attrs
,
controller
)
{
var
checker
=
function
()
{
// get the value of the first password
var
pwd
=
scope
.
$eval
(
attrs
.
ngModel
);
// get the value of the other password
var
pwd2
=
scope
.
$eval
(
attrs
.
passwordMatch
);
return
pwd
===
pwd2
;
};
scope
.
$watch
(
checker
,
function
(
pwdMatch
)
{
controller
.
$setValidity
(
'match'
,
pwdMatch
);
});
}
};
})
/**
* Directive to manage valid/invalid states of remote-validated Data.
* It stores an internal array of values declared invalid by the server.
* Generates the form error specified in case the user re-types the same invalid values,
* clears the errors in case the user changes the ngModel.
*
* usage:
* <input type="email" ng-model="email" remote-validated="used">
*
* NOTE: Your controllers have to make the field invalid in case *your* server says so.
*/
.
directive
(
'remoteValidated'
,
function
()
{
return
{
restrict
:
'A'
,
scope
:
false
,
require
:
'ngModel'
,
link
:
function
(
scope
,
elem
,
attrs
,
controller
)
{
var
invalidItems
=
[];
scope
.
$watch
(
attrs
.
ngModel
,
function
(
newValue
,
oldValue
)
{
if
(
newValue
)
{
// Check the array of already-bad items
if
(
invalidItems
.
indexOf
(
newValue
)
!==
-
1
)
{
return
controller
.
$setValidity
(
attrs
.
remoteValidated
,
false
);
}
// When the model changes, it checks if the previous value was
// triggering the error from server-side
if
(
controller
.
$error
[
attrs
.
remoteValidated
])
{
invalidItems
.
push
(
oldValue
);
}
controller
.
$setValidity
(
attrs
.
remoteValidated
,
true
);
}
});
}
};
});
app/dashboard/dashboard.html
→
app/
components/
dashboard/dashboard.html
View file @
02054713
File moved
app/dashboard/dashboard.js
→
app/
components/
dashboard/dashboard.js
View file @
02054713
File moved
app/dashboard/dashboard_test.js
→
app/
components/
dashboard/dashboard_test.js
View file @
02054713
File moved
app/student/student_add.js
→
app/
components/
student/student_add.js
View file @
02054713
File moved
app/student/student_add_template.html
→
app/
components/
student/student_add_template.html
View file @
02054713
File moved
app/test_view_for_generator/test_template.html
deleted
100644 → 0
View file @
a2f2b34d
<div
ng-app=
"zaerp.test"
>
<div
class=
"starter-template"
>
<h1>
Add Student
</h1>
<div>
{{ form }}
</div>
</div>
</div>
\ No newline at end of file
app/test_view_for_generator/testfile.js
deleted
100644 → 0
View file @
a2f2b34d
'use strict'
;
var
testform
=
angular
.
module
(
'zaerp.'
,
[
'ngRoute'
,
'schemaForm'
,
'formGenerator'
]);
testform
.
controller
(
'RecordCtrl'
,
function
(
$scope
,
$http
,
$timeout
,
$log
,
Generator
,
RESTURL
){
$scope
.
form
=
Generator
.
generate
(
'add_student'
,
''
);
$log
.
info
(
$scope
.
form
);
$http
.
get
(
RESTURL
.
url
+
'add_student'
).
then
(
function
(
res
){
$log
.
info
(
res
.
data
);
});
});
\ No newline at end of file
app/forms/form_service.js
→
app/
zetalib/
forms/form_service.js
View file @
02054713
File moved
app/forms/form_service_template.html
→
app/
zetalib/
forms/form_service_template.html
View file @
02054713
File moved
app/forms/form_service_test.js
→
app/
zetalib/
forms/form_service_test.js
View file @
02054713
File moved
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