# HG changeset patch # User bsw # Date 1613305641 -3600 # Node ID c08690678b2d6b0c5b3b55a12b04a9518187fbc3 # Parent 4d5f30d8df4a4343ff628e18512bfcf518b10bed Do not show authors as avatar, improved suggestion rating info diff -r 4d5f30d8df4a -r c08690678b2d app/main/initiative/_head.lua --- a/app/main/initiative/_head.lua Sun Feb 14 13:12:08 2021 +0100 +++ b/app/main/initiative/_head.lua Sun Feb 14 13:27:21 2021 +0100 @@ -65,11 +65,13 @@ ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function () if not config.voting_only and app.session:has_access("authors_pseudonymous") then + ui.tag{ content = _"by" } + slot.put(" ") for i, member in ipairs(initiators) do if i > 1 then slot.put(" ") end - util.micro_avatar( member ) + ui.link{ module = "member", view = "show", id = member.id, content = member.name } end -- for i, member end diff -r 4d5f30d8df4a -r c08690678b2d app/main/initiative/_suggestions.lua --- a/app/main/initiative/_suggestions.lua Sun Feb 14 13:12:08 2021 +0100 +++ b/app/main/initiative/_suggestions.lua Sun Feb 14 13:27:21 2021 +0100 @@ -176,7 +176,12 @@ content = function () if app.session:has_access("authors_pseudonymous") then - util.micro_avatar ( suggestion.author ) + ui.tag{ content = _"by" } + slot.put(" ") + ui.link{ + module = "member", view = "show", id = suggestion.author_id, + content = suggestion.author.name + } end execute.view{ @@ -230,77 +235,79 @@ ui.container { attr = { class = "mdl-card__actions mdl-card--border" }, content = function() - ui.container{ attr = { class = "float-right" }, content = function() - ui.tag{ attr = { id = "s" .. suggestion.id .. "_rating_text" }, content = function() - local text = "" - if opinion then - if opinion.degree == 2 then - text = _"must" - elseif opinion.degree == 1 then - text = _"should" - elseif opinion.degree == 0 then - text = _"neutral" - elseif opinion.degree == -1 then - text = _"should not" - elseif opinion.degree == -2 then - text = _"must not" + if direct_supporter then + ui.container{ attr = { class = "suggestion_rating_info" }, content = function() + ui.tag{ attr = { id = "s" .. suggestion.id .. "_rating_text" }, content = function() + local text = "" + if opinion then + if opinion.degree == 2 then + text = _"must" + elseif opinion.degree == 1 then + text = _"should" + elseif opinion.degree == 0 then + text = _"neutral" + elseif opinion.degree == -1 then + text = _"should not" + elseif opinion.degree == -2 then + text = _"must not" + end + ui.tag { content = text } + slot.put ( " " ) + if + (opinion.degree > 0 and not opinion.fulfilled) + or (opinion.degree < 0 and opinion.fulfilled) + then + ui.tag{ content = _"but" } + else + ui.tag{ content = _"and" } + end + slot.put ( " " ) + local text = "" + if opinion.fulfilled then + text = _"is implemented" + else + text = _"is not implemented" + end + ui.tag { content = text } end - ui.tag { content = text } - slot.put ( " " ) - if + end } + local id = "s" .. suggestion.id .. "_rating_icon" + if opinion and ( (opinion.degree > 0 and not opinion.fulfilled) or (opinion.degree < 0 and opinion.fulfilled) - then - ui.tag{ content = _"but" } + ) + then + slot.put(" ") + if math.abs(opinion.degree) > 1 then + ui.icon("warning", "red", id) else - ui.tag{ content = _"and" } + ui.icon("warning", nil, id) end - slot.put ( " " ) - local text = "" - if opinion.fulfilled then - text = _"is implemented" - else - text = _"is not implemented" - end - ui.tag { content = text } + elseif opinion then + slot.put(" ") + ui.icon("done", nil, id) + else + slot.put(" ") + ui.icon("blank", nil, id) end end } - local id = "s" .. suggestion.id .. "_rating_icon" - if opinion and ( - (opinion.degree > 0 and not opinion.fulfilled) - or (opinion.degree < 0 and opinion.fulfilled) - ) - then - slot.put(" ") - if math.abs(opinion.degree) > 1 then - ui.icon("warning", "red", id) - else - ui.icon("warning", nil, id) + + ui.link{ + attr = { + id = "s" .. suggestion.id .. "_rate_button", + class = "mdl-button", + onclick = "rateSuggestion(" .. suggestion.id .. ", " .. (opinion and opinion.degree or 0) .. ", " .. (opinion and (opinion.fulfilled and "true" or "false") or "null") .. ");return false;" + }, + content = function() + if opinion then + ui.tag { content = _"update rating" } + else + ui.tag { content = _"rate suggestion" } + end end - elseif opinion then - slot.put(" ") - ui.icon("done", nil, id) - else - slot.put(" ") - ui.icon("blank", nil, id) - end - end } - - ui.link{ - attr = { - id = "s" .. suggestion.id .. "_rate_button", - class = "mdl-button", - onclick = "rateSuggestion(" .. suggestion.id .. ", " .. (opinion and opinion.degree or 0) .. ", " .. (opinion and (opinion.fulfilled and "true" or "false") or "null") .. ");return false;" - }, - content = function() - if opinion then - ui.tag { content = _"update rating" } - else - ui.tag { content = _"rate suggestion" } - end - end - } - + } + end + ui.link{ attr = { class = "mdl-button" }, content = _"Details", diff -r 4d5f30d8df4a -r c08690678b2d static/lf4.css --- a/static/lf4.css Sun Feb 14 13:12:08 2021 +0100 +++ b/static/lf4.css Sun Feb 14 13:27:21 2021 +0100 @@ -446,6 +446,11 @@ display: inline-block; } +.suggestion_rating_info { + float: right; + line-height: 200%; +} + .diff .diff_removed { text-decoration: line-through; background: #f00;