From 195a30c1a6faeb961e4905501003d213e79e8f07 Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Sat, 20 Mar 2021 19:10:38 +0100 Subject: [PATCH] refactoring live search to get cleaner css structure --- .../_h2_with_query_search.html.slim | 22 +++++------ assets/images/smileys/rose.png | Bin 1000 -> 0 bytes assets/stylesheets/additionals.css | 37 ++++++------------ config/locales/cs.yml | 1 + config/locales/de.yml | 1 + config/locales/en.yml | 1 + config/locales/es.yml | 1 + config/locales/fr.yml | 1 + config/locales/it.yml | 1 + config/locales/ja.yml | 1 + config/locales/ko.yml | 1 + config/locales/pl.yml | 1 + config/locales/pt-BR.yml | 1 + config/locales/ru.yml | 1 + config/locales/zh-TW.yml | 1 + config/locales/zh.yml | 1 + docs/manual.rst | 2 +- lib/additionals/formatter.rb | 1 - lib/additionals/helpers.rb | 6 +++ 19 files changed, 44 insertions(+), 37 deletions(-) delete mode 100644 assets/images/smileys/rose.png diff --git a/app/views/additionals/_h2_with_query_search.html.slim b/app/views/additionals/_h2_with_query_search.html.slim index d09b8ee3..e9d1b627 100644 --- a/app/views/additionals/_h2_with_query_search.html.slim +++ b/app/views/additionals/_h2_with_query_search.html.slim @@ -1,13 +1,13 @@ -- classes = 'title' unless defined? classes -h2 class="#{classes}" +- classes = 'live-search' +- if defined? css_class + - classes << " #{css_class}" +h2#page-title class="#{classes}" = @query.new_record? ? l(title) : h(@query.name) - span.additionals-live-search - = text_field_tag :search, - q, - autocomplete: 'off', - class: 'live-search-field', - placeholder: defined?(placeholder) ? placeholder : l(:label_query_name_search) + = text_field_tag :search, + q, + class: 'no-tooltip', + autocomplete: 'off', + title: defined?(title_info) ? title_info : nil - javascript: - observeLiveSearchField('search', - 'query-result-list') + javascript: + observeLiveSearchField('search', 'query-result-list'); diff --git a/assets/images/smileys/rose.png b/assets/images/smileys/rose.png deleted file mode 100644 index 66ea939be2f980a15e7d289181015395297c4f85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1000 zcmV>P)Gh_5wtDA=5sTdoxO994^jvwJ59s~|Bv_F^Z(uR z!3F+r>IM$|XJ#J(Pj&-4mzh7`1#lPe;CO{Y#Y4?59%f6>X(4xKRr|& zfSDa>+u*6GigzfRg#knk2v>{80t}G?5zLJn74OJw7DOa=F|Qw>fSaZH`8u_*04}bm z9+XNUn45zHuE%&(7BPSG=hdrELvZZ$MuYIM{v(bttcL>wSsK60_ACkS&n zsFoIx=K)a!a$Ts_RxDLl7=OZj%W3j1l%C?tiJ3;c0lO#2JK&A8l(fJ1M1yQJlQ z0D_2g`90y=$F=L<+T2uckB|Nlo_y0!tmSbPXTXdpMwEHr{vCJaa+?k#smEa0wrmA3 z?6sK30!|$DhfGvH{o{o%0^2RAY%W_TRqWEOsyoi$^^U5?6>ubC-cEqJFTWX=hQ^@+ zFU3{5-Lev|F|#h0if!+_<)2$~1-EsoWAXFj9gB~o$xko?ZlVTYhDc+g;oj|sckXyK z18{~JtNtf<1l(3f2Mho>b_SO1pkdR4_oO$t;`~>q1Fe@%o;d0ct(I4@saslGZO>@%*-JR@(O{7#kP}V*&Ym-VTAZEJaD9 zA`ga=0DFRjLnJgfp}?fSJh$~3W)T?XK!7%~Di__7^qcefq7BRs4-bbcT2v?$gfR&R zQaT3gu|X07X^_Y;p%(C_ul;%nU~ks2tYbngNMs<8W`m>wdyvvGCgBtc1pxqZIbd>f zlI!bhIbxQQBtbC45HmOupc2X8I_S5DulWFBl;MT1XBdWgyFCKb1=9{{DWm+~+Tj W#E){3Ktf^w0000:), B), (!), (?), (v), (x), (/) and @}->- + You can use the following manual smiley codes: :), =), :D, =D, :'(, :(, ;), :P, :O, :/, :S, :|, :X, :*, O:), >:), B), (!), (?), (v), (x) and (/) diff --git a/lib/additionals/formatter.rb b/lib/additionals/formatter.rb index 0bf67277..793045d4 100644 --- a/lib/additionals/formatter.rb +++ b/lib/additionals/formatter.rb @@ -18,7 +18,6 @@ module Additionals 'angel' => '[Oo][=:]-?\)', # O:) 'evil' => '>[=:;]-?[)(]', # >:) 'rock' => 'B-?\)', # B) - 'rose' => '@[)\}][-\\/\',;()>\}]*', # @}->- 'exclamation' => '[\[(]![\])]', # (!) 'question' => '[\[(]\?[\])]', # (?) 'check' => '[\[(]\\/[\])]', # (/) diff --git a/lib/additionals/helpers.rb b/lib/additionals/helpers.rb index 5328e9a5..a8048b01 100644 --- a/lib/additionals/helpers.rb +++ b/lib/additionals/helpers.rb @@ -1,5 +1,11 @@ module Additionals module Helpers + def live_search_title_info(entity) + fields = "LiveSearch::#{entity.to_s.classify}".constantize.info_fields + all_fields = fields.map { |f| "#{f}:term" }.join ', ' + l :label_live_search_hints, value: all_fields + end + def link_to_external(name, link, options = {}) options[:class] ||= 'external' options[:class] << ' external' if options[:class].exclude? 'external'