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
741fe310
Commit
741fe310
authored
Sep 04, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate modal form for listnode and node
parent
cef1f235
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
134 additions
and
202 deletions
+134
-202
app.js
app/app.js
+2
-2
index.html
app/index.html
+2
-2
directives.js
app/shared/directives.js
+0
-3
add.html
app/shared/templates/add.html
+35
-4
sidebar.html
app/shared/templates/directives/sidebar.html
+3
-48
linkedModelModalContent.html
app/shared/templates/linkedModelModalContent.html
+5
-1
listnodeModalContent.html
app/shared/templates/listnodeModalContent.html
+1
-0
form_service.js
app/zetalib/forms/form_service.js
+85
-141
interceptors.js
app/zetalib/interceptors.js
+1
-1
No files found.
app/app.js
View file @
741fe310
...
...
@@ -24,14 +24,14 @@ var app = angular.module(
//'ulakbus.version',
'schemaForm'
,
'gettext'
,
'templates-prod'
//
'templates-prod'
]).
/**
* RESTURL is the url of rest api to talk
* Based on the environment it changes from dev to prod
*/
constant
(
"RESTURL"
,
(
function
()
{
return
{
url
:
"http://
api.ulakbus.net
/"
};
return
{
url
:
"http://
"
+
window
.
location
.
hostname
+
":9001
/"
};
})()).
/**
* USER_ROLES and AUTH_EVENTS are constant for auth functions
...
...
app/index.html
View file @
741fe310
...
...
@@ -82,7 +82,7 @@
<script
src=
"bower_components/tv4/tv4.js"
></script>
<script
src=
"bower_components/objectpath/lib/ObjectPath.js"
></script>
<script
src=
"bower_components/objectpath/lib/ObjectPath.js"
></script>
<script
src=
"bower_components/angular-schema-form/dist/schema-form.
min.
js"
></script>
<script
src=
"bower_components/angular-schema-form/dist/schema-form.js"
></script>
<script
src=
"bower_components/angular-schema-form/dist/bootstrap-decorator.min.js"
></script>
<!--<script src="bower_components/angular-schema-form-datepicker/bootstrap-datepicker.min.js"></script>-->
<script
src=
"bower_components/angular-gettext/dist/angular-gettext.min.js"
></script>
...
...
@@ -99,8 +99,8 @@
<script
src=
"app.js"
></script>
<script
src=
"app_routes.js"
></script>
<script
src=
"shared/scripts/theme.js"
></script>
<script
src=
"shared/directives.js"
></script>
<!--<script src="shared/scripts/theme.js"></script>-->
<script
src=
"zetalib/interceptors.js"
></script>
<script
src=
"zetalib/general.js"
></script>
<script
src=
"zetalib/forms/form_service.js"
></script>
...
...
app/shared/directives.js
View file @
741fe310
...
...
@@ -42,12 +42,9 @@ app.directive('sidebar', ['$location', function () {
scope
:
{},
controller
:
function
(
$scope
,
$http
,
RESTURL
)
{
$http
.
post
(
RESTURL
.
url
+
'crud/'
).
success
(
function
(
data
)
{
//debugger;
$scope
.
menuItems
=
data
.
models
;
});
$scope
.
menuItems
=
'dsadkal'
;
$scope
.
selectedMenu
=
'dashboard'
;
$scope
.
collapseVar
=
0
;
$scope
.
multiCollapseVar
=
0
;
...
...
app/shared/templates/add.html
View file @
741fe310
<div
class=
"col-md-12"
>
<h1>
{{ schema.title }}
</h1>
<button
type=
"button"
ng-repeat=
"node in listnodes"
ng-click=
"openmodal(node)"
>
Add
<span>
{{node}}
</span></button>
<form
name=
"formgenerated"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
ng-submit=
"onSubmit(formgenerated)"
></form>
<h1>
{{ schema.title }}
</h1>
<form
name=
"formgenerated"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
></form>
<div
ng-repeat=
"node in listnodes"
>
<h3>
{{ node.title }}
<span>
<a
href=
"javascript:void(0);"
add-modal-for-list-node=
{{node.title}}
>
<i
class=
"fa fa-plus-circle fa-fw"
></i>
</a>
</span>
</h3>
<table
class=
"table table-bordered"
style=
"background-color:#fff;"
>
<thead>
<tr>
<th
colspan=
"2"
>
#
</th>
<th
ng-repeat=
"(key,value) in node.fields"
>
{{ value.title }}
</th>
<th>
action
</th>
</tr>
</thead>
<tbody>
<tr>
<td
width=
"60"
>
<label>
<input
type=
"checkbox"
style=
"zoom:1.5; margin:5px 0 0 8px;"
>
</label>
</td>
<th
scope=
"row"
style=
"text-align:center"
>
1
</th>
<td
ng-repeat=
"(key,value) in node.fields"
>
{{ value.value }}
</td>
<td>
<a
ng-href=
"#/crud/{{model}}/edit/{{object.key}}"
>
Edit
</a><br>
<a
ng-href=
"#/crud/{{model}}/{{object.key}}"
>
Show
</a>
<a
ng-href=
"#/crud/{{model}}/{{object.key}}"
>
Delete
</a>
</td>
</tr>
</tbody>
</table>
</div>
\ No newline at end of file
app/shared/templates/directives/sidebar.html
View file @
741fe310
<div
class=
"navbar-default sidebar"
role=
"navigation"
>
<div
class=
"sidebar-nav navbar-collapse"
>
<div
class=
"brand"
>
<a
href=
""
class=
"logo"
><img
src=
"
../../..
/img/brand-logo.png"
/></a>
<a
href=
""
class=
"logo"
><img
src=
"/img/brand-logo.png"
/></a>
</div>
<ul
class=
"nav in"
id=
"side-menu"
>
<
sidebar-search></sidebar-search
>
<
!--<sidebar-search></sidebar-search>--
>
<li
ui-sref-active=
"active"
>
<a
href=
"#/dashboard"
><i
class=
"fa fa-dashboard fa-fw"
></i>
Dashboard
</a>
</li>
<li
ng-repeat=
"(key, item) in menuItems"
ng-class=
"{active: collapseVar == key}"
>
{{dropDown}}
<li
ng-repeat=
"(key, item) in menuItems"
ng-class=
"{active: collapseVar == key}"
>
<a
href=
""
ng-click=
"check(key)"
><i
class=
"fa fa-wrench fa-fw"
></i>
{{ item }}
<span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-second-level"
collapse=
"collapseVar!={{key}}"
>
...
...
@@ -21,51 +21,6 @@
</ul>
<!-- /.nav-second-level -->
</li>
<!--<li ng-class="{active: collapseVar==2}">-->
<!--<a href="" ng-click="check(2)"><i class="fa fa-sitemap fa-fw"></i> Multi-Level Dropdown<span-->
<!--class="fa arrow"></span></a>-->
<!--<ul class="nav nav-second-level" collapse="collapseVar!=2">-->
<!--<li>-->
<!--<a href="">Second Level Item</a>-->
<!--</li>-->
<!--<li>-->
<!--<a href="">Second Level Item</a>-->
<!--</li>-->
<!--<li ng-init="third=!third" ng-class="{active: multiCollapseVar==3}">-->
<!--<a href="" ng-click="multiCheck(3)">Third Level <span class="fa arrow"></span></a>-->
<!--<ul class="nav nav-third-level" collapse="multiCollapseVar!=3">-->
<!--<li>-->
<!--<a href="">Third Level Item</a>-->
<!--</li>-->
<!--<li>-->
<!--<a href="">Third Level Item</a>-->
<!--</li>-->
<!--<li>-->
<!--<a href="">Third Level Item</a>-->
<!--</li>-->
<!--<li>-->
<!--<a href="">Third Level Item</a>-->
<!--</li>-->
<!--</ul>-->
<!--<!– /.nav-third-level –>-->
<!--</li>-->
<!--</ul>-->
<!--<!– /.nav-second-level –>-->
<!--</li>-->
<!--<li ng-class="{active:collapseVar==4}">-->
<!--<a href="" ng-click="check(4)"><i class="fa fa-files-o fa-fw"></i> Sample Pages<span-->
<!--class="fa arrow"></span></a>-->
<!--<ul class="nav nav-second-level" collapse="collapseVar!=4">-->
<!--<li ng-class="{active: selectedMenu=='blank'}">-->
<!--<a ui-sref="dashboard.blank" ng-click="selectedMenu='blank'">Blank Page</a>-->
<!--</li>-->
<!--<li>-->
<!--<a ui-sref="login">Login Page</a>-->
<!--</li>-->
<!--</ul>-->
<!--<!– /.nav-second-level –>-->
<!--</li>-->
</ul>
</div>
<!-- /.sidebar-collapse -->
...
...
app/shared/templates/linkedModelModalContent.html
View file @
741fe310
<div
class=
"modal-body"
>
<form
name=
"linkedModelForm"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
ng-submit=
"onSubmit(linkedModelForm)"
></form>
<form
name=
"linkedModelForm"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
></form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"submit"
class=
"btn btn-primary"
ng-click=
"onSubmit(linkedModelForm)"
>
OK
</button>
<button
type=
"button"
class=
"btn btn-warning"
ng-click=
"cancel()"
>
Cancel
</button>
</div>
\ No newline at end of file
app/shared/templates/listnodeModalContent.html
View file @
741fe310
<div
class=
"modal-body"
>
<h3>
{{schema.title}}
</h3>
<form
name=
"listnodeform"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
></form>
</div>
<div
class=
"modal-footer"
>
...
...
app/zetalib/forms/form_service.js
View file @
741fe310
This diff is collapsed.
Click to expand it.
app/zetalib/interceptors.js
View file @
741fe310
...
...
@@ -25,7 +25,7 @@ app.config(['$httpProvider', function ($httpProvider) {
'response'
:
function
(
response
)
{
//Will only be called for HTTP up to 300
if
(
response
.
data
.
is_login
===
true
){
$rootScope
.
loggedInUser
=
response
.
data
.
is_login
;
//
$rootScope.loggedInUser = response.data.is_login;
//$location.replace();
if
(
$location
.
path
()
===
"/login"
){
$location
.
path
(
"/dashboard"
);
...
...
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