liquid_feedback_frontend

changeset 720:cdd0bcbbef8b

Improved paginators on initiative view, optical improvements
author bsw
date Wed Jun 27 19:28:39 2012 +0200 (2012-06-27)
parents 17a33bd0d48a
children bf666fd13628
files app/main/initiative/show.lua app/main/member/_list.lua app/main/member_image/_show.lua app/main/suggestion/_list.lua app/main/supporter/_show_box.lua static/style.css
line diff
     1.1 --- a/app/main/initiative/show.lua	Wed Jun 27 14:48:35 2012 +0200
     1.2 +++ b/app/main/initiative/show.lua	Wed Jun 27 19:28:39 2012 +0200
     1.3 @@ -348,8 +348,8 @@
     1.4            :add_field("coalesce(vote.grade, 0) as grade")
     1.5            :left_join("initiative", nil, "initiative.id = vote.initiative_id")
     1.6            :left_join("issue", nil, "issue.id = initiative.issue_id")
     1.7 -          
     1.8 -    ui.container{ attr = { class = "heading"}, content = _"Member voting" }
     1.9 +    
    1.10 +    ui.anchor{ name = "voter", attr = { class = "heading" }, content = _"Member voter" }
    1.11      
    1.12      execute.view{
    1.13        module = "member",
    1.14 @@ -357,7 +357,8 @@
    1.15        params = {
    1.16          initiative = initiative,
    1.17          for_votes = true,
    1.18 -        members_selector = members_selector
    1.19 +        members_selector = members_selector,
    1.20 +        paginator_name = "voter"
    1.21        }
    1.22      }
    1.23    end
    1.24 @@ -370,29 +371,27 @@
    1.25              :add_where("direct_supporter_snapshot.satisfied")
    1.26              :add_field("direct_supporter_snapshot.informed", "is_informed")
    1.27  
    1.28 -
    1.29 -
    1.30    if members_selector:count() > 0 then
    1.31      if issue.fully_frozen then
    1.32 -      ui.container{ attr = { class = "heading"}, content = _"Supporters (before begin of voting)" }
    1.33 +      ui.anchor{ name = "supporters", attr = { class = "heading" }, content = _"Supporters (before begin of voting)" }
    1.34      else
    1.35 -      ui.container{ attr = { class = "heading"}, content = _"Supporters" }
    1.36 +      ui.anchor{ name = "supporters", attr = { class = "heading" }, content = _"Supporters" }
    1.37      end      
    1.38      
    1.39      execute.view{
    1.40        module = "member",
    1.41        view = "_list",
    1.42        params = {
    1.43 -        
    1.44          initiative = initiative,
    1.45 -        members_selector = members_selector
    1.46 +        members_selector = members_selector,
    1.47 +        paginator_name = "supporters"
    1.48        }
    1.49    }
    1.50    else
    1.51      if issue.fully_frozen then
    1.52 -      ui.container{ attr = { class = "heading"}, content = _"No supporters (before begin of voting)" }
    1.53 +      ui.anchor{ name = "supporters", attr = { class = "heading" }, content = _"No supporters (before begin of voting)" }
    1.54      else
    1.55 -      ui.container{ attr = { class = "heading"}, content = _"No supporters" }
    1.56 +      ui.anchor{ name = "supporters", attr = { class = "heading" }, content = _"No supporters" }
    1.57      end
    1.58      slot.put("<br />")
    1.59    end
    1.60 @@ -405,33 +404,32 @@
    1.61              :add_where("NOT direct_supporter_snapshot.satisfied")
    1.62              :add_field("direct_supporter_snapshot.informed", "is_informed")
    1.63  
    1.64 -
    1.65    if members_selector:count() > 0 then
    1.66      if issue.fully_frozen then
    1.67 -      ui.container{ attr = { class = "heading"}, content = _"Potential supporters (before begin of voting" }
    1.68 +      ui.anchor{ name = "potential_supporters", attr = { class = "heading" }, content = _"Potential supporters (before begin of voting)" }
    1.69      else
    1.70 -      ui.container{ attr = { class = "heading"}, content = _"Potential supporters" }
    1.71 +      ui.anchor{ name = "potential_supporters", attr = { class = "heading" }, content = _"Potential supporters" }
    1.72      end
    1.73                
    1.74      execute.view{
    1.75        module = "member",
    1.76        view = "_list",
    1.77        params = {
    1.78 -        
    1.79          initiative = initiative,
    1.80 -        members_selector = members_selector
    1.81 +        members_selector = members_selector,
    1.82 +        paginator_name = "potential_supporters"
    1.83        }
    1.84      }
    1.85    else
    1.86      if issue.fully_frozen then
    1.87 -      ui.container{ attr = { class = "heading"}, content = _"No potential supporters (before begin of voting)" }
    1.88 +      ui.anchor{ name = "potential_supporters", attr = { class = "heading" }, content = _"No potential supporters (before begin of voting)" }
    1.89      else
    1.90 -      ui.container{ attr = { class = "heading"}, content = _"No potential supporters" }
    1.91 +      ui.anchor{ name = "potential_supporters", attr = { class = "heading" }, content = _"No potential supporters" }
    1.92      end
    1.93      slot.put("<br />")
    1.94    end
    1.95    
    1.96 -  ui.container{ attr = { class = "heading"}, content = _"Details" }
    1.97 +  ui.container{ attr = { class = "heading" }, content = _"Details" }
    1.98    execute.view {
    1.99      module = "initiative",
   1.100      view = "_details",
   1.101 @@ -442,22 +440,3 @@
   1.102    }
   1.103  
   1.104  end
   1.105 -
   1.106 -
   1.107 ---[[
   1.108 -execute.view{
   1.109 -  module = "initiative",
   1.110 -  view = "show_tab",
   1.111 -  params = {
   1.112 -    initiative = initiative,
   1.113 -    initiator = initiator
   1.114 -  }
   1.115 -}
   1.116 -
   1.117 -if initiative.issue.snapshot then
   1.118 -  slot.put("<br />")
   1.119 -  ui.field.timestamp{ label = _"Last snapshot:", value = initiative.issue.snapshot }
   1.120 -end
   1.121 -
   1.122 -
   1.123 ---]]
     2.1 --- a/app/main/member/_list.lua	Wed Jun 27 14:48:35 2012 +0200
     2.2 +++ b/app/main/member/_list.lua	Wed Jun 27 19:28:39 2012 +0200
     2.3 @@ -7,6 +7,8 @@
     2.4  local initiator = param.get("initiator", "table")
     2.5  local for_votes = param.get("for_votes", atom.boolean)
     2.6  
     2.7 +local paginator_name = param.get("paginator_name")
     2.8 +
     2.9  if initiative or issue then
    2.10    if for_votes then
    2.11      members_selector:left_join("delegating_voter", "_member_list__delegating_voter", { "_member_list__delegating_voter.issue_id = issue.id AND _member_list__delegating_voter.member_id = ?", app.session.member_id })
    2.12 @@ -62,8 +64,10 @@
    2.13    filter,
    2.14    content = function()
    2.15      ui.paginate{
    2.16 +      name = paginator_name,
    2.17 +      anchor = paginator_name,
    2.18        selector = members_selector,
    2.19 -      per_page = 100,
    2.20 +      per_page = 50,
    2.21        content = function() 
    2.22          ui.container{
    2.23            attr = { class = "member_list" },
     3.1 --- a/app/main/member_image/_show.lua	Wed Jun 27 14:48:35 2012 +0200
     3.2 +++ b/app/main/member_image/_show.lua	Wed Jun 27 19:28:39 2012 +0200
     3.3 @@ -2,7 +2,6 @@
     3.4  local member_id = member and member.id or param.get("member_id", atom.integer)
     3.5  
     3.6  local image_type = param.get("image_type")
     3.7 -local show_dummy = param.get("show_dummy", atom.boolean)
     3.8  local class = param.get("class")
     3.9  local popup_text = param.get("popup_text")
    3.10  
    3.11 @@ -12,38 +11,21 @@
    3.12    class = ""
    3.13  end
    3.14  
    3.15 ---[[
    3.16 -local image = member:get_reference_selector("images")
    3.17 -  :add_where{ "image_type = ?", image_type }
    3.18 -  :optional_object_mode()
    3.19 -  :exec()
    3.20  
    3.21 -if image or show_dummy then
    3.22 -  if config.fastpath_url_func then
    3.23 -    ui.image{
    3.24 -      attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
    3.25 -      external = config.fastpath_url_func(member.id, image_type)
    3.26 +if config.fastpath_url_func then
    3.27 +  ui.image{
    3.28 +    attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
    3.29 +    external = config.fastpath_url_func(member.id, image_type)
    3.30 +  }
    3.31 +else
    3.32 +  ui.image{
    3.33 +    attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
    3.34 +    module = "member_image",
    3.35 +    view = "show",
    3.36 +    extension = "jpg",
    3.37 +    id = member_id,
    3.38 +    params = {
    3.39 +      image_type = image_type
    3.40      }
    3.41 -  else
    3.42 -    if not image then
    3.43 -      ui.image{
    3.44 -        attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
    3.45 -        external = encode.url{ static = (config.member_image_default_file[image_type] or 'icons/16/lightning.png')},
    3.46 -      }
    3.47 -    else
    3.48 ---]]
    3.49 -      ui.image{
    3.50 -        attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
    3.51 -        module = "member_image",
    3.52 -        view = "show",
    3.53 -        extension = "jpg",
    3.54 -        id = member_id,
    3.55 -        params = {
    3.56 -          image_type = image_type
    3.57 -        }
    3.58 -      }
    3.59 -    --[[
    3.60 -    end
    3.61 -  end
    3.62 +  }
    3.63  end
    3.64 ---]]
    3.65 \ No newline at end of file
     4.1 --- a/app/main/suggestion/_list.lua	Wed Jun 27 14:48:35 2012 +0200
     4.2 +++ b/app/main/suggestion/_list.lua	Wed Jun 27 19:28:39 2012 +0200
     4.3 @@ -86,7 +86,12 @@
     4.4          end
     4.5        }
     4.6      end }
     4.7 -    if not initiative.issue.fully_frozen and not initiative.issue.closed then
     4.8 +    if app.session.member_id
     4.9 +      and not initiative.issue.half_frozen
    4.10 +      and not initiative.issue.closed
    4.11 +      and not initiative.revoked
    4.12 +      and app.session.member:has_voting_right_for_unit_id(initiative.issue.area.unit_id)
    4.13 +    then
    4.14        ui.container{ attr = { class = "content" }, content = function()
    4.15          ui.link{
    4.16            module = "suggestion", view = "new", params = { initiative_id = initiative.id },
     5.1 --- a/app/main/supporter/_show_box.lua	Wed Jun 27 14:48:35 2012 +0200
     5.2 +++ b/app/main/supporter/_show_box.lua	Wed Jun 27 19:28:39 2012 +0200
     5.3 @@ -77,25 +77,6 @@
     5.4    end
     5.5  end
     5.6  
     5.7 -if app.session.member_id
     5.8 -  and not initiative.issue.half_frozen
     5.9 -  and not initiative.issue.closed
    5.10 -  and not initiative.revoked
    5.11 -  and app.session.member:has_voting_right_for_unit_id(initiative.issue.area.unit_id)
    5.12 -then
    5.13 -  ui.link{
    5.14 -    content = function()
    5.15 -      slot.put(_"Add suggestion")
    5.16 -    end,
    5.17 -    module = "suggestion",
    5.18 -    view = "new",
    5.19 -    params = {
    5.20 -      initiative_id = initiative.id
    5.21 -    }
    5.22 -  }
    5.23 -  slot.put(" ")
    5.24 -end
    5.25 -
    5.26  if (initiative.discussion_url and #initiative.discussion_url > 0) then
    5.27    if initiative.discussion_url:find("^https?://") then
    5.28      if initiative.discussion_url and #initiative.discussion_url > 0 then
     6.1 --- a/static/style.css	Wed Jun 27 14:48:35 2012 +0200
     6.2 +++ b/static/style.css	Wed Jun 27 19:28:39 2012 +0200
     6.3 @@ -370,7 +370,7 @@
     6.4  }
     6.5  
     6.6  .initiative_head {
     6.7 -  margin-bottom: 10px;
     6.8 +  margin-bottom: 2ex;
     6.9  }
    6.10  
    6.11  .page_head .actions:last-child,
    6.12 @@ -634,6 +634,11 @@
    6.13  
    6.14  .ui_paginate_foot {
    6.15    margin-top: 1ex;
    6.16 +  margin-bottom: 4ex;
    6.17 +}
    6.18 +
    6.19 +.initiative_head .ui_paginate_foot {
    6.20 +  margin-bottom: 1ex;
    6.21  }
    6.22  
    6.23  .ui_paginate_select a {
    6.24 @@ -1339,6 +1344,7 @@
    6.25    font-size: 115%;
    6.26    font-weight: bold;
    6.27    margin-bottom: 10px;
    6.28 +  text-decoration: none;
    6.29  }
    6.30  
    6.31  .heading.first {

Impressum / About Us