liquid_feedback_frontend

diff app/main/issue/_head2.lua @ 1045:701a5cf6b067

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/issue/_head2.lua	Thu Jul 10 01:19:48 2014 +0200
     1.3 @@ -0,0 +1,96 @@
     1.4 +local issue = param.get("issue", "table")
     1.5 +local for_history = param.get("for_history", atom.boolean)
     1.6 +
     1.7 +ui.sectionHead( "issueInfo", function ()
     1.8 +  ui.container { attr = { class = "left" }, content = function()
     1.9 +    ui.heading { level = 1, content = issue.name }
    1.10 +  end }
    1.11 +  if app.session.member then
    1.12 +    ui.container { attr = { class = "right" }, content = function ()
    1.13 +      if issue.fully_frozen then
    1.14 +        if issue.member_info.direct_voted then
    1.15 +          ui.image { attr = { class = "icon48 right" }, static = "icons/48/voted_ok.png" }
    1.16 +          ui.tag { content = _"You have voted" }
    1.17 +          slot.put(" ")
    1.18 +          if not issue.closed then
    1.19 +            slot.put("<br />")
    1.20 +            ui.link {
    1.21 +              module = "vote", view = "list", 
    1.22 +              params = { issue_id = issue.id },
    1.23 +              text = _"change vote"
    1.24 +            }
    1.25 +          else
    1.26 +            ui.link {
    1.27 +              module = "vote", view = "list", 
    1.28 +              params = { issue_id = issue.id },
    1.29 +              text = _"show vote"
    1.30 +            }
    1.31 +          end
    1.32 +          slot.put(" ")
    1.33 +        elseif active_trustee_id then
    1.34 +          ui.tag { content = _"You have voted via delegation" }
    1.35 +          ui.link {
    1.36 +            content = _"Show voting ballot",
    1.37 +            module = "vote", view = "list", params = {
    1.38 +              issue_id = issue.id, member_id = active_trustee_id
    1.39 +            }
    1.40 +          }
    1.41 +        elseif not issue.closed then
    1.42 +          ui.link {
    1.43 +            attr = { class = "btn btn-default" },
    1.44 +            module = "vote", view = "list", 
    1.45 +            params = { issue_id = issue.id },
    1.46 +            text = _"vote now"
    1.47 +          }
    1.48 +        end
    1.49 +      elseif not issue.closed then
    1.50 +        if issue.member_info.own_participation then
    1.51 +          ui.image { attr = { class = "icon48 right" }, static = "icons/48/eye.png" }
    1.52 +          ui.tag{ content = _"You are interested in this issue" }
    1.53 +          slot.put("<br />")
    1.54 +          ui.link {
    1.55 +            module = "interest", action = "update", 
    1.56 +            params = { issue_id = issue.id, delete = true },
    1.57 +            routing = { default = {
    1.58 +              mode = "redirect", module = "issue", view = "show", id = issue.id
    1.59 +            } },
    1.60 +            text = _"remove my interest"
    1.61 +          }
    1.62 +        else
    1.63 +          ui.link {
    1.64 +            attr = { class = "btn btn-default" },
    1.65 +            module = "interest", action = "update", 
    1.66 +            params = { issue_id = issue.id },
    1.67 +            routing = { default = {
    1.68 +              mode = "redirect", module = "issue", view = "show", id = issue.id
    1.69 +            } },
    1.70 +            text = _"add my interest"
    1.71 +          }
    1.72 +        end
    1.73 +      end
    1.74 +    end }
    1.75 +  end
    1.76 +end)
    1.77 +  
    1.78 +ui.container {
    1.79 +  attr = { class = "ui_filter", style="clear: left; margin-top: 4px;" },
    1.80 +  content = function ()
    1.81 +    ui.container {
    1.82 +      attr = { class = "ui_filter_head" },
    1.83 +      content = function ()
    1.84 +        
    1.85 +        ui.link{
    1.86 +          attr = { class = not for_history and "active" or nil },
    1.87 +          text = _"Initiatives",
    1.88 +          module = "issue", view = "show", id = issue.id
    1.89 +        }
    1.90 +        slot.put(" ")
    1.91 +        ui.link{
    1.92 +          attr = { class = for_history and "active" or nil },
    1.93 +          text = _"History",
    1.94 +          module = "issue", view = "history", id = issue.id
    1.95 +        }
    1.96 +      end
    1.97 +    }
    1.98 +  end
    1.99 +}

Impressum / About Us