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 2 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
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:lastQuery}) + '</h2>');
Copy link
Member

Choose a reason for hiding this comment

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

@jancborchardt since you're using append here, we can use directly into the string.
$status.append('<h2>' + t('core', 'No search results in other folders for <strong>{filter}</strong>', {filter:lastQuery}) + '</h2>');

Copy link
Member Author

Choose a reason for hiding this comment

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

Won’t that be a problem with translators again because they often mess up the tags? I thought that was a problem cc @LukasReschke

Copy link
Member

@LukasReschke LukasReschke Oct 6, 2016

Choose a reason for hiding this comment

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

<fett>{filter}</fett>

🙈

Copy link
Member

Choose a reason for hiding this comment

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

Oh yes it will indeed!
We should proceed th same way as ChristophWurst.

Copy link
Member

Choose a reason for hiding this comment

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

@jancborchardt
var error = t('core', 'No search results in other folders {tag}{filter}{endtag}', {filter:lastQuery}).replace('{tag}', '<strong>').replace('{endtag}', '</strong>'); $status.append('<h2>' + error + '</h2>');

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 can you add that as a commit directly on this branch? You are a Nextcloud member so you should be able to do that ;)

} 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