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
287e49d0
Commit
287e49d0
authored
Apr 15, 2016
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rfix #5255
fixes GH-97
parent
3e23b0d1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
crud_controller.js
app/components/crud/crud_controller.js
+16
-9
show.html
app/components/crud/templates/show.html
+1
-1
No files found.
app/components/crud/crud_controller.js
View file @
287e49d0
...
...
@@ -41,7 +41,8 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
* @memberof ulakbus.crud
* @ngdoc function
* @name generateParam
* @description generateParam is a function to generate required params to post backend api.
* @description generateParam is a function to generate required params to send backend api.
* backend needs that params to work without errors
* @param {object} scope
* @param {object} routeParams
* @param {string} cmd
...
...
@@ -92,6 +93,8 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
angular
.
forEach
(
pageData
,
function
(
value
,
key
)
{
scope
[
key
]
=
value
;
});
// when selective_list is sent with meta key it means
// "objects" is a list of "objects"s
if
(
scope
.
meta
[
'selective_listing'
]
===
true
)
{
angular
.
forEach
(
scope
.
objects
,
function
(
_v
,
_k
)
{
angular
.
forEach
(
_v
.
objects
,
function
(
value
,
key
)
{
...
...
@@ -169,6 +172,7 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
if
(
$location
.
url
().
indexOf
(
'?='
)
>
0
)
{
return
$location
.
url
(
$location
.
url
().
replace
(
'?='
,
''
));
}
// before calling get_wf parameters need to be generated with CrudUtility.generateParam
CrudUtility
.
generateParam
(
$scope
,
$routeParams
);
Generator
.
get_wf
(
$scope
);
})
...
...
@@ -200,14 +204,18 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
},
500
);
});
// todo: new feature wf_step is for to start a workflow from a certain step
$scope
.
wf_step
=
$routeParams
.
step
;
// pagination data is coming from api when too much results
$scope
.
paginate
=
function
(
reloadData
)
{
$scope
.
form_params
.
cmd
=
$scope
.
reload_cmd
;
$scope
.
form_params
=
angular
.
extend
(
$scope
.
form_params
,
reloadData
);
$log
.
debug
(
'reload data'
,
$scope
);
Generator
.
get_wf
(
$scope
);
};
// reload_cmd can be broadcasted app-wide, when $on it reloadCmd is called
$scope
.
$on
(
'reload_cmd'
,
function
(
event
,
data
){
$scope
.
reload_cmd
=
data
;
$scope
.
reloadCmd
();
...
...
@@ -241,7 +249,6 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
};
$scope
.
do_action
=
function
(
key
,
todo
)
{
//Generator.doItemAction($scope, key, todo.cmd, todo.wf, todo.mode || 'normal');
Generator
.
doItemAction
(
$scope
,
key
,
todo
,
todo
.
mode
||
'normal'
);
};
...
...
@@ -249,11 +256,11 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
return
new
Array
(
num
);
};
// trust as html for using markdown support
$scope
.
trustAsHtml
=
function
(
value
)
{
return
$sce
.
trustAsHtml
(
value
);
}
$scope
.
markdownWorkaround
=
function
(
value
)
{
// this is new line workaround for markdown support
// kind of ugly hack
return
value
.
replace
(
'
\
n'
,
'<br>'
);
}
;
// inline edit fields
$scope
.
datepickerstatuses
=
{};
...
...
app/components/crud/templates/show.html
View file @
287e49d0
...
...
@@ -20,7 +20,7 @@
<tr
ng-repeat=
"(key, value) in obj.fields"
>
<td
class=
"col-md-2"
>
{{key}}
</td>
<!--<td class="col-md-8"><markdown ng-bind-html="value"></markdown></td>-->
<td
class=
"col-md-8"
ng-bind-html=
"
value
| markdown"
></td>
<td
class=
"col-md-8"
ng-bind-html=
"
markdownWorkaround(value)
| markdown"
></td>
</tr>
</tbody>
</table>
...
...
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