liquid_feedback_frontend

changeset 34:a851cc1d9903

Beautified report view for closed issues
author bsw
date Wed Feb 24 12:37:28 2010 +0100 (2010-02-24)
parents 1d213e9e3456
children cfc2b9aeca91
files app/main/_layout/report.html app/main/report/area.lua app/main/report/index.lua config/default.lua locale/translations.de.lua locale/translations.en.lua locale/translations.eo.lua static/icons/16/go_up.png static/icons/16/resultset_next_double.png static/icons/16/resultset_previous_double.png
line diff
     1.1 --- a/app/main/_layout/report.html	Tue Feb 23 21:10:56 2010 +0100
     1.2 +++ b/app/main/_layout/report.html	Wed Feb 24 12:37:28 2010 +0100
     1.3 @@ -17,7 +17,7 @@
     1.4          el.style.display = 'block';
     1.5        }
     1.6        function undo() {
     1.7 -        if (lastEls.length > 0) {
     1.8 +        if (lastEls.length > 1) {
     1.9            var el = lastEls.pop();
    1.10            el.style.display='none';
    1.11          };
    1.12 @@ -27,6 +27,7 @@
    1.13        }
    1.14        var prev_issues = {};
    1.15        var prev_initiatives = {};
    1.16 +      var parents = {};
    1.17        var next_initiatives = {};
    1.18        var next_issues = {};
    1.19        function openPrevIssue() {
    1.20 @@ -35,6 +36,9 @@
    1.21        function openPrevInitiative() {
    1.22          openEl(prev_initiatives[lastEls[lastEls.length-1].id]);
    1.23        };
    1.24 +      function openParent() {
    1.25 +        openEl(parents[lastEls[lastEls.length-1].id]);
    1.26 +      };
    1.27        function openNextInitiative() {
    1.28          openEl(next_initiatives[lastEls[lastEls.length-1].id]);
    1.29        };
    1.30 @@ -53,6 +57,24 @@
    1.31          initiative_id_el.value = "";
    1.32        }
    1.33      </script>
    1.34 +    <style>
    1.35 +      .nav {
    1.36 +        font-size: 75%;
    1.37 +      }
    1.38 +      .nav .left {
    1.39 +        float: left;
    1.40 +      }
    1.41 +
    1.42 +      .nav a {
    1.43 +        text-decoration: none;
    1.44 +        margin-left: 0.5em;
    1.45 +        padding: 1ex;
    1.46 +        background-color: #ddd;
    1.47 +      }
    1.48 +      .nav img {
    1.49 +        vertical-align: middle;
    1.50 +      }
    1.51 +    </style>
    1.52    </head>
    1.53    <body>
    1.54      <div class="main" id="default">
     2.1 --- a/app/main/report/area.lua	Tue Feb 23 21:10:56 2010 +0100
     2.2 +++ b/app/main/report/area.lua	Wed Feb 24 12:37:28 2010 +0100
     2.3 @@ -117,6 +117,8 @@
     2.4    end
     2.5  }
     2.6  
     2.7 +ui.script{ script = "parents['area_" .. tostring(area.id) .. "'] = 'areas';" }
     2.8 +
     2.9  local next_issue = issues[1]
    2.10  if next_issue then
    2.11    ui.script{ script = "next_issues['area_" .. tostring(area.id) .. "'] = 'issue_" .. tostring(next_issue.id) .. "';" }
    2.12 @@ -157,6 +159,8 @@
    2.13      ui.script{ script = "next_initiatives['issue_" .. tostring(issue.id) .. "'] = 'initiative_" .. tostring(next_initiative.id) .. "';" }
    2.14    end
    2.15  
    2.16 +  ui.script{ script = "parents['issue_" .. tostring(issue.id) .. "'] = 'area_" .. tostring(area.id) .. "';" }
    2.17 +
    2.18    local next_issue = issues[i+1]
    2.19    if next_issue then
    2.20      ui.script{ script = "next_issues['issue_" .. tostring(issue.id) .. "'] = 'issue_" .. tostring(next_issue.id) .. "';" }
    2.21 @@ -197,6 +201,8 @@
    2.22        ui.script{ script = "prev_initiatives['initiative_" .. tostring(initiative.id) .. "'] = 'initiative_" .. tostring(previous_initiative.id) .. "';" }
    2.23      end
    2.24  
    2.25 +    ui.script{ script = "parents['initiative_" .. tostring(initiative.id) .. "'] = 'issue_" .. tostring(issue.id) .. "';" }
    2.26 +
    2.27      local next_initiative = initiatives[j+1]
    2.28      if next_initiative then
    2.29        ui.script{ script = "next_initiatives['initiative_" .. tostring(initiative.id) .. "'] = 'initiative_" .. tostring(next_initiative.id) .. "';" }
     3.1 --- a/app/main/report/index.lua	Tue Feb 23 21:10:56 2010 +0100
     3.2 +++ b/app/main/report/index.lua	Wed Feb 24 12:37:28 2010 +0100
     3.3 @@ -8,7 +8,6 @@
     3.4      },
     3.5      content = function()
     3.6        ui.heading{
     3.7 -        attr = { style = "background-color: #000; color: #fff;" },
     3.8          content = area.name
     3.9        }
    3.10      end
    3.11 @@ -17,97 +16,136 @@
    3.12  
    3.13  slot.set_layout("report")
    3.14  
    3.15 -ui.form{
    3.16 +slot.put("<br />")
    3.17 +
    3.18 +ui.container{
    3.19    attr = {
    3.20 -    style = " float: right;",
    3.21 -    onsubmit = "openElDirect(); return(false);"
    3.22 +    class = "nav",
    3.23 +    style = "text-align: center;"
    3.24    },
    3.25    content = function()
    3.26 -    slot.put("#")
    3.27 -    ui.tag{
    3.28 -      tag = "input",
    3.29 -      attr = {
    3.30 -        id = "input_issue",
    3.31 -        type = "text",
    3.32 -        style = "width: 4em;"
    3.33 -      }
    3.34 +
    3.35 +
    3.36 +    ui.container{
    3.37 +      attr = { 
    3.38 +        class = "left",
    3.39 +      },
    3.40 +      content = function()
    3.41 +        ui.link{
    3.42 +          external = "",
    3.43 +          attr = {
    3.44 +            onclick = "undo(); return(false);"
    3.45 +          },
    3.46 +          content = function()
    3.47 +            ui.image{ static = "icons/16/cancel.png" }
    3.48 +            slot.put(" ")
    3.49 +            slot.put(_"Back")
    3.50 +          end
    3.51 +        }
    3.52 +      end
    3.53      }
    3.54 -    slot.put(".")
    3.55 -    ui.tag{
    3.56 -      tag = "input",
    3.57 +
    3.58 +    ui.form{
    3.59        attr = {
    3.60 -        id = "input_initiative",
    3.61 -        type = "text",
    3.62 -        style = "width: 4em;"
    3.63 -      }
    3.64 +        style = "float: right;",
    3.65 +        onsubmit = "openElDirect(); return(false);"
    3.66 +      },
    3.67 +      content = function()
    3.68 +        slot.put("#")
    3.69 +        ui.tag{
    3.70 +          tag = "input",
    3.71 +          attr = {
    3.72 +            id = "input_issue",
    3.73 +            type = "text",
    3.74 +            style = "width: 4em;"
    3.75 +          }
    3.76 +        }
    3.77 +        slot.put(".")
    3.78 +        ui.tag{
    3.79 +          tag = "input",
    3.80 +          attr = {
    3.81 +            id = "input_initiative",
    3.82 +            type = "text",
    3.83 +            style = "width: 4em;"
    3.84 +          }
    3.85 +        }
    3.86 +        slot.put(" ")
    3.87 +        ui.tag{
    3.88 +          tag = "input",
    3.89 +          attr = {
    3.90 +            type = "submit",
    3.91 +            value = "OK",
    3.92 +          }
    3.93 +        }
    3.94 +      end
    3.95 +    }
    3.96 +
    3.97 +
    3.98 +    ui.link{
    3.99 +      external = "",
   3.100 +      attr = {
   3.101 +        onclick = "openPrevIssue(); return(false);"
   3.102 +      },
   3.103 +      content = function()
   3.104 +        ui.image{ static = "icons/16/resultset_previous_double.png" }
   3.105 +        slot.put(" ")
   3.106 +        slot.put(_"Previous issue")
   3.107 +      end
   3.108      }
   3.109 -    slot.put(" ")
   3.110 -    ui.tag{
   3.111 -      tag = "input",
   3.112 +
   3.113 +    ui.link{
   3.114 +      external = "",
   3.115 +      attr = {
   3.116 +        onclick = "openPrevInitiative(); return(false);"
   3.117 +      },
   3.118 +      content = function()
   3.119 +        ui.image{ static = "icons/16/resultset_previous.png" }
   3.120 +        slot.put(" ")
   3.121 +        slot.put(_"Previous initiative")
   3.122 +      end
   3.123 +    }
   3.124 +
   3.125 +    ui.link{
   3.126 +      external = "",
   3.127        attr = {
   3.128 -        type = "submit",
   3.129 -        value = "OK",
   3.130 -      }
   3.131 +        onclick = "openParent(); return(false);"
   3.132 +      },
   3.133 +      content = function()
   3.134 +        ui.image{ static = "icons/16/go_up.png" }
   3.135 +        slot.put(" ")
   3.136 +        slot.put(_"Go up")
   3.137 +      end
   3.138 +    }
   3.139 +
   3.140 +    ui.link{
   3.141 +      external = "",
   3.142 +      attr = {
   3.143 +        onclick = "openNextInitiative(); return(false);"
   3.144 +      },
   3.145 +      content = function()
   3.146 +        ui.image{ static = "icons/16/resultset_next.png" }
   3.147 +        slot.put(" ")
   3.148 +        slot.put(_"Next initiative")
   3.149 +      end
   3.150 +    }
   3.151 +
   3.152 +    ui.link{
   3.153 +      external = "",
   3.154 +      attr = {
   3.155 +        onclick = "openNextIssue(); return(false);"
   3.156 +      },
   3.157 +      content = function()
   3.158 +        ui.image{ static = "icons/16/resultset_next_double.png" }
   3.159 +        slot.put(" ")
   3.160 +        slot.put(_"Next issue")
   3.161 +      end
   3.162      }
   3.163    end
   3.164  }
   3.165  
   3.166 -ui.link{
   3.167 -  external = "",
   3.168 -  attr = {
   3.169 -    onclick = "undo(); return(false);"
   3.170 -  },
   3.171 -  text = _"Back"
   3.172 -}
   3.173 -
   3.174 -slot.put(" ")
   3.175 -
   3.176 -ui.link{
   3.177 -  external = "",
   3.178 -  text = _"Areas"
   3.179 -}
   3.180 -
   3.181 -slot.put(" ")
   3.182 -
   3.183 -ui.link{
   3.184 -  external = "",
   3.185 -  attr = {
   3.186 -    onclick = "openPrevIssue(); return(false);"
   3.187 -  },
   3.188 -  text = "<< " .. _"Previous issue"
   3.189 -}
   3.190 -
   3.191 -slot.put(" ")
   3.192 +slot.put("<br />")
   3.193  
   3.194 -ui.link{
   3.195 -  external = "",
   3.196 -  attr = {
   3.197 -    onclick = "openPrevInitiative(); return(false);"
   3.198 -  },
   3.199 -  text = "< " .. _"Previous initiative"
   3.200 -}
   3.201 -
   3.202 -slot.put(" ")
   3.203 -
   3.204 -ui.link{
   3.205 -  external = "",
   3.206 -  attr = {
   3.207 -    onclick = "openNextInitiative(); return(false);"
   3.208 -  },
   3.209 -  text = _"Next initiative" .. " >"
   3.210 -}
   3.211 -
   3.212 -slot.put(" ")
   3.213 -
   3.214 -ui.link{
   3.215 -  external = "",
   3.216 -  attr = {
   3.217 -    onclick = "openNextIssue(); return(false);"
   3.218 -  },
   3.219 -  text = _"Next issue" .. " >>"
   3.220 -}
   3.221 -
   3.222 -local areas = Area:new_selector():exec()
   3.223 +local areas = Area:new_selector():add_order_by("name"):exec()
   3.224  
   3.225  
   3.226  ui.container{
   3.227 @@ -116,7 +154,8 @@
   3.228      for i, area in ipairs(areas) do
   3.229        link_area(area)
   3.230      end
   3.231 -  end
   3.232 +    slot.put("<br /><br />")
   3.233 +    slot.put(_"This report can be saved (use 'save complete website') and used offline.")  end
   3.234  }
   3.235  
   3.236  ui.script{ script = "openEl('areas')" }
   3.237 @@ -127,4 +166,5 @@
   3.238      view = "area",
   3.239      params = { area = area }
   3.240    }
   3.241 -end
   3.242 \ No newline at end of file
   3.243 +end
   3.244 +
     4.1 --- a/config/default.lua	Tue Feb 23 21:10:56 2010 +0100
     4.2 +++ b/config/default.lua	Wed Feb 24 12:37:28 2010 +0100
     4.3 @@ -1,5 +1,5 @@
     4.4  config.app_name = "LiquidFeedback"
     4.5 -config.app_version = "beta12"
     4.6 +config.app_version = "beta12.1"
     4.7  
     4.8  config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)"
     4.9  
     5.1 --- a/locale/translations.de.lua	Tue Feb 23 21:10:56 2010 +0100
     5.2 +++ b/locale/translations.de.lua	Wed Feb 24 12:37:28 2010 +0100
     5.3 @@ -155,6 +155,7 @@
     5.4  ["Fully frozen at"] = "Ganz eingefroren am/um";
     5.5  ["Global delegation"] = "Globale Delegation";
     5.6  ["Global delegation active"] = "Globale Delegation aktiv";
     5.7 +["Go up"] = "Nach oben";
     5.8  ["Half frozen at"] = "Halb eingefroren am/um";
     5.9  ["Hello "] = "Hallo ";
    5.10  ["Help for: #{text}"] = "Hilfe zu: #{text}";
    5.11 @@ -450,6 +451,7 @@
    5.12  ["This name is already taken, please choose another one!"] = "Dieser Name ist bereits vergeben, bitte wähle einen anderen!";
    5.13  ["This name is really too short!"] = "Dieser Name ist wirklich zu kurz!";
    5.14  ["This name is too short!"] = "Dieser Name ist zu kurz!";
    5.15 +["This report can be saved (use 'save complete website') and used offline."] = "Dieser Bericht kann gespeichert (mit 'Webseite komplett speichern') und offline genutzt werden.";
    5.16  ["This suggestion has been meanwhile deleted"] = "Diese Anregung wurde zwischenzeitlich gelöscht";
    5.17  ["This title is really too short!"] = "Dieser Titel ist wirklich zu kurz!";
    5.18  ["This username is too short!"] = "Dieser Benutzername ist zu kurz!";
     6.1 --- a/locale/translations.en.lua	Tue Feb 23 21:10:56 2010 +0100
     6.2 +++ b/locale/translations.en.lua	Wed Feb 24 12:37:28 2010 +0100
     6.3 @@ -155,6 +155,7 @@
     6.4  ["Fully frozen at"] = false;
     6.5  ["Global delegation"] = false;
     6.6  ["Global delegation active"] = false;
     6.7 +["Go up"] = false;
     6.8  ["Half frozen at"] = false;
     6.9  ["Hello "] = false;
    6.10  ["Help for: #{text}"] = false;
    6.11 @@ -450,6 +451,7 @@
    6.12  ["This name is already taken, please choose another one!"] = false;
    6.13  ["This name is really too short!"] = false;
    6.14  ["This name is too short!"] = false;
    6.15 +["This report can be saved (use 'save complete website') and used offline."] = false;
    6.16  ["This suggestion has been meanwhile deleted"] = false;
    6.17  ["This title is really too short!"] = false;
    6.18  ["This username is too short!"] = false;
     7.1 --- a/locale/translations.eo.lua	Tue Feb 23 21:10:56 2010 +0100
     7.2 +++ b/locale/translations.eo.lua	Wed Feb 24 12:37:28 2010 +0100
     7.3 @@ -155,6 +155,7 @@
     7.4  ["Fully frozen at"] = "Tute ĝelita je";
     7.5  ["Global delegation"] = "Ĝenerala delegacio";
     7.6  ["Global delegation active"] = "Ĝenerala delegacio estas aktiva";
     7.7 +["Go up"] = false;
     7.8  ["Half frozen at"] = "Duone ĝelita je";
     7.9  ["Hello "] = "Saluton ";
    7.10  ["Help for: #{text}"] = "Helpo por: #{text}";
    7.11 @@ -450,6 +451,7 @@
    7.12  ["This name is already taken, please choose another one!"] = "Tiu nomo estas jam fordonita, bonvolu elekti alian!";
    7.13  ["This name is really too short!"] = "Tiu nomo estas vere tro mallonga!";
    7.14  ["This name is too short!"] = "Tiu nomo estas tro mallonga!";
    7.15 +["This report can be saved (use 'save complete website') and used offline."] = false;
    7.16  ["This suggestion has been meanwhile deleted"] = "Tiu sugesto estis intertempe forviŝita";
    7.17  ["This title is really too short!"] = "Tiu titolo estas vere tro mallonga!";
    7.18  ["This username is too short!"] = "Tiu salutonomo estas tro mallonga!";
     8.1 Binary file static/icons/16/go_up.png has changed
     9.1 Binary file static/icons/16/resultset_next_double.png has changed
    10.1 Binary file static/icons/16/resultset_previous_double.png has changed

Impressum / About Us