FIX: Text content search warning if more than 50 results

This commit is contained in:
venarius 2019-03-08 22:13:10 +01:00 committed by Robin Ward
parent da7406e567
commit dc4541a95c
4 changed files with 10 additions and 1 deletions

View File

@ -23,4 +23,8 @@
{{#each siteTexts as |siteText|}} {{#each siteTexts as |siteText|}}
{{site-text-summary siteText=siteText editAction=(action "edit") term=q searchRegex=siteTexts.extras.regex}} {{site-text-summary siteText=siteText editAction=(action "edit") term=q searchRegex=siteTexts.extras.regex}}
{{/each}} {{/each}}
{{#if siteTexts.extras.has_more}}
<p class="warning">{{i18n 'admin.site_text.more_than_50_results'}}</p>
{{/if}}
{{/conditional-loading-spinner}} {{/conditional-loading-spinner}}

View File

@ -260,6 +260,9 @@ $mobile-breakpoint: 700px;
margin-top: 1em; margin-top: 1em;
} }
} }
.warning {
color: #e45735;
}
} }
.content-list { .content-list {

View File

@ -43,7 +43,8 @@ class Admin::SiteTextsController < Admin::AdminController
end end
end end
render_serialized(results[0..50], SiteTextSerializer, root: 'site_texts', rest_serializer: true, extras: extras) extras[:has_more] = true if results.size > 50
render_serialized(results[0..49], SiteTextSerializer, root: 'site_texts', rest_serializer: true, extras: extras)
end end
def show def show

View File

@ -4034,6 +4034,7 @@ en:
go_back: "Back to Search" go_back: "Back to Search"
recommended: "We recommend customizing the following text to suit your needs:" recommended: "We recommend customizing the following text to suit your needs:"
show_overriden: "Only show overridden" show_overriden: "Only show overridden"
more_than_50_results: "There are more than 50 results. Please refine your search."
settings: # used by theme and site settings settings: # used by theme and site settings
show_overriden: "Only show overridden" show_overriden: "Only show overridden"