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
46246123
Commit
46246123
authored
Jun 16, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
async work & structure design
parent
235c56fc
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
28 additions
and
102 deletions
+28
-102
app.js
app/app.js
+9
-0
dashboard.html
app/dashboard/dashboard.html
+1
-1
dashboard.js
app/dashboard/dashboard.js
+1
-6
form_generator.js
app/forms/form_generator.js
+0
-28
form_generator_test.js
app/forms/form_generator_test.js
+0
-44
form_template.html
app/forms/form_template.html
+0
-6
index.html
app/index.html
+1
-1
test_template.html
app/test_view_for_generator/test_template.html
+4
-4
testfile.js
app/test_view_for_generator/testfile.js
+7
-8
bower.json
bower.json
+5
-4
No files found.
app/app.js
View file @
46246123
...
...
@@ -57,6 +57,15 @@ angular.module(
}]
}
})
.
when
(
'/test'
,
{
templateUrl
:
'test_view_for_generator/test_template.html'
,
controller
:
'TestCtrl'
,
resolve
:
{
loadMyCtrl
:
[
'$ocLazyLoad'
,
function
(
$ocLazyLoad
)
{
return
$ocLazyLoad
.
load
(
'test_view_for_generator/testfile.js'
);
}]
}
})
.
otherwise
({
redirectTo
:
'/dashboard'
});
}]).
run
(
function
(
$rootScope
,
$location
,
$cookies
)
{
...
...
app/dashboard/dashboard.html
View file @
46246123
<div
ng-app=
"zaerp.dashboard"
>
<div
class=
"starter-template"
ng-controller=
"DashCtrl"
>
<div
class=
"starter-template"
>
<h1>
Main Dashboard
</h1>
{{ testData }}
</div>
...
...
app/dashboard/dashboard.js
View file @
46246123
...
...
@@ -11,12 +11,7 @@
angular
.
module
(
'zaerp.dashboard'
,
[
'ngRoute'
])
.
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
//$routeProvider.when('/dashboard', {
// templateUrl: 'dashboard/dashboard.html',
// controller: 'DashCtrl'
//});
}])
.
controller
(
'DashCtrl'
,
function
(
$scope
)
{
$scope
.
testData
=
"<h1>This is main Dashboard</h1>"
;
console
.
log
(
22
);
});
\ No newline at end of file
app/forms/form_generator.js
deleted
100644 → 0
View file @
235c56fc
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
var
form_generator
=
angular
.
module
(
'formGenerator'
,
[]);
form_generator
.
factory
(
'Generator'
,
function
(
$http
,
RESTURL
)
{
var
generator
=
{};
generator
.
generate
=
function
(
modelObject
)
{
return
generator
.
group
(
modelObject
);
};
generator
.
group
=
function
(
form_items
)
{
return
form_items
;
};
generator
.
get_form
=
function
(
url
,
getParams
)
{
return
$http
.
get
(
RESTURL
.
url
+
url
+
getParams
)
.
then
(
function
(
res
)
{
if
(
res
.
data
)
{
return
res
.
data
;
}
});
};
return
generator
;
});
\ No newline at end of file
app/forms/form_generator_test.js
deleted
100644 → 0
View file @
235c56fc
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
'use strict'
;
describe
(
'general module'
,
function
()
{
beforeEach
(
module
(
'general'
));
describe
(
'form diff factory'
,
function
()
{
it
(
'should return diff object'
,
inject
([
'FormDiff'
,
function
(
FormDiff
)
{
expect
(
FormDiff
.
get_diff
).
not
.
toBe
(
null
);
// test cases - testing for success
var
same_json
=
[
{
email
:
'test@test.com'
,
id
:
2
,
name
:
'travolta'
},
{
email
:
'test@test.com'
,
id
:
2
,
name
:
'travolta'
}
];
// test cases - testing for failure
var
different_json
=
[
{
email
:
'test@test.com'
,
id
:
2
,
name
:
'travolta'
},
{
email
:
'test1@test.com'
,
id
:
2
,
name
:
'john'
}
];
var
diff
=
{
email
:
'test1@test.com'
,
name
:
'john'
};
var
nodiff
=
{};
var
same
=
FormDiff
.
get_diff
(
same_json
[
0
],
same_json
[
1
]);
expect
(
same
).
toEqual
(
nodiff
);
var
different
=
FormDiff
.
get_diff
(
different_json
[
0
],
different_json
[
1
]);
expect
(
different
).
toEqual
(
diff
);
}])
);
});
});
\ No newline at end of file
app/forms/form_template.html
deleted
100644 → 0
View file @
235c56fc
<div
ng-app=
"FormGenerator"
>
<div
class=
"col-md-6"
ng-controller=
""
>
<h1>
{{ form.name }}
</h1>
<form
name=
"{{ form.formname }}"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
ng-submit=
"onSubmit()"
></form>
</div>
</div>
\ No newline at end of file
app/index.html
View file @
46246123
...
...
@@ -36,7 +36,7 @@
<div
id=
"navbar"
class=
"navbar-collapse collapse"
>
<ul
class=
"nav navbar-nav navbar-right"
>
<li><a
href=
"#/dashboard"
>
Dashboard
</a></li>
<li><a
href=
"#/
settings"
>
Settings
</a></li>
<li><a
href=
"#/
test"
>
Test
</a></li>
<li><a
href=
"#/profile"
>
Profile
</a></li>
<li><a
href=
"#/login"
>
Login
</a></li>
</ul>
...
...
app/test_view_for_generator/test_template.html
View file @
46246123
<div
ng-app=
"zaerp.
dashboard
"
>
<div
class=
"starter-template"
ng-controller=
"TestCtrl"
>
<h1>
Main Dashboard
</h1>
<div
ng-include=
" '' "
>
</div>
<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
View file @
46246123
'use strict'
;
var
testform
=
angular
.
module
(
'zaerp.test'
,
[
'ngRoute'
,
'schemaForm'
]);
testform
.
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
$routeProvider
.
when
(
'/test'
,
{
templateUrl
:
'test_view_for_generator/test_template.html'
,
controller
:
'TestCtrl'
});
}]);
var
testform
=
angular
.
module
(
'zaerp.'
,
[
'ngRoute'
,
'schemaForm'
,
'formGenerator'
]);
testform
.
controller
(
'
TestCtrl'
,
function
(
$scope
,
$q
,
$timeout
,
Generator
){
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
bower.json
View file @
46246123
...
...
@@ -6,10 +6,11 @@
"license"
:
"MIT"
,
"private"
:
true
,
"dependencies"
:
{
"angular"
:
"1.3.x"
,
"angular-mocks"
:
"1.3.x"
,
"angular-route"
:
"1.3.x"
,
"angular-resource"
:
"1.3.x"
,
"angular"
:
"1.4.x"
,
"angular-mocks"
:
"1.4.x"
,
"angular-route"
:
"1.4.x"
,
"angular-resource"
:
"1.4.x"
,
"angular-cookies"
:
"1.4.x"
,
"bootstrap"
:
"3.3.4"
,
"angular-schema-form"
:
"*"
,
"oclazyload"
:
"*"
...
...
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