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
333a141e
Commit
333a141e
authored
9 years ago
by
dileep bhimineni
Committed by
Vishal Kadam
9 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for search results and paginations
parent
a10b34d1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
10 deletions
+27
-10
common.css
dashboard/v2/public/css/common.css
+5
-0
searchController.js
dashboard/v2/public/modules/search/searchController.js
+14
-6
search.html
dashboard/v2/public/modules/search/views/search.html
+1
-1
searchResult.html
dashboard/v2/public/modules/search/views/searchResult.html
+7
-3
No files found.
dashboard/v2/public/css/common.css
View file @
333a141e
...
...
@@ -120,3 +120,7 @@ footer.navbar-bottom img {
min-height
:
0
;
padding
:
5px
5px
5px
0
;
}
.pagination
{
float
:
right
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboard/v2/public/modules/search/searchController.js
View file @
333a141e
...
...
@@ -25,6 +25,16 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope
.
results
=
[];
$scope
.
resultCount
=
0
;
$scope
.
isCollapsed
=
true
;
$scope
.
currentPage
=
1
;
$scope
.
numPerPage
=
10
;
$scope
.
itemsPerPage
=
2
;
$scope
.
maxSize
=
5
;
$scope
.
$watch
(
"currentPage + numPerPage"
,
function
()
{
var
begin
=
((
$scope
.
currentPage
-
1
)
*
$scope
.
numPerPage
);
var
end
=
begin
+
$scope
.
numPerPage
;
$scope
.
filteredResults
=
$scope
.
results
.
slice
(
begin
,
end
);
});
$scope
.
search
=
function
(
query
)
{
$scope
.
results
=
[];
NotificationService
.
reset
();
...
...
@@ -47,12 +57,10 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
return
$scope
.
types
.
indexOf
(
this
.
results
.
dataType
.
typeName
&&
this
.
results
.
dataType
.
typeName
.
toLowerCase
())
>
-
1
;
};
/* $scope.$watch("currentPage + numPerPage", function() {
var begin = (($scope.currentPage - 1) * $scope.numPerPage);
var end = begin + $scope.numPerPage;
$scope.filteredResults = $scope.rows.slice(begin, end);
});*/
$scope
.
doToggle
=
function
(
$event
,
el
)
{
this
.
isCollapsed
=
!
el
;
var
currElem
=
$event
.
currentTarget
;
};
$scope
.
filterSearchResults
=
function
(
items
)
{
var
res
=
{};
angular
.
forEach
(
items
,
function
(
value
,
key
)
{
...
...
This diff is collapsed.
Click to expand it.
dashboard/v2/public/modules/search/views/search.html
View file @
333a141e
...
...
@@ -21,7 +21,7 @@
<form
name=
"form"
novalidate
class=
"container"
>
<div
class=
"col-lg-7 col-lg-offset-3"
>
<div
class=
"row input-group"
>
<input
type=
"text"
class=
"form-control"
placeholder=
"Search"
data-ng-model=
"query"
data-typeahead=
"type for type in types"
required
/>
<input
type=
"text"
class=
"form-control"
placeholder=
"Search"
data-ng-model=
"query"
required
/>
<span
class=
"input-group-btn"
>
<button
class=
"btn btn-success"
type=
"submit"
data-ng-disabled=
"form.$invalid"
data-ng-click=
"search(query)"
>
<i
class=
"glyphicon glyphicon-search white "
></i>
...
...
This diff is collapsed.
Click to expand it.
dashboard/v2/public/modules/search/views/searchResult.html
View file @
333a141e
...
...
@@ -16,7 +16,9 @@
~ limitations under the License.
-->
<h4>
{{resultCount}} results matching your search query "{{query}}" were found
</h4>
<h4
ng-show=
'resultCount > 0'
>
{{resultCount}} results matching your search query "{{query}}" were found
</h4>
<h4
ng-show=
'resultCount == "0"'
>
searching .....
</h4>
<ul
class=
"list-unstyled"
>
<li
ng-repeat=
"result in results.rows"
class=
"searchresults"
>
<div
data-ng-if=
"typeAvailable()"
>
...
...
@@ -30,8 +32,8 @@
<span
ng-show=
"$index > 4"
><b>
{{key}}:
</b>
{{value}}{{$last ? '' : ', '}}
</span>
</span></span>
</div>
<a
href=
"javascript: void(0);"
class=
"show-more"
ng-click=
"isCollapsed = !isCollapsed
"
>
..show more
</a>
<!-- <a href="javascript: void(0);" bn-slide-show class="show-more" ng-click="doToggle(!isCollapsed)">..show more</a>--
>
<a
href=
"javascript: void(0);"
ng-show=
"isCollapsed"
ng-click=
"doToggle($event,isCollapsed)
"
>
..show more
</a>
<a
href=
"javascript: void(0);"
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>
...
...
@@ -40,3 +42,5 @@
<div
data-ng-if=
"!typeAvailable()"
data-ng-include=
"'/modules/search/views/types/guid.html'"
></div>
</li>
</ul>
<div
ng-show=
'resultCount > 0'
><pagination
total-items=
"totalItems"
ng-model=
"currentPage"
ng-change=
"pageChanged()"
></pagination></div>
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