liquid_feedback_frontend
diff app/main/issue/_show.lua @ 572:1b799fcdae31
Fixed middots at issue actions
author | bsw |
---|---|
date | Tue Jun 19 23:35:10 2012 +0200 (2012-06-19) |
parents | 565bcc56ea30 |
children | b8e72db6dd0d |
line diff
1.1 --- a/app/main/issue/_show.lua Tue Jun 19 23:21:34 2012 +0200 1.2 +++ b/app/main/issue/_show.lua Tue Jun 19 23:35:10 2012 +0200 1.3 @@ -72,60 +72,94 @@ 1.4 end 1.5 } 1.6 1.7 - ui.container{ 1.8 - attr = { class = "content actions" }, content = function() 1.9 + local links = {} 1.10 1.11 if voteable then 1.12 - ui.link{ 1.13 + links[#links+1] ={ 1.14 content = vote_link_text, 1.15 module = "vote", 1.16 view = "list", 1.17 params = { issue_id = issue.id } 1.18 } 1.19 - slot.put(" · ") 1.20 end 1.21 1.22 if app.session.member_id then 1.23 - execute.view{ 1.24 - module = "interest", 1.25 - view = "_show_box", 1.26 - params = { issue = issue, initiative = initiative } 1.27 - } 1.28 - slot.put(" · ") 1.29 + 1.30 + if issue.member_info.own_participation then 1.31 + if issue.closed then 1.32 + links[#links+1] = { content = _"You were interested" } 1.33 + else 1.34 + links[#links+1] = { content = _"You are interested" } 1.35 + end 1.36 + end 1.37 + 1.38 + if not issue.closed and not issue.fully_frozen then 1.39 + if issue.member_info.own_participation then 1.40 + links[#links+1] = { 1.41 + in_brackets = true, 1.42 + text = _"Withdraw", 1.43 + module = "interest", 1.44 + action = "update", 1.45 + params = { issue_id = issue.id, delete = true }, 1.46 + routing = { 1.47 + default = { 1.48 + mode = "redirect", 1.49 + module = request.get_module(), 1.50 + view = request.get_view(), 1.51 + id = param.get_id_cgi(), 1.52 + params = param.get_all_cgi() 1.53 + } 1.54 + } 1.55 + } 1.56 + elseif app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then 1.57 + links[#links+1] = { 1.58 + text = _"Add my interest", 1.59 + module = "interest", 1.60 + action = "update", 1.61 + params = { issue_id = issue.id }, 1.62 + routing = { 1.63 + default = { 1.64 + mode = "redirect", 1.65 + module = request.get_module(), 1.66 + view = request.get_view(), 1.67 + id = param.get_id_cgi(), 1.68 + params = param.get_all_cgi() 1.69 + } 1.70 + } 1.71 + } 1.72 + end 1.73 + end 1.74 end 1.75 1.76 - if not issue.closed and app.session.member_id then 1.77 + if not issue.closed and app.session.member_id and app.session.member:has_voting_right_for_unit_id(issue.area.unit) then 1.78 if issue.member_info.own_delegation_scope ~= "issue" then 1.79 - ui.link{ text = _"Delegate issue", module = "delegation", view = "show", params = { issue_id = issue.id } } 1.80 + links[#links+1] = { text = _"Delegate issue", module = "delegation", view = "show", params = { issue_id = issue.id } } 1.81 else 1.82 - ui.link{ text = _"Change issue delegation", module = "delegation", view = "show", params = { issue_id = issue.id } } 1.83 + links[#links+1] = { text = _"Change issue delegation", module = "delegation", view = "show", params = { issue_id = issue.id } } 1.84 end 1.85 - slot.put(" · ") 1.86 end 1.87 1.88 if config.issue_discussion_url_func then 1.89 local url = config.issue_discussion_url_func(issue) 1.90 - ui.link{ 1.91 + links[#links+1] = { 1.92 attr = { target = "_blank" }, 1.93 external = url, 1.94 content = _"Discussion on issue" 1.95 } 1.96 - slot.put(" · ") 1.97 end 1.98 1.99 if config.etherpad and app.session.member then 1.100 - ui.link{ 1.101 + links[#links+1] = { 1.102 attr = { target = "_blank" }, 1.103 external = issue.etherpad_url, 1.104 content = _"Issue pad" 1.105 } 1.106 - slot.put(" · ") 1.107 end 1.108 1.109 1.110 if app.session.member_id and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then 1.111 if not issue.fully_frozen and not issue.closed then 1.112 - ui.link{ 1.113 + links[#links+1] = { 1.114 attr = { class = "action" }, 1.115 text = _"Create alternative initiative", 1.116 module = "initiative", 1.117 @@ -135,6 +169,22 @@ 1.118 end 1.119 end 1.120 1.121 + ui.container{ attr = { class = "content actions" }, content = function() 1.122 + for i, link in ipairs(links) do 1.123 + if link.in_brackets then 1.124 + slot.put(" (") 1.125 + elseif i > 1 then 1.126 + slot.put(" · ") 1.127 + end 1.128 + if link.module then 1.129 + ui.link(link) 1.130 + else 1.131 + ui.tag(link) 1.132 + end 1.133 + if link.in_brackets then 1.134 + slot.put(")") 1.135 + end 1.136 + end 1.137 end } 1.138 1.139 if not for_listing then