Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce a icon letting you know querqy rule matched a query #1053

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/assets/javascripts/controllers/searchResults.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';

angular.module('QuepidApp')
.controller('SearchResultsCtrl', [
'$rootScope',
Expand Down Expand Up @@ -137,5 +136,14 @@ angular.module('QuepidApp')
return $scope.query.rating;
}
};

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

if ($scope.query.searcher.parsedQueryDetails.querqy?.rewrite !== undefined) { // jshint ignore:line
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.