liquid_feedback_frontend
diff app/main/issue/_sidebar.lua @ 1309:32cc544d5a5b
Cumulative patch for upcoming frontend version 4
author | bsw/jbe |
---|---|
date | Sun Jul 15 14:07:29 2018 +0200 (2018-07-15) |
parents | |
children | d14462e2b38b |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/issue/_sidebar.lua Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -0,0 +1,133 @@ 1.4 +local issue = param.get("issue", "table") 1.5 +local initiative = param.get("initiative", "table") 1.6 + 1.7 +local member = param.get ( "member", "table" ) 1.8 + 1.9 +ui.container{ attr = { class = "mdl-card mdl-shadow--2dp mdl-card__fullwidth" }, content = function() 1.10 + 1.11 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.12 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = issue.name } 1.13 + end } 1.14 + 1.15 + if issue.admin_notice then 1.16 + ui.container{ attr = { class = "mdl-card__content mdl-card--border phases" }, content = function() 1.17 + slot.put(encode.html_newlines(issue.admin_notice)) 1.18 + end } 1.19 + end 1.20 + 1.21 + ui.container{ attr = { class = "mdl-card__content mdl-card--border phases" }, content = function() 1.22 + execute.view{ module = "issue", view = "_sidebar_state", params = { 1.23 + issue = issue 1.24 + } } 1.25 + end } 1.26 + 1.27 + if app.session.member then 1.28 + if issue.fully_frozen then 1.29 + if issue.member_info.direct_voted then 1.30 + ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() 1.31 + ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "mail_outline" } 1.32 + slot.put(" ") 1.33 + ui.tag { content = _"You have voted" } 1.34 + end } 1.35 + elseif active_trustee_id then 1.36 + ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() 1.37 + ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "mail_outline" } 1.38 + slot.put(" ") 1.39 + ui.tag { content = _"You have voted via delegation" } 1.40 + end } 1.41 + end 1.42 + elseif not issue.closed then 1.43 + if issue.member_info.own_participation then 1.44 + ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() 1.45 + ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "remove_red_eye" } 1.46 + slot.put(" ") 1.47 + ui.tag{ content = _"You are interested in this issue" } 1.48 + end } 1.49 + end 1.50 + end 1.51 + 1.52 + if not issue.closed then 1.53 + ui.container{ attr = { class = "mdl-card__actions" }, content = function() 1.54 + if issue.fully_frozen then 1.55 + if issue.member_info.direct_voted then 1.56 + if not issue.closed then 1.57 + ui.link { 1.58 + attr = { class = "mdl-button mdl-js-button" }, 1.59 + module = "vote", view = "list", 1.60 + params = { issue_id = issue.id }, 1.61 + text = _"change vote" 1.62 + } 1.63 + else 1.64 + ui.link { 1.65 + attr = { class = "mdl-button mdl-js-button" }, 1.66 + module = "vote", view = "list", 1.67 + params = { issue_id = issue.id }, 1.68 + text = _"show vote" 1.69 + } 1.70 + end 1.71 + elseif active_trustee_id then 1.72 + ui.link { 1.73 + attr = { class = "mdl-button mdl-js-button" }, 1.74 + content = _"Show voting ballot", 1.75 + module = "vote", view = "list", params = { 1.76 + issue_id = issue.id, member_id = active_trustee_id 1.77 + } 1.78 + } 1.79 + elseif not issue.closed then 1.80 + ui.link { 1.81 + attr = { class = "mdl-button mdl-js-button" }, 1.82 + module = "vote", view = "list", 1.83 + params = { issue_id = issue.id }, 1.84 + text = _"vote now" 1.85 + } 1.86 + end 1.87 + elseif not issue.closed then 1.88 + if issue.member_info.own_participation then 1.89 + ui.link { 1.90 + attr = { class = "mdl-button mdl-js-button" }, 1.91 + module = "interest", action = "update", 1.92 + params = { issue_id = issue.id, delete = true }, 1.93 + routing = { default = { 1.94 + mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id 1.95 + } }, 1.96 + text = _"remove my interest" 1.97 + } 1.98 + else 1.99 + ui.link { 1.100 + attr = { class = "mdl-button mdl-js-button" }, 1.101 + module = "interest", action = "update", 1.102 + params = { issue_id = issue.id }, 1.103 + routing = { default = { 1.104 + mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id 1.105 + } }, 1.106 + content = function() 1.107 + ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "remove_red_eye" } 1.108 + slot.put(" ") 1.109 + ui.tag{ content = _"add my interest" } 1.110 + end 1.111 + } 1.112 + end 1.113 + end 1.114 + end } 1.115 + end 1.116 + end 1.117 + 1.118 +end } 1.119 + 1.120 +if initiative then 1.121 + 1.122 + ui.container{ attr = { class = "mdl-card mdl-shadow--2dp mdl-card__fullwidth" }, content = function() 1.123 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.124 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Competing initiatives" } 1.125 + end } 1.126 + 1.127 + execute.view { 1.128 + module = "issue", view = "_sidebar_issue", 1.129 + params = { 1.130 + issue = issue, 1.131 + ommit_initiative_id = initiative.id 1.132 + } 1.133 + } 1.134 + 1.135 + end } 1.136 +end