annotate app/main/admin/newsletter_list.lua @ 1474:a006f2e3b5b5
Added breadcrumbs to admin member list view
author |
bsw |
date |
Thu Oct 18 17:45:09 2018 +0200 (2018-10-18) |
parents |
54efe6c8ae9d |
children |
|
rev |
line source |
bsw@1248
|
1 local newsletter = Newsletter:new_selector()
|
bsw@1248
|
2 :add_order_by("published DESC")
|
bsw@1248
|
3 :exec()
|
bsw@1248
|
4
|
bsw@1248
|
5 ui.titleAdmin(_"Newsletter")
|
bsw@1248
|
6
|
bsw@1465
|
7 ui.grid{ content = function()
|
bsw@1248
|
8
|
bsw@1465
|
9 ui.cell_main{ content = function()
|
bsw@1465
|
10 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
|
bsw@1465
|
11 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
|
bsw@1465
|
12 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Newsletter list" }
|
bsw@1465
|
13 end }
|
bsw@1465
|
14 ui.container{ attr = { class = "mdl-card__content" }, content = function()
|
bsw@1248
|
15
|
bsw@1465
|
16 ui.list{
|
bsw@1465
|
17 records = newsletter,
|
bsw@1465
|
18 columns = {
|
bsw@1465
|
19 { label = _"Unit", content = function(r) ui.tag{ content = r.unit and r.unit.name or _"All members" } end },
|
bsw@1465
|
20 { name = "published", label = _"Published" },
|
bsw@1465
|
21 { name = "subject", label = _"Subject" },
|
bsw@1465
|
22 { label = _"sent", content = function(r)
|
bsw@1465
|
23 if not r.sent then
|
bsw@1465
|
24 ui.link{ text = _"Edit", module = "admin", view = "newsletter_edit", id = r.id }
|
bsw@1465
|
25 else
|
bsw@1465
|
26 ui.tag{ content = format.timestamp(r.sent) }
|
bsw@1465
|
27 end
|
bsw@1465
|
28 end }
|
bsw@1465
|
29 }
|
bsw@1465
|
30 }
|
bsw@1465
|
31 end }
|
bsw@1465
|
32 end }
|
bsw@1465
|
33 end }
|
bsw@1465
|
34 end }
|