Add new dashboard block for text asynchronous

This commit is contained in:
Alexander Meindl 2020-11-06 10:12:25 +01:00
parent e605de8795
commit a4d5b2f17a
20 changed files with 97 additions and 51 deletions

View File

@ -10,6 +10,7 @@ Changelog
- Mermaid 8.8.2 support
- add current_user as special login name for user macro (which shows current login user)
- add text parameter to user macro (which disable link to user)
- add asynchronous text block
3.0.0
+++++

View File

@ -321,11 +321,11 @@ class Dashboard < ActiveRecord::Base
unique_params = settings.flatten
unique_params += options[:unique_params].reject(&:blank?) if options[:unique_params].present?
Rails.logger.debug "debug async_params for #{block}: unique_params=#{unique_params.inspect}"
# Rails.logger.debug "debug async_params for #{block}: unique_params=#{unique_params.inspect}"
config[:unique_key] = Digest::SHA256.hexdigest(unique_params.join('_'))
end
Rails.logger.debug "debug async_params for #{block}: config=#{config.inspect}"
# Rails.logger.debug "debug async_params for #{block}: config=#{config.inspect}"
config
end

View File

@ -41,9 +41,13 @@ class DashboardContent
with_project: true
},
max_occurs: DashboardContent::MAX_MULTIPLE_OCCURS },
'text' => { label: l(:label_text),
'text' => { label: l(:label_text_sync),
max_occurs: MAX_MULTIPLE_OCCURS,
partial: 'dashboards/blocks/text' },
'text_async' => { label: l(:label_text_async),
max_occurs: MAX_MULTIPLE_OCCURS,
async: { required_settings: %i[text],
partial: 'dashboards/blocks/text_async' } },
'news' => { label: l(:label_news_latest),
permission: :view_news },
'documents' => { label: l(:label_document_plural),

View File

@ -1,26 +1,12 @@
ruby:
title = settings[:title] || l(:label_text)
text = settings[:text]
- if title.present?
h3 = title
- if settings[:text].nil?
h3
= l :label_text_sync
- elsif settings[:title].present?
h3
= settings[:title]
- if @can_edit
div id="#{block}-settings" style='display: none;'
= form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do
.box
p
label
= l :field_title
' :
= text_field_tag "settings[#{block}][title]", title
p
= text_area_tag "settings[#{block}][text]", text, rows: addtionals_textarea_cols(text), class: 'wiki-edit'
= wikitoolbar_for "settings_#{block}_text"
p
= submit_tag l(:button_save)
'
= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();"
= render partial: 'dashboards/blocks/text_async_settings', locals: { block: block, settings: settings }
.wiki
= textilizable text
= textilizable settings[:text]

View File

@ -0,0 +1,10 @@
- cache render_async_cache_key(_dashboard_async_blocks_path(@project,
dashboard.async_params(block, async, settings))),
expires_in: async[:cache_expires_in],
skip_digest: true do
- if settings[:title].present?
h3 = settings[:title]
.wiki
= textilizable settings[:text]

View File

@ -0,0 +1,15 @@
div id="#{block}-settings" style='display: none;'
= form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do
.box
p
label
= l :field_title
' :
= text_field_tag "settings[#{block}][title]", (settings[:title] || l(:label_text_sync))
p
= text_area_tag "settings[#{block}][text]", settings[:text], rows: addtionals_textarea_cols(settings[:text]), class: 'wiki-edit'
= wikitoolbar_for "settings_#{block}_text"
p
= submit_tag l :button_save
'
= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();"

View File

@ -74,6 +74,8 @@ cs:
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: Seznam barev
label_content_plural: Obsah
label_copied_to_clipboard: "Zkopírováno!"
label_copy_to_clipboard: "Zkopírovat do schránky"
label_custom_fields_distribution: "Vlastní pole pro distribuci"
label_custom_menu_items: "Vlastní položky nabídky"
label_daily: denně
@ -149,6 +151,8 @@ cs:
label_show_all: "Ukázat vše"
label_system_info: "Systémová informace"
label_tags_without_color: Show tags without color
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "Zde získáte seznam všech dostupných maker Redmine vaší instalace, která jsou poskytována doplňky Redmine a Redmine."
label_top_menu_help_html: "Zde můžete definovat nové položky horní nabídky."
label_top_menu: Top menu
@ -187,5 +191,3 @@ cs:
top_wiki_help: "Zde můžete definovat obsah a nastavení vaší Wiki."
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."
label_copied_to_clipboard: "Zkopírováno!"
label_copy_to_clipboard: "Zkopírovat do schránky"

View File

@ -74,6 +74,8 @@ de:
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: Farbschema Auflistung
label_content_plural: Inhalte
label_copied_to_clipboard: Kopiert!
label_copy_to_clipboard: In die Zwischenablage kopieren
label_custom_fields_distribution: Benutzerdefinierte Felder für Verteilung
label_custom_menu_items: Benutzerdefinierte Menüpunkte
label_daily: täglich
@ -149,6 +151,8 @@ de:
label_show_all: Alle anzeigen
label_system_info: Systeminformation
label_tags_without_color: Zeige TAGs ohne Farbe
label_text_async: Text (asynchron)
label_text_sync: Text
label_top_macros_help_html: "Hier sind alle Makros aufgelistet, welche über Redmine selbst oder Plugins bereitgestellt werden (nicht nur über Additionals). Diese Makros können in allen Texten innerhalb Redmines verwendet werden (sofern diese im jeweiligen Kontext Sinn machen)."
label_top_menu_help_html: "Hier können Menüpunkte festgelegt werden, die im Top-Menü angezeigt werden."
label_top_menu: Top Menü
@ -187,5 +191,3 @@ de:
top_wiki_help: Hier kannst Du Inhalte und Einstellungen bzg. der Wiki festlegen.
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.
label_copied_to_clipboard: Kopiert!
label_copy_to_clipboard: In die Zwischenablage kopieren

View File

@ -74,6 +74,8 @@ en:
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: Color list
label_content_plural: Contents
label_copied_to_clipboard: Copied!
label_copy_to_clipboard: Copy to clipboard
label_custom_fields_distribution: "Custom fields for distribution"
label_custom_menu_items: Custom menu items
label_daily: daily
@ -149,6 +151,8 @@ en:
label_show_all: Show all
label_system_info: System info
label_tags_without_color: Show TAGs without color
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "Here you get a list of all available Redmine macros of your installation, which are provided by Redmine and the Redmine plugins."
label_top_menu_help_html: "Here you can define new top menu items."
label_top_menu: Top menu
@ -187,5 +191,3 @@ en:
top_wiki_help: "Here you can define contents and settings for your Wiki."
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."
label_copied_to_clipboard: Copied!
label_copy_to_clipboard: Copy to clipboard

View File

@ -74,6 +74,8 @@ es:
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: "Lista de colores"
label_content_plural: Contenido
label_copied_to_clipboard: "¡Copiado!"
label_copy_to_clipboard: "Copia al portapapeles"
label_custom_fields_distribution: "Campos customizados para la distribución"
label_custom_menu_items: Entradas de menú personalizadas
label_daily: diario
@ -149,6 +151,8 @@ es:
label_show_all: Mostrar todo
label_system_info: Información del sistema
label_tags_without_color: Mostrar etiquetas sin color
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "Aquí tiene una lista de todos los Macros de Redmine disponibles en su instalación (provistos por Redmine o por sus extensiones)."
label_top_menu_help_html: "Aquí puede definir nuevas entradas para el menú superior."
label_top_menu: Menú superior
@ -187,5 +191,3 @@ es:
top_wiki_help: "Aquí puede definir contenidos y configuracioens para su Wiki."
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."
label_copied_to_clipboard: "¡Copiado!"
label_copy_to_clipboard: "Copia al portapapeles"

View File

@ -74,6 +74,8 @@ fr:
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: "Liste des couleurs"
label_content_plural: Contents
label_copied_to_clipboard: "Copie !"
label_copy_to_clipboard: "Copie dans le presse-papiers"
label_custom_fields_distribution: "Champs personnalisés pour la distribution"
label_custom_menu_items: Éléments de menu personnalisés
label_daily: tous les jours
@ -149,6 +151,8 @@ fr:
label_show_all: Montrer tout
label_system_info: System info
label_tags_without_color: "Afficher les étiquettes sans couleur"
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "Vous obtenez ici une liste de toutes les macros Redmine disponibles de votre installation, qui sont fournies par Redmine et les plugins Redmine."
label_top_menu_help_html: "Ici, vous pouvez définir de nouveaux éléments de menu du haut."
label_top_menu: Top menu
@ -187,5 +191,3 @@ fr:
top_wiki_help: "Ici vous pouvez définir le contenu et les paramètres de votre Wiki."
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."
label_copied_to_clipboard: "Copie !"
label_copy_to_clipboard: "Copie dans le presse-papiers"

View File

@ -74,6 +74,8 @@ it:
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: Color list
label_content_plural: Il contentuto
label_copied_to_clipboard: "Copiato!"
label_copy_to_clipboard: "Copia negli appunti"
label_custom_fields_distribution: "Campi personalizzati per la distribuzione"
label_custom_menu_items: Custom menu items
label_daily: giornalmente
@ -149,6 +151,8 @@ it:
label_show_all: Mostra tutto
label_system_info: System info
label_tags_without_color: "Mostra tag senza colore"
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "Qui trovate un elenco di tutte le macro Redmine disponibili della vostra installazione, fornite da Redmine e dai plugin Redmine."
label_top_menu_help_html: "Qui è possibile definire nuove voci di menu in alto."
label_top_menu: Top menu
@ -187,5 +191,3 @@ it:
top_wiki_help: "Qui puoi definire contenuti e impostazioni per il tuo Wiki."
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."
label_copied_to_clipboard: "Copiato!"
label_copy_to_clipboard: "Copia negli appunti"

View File

@ -74,6 +74,8 @@ ja:
label_chart_with_name: "チャート: %{value}"
label_chartjs_colorscheme_info: "カラーリスト"
label_content_plural: "内容"
label_copied_to_clipboard: "コピーしました"
label_copy_to_clipboard: "クリップボードにコピー"
label_custom_fields_distribution: "配布用のカスタムフィールド"
label_custom_menu_items: Custom menu items
label_daily: daily
@ -149,6 +151,8 @@ ja:
label_show_all: Show all
label_system_info: System info
label_tags_without_color: Show tags without color
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "Here you get a list of all available Redmine macros of your installation, which are provided by Redmine and the Redmine plugins."
label_top_menu_help: "ここで新しいトップメニューの項目を定義出来ます。"
label_top_menu: Top menu
@ -187,5 +191,3 @@ ja:
top_wiki_help: "ここでは、Wikiの内容や設定を定義することができます。"
wiki_pdf_remove_attachments_info: "アクティブな場合、添付されたWikiファイルはPDFビューに表示されません。"
wiki_pdf_remove_title_info: "アクティブな場合、Wikiのタイトル情報はPDFビューに表示されません。"
label_copied_to_clipboard: "コピーしました"
label_copy_to_clipboard: "クリップボードにコピー"

View File

@ -74,6 +74,8 @@ ko:
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: 컬러리스트
label_content_plural: 내용
label_copied_to_clipboard: "복사되었습니다!"
label_copy_to_clipboard: "클립 보드에 복사"
label_custom_fields_distribution: "Custom fields for distribution"
label_custom_menu_items: 맞춤 메뉴 항목
label_daily: 매일
@ -149,6 +151,8 @@ ko:
label_show_all: 모두 표시
label_system_info: 시스템 정보
label_tags_without_color: 색상없이 태그 표시
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "다음은 Redmine 및 Redmine 플러그인에서 제공하는 설치에 사용 가능한 모든 Redmine 매크로 목록입니다."
label_top_menu_help_html: "여기에서 새로운 최상위 메뉴 항목을 정의 할 수 있습니다."
label_top_menu: 톱 메뉴
@ -187,5 +191,3 @@ ko:
top_wiki_help: 여기에서 위키의 내용과 설정을 정의 할 수 있습니다.
wiki_pdf_remove_attachments_info: 활성화 된 경우 첨부 된 Wiki 파일은 PDF보기에 표시되지 않습니다.
wiki_pdf_remove_title_info: 활성화되면 위키 제목 정보가 PDF보기에 표시되지 않습니다.
label_copied_to_clipboard: "복사되었습니다!"
label_copy_to_clipboard: "클립 보드에 복사"

View File

@ -74,6 +74,8 @@ pl:
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: "Lista kolorów"
label_content_plural: "Spis treści"
label_copied_to_clipboard: "Skopiowane!"
label_copy_to_clipboard: "Kopia do schowka"
label_custom_fields_distribution: "Pola niestandardowe dla dystrybucji"
label_custom_menu_items: "Niestandardowe pozycje menu"
label_daily: "dobowy"
@ -149,6 +151,8 @@ pl:
label_show_all: "Pokaż wszystkof"
label_system_info: "Informacje systemowe"
label_tags_without_color: Show tags without color
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "Tutaj otrzymujesz listę wszystkich dostępnych makr Redmine z Twojej instalacji, które są dostarczane przez Redmine i wtyczki Redmine."
label_top_menu_help_html: "Tutaj możesz zdefiniować nowe pozycje menu górnego."
label_top_menu: Top menu
@ -187,5 +191,3 @@ pl:
top_wiki_help: "Tutaj możesz zdefiniować zawartość i ustawienia dla swojej Wiki."
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."
label_copied_to_clipboard: "Skopiowane!"
label_copy_to_clipboard: "Kopia do schowka"

View File

@ -74,6 +74,8 @@ pt-BR:
label_chart_with_name: "Gráfico: %{value}"
label_chartjs_colorscheme_info: "Lista de cores"
label_content_plural: "Conteúdo"
label_copied_to_clipboard: "Copiado!"
label_copy_to_clipboard: "Copiar para prancheta"
label_custom_fields_distribution: "Campos personalizados para distribuição"
label_custom_menu_items: "Itens de menu personalizados"
label_daily: "diariamente"
@ -149,6 +151,8 @@ pt-BR:
label_show_all: "Mostrar tudo"
label_system_info: "Informações do sistema"
label_tags_without_color: "Mostrar TAGs sem cor"
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "Aqui você obtém uma lista de todas as macros Redmine disponíveis de sua instalação, que são fornecidas pela Redmine e pelos plugins Redmine."
label_top_menu_help_html: "Aqui você pode definir novos itens do menu superior."
label_top_menu: Top menu
@ -187,5 +191,3 @@ pt-BR:
top_wiki_help: "Aqui você pode definir conteúdos e configurações para seu Wiki."
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."
label_copied_to_clipboard: "Copiado!"
label_copy_to_clipboard: "Copiar para prancheta"

View File

@ -74,6 +74,8 @@ ru:
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: "Список цветов"
label_content_plural: Contents
label_copied_to_clipboard: "Принято!"
label_copy_to_clipboard: "Скопировано в буфер обмена"
label_custom_fields_distribution: "Пользовательские поля для распределения"
label_custom_menu_items: "Пользовательские пункты меню"
label_daily: "ежедневный"
@ -149,6 +151,8 @@ ru:
label_show_all: "Показать все"
label_system_info: System info
label_tags_without_color: Show tags without color
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "Здесь вы получите список всех доступных макросов Redmine вашей установки, которые предоставляются плагинами Redmine и Redmine."
label_top_menu_help_html: "Здесь можно задать новые пункты верхнего меню."
label_top_menu: Top menu
@ -187,5 +191,3 @@ ru:
top_wiki_help: "Здесь вы можете определить содержимое и настройки для вашей Вики."
wiki_pdf_remove_attachments_info: "Если флажок установлен, вложенные Вики-файлы не будут отображаться в PDF-формате."
wiki_pdf_remove_title_info: "При активации этого параметра информация о названии Вики не будет отображаться в PDF-формате."
label_copied_to_clipboard: "Принято!"
label_copy_to_clipboard: "Скопировано в буфер обмена"

View File

@ -74,6 +74,8 @@
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: "顏色清單"
label_content_plural: 内容
label_copied_to_clipboard: "复制!"
label_copy_to_clipboard: "复制到剪贴板"
label_custom_fields_distribution: "Custom fields for distribution"
label_custom_menu_items: "自訂選單項目"
label_daily: 每天
@ -149,6 +151,8 @@
label_show_all: "顯示全部"
label_system_info: "系統訊息"
label_tags_without_color: "顯示無顏色標籤"
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "此處列出Redmine與Redmine外掛支援的macros指令。"
label_top_menu_help_html: "此處可以自訂頂部選單。在移除或修改後,必須 <strong>重啟 Redmine</strong> 以確保修改生效。"
label_top_menu: "頂部選單"
@ -187,5 +191,3 @@
top_wiki_help: "您可以在此自訂Wiki的內容和設定。"
wiki_pdf_remove_attachments_info: "當啟用時Wiki附件將不會顯示在PDF中。"
wiki_pdf_remove_title_info: "當啟用時Wiki標題訊息不會顯示在PDF中"
label_copied_to_clipboard: "复制!"
label_copy_to_clipboard: "复制到剪贴板"

View File

@ -74,6 +74,8 @@ zh:
label_chart_with_name: "Chart: %{value}"
label_chartjs_colorscheme_info: "颜色清单"
label_content_plural: 内容
label_copied_to_clipboard: "复制!"
label_copy_to_clipboard: "复制到剪贴板"
label_custom_fields_distribution: "用于分发的自定义字段"
label_custom_menu_items: 自定义菜单项
label_daily: 每天
@ -149,6 +151,8 @@ zh:
label_show_all: 显示所有
label_system_info: 系统信息
label_tags_without_color: Show tags without color
label_text_async: Text (asynchronous)
label_text_sync: Text
label_top_macros_help_html: "此处列出了来自 Redmine 及 Redmine 插件中提供的所有可用的宏命令。"
label_top_menu_help_html: "此处可以自定义顶部菜单项。在移除或修改菜单项后,请务必 <strong>重启 Redmine 服务</strong> 确保修改内容生效。"
label_top_menu: Top menu
@ -187,5 +191,3 @@ zh:
top_wiki_help: 您可以在此定义 WIKI 的内容及设置。
wiki_pdf_remove_attachments_info: 当启用时WIKI 附件将不会显示在PDF视图中。
wiki_pdf_remove_title_info: 当启用时WIKI 标题信息将不会显示在PDF视图中。
label_copied_to_clipboard: "复制!"
label_copy_to_clipboard: "复制到剪贴板"

View File

@ -13,6 +13,7 @@ system_default_welcome:
- my_spent_time
left:
- text
- text_async
- legacy_left
right:
- text__1
@ -23,6 +24,9 @@ system_default_welcome:
text:
:title: Welcome left
:text: Some example text in left text block
text_async:
:title: Async loaded
:text: Use it for better performance
text__1:
:title: Welcome right
:text: Some example text in right text block