Разукрасить список багов

MantisBT forum for users who prefer to ask and answer questions in Russian.

Moderators: Developer, Contributor

Post Reply
Vadman
Posts: 57
Joined: 12 Sep 2018, 12:31

Разукрасить список багов

Post by Vadman »

<br>Добрый день!</br>
Подскажите, можно ли в новой версии Mantis (2.18.0) в списке багов выделять цветом всю строку с багом, как это было в более ранних версиях. Или как-то сделать более наглядную цветовую индикацию?
Kirill
Posts: 638
Joined: 25 Nov 2007, 08:05
Location: Kaliningrad, RF
Contact:

Re: Разукрасить список багов

Post by Kirill »

Можете привести пример (скриншот), о чем вы говорите?
Vadman
Posts: 57
Joined: 12 Sep 2018, 12:31

Re: Разукрасить список багов

Post by Vadman »

Как было раньше - MantisBT_old.png (цветом выделена вся строка)
Как стало - MantisBT_new.png (цветом выделен только столбец Статус)
Attachments
MantisBT_old.png
MantisBT_old.png (148.09 KiB) Viewed 19992 times
MantisBT_new.png
MantisBT_new.png (137.13 KiB) Viewed 19992 times
Kirill
Posts: 638
Joined: 25 Nov 2007, 08:05
Location: Kaliningrad, RF
Contact:

Re: Разукрасить список багов

Post by Kirill »

Без изменения кода ядра мантиса не получится.
dmrom00
Posts: 4
Joined: 10 Sep 2012, 04:13

Re: Разукрасить список багов

Post by dmrom00 »

У меня получилось по этому совету:
viewtopic.php?f=4&t=25073

Там ставится плагин CustomContent и небольшой js
Vadman
Posts: 57
Joined: 12 Sep 2018, 12:31

Re: Разукрасить список багов

Post by Vadman »

Резюмирую все настройки, может кому-то ещё пригодятся.
  • Скачиваем CustomContent Plugin и копируем его в mantis/plugins
  • Добавляем в файл mantis/config/config_inc.php настройки для CustomContent Plugin:

Code: Select all

# CustomContent Plugin settings
# ------------------------------------------------------
# this file will be included right after the opening <body> tag
$g_custom_body_begin_file = "%absolute_path%/plugins/CustomContent/inc/custom_body_begin_file.php";
 
# this file will be included at the end of the header layout section, i.e. the main menu
$g_custom_page_header = "%absolute_path%/plugins/CustomContent/inc/custom_page_header_file.php";
 
# this file will be included at the end of the footer layout section, i.e the Mantis copyright
$g_custom_page_footer = "%absolute_path%/plugins/CustomContent/inc/custom_page_footer_file.php";
 
# this file will be included right before the closing <body> tag
$g_custom_body_end_file = "%absolute_path%/plugins/CustomContent/inc/custom_body_end_file.php";
  • В mantis/js создаём файл custom.js с содержимым:

Code: Select all

$(function() {

$(".fa-status-box").each(function() {
var $this = $(this);
var col = $this.css('color');
var a = col.slice(4).split(',');
var newAlpha = 0.3;
var bgCol = 'rgba('+a[0]+','+parseInt(a[1])+','+parseInt(a[2])+','+newAlpha+')';
$this.closest("tr").css("background-color", bgCol);
});

});
  • В конец файла mantis/plugins/CustomContent/inc/custom_body_begin_file.php добавляем:

Code: Select all

<script type="text/javascript" src="/js/custom.js" /></script>
  • Входим в администрирование mantis и включаем CustomContent Plugin
Post Reply