liquid_feedback_frontend

diff app/main/interest/_show_box.lua @ 4:80c215dbf076

Version alpha5

Many optical changes and improved usability

Support for different wiki-formatting-engines

Help system
author bsw/jbe
date Thu Dec 10 12:00:00 2009 +0100 (2009-12-10)
parents 768faea1096d
children afd9f769c7ae
line diff
     1.1 --- a/app/main/interest/_show_box.lua	Mon Nov 30 12:00:00 2009 +0100
     1.2 +++ b/app/main/interest/_show_box.lua	Thu Dec 10 12:00:00 2009 +0100
     1.3 @@ -1,73 +1,71 @@
     1.4  
     1.5  local issue = param.get("issue", "table")
     1.6  
     1.7 -
     1.8 -slot.select("interest", function()
     1.9 -  local interest = Interest:by_pk(issue.id, app.session.member.id)
    1.10 +local interest = Interest:by_pk(issue.id, app.session.member.id)
    1.11  
    1.12 -  ui.container{
    1.13 -    attr = { 
    1.14 -      class = "head",
    1.15 -      onclick = "document.getElementById('interest_content').style.display = 'block';"
    1.16 -    },
    1.17 -    content = function()
    1.18 -      if interest then
    1.19 -        ui.field.text{ value = _"You are interested. [more]" }
    1.20 -      else
    1.21 -        ui.field.text{ value = _"You are not interested. [more]" }
    1.22 -      end
    1.23 -    end
    1.24 -  }
    1.25 +if interest then
    1.26 +  slot.select("actions", function()
    1.27  
    1.28    ui.container{
    1.29 -    attr = { class = "content", id = "interest_content" },
    1.30 +    attr = { class = "interest vote_info"},
    1.31      content = function()
    1.32 -      ui.container{
    1.33 -        attr = {
    1.34 -          class = "close",
    1.35 -          style = "cursor: pointer;",
    1.36 -          onclick = "document.getElementById('interest_content').style.display = 'none';"
    1.37 -        },
    1.38 -        content = _"X"
    1.39 -      }
    1.40 -      if interest then
    1.41 -        ui.link{
    1.42 -          content = _"Remove my interest",
    1.43 -          module = "interest",
    1.44 -          action = "update",
    1.45 -          params = { issue_id = issue.id, delete = true },
    1.46 -          routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    1.47 +        ui.container{
    1.48 +          attr = { 
    1.49 +            class = "head head_active",
    1.50 +            onclick = "document.getElementById('interest_content').style.display = 'block';"
    1.51 +          },
    1.52 +          content = function()
    1.53 +            slot.put(_"Your are interested")
    1.54 +            ui.image{
    1.55 +              static = "icons/16/dropdown.png"
    1.56 +            }
    1.57 +          end
    1.58          }
    1.59 -        slot.put("<br />")
    1.60 -        slot.put("<br />")
    1.61 -        if interest.autoreject then
    1.62 -          ui.field.text{ value = _"Autoreject is on." }
    1.63 -          ui.link{
    1.64 -            content = _"Remove autoreject",
    1.65 -            module = "interest",
    1.66 -            action = "update",
    1.67 -            params = { issue_id = issue.id, autoreject = false },
    1.68 -            routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    1.69 -          }
    1.70 -        else
    1.71 -          ui.field.text{ value = _"Autoreject is off." }
    1.72 -          ui.link{
    1.73 -            content = _"Set autoreject",
    1.74 -            module = "interest",
    1.75 -            action = "update",
    1.76 -            params = { issue_id = issue.id, autoreject = true },
    1.77 -            routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    1.78 -          }
    1.79 -        end
    1.80 -      else
    1.81 -        ui.link{
    1.82 -          content = _"Add my interest to this issue",
    1.83 -          module = "interest",
    1.84 -          action = "update",
    1.85 -          params = { issue_id = issue.id },
    1.86 -          routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    1.87 +    
    1.88 +        ui.container{
    1.89 +          attr = { class = "content", id = "interest_content" },
    1.90 +          content = function()
    1.91 +            ui.container{
    1.92 +              attr = {
    1.93 +                class = "close",
    1.94 +                style = "cursor: pointer;",
    1.95 +                onclick = "document.getElementById('interest_content').style.display = 'none';"
    1.96 +              },
    1.97 +              content = function()
    1.98 +                ui.image{ static = "icons/16/cross.png" }
    1.99 +              end
   1.100 +            }
   1.101 +            ui.link{
   1.102 +              content = _"Remove my interest",
   1.103 +              module = "interest",
   1.104 +              action = "update",
   1.105 +              params = { issue_id = issue.id, delete = true },
   1.106 +              routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
   1.107 +            }
   1.108 +            slot.put("<br />")
   1.109 +            slot.put("<br />")
   1.110 +            if interest.autoreject then
   1.111 +              ui.field.text{ value = _"Autoreject is on." }
   1.112 +              ui.link{
   1.113 +                content = _"Remove autoreject",
   1.114 +                module = "interest",
   1.115 +                action = "update",
   1.116 +                params = { issue_id = issue.id, autoreject = false },
   1.117 +                routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
   1.118 +              }
   1.119 +            else
   1.120 +              ui.field.text{ value = _"Autoreject is off." }
   1.121 +              ui.link{
   1.122 +                content = _"Set autoreject",
   1.123 +                module = "interest",
   1.124 +                action = "update",
   1.125 +                params = { issue_id = issue.id, autoreject = true },
   1.126 +                routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
   1.127 +              }
   1.128 +            end
   1.129 +          end
   1.130          }
   1.131        end
   1.132 -    end
   1.133 -  }
   1.134 -end)
   1.135 +    }
   1.136 +  end)
   1.137 +end
   1.138 \ No newline at end of file

Impressum / About Us