liquid_feedback_frontend

changeset 1658:c08690678b2d

Do not show authors as avatar, improved suggestion rating info
author bsw
date Sun Feb 14 13:27:21 2021 +0100 (2021-02-14)
parents 4d5f30d8df4a
children 4b74a177884b
files app/main/initiative/_head.lua app/main/initiative/_suggestions.lua static/lf4.css
line diff
     1.1 --- a/app/main/initiative/_head.lua	Sun Feb 14 13:12:08 2021 +0100
     1.2 +++ b/app/main/initiative/_head.lua	Sun Feb 14 13:27:21 2021 +0100
     1.3 @@ -65,11 +65,13 @@
     1.4  ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
     1.5  
     1.6    if not config.voting_only and app.session:has_access("authors_pseudonymous") then
     1.7 +    ui.tag{ content = _"by" }
     1.8 +    slot.put(" ")
     1.9      for i, member in ipairs(initiators) do
    1.10        if i > 1 then
    1.11          slot.put(" ")
    1.12        end
    1.13 -      util.micro_avatar( member )
    1.14 +      ui.link{ module = "member", view = "show", id = member.id, content = member.name }
    1.15      end -- for i, member
    1.16    end
    1.17    
     2.1 --- a/app/main/initiative/_suggestions.lua	Sun Feb 14 13:12:08 2021 +0100
     2.2 +++ b/app/main/initiative/_suggestions.lua	Sun Feb 14 13:27:21 2021 +0100
     2.3 @@ -176,7 +176,12 @@
     2.4                content = function ()
     2.5                
     2.6                  if app.session:has_access("authors_pseudonymous") then
     2.7 -                  util.micro_avatar ( suggestion.author )
     2.8 +                  ui.tag{ content = _"by" }
     2.9 +                  slot.put(" ")
    2.10 +                  ui.link{
    2.11 +                    module = "member", view = "show", id = suggestion.author_id,
    2.12 +                    content = suggestion.author.name
    2.13 +                  }
    2.14                  end
    2.15                  
    2.16                  execute.view{
    2.17 @@ -230,77 +235,79 @@
    2.18  
    2.19            ui.container { attr = { class = "mdl-card__actions mdl-card--border" }, content = function()
    2.20  
    2.21 -            ui.container{ attr = { class = "float-right" }, content = function()
    2.22 -              ui.tag{ attr = { id = "s" .. suggestion.id .. "_rating_text" }, content = function()
    2.23 -                local text = ""
    2.24 -                if opinion then
    2.25 -                  if opinion.degree == 2 then
    2.26 -                    text = _"must"
    2.27 -                  elseif opinion.degree == 1 then
    2.28 -                    text = _"should"
    2.29 -                  elseif opinion.degree == 0 then
    2.30 -                    text = _"neutral"
    2.31 -                  elseif opinion.degree == -1 then
    2.32 -                    text = _"should not"
    2.33 -                  elseif opinion.degree == -2 then
    2.34 -                    text = _"must not"
    2.35 +            if direct_supporter then
    2.36 +              ui.container{ attr = { class = "suggestion_rating_info" }, content = function()
    2.37 +                ui.tag{ attr = { id = "s" .. suggestion.id .. "_rating_text" }, content = function()
    2.38 +                  local text = ""
    2.39 +                  if opinion then
    2.40 +                    if opinion.degree == 2 then
    2.41 +                      text = _"must"
    2.42 +                    elseif opinion.degree == 1 then
    2.43 +                      text = _"should"
    2.44 +                    elseif opinion.degree == 0 then
    2.45 +                      text = _"neutral"
    2.46 +                    elseif opinion.degree == -1 then
    2.47 +                      text = _"should not"
    2.48 +                    elseif opinion.degree == -2 then
    2.49 +                      text = _"must not"
    2.50 +                    end
    2.51 +                    ui.tag { content = text }
    2.52 +                    slot.put ( " " )
    2.53 +                    if 
    2.54 +                      (opinion.degree > 0 and not opinion.fulfilled)
    2.55 +                      or (opinion.degree < 0 and opinion.fulfilled)
    2.56 +                    then
    2.57 +                      ui.tag{ content = _"but" }
    2.58 +                    else
    2.59 +                      ui.tag{ content = _"and" }
    2.60 +                    end
    2.61 +                    slot.put ( " " )
    2.62 +                    local text = ""
    2.63 +                    if opinion.fulfilled then
    2.64 +                      text = _"is implemented"
    2.65 +                    else
    2.66 +                      text = _"is not implemented"
    2.67 +                    end
    2.68 +                    ui.tag { content = text }
    2.69                    end
    2.70 -                  ui.tag { content = text }
    2.71 -                  slot.put ( " " )
    2.72 -                  if 
    2.73 +                end }
    2.74 +                local id = "s" .. suggestion.id .. "_rating_icon"
    2.75 +                if opinion and (
    2.76                      (opinion.degree > 0 and not opinion.fulfilled)
    2.77                      or (opinion.degree < 0 and opinion.fulfilled)
    2.78 -                  then
    2.79 -                    ui.tag{ content = _"but" }
    2.80 +                  )
    2.81 +                then
    2.82 +                  slot.put(" ")
    2.83 +                  if math.abs(opinion.degree) > 1 then
    2.84 +                    ui.icon("warning", "red", id)
    2.85                    else
    2.86 -                    ui.tag{ content = _"and" }
    2.87 +                    ui.icon("warning", nil, id)
    2.88                    end
    2.89 -                  slot.put ( " " )
    2.90 -                  local text = ""
    2.91 -                  if opinion.fulfilled then
    2.92 -                    text = _"is implemented"
    2.93 -                  else
    2.94 -                    text = _"is not implemented"
    2.95 -                  end
    2.96 -                  ui.tag { content = text }
    2.97 +                elseif opinion then
    2.98 +                  slot.put(" ")
    2.99 +                  ui.icon("done", nil, id)
   2.100 +                else
   2.101 +                  slot.put(" ")
   2.102 +                  ui.icon("blank", nil, id)
   2.103                  end
   2.104                end }
   2.105 -              local id = "s" .. suggestion.id .. "_rating_icon"
   2.106 -              if opinion and (
   2.107 -                  (opinion.degree > 0 and not opinion.fulfilled)
   2.108 -                  or (opinion.degree < 0 and opinion.fulfilled)
   2.109 -                )
   2.110 -              then
   2.111 -                slot.put(" ")
   2.112 -                if math.abs(opinion.degree) > 1 then
   2.113 -                  ui.icon("warning", "red", id)
   2.114 -                else
   2.115 -                  ui.icon("warning", nil, id)
   2.116 +              
   2.117 +              ui.link{
   2.118 +                attr = {
   2.119 +                  id = "s" .. suggestion.id .. "_rate_button",
   2.120 +                  class = "mdl-button",
   2.121 +                  onclick = "rateSuggestion(" .. suggestion.id .. ", " .. (opinion and opinion.degree or 0) .. ", " .. (opinion and (opinion.fulfilled and "true" or "false") or "null") .. ");return false;"
   2.122 +                },
   2.123 +                content = function()
   2.124 +                  if opinion then
   2.125 +                    ui.tag { content = _"update rating" }
   2.126 +                  else
   2.127 +                    ui.tag { content = _"rate suggestion" }
   2.128 +                  end
   2.129                  end
   2.130 -              elseif opinion then
   2.131 -                slot.put(" ")
   2.132 -                ui.icon("done", nil, id)
   2.133 -              else
   2.134 -                slot.put(" ")
   2.135 -                ui.icon("blank", nil, id)
   2.136 -              end
   2.137 -            end }
   2.138 -            
   2.139 -            ui.link{
   2.140 -              attr = {
   2.141 -                id = "s" .. suggestion.id .. "_rate_button",
   2.142 -                class = "mdl-button",
   2.143 -                onclick = "rateSuggestion(" .. suggestion.id .. ", " .. (opinion and opinion.degree or 0) .. ", " .. (opinion and (opinion.fulfilled and "true" or "false") or "null") .. ");return false;"
   2.144 -              },
   2.145 -              content = function()
   2.146 -                if opinion then
   2.147 -                  ui.tag { content = _"update rating" }
   2.148 -                else
   2.149 -                  ui.tag { content = _"rate suggestion" }
   2.150 -                end
   2.151 -              end
   2.152 -            }
   2.153 -          
   2.154 +              }
   2.155 +            end
   2.156 +                      
   2.157              ui.link{
   2.158                attr = { class = "mdl-button" },
   2.159                content = _"Details",
     3.1 --- a/static/lf4.css	Sun Feb 14 13:12:08 2021 +0100
     3.2 +++ b/static/lf4.css	Sun Feb 14 13:27:21 2021 +0100
     3.3 @@ -446,6 +446,11 @@
     3.4    display: inline-block;
     3.5  }
     3.6  
     3.7 +.suggestion_rating_info {
     3.8 +  float: right;
     3.9 +  line-height: 200%;
    3.10 +}
    3.11 +
    3.12  .diff .diff_removed {
    3.13    text-decoration: line-through;
    3.14    background: #f00;

Impressum / About Us