Skip to content

Commit

Permalink
Post fix for UI disabling
Browse files Browse the repository at this point in the history
* Got in too much of rush towards the end and boofed this. ;)

Post OpenUserJS#2048
  • Loading branch information
Martii committed Feb 24, 2025
1 parent 32d45a4 commit 56fe00b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libs/modelQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,11 @@ exports.applyModelListQueryFlaggedFilter = applyModelListQueryFlaggedFilter;
var applyModelListQueryDefaults = function (aModelListQuery, aOptions, aReq, aDefaultOptions) {
var orders = null;
var authedUser = aReq.session.user;
var authRequired = 'Sign In to ';
aOptions.authRequired = 'Sign In to ';

// Search
if (authedUser || !aOptions.authToSearch) {
authRequired = '';
aOptions.authRequired = '';
aOptions.authToSearch = false;

if (aReq.query.q) {
Expand All @@ -279,7 +279,7 @@ var applyModelListQueryDefaults = function (aModelListQuery, aOptions, aReq, aDe
aOptions.authToSearch = false;
}
aOptions.searchBarFormAction = aDefaultOptions.searchBarFormAction || '';
aOptions.searchBarPlaceholder = authRequired
aOptions.searchBarPlaceholder = aOptions.authRequired
+ aDefaultOptions.searchBarPlaceholder || 'Search';
aOptions.searchBarFormHiddenVariables = aDefaultOptions.searchBarFormHiddenVariables || [];

Expand Down
6 changes: 3 additions & 3 deletions views/includes/searchBar.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<form action="{{{searchBarFormAction}}}" method="get">
{{#searchBarFormHiddenVariables}}
<input type="hidden" name="{{name}}" value="{{value}}"{{#authToSearch}} readonly="readonly"{{/authToSearch}}>
<input type="hidden" name="{{name}}" value="{{value}}"{{#authRequired}} readonly="readonly"{{/authRequired}}>
{{/searchBarFormHiddenVariables}}
<div class="input-group col-xs-12">
<div class="form-group has-feedback has-clear">
<input name="q" type="text" placeholder="{{searchBarPlaceholder}}" class="search form-control" value="{{searchBarValue}}" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off"{{#authToSearch}} readonly="readonly"{{/authToSearch}} />
<input name="q" type="text" placeholder="{{searchBarPlaceholder}}" class="search form-control" value="{{searchBarValue}}" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off"{{#authRequired}} readonly="readonly"{{/authRequired}} />
<span class="form-control-feedback form-control-clear fa fa-times hidden"></span>
</div>
<span class="input-group-btn">
<button class="btn btn-default" type="submit"{{#authToSearch}} disabled="disabled"{{/authToSearch}}>
<button class="btn btn-default" type="submit"{{#authRequired}} disabled="disabled"{{/authRequired}}>
<i class="fa fa-search"></i>
</button>
</span>
Expand Down

0 comments on commit 56fe00b

Please sign in to comment.