liquid_feedback_frontend
diff app/main/draft/diff.lua @ 159:5d797c6706d5
implement quorum display
show the initiative quorum as a small 1px line in bargraph
allow to update your support on the diff page
better linked title in diff page
show absolute quorum numbers in detail pages of issue and initiative
show the initiative quorum as a small 1px line in bargraph
allow to update your support on the diff page
better linked title in diff page
show absolute quorum numbers in detail pages of issue and initiative
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Sat Oct 09 03:42:48 2010 +0200 (2010-10-09) |
parents | 6a12fb7e4963 |
children | cc7650c7053f |
line diff
1.1 --- a/app/main/draft/diff.lua Fri Oct 08 20:36:56 2010 +0200 1.2 +++ b/app/main/draft/diff.lua Sat Oct 09 03:42:48 2010 +0200 1.3 @@ -1,5 +1,3 @@ 1.4 -slot.put_into("title", _"Diff") 1.5 - 1.6 local old_draft_id = param.get("old_draft_id", atom.integer) 1.7 local new_draft_id = param.get("new_draft_id", atom.integer) 1.8 1.9 @@ -22,6 +20,62 @@ 1.10 local old_draft = Draft:by_id(old_draft_id) 1.11 local new_draft = Draft:by_id(new_draft_id) 1.12 1.13 +local initiative = new_draft.initiative 1.14 +local issue = initiative.issue 1.15 + 1.16 +slot.select("title", function() 1.17 + ui.link{ 1.18 + content = issue.area.name, 1.19 + module = "area", 1.20 + view = "show", 1.21 + id = issue.area.id 1.22 + } 1.23 + slot.put(" · ") 1.24 + ui.link{ 1.25 + content = _("Issue ##{id}", { id = issue.id }), 1.26 + module = "issue", 1.27 + view = "show", 1.28 + id = issue.id 1.29 + } 1.30 + slot.put(" · ") 1.31 + ui.link{ 1.32 + content = _("Initiative: ")..initiative.name, 1.33 + module = "initiative", 1.34 + view = "show", 1.35 + id = initiative.id 1.36 + } 1.37 + slot.put(" · ") 1.38 + slot.put_into("title", _"Diff") 1.39 + 1.40 +end) 1.41 + 1.42 +if app.session.member_id and not new_draft.initiative.revoked then 1.43 + local supporter = Supporter:new_selector():add_where{"member_id = ?", app.session.member_id}:count() 1.44 + if supporter then 1.45 + ui.container{ 1.46 + attr = { class = "draft_updated_info" }, 1.47 + content = function() 1.48 + slot.put(_"The draft of this initiative has been updated!") 1.49 + slot.put(" ") 1.50 + ui.link{ 1.51 + text = _"Refresh support to current draft", 1.52 + module = "initiative", 1.53 + action = "add_support", 1.54 + id = new_draft.initiative.id, 1.55 + routing = { 1.56 + default = { 1.57 + mode = "redirect", 1.58 + module = "initiative", 1.59 + view = "show", 1.60 + id = new_draft.initiative.id 1.61 + } 1.62 + } 1.63 + } 1.64 + end 1.65 + } 1.66 + end 1.67 +end 1.68 + 1.69 local old_draft_content = string.gsub(string.gsub(old_draft.content, "\n", " ###ENTER###\n"), " ", "\n") 1.70 local new_draft_content = string.gsub(string.gsub(new_draft.content, "\n", " ###ENTER###\n"), " ", "\n") 1.71