liquid_feedback_frontend
diff app/main/initiative/history.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 | fede09736f2b |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/initiative/history.lua Thu Jul 10 01:19:48 2014 +0200 1.3 @@ -0,0 +1,117 @@ 1.4 +local initiative = Initiative:by_id(param.get_id()) 1.5 + 1.6 +initiative:load_everything_for_member_id(app.session.member_id) 1.7 +initiative.issue:load_everything_for_member_id(app.session.member_id) 1.8 + 1.9 + 1.10 +execute.view{ module = "issue", view = "_sidebar_state", params = { 1.11 + initiative = initiative 1.12 +} } 1.13 + 1.14 +execute.view { 1.15 + module = "issue", view = "_sidebar_issue", 1.16 + params = { 1.17 + issue = initiative.issue, 1.18 + highlight_initiative_id = initiative.id 1.19 + } 1.20 +} 1.21 + 1.22 +execute.view { 1.23 + module = "issue", view = "_sidebar_whatcanido", 1.24 + params = { initiative = initiative } 1.25 +} 1.26 + 1.27 +execute.view { 1.28 + module = "issue", view = "_sidebar_members", params = { 1.29 + issue = initiative.issue, initiative = initiative 1.30 + } 1.31 +} 1.32 + 1.33 + 1.34 + 1.35 +execute.view { 1.36 + module = "issue", view = "_head", params = { 1.37 + issue = initiative.issue 1.38 + } 1.39 +} 1.40 + 1.41 +ui.form{ 1.42 + method = "get", 1.43 + module = "draft", 1.44 + view = "diff", 1.45 + attr = { class = "section" }, 1.46 + content = function() 1.47 + ui.field.hidden{ name = "initiative_id", value = initiative.id } 1.48 + 1.49 + ui.sectionHead( function() 1.50 + ui.link{ 1.51 + module = "initiative", view = "show", id = initiative.id, 1.52 + content = function () 1.53 + ui.heading { 1.54 + level = 1, 1.55 + content = initiative.display_name 1.56 + } 1.57 + end 1.58 + } 1.59 + ui.heading { level = 2, content = _"Draft history" } 1.60 + end) 1.61 + 1.62 + ui.sectionRow( function() 1.63 + 1.64 + local columns = { 1.65 + { 1.66 + label = _"draft ID", 1.67 + content = function(record) 1.68 + ui.tag { content = record.id } 1.69 + end 1.70 + }, 1.71 + { 1.72 + label = _"published at", 1.73 + content = function(record) 1.74 + ui.link{ 1.75 + attr = { class = "action" }, 1.76 + module = "draft", view = "show", id = record.id, 1.77 + text = format.timestamp(record.created) 1.78 + } 1.79 + end 1.80 + }, 1.81 + { 1.82 + label = _"compare", 1.83 + content = function(record) 1.84 + slot.put('<input type="radio" name="old_draft_id" value="' .. tostring(record.id) .. '">') 1.85 + slot.put('<input type="radio" name="new_draft_id" value="' .. tostring(record.id) .. '">') 1.86 + end 1.87 + } 1.88 + } 1.89 + 1.90 + if app.session:has_access("authors_pseudonymous") then 1.91 + columns[#columns+1] = { 1.92 + label = _"author", 1.93 + content = function(record) 1.94 + if record.author then 1.95 + return util.micro_avatar ( record.author ) 1.96 + end 1.97 + end 1.98 + } 1.99 + end 1.100 + 1.101 + ui.list{ 1.102 + records = initiative.drafts, 1.103 + columns = columns 1.104 + } 1.105 + 1.106 + slot.put("<br />") 1.107 + ui.container { attr = { class = "actions" }, content = function() 1.108 + ui.tag{ 1.109 + tag = "input", 1.110 + attr = { 1.111 + type = "submit", 1.112 + class = "btn btn-default", 1.113 + value = _"compare revisions" 1.114 + }, 1.115 + content = "" 1.116 + } 1.117 + end } 1.118 + end ) 1.119 + end 1.120 +}