liquid_feedback_frontend
changeset 1463:16868516595f
New layout for admin policy edit view
author | bsw |
---|---|
date | Thu Oct 18 17:34:24 2018 +0200 (2018-10-18) |
parents | 6929d3ced007 |
children | f3082de14228 |
files | app/main/admin/policy_show.lua |
line diff
1.1 --- a/app/main/admin/policy_show.lua Thu Oct 18 17:33:11 2018 +0200 1.2 +++ b/app/main/admin/policy_show.lua Thu Oct 18 17:34:24 2018 +0200 1.3 @@ -4,71 +4,75 @@ 1.4 1.5 ui.titleAdmin(_"Policy") 1.6 1.7 -ui.section( function() 1.8 +ui.grid{ content = function() 1.9 1.10 - ui.sectionHead( function() 1.11 - ui.heading { level = 1, content = policy and policy.name or _"New policy" } 1.12 - end ) 1.13 - ui.sectionRow( function() 1.14 - ui.form{ 1.15 - attr = { class = "vertical" }, 1.16 - record = policy, 1.17 - module = "admin", 1.18 - action = "policy_update", 1.19 - routing = { 1.20 - default = { 1.21 - mode = "redirect", 1.22 + ui.cell_main{ content = function() 1.23 + ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 1.24 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.25 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = policy and policy.name or _"New policy" } 1.26 + end } 1.27 + ui.container{ attr = { class = "mdl-card__content" }, content = function() 1.28 + ui.form{ 1.29 + attr = { class = "vertical" }, 1.30 + record = policy, 1.31 module = "admin", 1.32 - view = "index" 1.33 - } 1.34 - }, 1.35 - id = policy.id, 1.36 - content = function() 1.37 + action = "policy_update", 1.38 + routing = { 1.39 + default = { 1.40 + mode = "redirect", 1.41 + module = "admin", 1.42 + view = "index" 1.43 + } 1.44 + }, 1.45 + id = policy.id, 1.46 + content = function() 1.47 1.48 - ui.field.text{ label = _"Index", name = "index", value = hint and "1" or nil } 1.49 + ui.field.text{ label = _"Index", name = "index", value = hint and "1" or nil } 1.50 1.51 - ui.field.text{ label = _"Name", name = "name" } 1.52 - ui.field.text{ label = _"Description", name = "description", multiline = true } 1.53 - ui.field.text{ label = _"Hint", readonly = true, 1.54 - value = _"Interval format:" .. " 3 mons 2 weeks 1 day 10:30:15" } 1.55 + ui.field.text{ label = _"Name", name = "name" } 1.56 + ui.field.text{ label = _"Description", name = "description", multiline = true } 1.57 + ui.field.text{ label = _"Hint", readonly = true, 1.58 + value = _"Interval format:" .. " 3 mons 2 weeks 1 day 10:30:15" } 1.59 1.60 - ui.field.text{ label = _"Minimum admission time", name = "min_admission_time", value = hint and "0" or nil } 1.61 - ui.field.text{ label = _"Maximum admission time", name = "max_admission_time", value = hint and "30 days" or nil } 1.62 - ui.field.text{ label = _"Discussion time", name = "discussion_time", value = hint and "30 days" or nil } 1.63 - ui.field.text{ label = _"Verification time", name = "verification_time", value = hint and "15 days" or nil } 1.64 - ui.field.text{ label = _"Voting time", name = "voting_time", value = hint and "15 days" or nil } 1.65 + ui.field.text{ label = _"Minimum admission time", name = "min_admission_time", value = hint and "0" or nil } 1.66 + ui.field.text{ label = _"Maximum admission time", name = "max_admission_time", value = hint and "30 days" or nil } 1.67 + ui.field.text{ label = _"Discussion time", name = "discussion_time", value = hint and "30 days" or nil } 1.68 + ui.field.text{ label = _"Verification time", name = "verification_time", value = hint and "15 days" or nil } 1.69 + ui.field.text{ label = _"Voting time", name = "voting_time", value = hint and "15 days" or nil } 1.70 1.71 - ui.field.text{ label = _"Issue quorum", name = "issue_quorum", value = hint and "1" or nil } 1.72 - ui.field.text{ label = _"Issue quorum numerator", name = "issue_quorum_num", value = hint and "1" or nil } 1.73 - ui.field.text{ label = _"Issue quorum denominator", name = "issue_quorum_den", value = hint and "10" or nil } 1.74 + ui.field.text{ label = _"Issue quorum", name = "issue_quorum", value = hint and "1" or nil } 1.75 + ui.field.text{ label = _"Issue quorum numerator", name = "issue_quorum_num", value = hint and "1" or nil } 1.76 + ui.field.text{ label = _"Issue quorum denominator", name = "issue_quorum_den", value = hint and "10" or nil } 1.77 1.78 - ui.field.text{ label = _"Initiative quorum absolute", name = "initiative_quorum", value = hint and "1" or nil } 1.79 - ui.field.text{ label = _"Initiative quorum numerator", name = "initiative_quorum_num", value = hint and "10" or nil } 1.80 - ui.field.text{ label = _"Initiative quorum denominator", name = "initiative_quorum_den", value = hint and "100" or nil } 1.81 + ui.field.text{ label = _"Initiative quorum absolute", name = "initiative_quorum", value = hint and "1" or nil } 1.82 + ui.field.text{ label = _"Initiative quorum numerator", name = "initiative_quorum_num", value = hint and "10" or nil } 1.83 + ui.field.text{ label = _"Initiative quorum denominator", name = "initiative_quorum_den", value = hint and "100" or nil } 1.84 1.85 - ui.field.text{ label = _"Direct majority numerator", name = "direct_majority_num", value = hint and "50" or nil } 1.86 - ui.field.text{ label = _"Direct majority denominator", name = "direct_majority_den", value = hint and "100" or nil } 1.87 - ui.field.boolean{ label = _"Strict direct majority", name = "direct_majority_strict", value = hint and true or nil } 1.88 - ui.field.text{ label = _"Direct majority positive", name = "direct_majority_positive", value = hint and "0" or nil } 1.89 - ui.field.text{ label = _"Direct majority non negative", name = "direct_majority_non_negative", value = hint and "0" or nil } 1.90 + ui.field.text{ label = _"Direct majority numerator", name = "direct_majority_num", value = hint and "50" or nil } 1.91 + ui.field.text{ label = _"Direct majority denominator", name = "direct_majority_den", value = hint and "100" or nil } 1.92 + ui.field.boolean{ label = _"Strict direct majority", name = "direct_majority_strict", value = hint and true or nil } 1.93 + ui.field.text{ label = _"Direct majority positive", name = "direct_majority_positive", value = hint and "0" or nil } 1.94 + ui.field.text{ label = _"Direct majority non negative", name = "direct_majority_non_negative", value = hint and "0" or nil } 1.95 1.96 - ui.field.text{ label = _"Indirect majority numerator", name = "indirect_majority_num", value = hint and "50" or nil } 1.97 - ui.field.text{ label = _"Indirect majority denominator", name = "indirect_majority_den", value = hint and "100" or nil } 1.98 - ui.field.boolean{ label = _"Strict indirect majority", name = "indirect_majority_strict", value = hint and true or nil } 1.99 - ui.field.text{ label = _"Indirect majority positive", name = "indirect_majority_positive", value = hint and "0" or nil } 1.100 - ui.field.text{ label = _"Indirect majority non negative", name = "indirect_majority_non_negative", value = hint and "0" or nil } 1.101 + ui.field.text{ label = _"Indirect majority numerator", name = "indirect_majority_num", value = hint and "50" or nil } 1.102 + ui.field.text{ label = _"Indirect majority denominator", name = "indirect_majority_den", value = hint and "100" or nil } 1.103 + ui.field.boolean{ label = _"Strict indirect majority", name = "indirect_majority_strict", value = hint and true or nil } 1.104 + ui.field.text{ label = _"Indirect majority positive", name = "indirect_majority_positive", value = hint and "0" or nil } 1.105 + ui.field.text{ label = _"Indirect majority non negative", name = "indirect_majority_non_negative", value = hint and "0" or nil } 1.106 1.107 - ui.field.boolean{ label = _"No reverse beat path", name = "no_reverse_beat_path", value = hint and false or nil } 1.108 - ui.field.boolean{ label = _"No multistage majority", name = "no_multistage_majority", value = hint and false or nil } 1.109 - ui.field.boolean{ label = _"Polling mode", name = "polling", value = hint and false or nil } 1.110 + ui.field.boolean{ label = _"No reverse beat path", name = "no_reverse_beat_path", value = hint and false or nil } 1.111 + ui.field.boolean{ label = _"No multistage majority", name = "no_multistage_majority", value = hint and false or nil } 1.112 + ui.field.boolean{ label = _"Polling mode", name = "polling", value = hint and false or nil } 1.113 1.114 1.115 - ui.field.boolean{ label = _"Active?", name = "active", value = hint and true or nil } 1.116 + ui.field.boolean{ label = _"Active?", name = "active", value = hint and true or nil } 1.117 1.118 - ui.submit{ text = _"update policy" } 1.119 - slot.put(" ") 1.120 - ui.link { module = "admin", view = "index", content = _"cancel" } 1.121 - end 1.122 - } 1.123 - end ) 1.124 -end ) 1.125 + ui.submit{ text = _"update policy" } 1.126 + slot.put(" ") 1.127 + ui.link { module = "admin", view = "index", content = _"cancel" } 1.128 + end 1.129 + } 1.130 + end } 1.131 + end } 1.132 + end } 1.133 +end }