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

search design details #1606

Merged
merged 3 commits into from
Oct 18, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2427,7 +2427,7 @@
$('#searchresults .emptycontent').addClass('emptycontent-search');
if ( $('#searchresults').length === 0 || $('#searchresults').hasClass('hidden') ) {
this.$el.find('.nofilterresults').removeClass('hidden').
find('p').text(t('files', "No entries in this folder match '{filter}'", {filter:this._filter}, null, {'escape': false}));
find('h2').text(t('files', "No results in this folder for {filter}", {filter:this._filter}, null, {'escape': false}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, you can use html instead of text if you want to add <strong>

Copy link
Member

@skjnldsv skjnldsv Oct 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find('p').html(t('files', "No entries in this folder match '{tag}{filter}{endtag}'", {filter:this._filter}, null, {'escape': false}).replace('{tag}', '<strong>').replace('{endtag}', '</strong>'));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean {tag} and {endtag}?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skjnldsv I meant if the solution you suggested works, you are welcome to add a commit :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it works, I used the same as here nextcloud/mail#57 (review)

But I can't tell you if this will cause issue with the translators or not. I don't really knows how they work :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skjnldsv then go ahead and add a commit in this branch, you should be able to since you are in the Nextcloud organization ;) You know Javascript better than me. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will commit. But we need to be sure the issue you raised with the translators is fine! :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skjnldsv Looks good 👍

}
} else {
$('#searchresults').removeClass('filter-empty');
Expand Down
4 changes: 2 additions & 2 deletions apps/files/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
show size and last modified date on the right */
this.updateLegacyMimetype(result);

var $pathDiv = $('<div class="path"></div>').text(result.path);
var $pathDiv = $('<div class="path"></div>').text(result.path.substr(1));
$row.find('td.info div.name').after($pathDiv).text(result.name);

$row.find('td.result a').attr('href', result.link);
Expand All @@ -80,7 +80,7 @@
show size and last modified date on the right */
this.updateLegacyMimetype(result);

var $pathDiv = $('<div class="path"></div>').text(result.path);
var $pathDiv = $('<div class="path"></div>').text(result.path.substr(1));
$row.find('td.info div.name').after($pathDiv).text(result.name);

$row.find('td.result a').attr('href', result.link);
Expand Down
1 change: 0 additions & 1 deletion apps/files_sharing/templates/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<div class="nofilterresults hidden">
<div class="icon-search"></div>
<h2><?php p($l->t('No entries found in this folder')); ?></h2>
<p></p>
</div>

<table id="filestable">
Expand Down
2 changes: 1 addition & 1 deletion core/search/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
$status.addClass('emptycontent').removeClass('status');
$status.html('');
$status.append('<div class="icon-search"></div>');
$status.append('<h2>' + t('core', 'No search results in other folders') + '</h2>');
$status.append('<h2>' + t('core', 'No search results in other folders {filter}', {filter:this._filter}) + '</h2>');
Copy link
Member

@eppfel eppfel Oct 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not substituted and will be shown as {filter} on my end.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bildschirmfoto 2016-10-01 um 18 46 45

Copy link
Contributor

@te-online te-online Oct 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it supposed to be ('... folders %s', this._filter) – or something like this?
Edit: this is for php, I guess.

Copy link
Contributor

@te-online te-online Oct 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I see, you might just need the last two parameters, maybe?
..., {filter:this._filter}, null, {'escape': false}) as in filelist.js

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @nextcloud/javascript can you help in this regard?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jancborchardt is this supposed to display the searched string?

Copy link
Member

@skjnldsv skjnldsv Oct 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this._filter is undefined for me. I think we should pass the query in the function arguments if that's what you were planning! :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is undefined, will fix

} else {
$status.removeClass('emptycontent').addClass('status');
$status.text(n('core', '{count} search result in another folder', '{count} search results in other folders', count, {count:count}));
Expand Down