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
bf450bf8
Commit
bf450bf8
authored
Sep 11, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 401 login status
datepicker unfix
parent
d91e9e9b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
10 deletions
+37
-10
add.html
app/components/crud/templates/add.html
+1
-1
add.html
app/shared/templates/add.html
+1
-1
datefield.html
app/shared/templates/datefield.html
+22
-2
form_service.js
app/zetalib/forms/form_service.js
+12
-5
interceptors.js
app/zetalib/interceptors.js
+1
-1
No files found.
app/components/crud/templates/add.html
View file @
bf450bf8
<div
ng-app=
"ulakbus.crud"
>
<div>
<ng-include
src=
"'shared/templates/add.html'"
></ng-include>
<ng-include
src=
"'shared/templates/add.html'"
></ng-include>
</div>
</div>
\ No newline at end of file
app/shared/templates/add.html
View file @
bf450bf8
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
</label>
</label>
</td>
</td>
<th
scope=
"row"
style=
"text-align:center"
>
1
</th>
<th
scope=
"row"
style=
"text-align:center"
>
1
</th>
<td
ng-repeat=
"(key,value) in node.
field
s"
>
{{ value.value }}
</td>
<td
ng-repeat=
"(key,value) in node.
model
s"
>
{{ value.value }}
</td>
<td>
<td>
<a
ng-href=
"#/crud/{{model}}/edit/{{object.key}}"
>
Edit
</a><br>
<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}}"
>
Show
</a>
...
...
app/shared/templates/datefield.html
View file @
bf450bf8
...
@@ -16,15 +16,35 @@
...
@@ -16,15 +16,35 @@
ng-disabled=
"form.readonly"
ng-disabled=
"form.readonly"
schema-validate=
"form"
schema-validate=
"form"
name=
"{{form.key.slice(-1)[0]}}"
name=
"{{form.key.slice(-1)[0]}}"
aria-describedby=
"{{form.key.slice(-1)[0] + 'Status'}}"
/>
aria-describedby=
"{{form.key.slice(-1)[0] + 'Status'}}"
type=
"date"
datepicker-popup
is-open=
"status.opened"
date-disabled=
"disabled(date, mode)"
close-text=
"Close"
/>
<span
class=
"input-group-btn"
>
<span
class=
"input-group-btn"
>
<button
type=
"button"
class=
"btn btn-default"
>
<button
type=
"button"
class=
"btn btn-default"
ng-click=
"open($event)"
>
<i
class=
"glyphicon glyphicon-calendar"
></i>
<i
class=
"glyphicon glyphicon-calendar"
></i>
</button>
</button>
</span>
</span>
</p>
</p>
<!--<input ng-if="!form.fieldAddonLeft && !form.fieldAddonRight"-->
<!--ng-show="form.key"-->
<!--type="{{form.type}}"-->
<!--step="any"-->
<!--sf-changed="form"-->
<!--placeholder="{{form.placeholder}}"-->
<!--class="form-control {{form.fieldHtmlClass}}"-->
<!--id="{{form.key.slice(-1)[0]}}"-->
<!--ng-model-options="form.ngModelOptions"-->
<!--ng-model="$$value$$"-->
<!--ng-disabled="form.readonly"-->
<!--schema-validate="form"-->
<!--name="{{form.key.slice(-1)[0]}}"-->
<!--aria-describedby="{{form.key.slice(-1)[0] + 'Status'}}">-->
<div
ng-if=
"form.fieldAddonLeft || form.fieldAddonRight"
<div
ng-if=
"form.fieldAddonLeft || form.fieldAddonRight"
ng-class=
"{'input-group': (form.fieldAddonLeft || form.fieldAddonRight)}"
>
ng-class=
"{'input-group': (form.fieldAddonLeft || form.fieldAddonRight)}"
>
<span
ng-if=
"form.fieldAddonLeft"
<span
ng-if=
"form.fieldAddonLeft"
...
...
app/zetalib/forms/form_service.js
View file @
bf450bf8
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* (GPLv3). See LICENSE.txt for details.
* (GPLv3). See LICENSE.txt for details.
*/
*/
var
form_generator
=
angular
.
module
(
'formService'
,
[
'general'
,
'ui.bootstrap'
]);
var
form_generator
=
angular
.
module
(
'formService'
,
[
'general'
]);
form_generator
.
factory
(
'Generator'
,
function
(
$http
,
$q
,
$log
,
$modal
,
$timeout
,
RESTURL
,
FormDiff
)
{
form_generator
.
factory
(
'Generator'
,
function
(
$http
,
$q
,
$log
,
$modal
,
$timeout
,
RESTURL
,
FormDiff
)
{
var
generator
=
{};
var
generator
=
{};
...
@@ -31,16 +31,19 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout,
...
@@ -31,16 +31,19 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout,
// and give it 'type':'template' property and load it with template
// and give it 'type':'template' property and load it with template
if
(
k
.
type
==
'date'
)
{
if
(
k
.
type
==
'date'
)
{
k
.
title
=
k
.
title
;
scope
.
form
[
scope
.
form
.
indexOf
(
v
)]
=
{
scope
.
form
[
scope
.
form
.
indexOf
(
v
)]
=
{
"type"
:
"template"
,
"type"
:
"template"
,
"templateUrl"
:
"shared/templates/datefield.html"
,
"templateUrl"
:
"shared/templates/datefield.html"
,
"title"
:
k
.
title
,
"title"
:
k
.
title
,
"key"
:
k
.
name
"key"
:
k
.
name
};
};
//scope.model[k.name] = generator.dateformatter(scope.model[k.name]);
debugger
;
scope
.
model
[
k
.
name
]
=
generator
.
dateformatter
(
scope
.
model
[
k
.
name
]);
// seek for datepicker field and initialize datepicker
// seek for datepicker field and initialize datepicker
scope
.
$watch
(
angular
.
element
(
$
(
'.datepickerfield'
)),
function
(){
scope
.
$watch
(
angular
.
element
(
$
(
'.datepickerfield'
)),
function
(){
console
.
log
(
'date field initialized'
);
$
(
'.datepickerfield'
).
datepicker
();
$
(
'.datepickerfield'
).
datepicker
();
});
});
}
}
...
@@ -83,7 +86,12 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout,
...
@@ -83,7 +86,12 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout,
scope
.
form
.
splice
([
scope
.
form
.
indexOf
(
v
)],
1
);
scope
.
form
.
splice
([
scope
.
form
.
indexOf
(
v
)],
1
);
scope
.
listnodes
=
scope
.
listnodes
?
scope
.
listnodes
:
{};
scope
.
listnodes
=
scope
.
listnodes
?
scope
.
listnodes
:
{};
scope
.
listnodes
[
k
.
title
]
=
(
k
);
scope
.
listnodes
[
k
.
title
]
=
(
k
);
scope
.
model
[
k
.
title
]
=
[];
scope
.
listnodes
[
k
.
title
][
'fields'
]
=
scope
.
model
[
k
.
title
][
0
].
fields
;
scope
.
listnodes
[
k
.
title
][
'models'
]
=
scope
.
model
[
k
.
title
][
0
].
models
;
scope
.
listnodes
[
k
.
title
][
'lengthModels'
]
=
scope
.
listnodes
[
k
.
title
][
'models'
].
length
;
scope
.
listnodes
[
k
.
title
][
'lengthModels'
]
=
1
;
//scope.model[k.title] = [];
debugger
;
}
}
if
(
k
.
type
==
'Node'
)
{
if
(
k
.
type
==
'Node'
)
{
...
@@ -91,7 +99,7 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout,
...
@@ -91,7 +99,7 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout,
scope
.
nodes
=
scope
.
nodes
?
scope
.
nodes
:
{};
scope
.
nodes
=
scope
.
nodes
?
scope
.
nodes
:
{};
scope
.
nodes
[
k
.
title
]
=
(
k
);
scope
.
nodes
[
k
.
title
]
=
(
k
);
// todo: learn what node model will be?
// todo: learn what node model will be?
scope
.
model
[
k
.
title
]
=
[];
//
scope.model[k.title] = [];
}
}
});
});
...
@@ -165,7 +173,6 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout,
...
@@ -165,7 +173,6 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout,
"model"
:
$scope
.
form_params
.
model
,
"model"
:
$scope
.
form_params
.
model
,
"token"
:
$scope
.
token
"token"
:
$scope
.
token
};
};
debugger
;
if
(
$scope
.
object_id
)
{
if
(
$scope
.
object_id
)
{
var
get_diff
=
FormDiff
.
get_diff
(
$scope
.
model
,
$scope
.
initialModel
);
var
get_diff
=
FormDiff
.
get_diff
(
$scope
.
model
,
$scope
.
initialModel
);
var
data
=
{
var
data
=
{
...
...
app/zetalib/interceptors.js
View file @
bf450bf8
...
@@ -42,7 +42,7 @@ app.config(['$httpProvider', function ($httpProvider) {
...
@@ -42,7 +42,7 @@ app.config(['$httpProvider', function ($httpProvider) {
$location
.
reload
();
$location
.
reload
();
}
}
if
(
rejection
.
status
===
401
)
{
if
(
rejection
.
status
===
401
)
{
$rootScope
.
loggedInUser
=
response
.
data
.
is_login
;
$rootScope
.
loggedInUser
=
false
;
if
(
$location
.
path
()
===
"/login"
){
if
(
$location
.
path
()
===
"/login"
){
console
.
log
(
"show errors on login form"
);
console
.
log
(
"show errors on login form"
);
}
else
{
}
else
{
...
...
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