add "☆" hollow five-pointed star to indicate a negative number,

71 views
Skip to first unread message

sini Ai

unread,
May 17, 2026, 3:52:02 AM (2 days ago) May 17
to mementodatabase
I hope that this rating "★" field, add "☆" hollow five-pointed star to indicate a negative number, the corresponding value is -10 to -1,



Screenshot_2026-05-17-15-31-19-77_1a0e309e342d0b39d45ce86487c154fd.jpg

Mmm

unread,
May 17, 2026, 6:45:39 AM (2 days ago) May 17
to mementodatabase
Свое предложение направьте в поддержку. На это не решается.

Временное решение:
– числовое поле с указанием положительного или отрицательного рейтинга;
– поле JS с кодом:

if (field("rating")) {
    let num = field("rating");

    //вид звездочки
    let star = Math.sign(num);
    if (star == 1) star = '★';
    else if (star = -1) star = '☆';
    else '';

    //ограничение от -5 до 5
    let nn = Math.abs(num) > 5 ? 5 : Math.abs(num);

    star.repeat(nn);

} else {
    null;
}

воскресенье, 17 мая 2026 г. в 10:52:02 UTC+3, hao...@gmail.com:
rating.png

Mmm

unread,
May 17, 2026, 7:47:46 AM (2 days ago) May 17
to mementodatabase
Если добавить раскрашивание текста поля JS, то можно получить различные цветные варианты "полных" и "пустых" звёздочек или только полных звездочек.

Шаблон библиотеки в каталоге шаблонов:

воскресенье, 17 мая 2026 г. в 13:45:39 UTC+3, Mmm:
rating_color.png

Flaviano

unread,
May 17, 2026, 5:02:27 PM (2 days ago) May 17
to mementodatabase
Excellent example library, Mmm.
The first and second fields have the stars filled in or not, the first without color and the second with color (which is different for each number of stars). And the third field always has the stars filled in, but using only two colors, to differentiate whether it was a positive or negative evaluation.

Captura de tela 2026-05-17 144530.jpg
Reply all
Reply to author
Forward
0 new messages