Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
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
dataplatform
atlas
Commits
f7ce5a27
Commit
f7ce5a27
authored
9 years ago
by
dileep bhimineni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for nested looping
parent
fbb7582c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
26 deletions
+41
-26
header.html
dashboard/v2/public/modules/home/views/header.html
+1
-1
navigation.html
dashboard/v2/public/modules/navigation/views/navigation.html
+1
-1
searchController.js
dashboard/v2/public/modules/search/searchController.js
+4
-13
searchRoutes.js
dashboard/v2/public/modules/search/searchRoutes.js
+3
-7
search.html
dashboard/v2/public/modules/search/views/search.html
+32
-4
No files found.
dashboard/v2/public/modules/home/views/header.html
View file @
f7ce5a27
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
</button>
<a
data-ui-sref=
"search"
data-ui-sref-active=
"active"
><h1>
DGI
</h1></a>
<a
data-ui-sref=
"search
({ query: '' })
"
data-ui-sref-active=
"active"
><h1>
DGI
</h1></a>
</div>
</div>
<nav
class=
"collapse navbar-collapse"
data-collapse=
"isCollapsed"
data-role=
"navigation"
>
<nav
class=
"collapse navbar-collapse"
data-collapse=
"isCollapsed"
data-role=
"navigation"
>
<ul
class=
"navbar-nav nav"
data-ng-if=
"isLoggedIn()"
>
<ul
class=
"navbar-nav nav"
data-ng-if=
"isLoggedIn()"
>
...
...
This diff is collapsed.
Click to expand it.
dashboard/v2/public/modules/navigation/views/navigation.html
View file @
f7ce5a27
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<div
class=
"col-lg-3"
>
<div
class=
"col-lg-3"
>
<h4>
Tags
</h4>
<h4>
Tags
</h4>
<div
class=
"list-group"
>
<div
class=
"list-group"
>
<a
ng-repeat=
"nav in leftnav"
ui-sref=
"search
.results
({ query: nav })"
class=
"list-group-item"
>
{{nav}}
</a>
<a
ng-repeat=
"nav in leftnav"
ui-sref=
"search({ query: nav })"
class=
"list-group-item"
>
{{nav}}
</a>
</div>
</div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
dashboard/v2/public/modules/search/searchController.js
View file @
f7ce5a27
...
@@ -27,7 +27,6 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
...
@@ -27,7 +27,6 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope
.
isCollapsed
=
true
;
$scope
.
isCollapsed
=
true
;
$scope
.
currentPage
=
1
;
$scope
.
currentPage
=
1
;
$scope
.
itemsPerPage
=
10
;
$scope
.
itemsPerPage
=
10
;
$scope
.
totalItems
=
40
;
$scope
.
filteredResults
=
[];
$scope
.
filteredResults
=
[];
$scope
.
resultRows
=
[];
$scope
.
resultRows
=
[];
...
@@ -36,11 +35,6 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
...
@@ -36,11 +35,6 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope
.
loading
=
true
;
$scope
.
loading
=
true
;
}
}
});
});
$scope
.
$on
(
'$stateChangeSuccess'
,
function
(
event
,
toState
)
{
if
(
toState
.
resolve
)
{
$scope
.
loading
=
false
;
}
});
$scope
.
setPage
=
function
(
pageNo
)
{
$scope
.
setPage
=
function
(
pageNo
)
{
$scope
.
currentPage
=
pageNo
;
$scope
.
currentPage
=
pageNo
;
};
};
...
@@ -49,10 +43,12 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
...
@@ -49,10 +43,12 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
NotificationService
.
reset
();
NotificationService
.
reset
();
$scope
.
limit
=
4
;
$scope
.
limit
=
4
;
$scope
.
searchMessage
=
'searching...'
;
$scope
.
searchMessage
=
'searching...'
;
$scope
.
$parent
.
query
=
query
;
$scope
.
$parent
.
query
=
query
;
SearchResource
.
search
({
SearchResource
.
search
({
query
:
query
query
:
query
},
function
searchSuccess
(
response
)
{
},
function
searchSuccess
(
response
)
{
$scope
.
querySuceess
=
true
;
$scope
.
resultCount
=
response
.
count
;
$scope
.
resultCount
=
response
.
count
;
$scope
.
results
=
response
.
results
;
$scope
.
results
=
response
.
results
;
$scope
.
resultRows
=
$scope
.
results
.
rows
;
$scope
.
resultRows
=
$scope
.
results
.
rows
;
...
@@ -78,15 +74,10 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
...
@@ -78,15 +74,10 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope
.
searchMessage
=
'0 results matching your search query '
+
$scope
.
query
+
' were found'
;
$scope
.
searchMessage
=
'0 results matching your search query '
+
$scope
.
query
+
' were found'
;
}
}
});
});
$state
.
go
(
'search.results'
,
{
query
:
query
},
{
location
:
'replace'
});
},
function
searchError
(
err
)
{
},
function
searchError
(
err
)
{
NotificationService
.
error
(
'Error occurred during executing search query, error status code = '
+
err
.
status
+
', status text = '
+
err
.
statusText
,
false
);
NotificationService
.
error
(
'Error occurred during executing search query, error status code = '
+
err
.
status
+
', status text = '
+
err
.
statusText
,
false
);
});
});
};
};
$scope
.
typeAvailable
=
function
()
{
$scope
.
typeAvailable
=
function
()
{
...
@@ -115,6 +106,6 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
...
@@ -115,6 +106,6 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope
.
query
=
(
$location
.
search
()).
query
;
$scope
.
query
=
(
$location
.
search
()).
query
;
if
(
$scope
.
query
)
{
if
(
$scope
.
query
)
{
$scope
.
search
(
$scope
.
query
);
$scope
.
search
(
$scope
.
query
);
}
}
}
}
]);
]);
This diff is collapsed.
Click to expand it.
dashboard/v2/public/modules/search/searchRoutes.js
View file @
f7ce5a27
...
@@ -23,13 +23,9 @@ angular.module('dgc.search').config(['$stateProvider',
...
@@ -23,13 +23,9 @@ angular.module('dgc.search').config(['$stateProvider',
function
(
$stateProvider
)
{
function
(
$stateProvider
)
{
// states for my app
// states for my app
$stateProvider
.
state
(
'search'
,
{
$stateProvider
.
state
(
'search'
,
{
url
:
'/search'
,
url
:
'/search
?query
'
,
templateUrl
:
'/modules/search/views/search.html'
,
templateUrl
:
'/modules/search/views/search.html'
,
controller
:
'SearchController'
controller
:
'SearchController'
,
}).
state
(
'search.results'
,
{
})
url
:
'?query'
,
templateUrl
:
'/modules/search/views/searchResult.html'
,
controller
:
'SearchController'
});
}
}
]);
]);
This diff is collapsed.
Click to expand it.
dashboard/v2/public/modules/search/views/search.html
View file @
f7ce5a27
...
@@ -16,14 +16,14 @@
...
@@ -16,14 +16,14 @@
~ limitations under the License.
~ limitations under the License.
-->
-->
<div
data-ng-controller=
"SearchController"
>
<div>
<div
class=
"search"
>
<div
class=
"search"
>
<form
name=
"form"
novalidate
class=
"container"
>
<form
name=
"form"
novalidate
class=
"container"
>
<div
class=
"col-lg-7 col-lg-offset-3"
>
<div
class=
"col-lg-7 col-lg-offset-3"
>
<div
class=
"row input-group"
>
<div
class=
"row input-group"
>
<input
type=
"text"
class=
"form-control"
placeholder=
"Search"
data-ng-model=
"query"
required
/>
<input
type=
"text"
class=
"form-control"
placeholder=
"Search"
data-ng-model=
"query"
required
/>
<span
class=
"input-group-btn"
>
<span
class=
"input-group-btn"
>
<button
class=
"btn btn-success"
type=
"submit"
data-ng-disabled=
"form.$invalid"
ui-sref=
"search
.results
({ query: query })"
>
<button
class=
"btn btn-success"
type=
"submit"
data-ng-disabled=
"form.$invalid"
ui-sref=
"search({ query: query })"
>
<i
class=
"glyphicon glyphicon-search white "
></i>
<i
class=
"glyphicon glyphicon-search white "
></i>
</button>
</button>
</span>
</span>
...
@@ -37,9 +37,36 @@
...
@@ -37,9 +37,36 @@
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
data-ng-include=
"'/modules/navigation/views/navigation.html'"
></div>
<div
data-ng-include=
"'/modules/navigation/views/navigation.html'"
></div>
<div
class=
"col-lg-9"
data-ui-view=
""
></div>
<div
class=
"col-lg-9"
>
<h4
ng-show=
"searchMessage"
>
{{searchMessage}}
</h4>
<ul
class=
"list-unstyled"
>
<li
ng-repeat=
"result in filteredResults"
class=
"searchresults"
>
<h4><a
data-ui-sref=
"details({id:result['$id$'].id})"
>
{{result.name}}
</a></h4>
<p>
{{result.description}}
</p>
<span
ng-repeat=
"(key, value) in filterSearchResults(result)"
>
<span
ng-show=
"$index < 4"
><b>
{{key}}:
</b>
{{value}}{{$index+1 === limit ? '' : ', '}}
</span>
</span>
<div
collapse=
"isCollapsed"
>
<span
ng-repeat=
"(key, value) in filterSearchResults(result)"
>
<span
ng-show=
"$index > 4"
><b>
{{key}}:
</b>
{{value}}{{$last ? '' : ', '}}
</span>
</span>
</div>
<a
href
ng-show=
"isCollapsed && (keyLength > 4)"
ng-click=
"doToggle($event,isCollapsed)"
>
..show more
</a>
<a
href
ng-show=
"!isCollapsed"
ng-click=
"doToggle($event,isCollapsed)"
>
..show less
</a>
<h5>
Tags :
<a
ng-repeat=
"(key, value) in result['$traits$']"
data-ui-sref=
"search.results({query: key})"
>
{{key}}
</a>
</h5>
<div
data-ng-if=
"!searchTypesAvailable"
data-ng-include=
"'/modules/search/views/types/guid.html'"
></div>
</li>
</ul>
<div
class=
"resultsPagination"
ng-show=
'filteredResults.length > 0'
>
<pagination
total-items=
"totalItems"
items-per-page=
"itemsPerPage"
ng-model=
"currentPage"
ng-change=
"pageChanged()"
></pagination>
<p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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