liquid_feedback_frontend
changeset 1781:c28ff4a85ded
Removed unused views
author | bsw |
---|---|
date | Tue Oct 19 14:45:36 2021 +0200 (2021-10-19) |
parents | 7dcbcbf492e3 |
children | 256c8f6a0ed4 |
files | app/main/_filter/21_auth.lua app/main/initiative/_sidebar_policies.lua app/main/policy/_list.lua app/main/policy/list.lua app/main/policy/show.lua |
line diff
1.1 --- a/app/main/_filter/21_auth.lua Tue Oct 19 14:42:20 2021 +0200 1.2 +++ b/app/main/_filter/21_auth.lua Tue Oct 19 14:45:36 2021 +0200 1.3 @@ -61,8 +61,6 @@ 1.4 module == "index" and view == "index" 1.5 or module == "area" and view == "show" 1.6 or module == "unit" and view == "show" 1.7 - or module == "policy" and view == "show" 1.8 - or module == "policy" and view == "list" 1.9 or module == "issue" and view == "show" 1.10 or module == "issue" and view == "history" 1.11 or module == "initiative" and view == "show"
2.1 --- a/app/main/initiative/_sidebar_policies.lua Tue Oct 19 14:42:20 2021 +0200 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,10 +0,0 @@ 2.4 -local area = param.get("area", "table") 2.5 - 2.6 -ui.sidebar ( "tab-whatcanido", function () 2.7 - ui.sidebarHead( function() 2.8 - ui.heading { level = 2, content = _"Available policies" } 2.9 - end ) 2.10 - execute.view { module = "policy", view = "_list", params = { 2.11 - for_area = area 2.12 - } } 2.13 -end ) 2.14 \ No newline at end of file
3.1 --- a/app/main/policy/_list.lua Tue Oct 19 14:42:20 2021 +0200 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,92 +0,0 @@ 3.4 -local for_area = param.get("for_area", "table") 3.5 - 3.6 -local selector = Policy:new_selector() 3.7 - :add_where("policy.active") 3.8 - :add_order_by("policy.index") 3.9 - 3.10 -if for_area then 3.11 - selector:join("allowed_policy", nil, 3.12 - { "allowed_policy.policy_id = policy.id AND allowed_policy.area_id = ?", for_area.id } 3.13 - ) 3.14 -end 3.15 - 3.16 -local policies = selector:exec() 3.17 - 3.18 - 3.19 -for i, policy in ipairs(policies) do 3.20 - ui.container { 3.21 - attr = { class = "sidebarRow", id = "policy" .. policy.id }, 3.22 - content = function () 3.23 - 3.24 - ui.heading { level = 3, content = policy.name } 3.25 - 3.26 - if policy.description and #(policy.description) > 0 then 3.27 - ui.tag{ 3.28 - content = policy.description 3.29 - } 3.30 - slot.put ( "<br />" ) 3.31 - end 3.32 - 3.33 - ui.link { 3.34 - attr = { 3.35 - class = "policy-show-details", 3.36 - onclick = "$('#policy" .. policy.id .. " .policy-details').show(); $('#policy" .. policy.id .. " .policy-show-details').hide(); $('#policy" .. policy.id .. " .policy-hide-details').show(); return false;" 3.37 - }, 3.38 - content = _"show details" 3.39 - } 3.40 - 3.41 - ui.link { 3.42 - attr = { 3.43 - class = "policy-hide-details", 3.44 - onclick = "$('#policy" .. policy.id .. " .policy-details').hide(); $('#policy" .. policy.id .. " .policy-show-details').show(); $('#policy" .. policy.id .. " .policy-hide-details').hide(); return false;", 3.45 - style = "display: none;" 3.46 - }, 3.47 - content = _"hide details" 3.48 - } 3.49 - 3.50 - ui.container { 3.51 - attr = { 3.52 - class = "policy-details", 3.53 - style = "display: none;" 3.54 - }, 3.55 - content = function () 3.56 - 3.57 - ui.heading { level = 4, content = _"Phase durations" } 3.58 - 3.59 - if policy.polling then 3.60 - ui.field.text{ label = _"New" .. ":", value = _"without" } 3.61 - else 3.62 - ui.field.text{ label = _"New" .. ":", value = "≥ " .. format.interval_text(policy.min_admission_time) } 3.63 - ui.field.text{ label = _"New" .. ":", value = "≤ " .. format.interval_text(policy.max_admission_time) } 3.64 - end 3.65 - ui.field.text{ label = _"Discussion" .. ":", value = format.interval_text(policy.discussion_time) or _"variable" } 3.66 - ui.field.text{ label = _"Frozen" .. ":", value = format.interval_text(policy.verification_time) or _"variable" } 3.67 - ui.field.text{ label = _"Voting" .. ":", value = format.interval_text(policy.voting_time) or _"variable" } 3.68 - 3.69 - ui.heading { level = 4, content = _"Quorums" } 3.70 - 3.71 - if policy.polling then 3.72 - ui.field.text{ label = _"Issue quorum" .. ":", value = _"without" } 3.73 - else 3.74 - ui.field.text{ 3.75 - label = _"Issue quorum" .. ":", 3.76 - value = "≥ " .. tostring(policy.issue_quorum) 3.77 - } 3.78 - end 3.79 - ui.field.text{ 3.80 - label = _"Initiative quorum" .. ":", 3.81 - value = "≥ " .. tostring(policy.initiative_quorum_num) .. "/" .. tostring(policy.initiative_quorum_den) 3.82 - } 3.83 - ui.field.text{ 3.84 - label = _"Direct majority" .. ":", 3.85 - value = (policy.direct_majority_strict and ">" or "≥" ) .. " " .. tostring(policy.direct_majority_num) .. "/" .. tostring(policy.direct_majority_den) 3.86 - } 3.87 - ui.field.text{ 3.88 - label = _"Indirect majority" .. ":", 3.89 - value = (policy.indirect_majority_strict and ">" or "≥" ) .. " " .. tostring(policy.indirect_majority_num) .. "/" .. tostring(policy.indirect_majority_den) 3.90 - } 3.91 - end 3.92 - } 3.93 - end 3.94 - } 3.95 -end
4.1 --- a/app/main/policy/list.lua Tue Oct 19 14:42:20 2021 +0200 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,3 +0,0 @@ 4.4 -ui.title(_"Policies") 4.5 - 4.6 -execute.view { module = "policy", view = "_list" } 4.7 \ No newline at end of file
5.1 --- a/app/main/policy/show.lua Tue Oct 19 14:42:20 2021 +0200 5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 5.3 @@ -1,75 +0,0 @@ 5.4 -local policy = Policy:by_id(param.get_id()) 5.5 - 5.6 -slot.put_into("title", encode.html(_("Policy '#{name}'", { name = policy.name }))) 5.7 - 5.8 -ui.form{ 5.9 - attr = { class = "vertical" }, 5.10 - record = policy, 5.11 - content = function() 5.12 - if policy.polling then 5.13 - ui.field.text{ label = _"New" .. ":", value = _"without" } 5.14 - else 5.15 - ui.field.text{ label = _"New" .. ":", value = "≤ min " .. policy.min_admission_time } 5.16 - ui.field.text{ label = _"New" .. ":", value = "≤ max " .. policy.max_admission_time } 5.17 - end 5.18 - ui.field.text{ label = _"Discussion" .. ":", value = policy.discussion_time or _"variable" } 5.19 - ui.field.text{ label = _"Frozen" .. ":", value = policy.verification_time or _"variable" } 5.20 - ui.field.text{ label = _"Voting" .. ":", value = policy.voting_time or _"variable" } 5.21 - 5.22 - if policy.polling then 5.23 - ui.field.text{ label = _"Issue quorum" .. ":", value = _"without" } 5.24 - else 5.25 - ui.field.text{ 5.26 - label = _"Issue quorum", 5.27 - value = "≥ " .. tostring(policy.issue_quorum_num) .. "/" .. tostring(policy.issue_quorum_den) 5.28 - } 5.29 - end 5.30 - ui.field.text{ 5.31 - label = _"Initiative quorum", 5.32 - value = "≥ " .. tostring(policy.initiative_quorum_num) .. "/" .. tostring(policy.initiative_quorum_den) 5.33 - } 5.34 - ui.field.text{ 5.35 - label = _"Direct majority", 5.36 - value = 5.37 - (policy.direct_majority_strict and ">" or "≥" ) .. " " 5.38 - .. tostring(policy.direct_majority_num) .. "/" 5.39 - .. tostring(policy.direct_majority_den) 5.40 - .. (policy.direct_majority_positive > 1 and ", " .. _("at least #{count} approvals", { count = policy.direct_majority_positive }) or "") 5.41 - .. (policy.direct_majority_non_negative > 1 and ", " .. _("at least #{count} approvals or abstentions", { count = policy.direct_majority_non_negative }) or "") 5.42 - } 5.43 - 5.44 - ui.field.text{ 5.45 - label = _"Indirect majority", 5.46 - value = 5.47 - (policy.indirect_majority_strict and ">" or "≥" ) .. " " 5.48 - .. tostring(policy.indirect_majority_num) .. "/" 5.49 - .. tostring(policy.indirect_majority_den) 5.50 - .. (policy.indirect_majority_positive > 1 and ", " .. _("at least #{count} approvals", { count = policy.indirect_majority_positive }) or "") 5.51 - .. (policy.indirect_majority_non_negative > 1 and ", " .. _("at least #{count} approvals or abstentions", { count = policy.indirect_majority_non_negative }) or "") 5.52 - } 5.53 - 5.54 - local texts = {} 5.55 - if policy.no_reverse_beat_path then 5.56 - texts[#texts+1] = _"no reverse beat path to status quo (including ties)" 5.57 - end 5.58 - if policy.no_multistage_majority then 5.59 - texts[#texts+1] = _"prohibit potentially instable results caused by multistage majorities" 5.60 - end 5.61 - ui.field.text{ 5.62 - label = _"Options", 5.63 - value = table.concat(texts, ", ") 5.64 - } 5.65 - if policy.description and #policy.description > 0 then 5.66 - ui.container{ 5.67 - attr = { class = "suggestion_content wiki" }, 5.68 - content = function() 5.69 - ui.tag{ 5.70 - tag = "p", 5.71 - content = policy.description 5.72 - } 5.73 - end 5.74 - } 5.75 - end 5.76 - 5.77 - end 5.78 -}