refactoring live search to get cleaner css structure

This commit is contained in:
Alexander Meindl 2021-03-20 19:10:38 +01:00
parent e5f95d5fc0
commit 195a30c1a6
19 changed files with 44 additions and 37 deletions

View File

@ -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');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1000 B

View File

@ -16,10 +16,6 @@
padding-bottom: 10px;
}
span.additionals-live-search input::placeholder {
font-size: 90%;
}
.query-description,
.dashboard-description {
color: #666;
@ -143,12 +139,6 @@ span.additionals-live-search input::placeholder {
background-image: url(../images/smileys/smiley-cool.png);
}
.smiley-rose {
background-image: url(../images/smileys/rose.png);
width: 24px;
height: 24px;
}
.smiley-check {
background-image: url(../images/smileys/check.png);
}
@ -191,26 +181,25 @@ div.clear-both { clear: both; }
img.additionals-avatar { margin-right: 0.25em; }
/* Live search */
.additionals-live-search input.live-search-field {
h2#page-title input {
font-size: 16px;
width: 65%;
}
.additionals-live-search {
h2#page-title::before {
font-family: Font Awesome\ 5 Free;
padding-right: 5px;
text-shadow: 0 2px 0 #efefef;
font-size: 90%;
}
/* Live search */
h2#page-title.live-search input {
margin-left: 5px;
}
.ui-tooltip {
color: #fff;
background: #000;
opacity: 0.85;
padding: 8px;
border: 0;
max-width: inherit;
border-radius: 4px;
box-shadow: 0 0 6px #888;
font-size: 12px;
h2#page-title.import::before {
font-weight: 900;
content: "\f093"; /* fas fa-upload */
}
a.external.redmine-link {

View File

@ -183,3 +183,4 @@ cs:
wiki_pdf_remove_attachments_info: "Pokud je aktivní, připojené soubory Wiki se nebudou zobrazovat v zobrazení PDF."
wiki_pdf_remove_title_info: "Pokud je aktivní, informace o názvu Wiki se nebudou zobrazovat v zobrazení PDF."
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@ de:
wiki_pdf_remove_attachments_info: Wenn aktiv, werden die an der Wiki Seite angehängten Dateien nicht in der PDF Ansicht angezeigt.
wiki_pdf_remove_title_info: Wenn aktiv, wird der Wiki Titel nicht in der PDF Ansicht angezeigt.
button_merge: Zusammenführen
label_live_search_hints: "Verfügbare Feldsuche: %{value}"

View File

@ -183,3 +183,4 @@ en:
wiki_pdf_remove_attachments_info: "When active the attached Wiki files will not be displayed in PDF view."
wiki_pdf_remove_title_info: "When active the Wiki title info will not be displayed in PDF view."
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@ es:
wiki_pdf_remove_attachments_info: "Cuando está activa, los adjuntos no serán mostrados en los PDF."
wiki_pdf_remove_title_info: "Cuando está activa, el título de la Wiki no será mostrado en los PDF."
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@ fr:
wiki_pdf_remove_attachments_info: "Lorsqu'ils sont actifs, les fichiers Wiki joints ne seront pas affichés en vue PDF."
wiki_pdf_remove_title_info: "Lorsqu'elle est active, l'information sur le titre du wiki ne sera pas affichée dans la vue PDF."
button_merge: Fusionner
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@ it:
wiki_pdf_remove_attachments_info: "Quando è attivo, il Wiki file allegati non verranno visualizzati nella vista PDF."
wiki_pdf_remove_title_info: "Quando è attivo, le informazioni sul titolo del Wiki non verranno visualizzate nella vista PDF."
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@ ja:
wiki_pdf_remove_attachments_info: "アクティブな場合、添付されたWikiファイルはPDFビューに表示されません。"
wiki_pdf_remove_title_info: "アクティブな場合、Wikiのタイトル情報はPDFビューに表示されません。"
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@ ko:
wiki_pdf_remove_attachments_info: 활성화 된 경우 첨부 된 Wiki 파일은 PDF보기에 표시되지 않습니다.
wiki_pdf_remove_title_info: 활성화되면 위키 제목 정보가 PDF보기에 표시되지 않습니다.
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@ pl:
wiki_pdf_remove_attachments_info: "Gdy jest aktywny, załączone pliki Wiki nie będą wyświetlane w widoku PDF."
wiki_pdf_remove_title_info: "Gdy jest aktywny, informacja o tytule Wiki nie będzie wyświetlana w widoku PDF."
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@ pt-BR:
wiki_pdf_remove_attachments_info: "Quando ativo, os arquivos Wiki anexos não serão exibidos na visualização em PDF."
wiki_pdf_remove_title_info: "Quando ativo, o título do Wiki não será exibido na visualização em PDF."
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@ ru:
wiki_pdf_remove_attachments_info: "Если флажок установлен, вложенные Вики-файлы не будут отображаться в PDF-формате."
wiki_pdf_remove_title_info: "При активации этого параметра информация о названии Вики не будет отображаться в PDF-формате."
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@
wiki_pdf_remove_attachments_info: "當啟用時Wiki附件將不會顯示在PDF中。"
wiki_pdf_remove_title_info: "當啟用時Wiki標題訊息不會顯示在PDF中"
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -183,3 +183,4 @@ zh:
wiki_pdf_remove_attachments_info: 当启用时WIKI 附件将不会显示在PDF视图中。
wiki_pdf_remove_title_info: 当启用时WIKI 标题信息将不会显示在PDF视图中。
button_merge: Merge
label_live_search_hints: "Available field searches: %{value}"

View File

@ -49,7 +49,7 @@ Disable modules
Please restart the application server, if you make changes to the external urls settings as well as if you activate the Smileys support.
.. note::
You can use the following manual smiley codes: :), =), :D, =D, :'(, :(, ;), :P, :O, :/, :S, :|, :X, :*, O:), >:), B), (!), (?), (v), (x), (/) and @}->-
You can use the following manual smiley codes: :), =), :D, =D, :'(, :(, ;), :P, :O, :/, :S, :|, :X, :*, O:), >:), B), (!), (?), (v), (x) and (/)

View File

@ -18,7 +18,6 @@ module Additionals
'angel' => '[Oo][=:]-?\)', # O:)
'evil' => '>[=:;]-?[)(]', # >:)
'rock' => 'B-?\)', # B)
'rose' => '@[)\}][-\\/\',;()>\}]*', # @}->-
'exclamation' => '[\[(]![\])]', # (!)
'question' => '[\[(]\?[\])]', # (?)
'check' => '[\[(]\\/[\])]', # (/)

View File

@ -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'