liquid_feedback_frontend

diff app/main/admin/policy_list.lua @ 1045:701a5cf6b067

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents b5684668ac4b
children 6929d3ced007
line diff
     1.1 --- a/app/main/admin/policy_list.lua	Thu Jul 10 01:02:43 2014 +0200
     1.2 +++ b/app/main/admin/policy_list.lua	Thu Jul 10 01:19:48 2014 +0200
     1.3 @@ -3,52 +3,58 @@
     1.4  local policies = Policy:build_selector{ active = not show_not_in_use }:exec()
     1.5  
     1.6  
     1.7 -ui.title(_"Policy list")
     1.8 +ui.titleAdmin(_"Policy list")
     1.9  
    1.10 +ui.section( function()
    1.11 +  ui.sectionHead( function()
    1.12 +    ui.heading { level = 1, content = _"Policy list" }
    1.13 +  end )
    1.14 +  
    1.15 +  ui.sectionRow( function()
    1.16  
    1.17 -ui.actions(function()
    1.18 +    if show_not_in_use then
    1.19 +      ui.link{
    1.20 +        text = _"Show policies in use",
    1.21 +        module = "admin",
    1.22 +        view = "policy_list"
    1.23 +      }
    1.24  
    1.25 -  if show_not_in_use then
    1.26 -    ui.link{
    1.27 -      text = _"Show policies in use",
    1.28 -      module = "admin",
    1.29 -      view = "policy_list"
    1.30 +    else
    1.31 +      ui.link{
    1.32 +        text = _"Create new policy",
    1.33 +        module = "admin",
    1.34 +        view = "policy_show"
    1.35 +      }
    1.36 +      slot.put(" · ")
    1.37 +      ui.link{
    1.38 +        text = _"Show policies not in use",
    1.39 +        module = "admin",
    1.40 +        view = "policy_list",
    1.41 +        params = { show_not_in_use = true }
    1.42 +      }
    1.43 +
    1.44 +    end
    1.45 +
    1.46 +  end )
    1.47 +  
    1.48 +  ui.sectionRow( function()
    1.49 +
    1.50 +    ui.list{
    1.51 +      records = policies,
    1.52 +      columns = {
    1.53 +
    1.54 +        { content = function(record)
    1.55 +            ui.link{
    1.56 +              text = record.name,
    1.57 +              module = "admin",
    1.58 +              view = "policy_show",
    1.59 +              id = record.id
    1.60 +            }
    1.61 +          end
    1.62 +        }
    1.63 +
    1.64 +      }
    1.65      }
    1.66  
    1.67 -  else
    1.68 -    ui.link{
    1.69 -      text = _"Create new policy",
    1.70 -      module = "admin",
    1.71 -      view = "policy_show"
    1.72 -    }
    1.73 -    slot.put(" · ")
    1.74 -    ui.link{
    1.75 -      text = _"Show policies not in use",
    1.76 -      module = "admin",
    1.77 -      view = "policy_list",
    1.78 -      params = { show_not_in_use = true }
    1.79 -    }
    1.80 -
    1.81 -  end
    1.82 -
    1.83 -end)
    1.84 -
    1.85 -
    1.86 -ui.list{
    1.87 -  records = policies,
    1.88 -  columns = {
    1.89 -
    1.90 -    { label = _"Policy", name = "name" },
    1.91 -
    1.92 -    { content = function(record)
    1.93 -        ui.link{
    1.94 -          text = _"Edit",
    1.95 -          module = "admin",
    1.96 -          view = "policy_show",
    1.97 -          id = record.id
    1.98 -        }
    1.99 -      end
   1.100 -    }
   1.101 -
   1.102 -  }
   1.103 -}
   1.104 \ No newline at end of file
   1.105 +  end )
   1.106 +end )
   1.107 \ No newline at end of file

Impressum / About Us