liquid_feedback_frontend

diff app/main/timeline/_list.lua @ 11:77d58efe99fd

Version beta7

Important security fixes:
- Added missing HTML encoding to postal address of member
- Link to discussion URL only if it starts with http(s)://

Other bugfixes:
- Fixed wrong display of 2nd level delegating voters for an initiative
- Do not display invited initiators as initiators while voting
- Added missing translation

New features:
- Public message of the day
- Both direct and indirect supporter count is shown in tab heads
- Support shown in initiative lists

Language chooser at the login page has been added (again)
author bsw
date Fri Jan 22 12:00:00 2010 +0100 (2010-01-22)
parents
children 00d1004545f1
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/timeline/_list.lua	Fri Jan 22 12:00:00 2010 +0100
     1.3 @@ -0,0 +1,124 @@
     1.4 +local timeline_selector = param.get("timeline_selector", "table")
     1.5 +local event_names = param.get("event_names", "table")
     1.6 +local initiatives_per_page = param.get("initiatives_per_page", atom.number) or 3
     1.7 +
     1.8 +ui.paginate{
     1.9 +  per_page = param.get("per_page", atom.number) or 25,
    1.10 +  selector = timeline_selector,
    1.11 +  content = function()
    1.12 +    local timelines = timeline_selector:exec()
    1.13 +    timelines:load("issue")
    1.14 +    timelines:load("initiative")
    1.15 +    timelines:load("member")
    1.16 +    ui.list{
    1.17 +      attr = { class = "nohover" },
    1.18 +      records = timelines,
    1.19 +      columns = {
    1.20 +        {
    1.21 +          field_attr = { style = "width: 10em;" },
    1.22 +          content = function(timeline)
    1.23 +            ui.field.text{
    1.24 +              attr = { style = "font-size: 75%; font-weight: bold; background-color: #ccc; display: block; margin-bottom: 1ex;"},
    1.25 +              value = format.time(timeline.occurrence)
    1.26 +            }
    1.27 +            ui.field.text{
    1.28 +              attr = { style = "font-size: 75%; font-weight: bold;"},
    1.29 +              value = event_names[timeline.event] or timeline.event
    1.30 +            }
    1.31 +          end
    1.32 +        },
    1.33 +        {
    1.34 +          content = function(timeline)
    1.35 +            local issue
    1.36 +            local initiative
    1.37 +            if timeline.issue then
    1.38 +              issue = timeline.issue
    1.39 +            elseif timeline.initiative then
    1.40 +              initiative = timeline.initiative
    1.41 +              issue = initiative.issue
    1.42 +            elseif timeline.draft then
    1.43 +              initiative = timeline.draft.initiative
    1.44 +              issue = initiative.issue
    1.45 +            elseif timeline.suggestion then
    1.46 +              initiative = timeline.suggestion.initiative
    1.47 +              issue = initiative.issue
    1.48 +            end
    1.49 +            if issue then
    1.50 +              if timeline.is_interested then
    1.51 +                local label = _"You are interested in this issue",
    1.52 +                ui.image{
    1.53 +                  attr = { alt = label, title = label, style = "float: left; margin-right: 0.5em;" },
    1.54 +                  static = "icons/16/eye.png"
    1.55 +                }
    1.56 +              end
    1.57 +              slot.put(" ")
    1.58 +              ui.tag{
    1.59 +                tag = "span",
    1.60 +                attr = { style = "font-size: 75%; font-weight: bold; background-color: #ccc; display: block; margin-bottom: 1ex;"},
    1.61 +                content = issue.area.name .. ", " .. _("Issue ##{id}", { id = issue.id })
    1.62 +              }
    1.63 +            else
    1.64 +              ui.tag{
    1.65 +                tag = "span",
    1.66 +                attr = { style = "font-size: 75%; background-color: #ccc; display: block; margin-bottom: 1ex;"},
    1.67 +                content = function() slot.put(" ") end
    1.68 +              }
    1.69 +            end
    1.70 +
    1.71 +            if timeline.member then
    1.72 +              execute.view{
    1.73 +                module = "member_image",
    1.74 +                view = "_show",
    1.75 +                params = {
    1.76 +                  member = timeline.member,
    1.77 +                  image_type = "avatar",
    1.78 +                  show_dummy = true
    1.79 +                }
    1.80 +              }
    1.81 +              ui.link{
    1.82 +                content = timeline.member.name,
    1.83 +                module = "member",
    1.84 +                view = "show",
    1.85 +                id = timeline.member.id
    1.86 +              }
    1.87 +            end
    1.88 +            if timeline.issue then
    1.89 +              local initiatives_selector = timeline.issue
    1.90 +                :get_reference_selector("initiatives")
    1.91 +              execute.view{
    1.92 +                module = "initiative",
    1.93 +                view = "_list",
    1.94 +                params = {
    1.95 +                  issue = timeline.issue,
    1.96 +                  initiatives_selector = initiatives_selector,
    1.97 +                  per_page = initiatives_per_page,
    1.98 +                  no_sort = true,
    1.99 +                  limit = initiatives_per_page
   1.100 +                }
   1.101 +              }
   1.102 +            elseif initiative then
   1.103 +              execute.view{
   1.104 +                module = "initiative",
   1.105 +                view = "_list",
   1.106 +                params = {
   1.107 +                  issue = initiative.issue,
   1.108 +                  initiatives_selector = Initiative:new_selector():add_where{ "initiative.id = ?", initiative.id },
   1.109 +                  per_page = initiatives_per_page,
   1.110 +                  no_sort = true
   1.111 +                }
   1.112 +              }
   1.113 +            end
   1.114 +            if timeline.suggestion then
   1.115 +              ui.link{
   1.116 +                module = "suggestion",
   1.117 +                view = "show",
   1.118 +                id = timeline.suggestion.id,
   1.119 +                content = timeline.suggestion.name
   1.120 +              }
   1.121 +            end
   1.122 +          end
   1.123 +        },
   1.124 +      }
   1.125 +    }
   1.126 +  end
   1.127 +}
   1.128 \ No newline at end of file

Impressum / About Us