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
0324659d
Commit
0324659d
authored
Apr 07, 2016
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADD button styling and confirm field type
parent
a078fb71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
confirm.html
app/shared/templates/confirm.html
+19
-0
form_service.js
app/zetalib/form_service.js
+23
-1
No files found.
app/shared/templates/confirm.html
0 → 100644
View file @
0324659d
<div
class=
"form-group schema-form-submit {{form.htmlClass}}"
>
<button
class=
"btn {{ form.style || 'btn-default' }}"
type=
"button"
ng-disabled=
"form.readonly"
uib-popover-template=
"'confirmPopoverTemplate.html'"
popover-title=
"{{form.title}}"
popover-placement=
"bottom"
popover-trigger=
"outsideClick"
>
<span
ng-if=
"form.icon"
class=
"{{form.icon}}"
></span>
{{form.title}}
</button>
<script
type=
"text/ng-template"
id=
"confirmPopoverTemplate.html"
>
<
div
>
{{
form
.
title
}}
<
/div
>
<
div
class
=
"form-group"
>
<
p
>
{{
form
.
confirm_message
}}
<
/p
>
<
button
class
=
"btn btn-default"
ng
-
click
=
"form.confirm()"
><
/button
>
<
/div
>
</script>
</div>
\ No newline at end of file
app/zetalib/form_service.js
View file @
0324659d
...
...
@@ -229,10 +229,14 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
var
buttonClass
=
(
buttonPositions
[
v
.
position
]
||
buttonPositions
.
bottom
);
var
redirectTo
=
scope
.
modalElements
?
false
:
true
;
// in case backend needs styling the buttons
// it needs to send style key with options below
// btn-default btn-primary btn-success btn-info btn warning
// btn-danger is default
scope
.
form
[
scope
.
form
.
indexOf
(
k
)]
=
{
type
:
v
.
type
,
title
:
v
.
title
,
style
:
"btn-danger
hide "
+
buttonClass
,
style
:
(
v
.
style
||
"btn-danger"
)
+
"
hide "
+
buttonClass
,
onClick
:
function
()
{
delete
scope
.
form_params
.
cmd
;
delete
scope
.
form_params
.
flow
;
...
...
@@ -508,6 +512,24 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
};
}
},
confirm
:
{
default
:
function
(
scope
,
v
,
k
)
{
scope
.
form
[
scope
.
form
.
indexOf
(
k
)]
=
{
type
:
"template"
,
title
:
v
.
title
,
confirm_message
:
v
.
confirm_message
,
templateUrl
:
"shared/templates/confirm.html"
,
name
:
k
,
key
:
k
,
cmd
:
v
.
cmd
,
confirm
:
function
()
{
console
.
log
(
v
.
cmd
);
// send cmd with submit
}
};
}
},
date
:
{
default
:
function
(
scope
,
v
,
k
)
{
$log
.
debug
(
'date:'
,
scope
.
model
[
k
]);
...
...
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