Skip to content

Commit

Permalink
introduce a icon letting you know querqy rule matched a query
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Pugh <[email protected]>
  • Loading branch information
epugh committed Sep 19, 2024
1 parent b0b6fe9 commit 513288e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
9 changes: 9 additions & 0 deletions app/assets/javascripts/controllers/searchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,14 @@ angular.module('QuepidApp')
return $scope.query.rating;
}
};

$scope.querqyRuleTriggered = function() {
var triggered = false;

if ($scope.query.searcher.parsedQueryDetails.querqy?.rewrite !== undefined){
triggered = true;
}
return triggered;
}
}
]);
4 changes: 2 additions & 2 deletions app/assets/stylesheets/animation.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ using ngAnimate and css from the https://animate.style project
*/

/* when hiding the picture */
.froggy.ng-hide-add { animation:2s flipOutX ease; }
.froggy-animation.ng-hide-add { animation:2s flipOutX ease; }

/* when showing the picture */
.froggy.ng-hide-remove { animation:2s flipInX ease; }
.froggy-animation.ng-hide-remove { animation:2s flipInX ease; }

/* ANIMATIONS (FROM ANIMATE.CSS) ======================== */

Expand Down
11 changes: 11 additions & 0 deletions app/assets/stylesheets/froggy.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,14 @@
width: 100%;
height: 100%;
}


.querqy-icon {
display: inline-block;
width: 24px; /* Adjust to match your image width */
height: 24px; /* Adjust to match your image height */
background-image: image-url('querqy-icon.png');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
6 changes: 5 additions & 1 deletion app/assets/templates/views/searchResults.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ <h2 class="results-title">

<span class="error-warning glyphicon glyphicon-warning-sign"></span>

<span ng-show="query.isNotAllRated()" class="froggy pull-right fa-lg" style="margin-right: 20px;" title="Hop to it! There are unrated results!">
<span ng-show="query.isNotAllRated()" class="froggy-animation pull-right" style="margin-right: 20px;" title="Hop to it! There are unrated results!">
<i class="fas fa-frog fa-stack-2x" data-count="{{ query.currentScore.countMissingRatings }}"></i>
</span>

<span ng-show="querqyRuleTriggered()" class="pull-right" style="margin-right: 20px;" title="Querqy Strikes Again!">
<i class="querqy-icon"></i>
</span>

<span class="toggleSign glyphicon {{query.isToggled() | plusOrMinus}}" ng-hide="isSortingEnabled()" ng-click="query.toggle()"></span>
</div>

Expand Down
Binary file added public/images/querqy-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 513288e

Please sign in to comment.