liquid_feedback_frontend

changeset 213:acf92c2d33f4

Seperated css and fixed issue delegations for second generation frontend
author bsw
date Thu Mar 03 21:26:35 2011 +0100 (2011-03-03)
parents 3e4ad069847a
children 7e3acb2f6284
files app/main/_layout/lf2.html app/main/lf2/_issues.lua app/main/lf2/_sidebar_issue.lua app/main/lf2/delegation.lua app/main/lf2/initiative.lua static/lf2.css
line diff
     1.1 --- a/app/main/_layout/lf2.html	Thu Mar 03 18:39:00 2011 +0100
     1.2 +++ b/app/main/_layout/lf2.html	Thu Mar 03 21:26:35 2011 +0100
     1.3 @@ -1,574 +1,32 @@
     1.4 -<!-- <html> -->
     1.5 -<head> 
     1.6 -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     1.7 -<style>
     1.8 -
     1.9 -/* CSS reset */
    1.10 -
    1.11 -html, body, div, span, applet, object, iframe,
    1.12 -h1, h2, h3, h4, h5, h6, p, blockquote, pre,
    1.13 -a, abbr, acronym, address, big, cite, code,
    1.14 -del, dfn, em, font, img, ins, kbd, q, s, samp,
    1.15 -small, strike, strong, sub, sup, tt, var,
    1.16 -dl, dt, dd, ol, ul, li,
    1.17 -fieldset, form, label, legend,
    1.18 -table, caption, tbody, tfoot, thead, tr, th, td {
    1.19 -    margin: 0;
    1.20 -    padding: 0;
    1.21 -    border: 0;
    1.22 -    outline: 0;
    1.23 -    font-weight: inherit;
    1.24 -    font-style: inherit;
    1.25 -    font-size: 100%;
    1.26 -    font-family: inherit;
    1.27 -    vertical-align: baseline;
    1.28 -}
    1.29 -/* remember to define focus styles! */
    1.30 -:focus {
    1.31 -    outline: 0;
    1.32 -}
    1.33 -body {
    1.34 -    line-height: 1;
    1.35 -    color: black;
    1.36 -    background: white;
    1.37 -}
    1.38 -ol, ul {
    1.39 -    list-style: none;
    1.40 -}
    1.41 -/* tables still need 'cellspacing="0"' in the markup */
    1.42 -table {
    1.43 -    border-collapse: separate;
    1.44 -    border-spacing: 0;
    1.45 -}
    1.46 -caption, th, td {
    1.47 -    text-align: left;
    1.48 -    font-weight: normal;
    1.49 -}
    1.50 -blockquote:before, blockquote:after,
    1.51 -q:before, q:after {
    1.52 -    content: "";
    1.53 -}
    1.54 -blockquote, q {
    1.55 -    quotes: "" "";
    1.56 -}
    1.57 -
    1.58 -/* end CSS reset */
    1.59 -
    1.60 -
    1.61 -/*
    1.62 -    Global settings
    1.63 -*/
    1.64 -body {
    1.65 -  font-family: sans-serif;
    1.66 -  background-color: #7df;
    1.67 -  color: #000;
    1.68 -}
    1.69 +<html><head> 
    1.70  
    1.71 -a {
    1.72 -  background-color: #ffffff;
    1.73 -  color: #000;
    1.74 -}
    1.75 -
    1.76 -/*
    1.77 -    Main top navigation
    1.78 -*/
    1.79 -
    1.80 -.tab1 {
    1.81 -  background-color: #444;
    1.82 -  color: #000;
    1.83 -}
    1.84 -
    1.85 -.tab1 .right {
    1.86 -  float: right;
    1.87 -}
    1.88 -
    1.89 -.tab1 a {
    1.90 -  float: left;
    1.91 -  padding: 0.5ex 0.5em 0.5ex 0.5em;
    1.92 -  margin-left: 0.5em;
    1.93 -  background-color: #444;
    1.94 -  color: #fff;
    1.95 -  font-weight: bold;
    1.96 -  text-decoration: none;
    1.97 -}
    1.98 -
    1.99 -.tab1 .right a {
   1.100 -  margin-left: 0;
   1.101 -  margin-right: 0.5em;
   1.102 -}
   1.103 -
   1.104 -.tab1 a.active {
   1.105 -  background-color: #7df;
   1.106 -  color: #000;
   1.107 -}
   1.108 -
   1.109 -/*
   1.110 -    Default slot
   1.111 -*/
   1.112 -
   1.113 -.slot_default {
   1.114 -  margin: 2ex 1% 2ex 32%;
   1.115 -  position: relative;
   1.116 -  width: 67%;
   1.117 -}
   1.118 -
   1.119 -/*
   1.120 -    Sidebar
   1.121 -*/
   1.122 -
   1.123 -.slot_sidebar {
   1.124 -  margin: 2ex 1% 2ex 1%;
   1.125 -  float: left;
   1.126 -  width: 30%;
   1.127 -}
   1.128 -
   1.129 -.slot_sidebar .box {
   1.130 -  width: 100%;
   1.131 -}
   1.132 -
   1.133 -
   1.134 -/*
   1.135 -    Boxes
   1.136 -*/
   1.137 -
   1.138 -.box a {
   1.139 -  text-decoration: none;
   1.140 -  color: #46a;
   1.141 -}
   1.142 +  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   1.143 +  <link rel="stylesheet" type="text/css" media="screen" href="__BASEURL__/static/lf2.css" />
   1.144 +  <title>LiquidFeedback</title>
   1.145  
   1.146 -.boxhead,
   1.147 -a.boxhead {
   1.148 -  /* position */
   1.149 -  display: block;
   1.150 -  margin-bottom: 0.5ex;
   1.151 -  margin-top: 1ex;
   1.152 -  margin-left: 0.5em;
   1.153 -
   1.154 -  /* color */
   1.155 -  background-color: #7df;
   1.156 -  color: #000;
   1.157 -
   1.158 -  /* text format */
   1.159 -  font-weight: bold;
   1.160 -  text-shadow: 2px 2px 2px #fff;
   1.161 -}
   1.162 -
   1.163 -.box {
   1.164 -  /* position */
   1.165 -  position: relative;
   1.166 -  width: 100%;
   1.167 -  margin-bottom: 2ex;
   1.168 -
   1.169 -  /* border and shadow*/
   1.170 -  border-radius: 1ex;
   1.171 -  -moz-border-radius: 1ex;
   1.172 -  -webkit-box-shadow: 2px 2px 3px 0px #444;
   1.173 -  -moz-box-shadow: 2px 2px 3px 0px #444;
   1.174 -
   1.175 -  /* color */
   1.176 -  background-color: #fff;
   1.177 -  color: #000;
   1.178 -
   1.179 -}
   1.180 -
   1.181 -.box .row {
   1.182 -  overflow: auto;
   1.183 -  /* position */
   1.184 -
   1.185 -  /* border */
   1.186 -  border-top: 1px solid #ccc;
   1.187 -}
   1.188 -
   1.189 -.box .row .col {
   1.190 -  /* position */
   1.191 -  padding: 0.5ex 0.2em 0.5ex 0.2em;
   1.192 -
   1.193 -  /* text format */
   1.194 -  line-height: 125%;
   1.195 -}
   1.196 -
   1.197 -.box .row .col.left {
   1.198 -  float: left;
   1.199 -}
   1.200 -
   1.201 -.box .row .col.right {
   1.202 -  float: right;
   1.203 -}
   1.204 -
   1.205 -.box .row .col.clearleft {
   1.206 -  clear: left;
   1.207 -}
   1.208 -
   1.209 -.box .row .col.clearright {
   1.210 -  clear: right;
   1.211 -}
   1.212 -
   1.213 -.box .row .col.toggle {
   1.214 -  float: left;
   1.215 -  /* position */
   1.216 -  padding-left: 0.4em;
   1.217 -}
   1.218 +</head><body>
   1.219  
   1.220 -.box .row .col.toggle:hover {
   1.221 -  /* color */
   1.222 -  background-color: #7cf;
   1.223 -
   1.224 -  /* cursor */
   1.225 -  cursor: pointer;
   1.226 -}
   1.227 -
   1.228 -.box .row.first .col.toggle {
   1.229 -  /* border */
   1.230 -  border-radius: 1ex 0 0 0;
   1.231 -}
   1.232 -
   1.233 -.box .row.last .col.toggle {
   1.234 -  /* border */
   1.235 -  border-radius: 0 0 0 1ex;
   1.236 -}
   1.237 -
   1.238 -.box .row.toggled .col.first {
   1.239 -  /* position */
   1.240 -  margin-left: 1.5em;
   1.241 -}
   1.242 -
   1.243 -.box .row.first {
   1.244 -  /* border */
   1.245 -  border-top: none;
   1.246 -}
   1.247 -
   1.248 -.box .row .col.first {
   1.249 -  /* position */
   1.250 -  padding-left: 0.5em;
   1.251 -}
   1.252 -
   1.253 -.box .row.toggled .col.first {
   1.254 -  /* position */
   1.255 -  padding-left: 0.2em;
   1.256 -}
   1.257 -
   1.258 -.box .row.head {
   1.259 -  background-color: #e4e7f0;
   1.260 -  color: #000;
   1.261 -  border-radius: 1ex 1ex 0 0;
   1.262 -}
   1.263 -
   1.264 -.box .row.last {
   1.265 -  border-radius: 0 0 1ex 1ex;
   1.266 -}
   1.267 -
   1.268 -.box .row.head .col.head {
   1.269 -  font-weight: bold;
   1.270 -  color: #444;
   1.271 -}
   1.272 -
   1.273 -.box .row.head .col a {
   1.274 -  background-color: #e4e7f0;
   1.275 -  color: #3B6E7F;
   1.276 -}
   1.277 -
   1.278 -.box .row.head2 {
   1.279 -  background-color: #f2f3f7;
   1.280 -  color: #000;
   1.281 -}
   1.282 -
   1.283 -.box .row.head2 .col a {
   1.284 -  background-color: #f2f3f7;
   1.285 -  color: #3B6E7F;
   1.286 -}
   1.287 -
   1.288 -
   1.289 -.box .row .col a {
   1.290 -  color: #3B6E7F;
   1.291 -}
   1.292 +  <div class="tab1">
   1.293 +    <!-- WEBMCP SLOT topnav -->
   1.294 +    <br style="clear: both;" />
   1.295 +  </div>
   1.296  
   1.297 -.box .row.active,
   1.298 -.box .row.active a {
   1.299 -  background-color: #DDF7FF;
   1.300 -}
   1.301 -
   1.302 -/* Sidebar hover button */
   1.303 -
   1.304 -.hoverbutton_container {
   1.305 -  position: relative;
   1.306 -}
   1.307 -
   1.308 -
   1.309 -.hoverbutton {
   1.310 -  /* position */
   1.311 -  display: none;
   1.312 -  position: absolute;
   1.313 -  top: 0px;
   1.314 -  left: 0px;
   1.315 -  height: 100%;
   1.316 -  width: 100%;
   1.317 -
   1.318 -  /* color */
   1.319 -  background-color: #fff;
   1.320 -
   1.321 -  /* text format */
   1.322 -  font-weight: bold;
   1.323 -
   1.324 -  /* cursor */
   1.325 -  cursor: pointer;
   1.326 -}
   1.327 -
   1.328 -.hoverbutton_container:hover .hoverbutton {
   1.329 -  /* position */
   1.330 -  display: block;
   1.331 -}
   1.332 -
   1.333 -.hoverbutton_container:hover .hoverbutton img {
   1.334 -  /* text format */
   1.335 -  vertical-align: middle;
   1.336 -}
   1.337 -
   1.338 -.hoverbutton_container:hover .hoverbutton.noaction {
   1.339 -  /* color */
   1.340 -  background-color: #ccc;
   1.341 -
   1.342 -  /* cursor */
   1.343 -  cursor: default;
   1.344 -}
   1.345 -
   1.346 -.hoverbutton_container:hover .hoverbutton.green {
   1.347 -  background-color: #cfc;
   1.348 -}
   1.349 -
   1.350 -.hoverbutton_container:hover .hoverbutton.red {
   1.351 -  background-color: #fcc;
   1.352 -}
   1.353 -
   1.354 -.hoverbutton .content {
   1.355 -  /* position */
   1.356 -  padding: 0.5ex 0.2em 0.5ex 0.5em;
   1.357 -}
   1.358 -
   1.359 -/* Scrolled col */
   1.360 -
   1.361 -.box .row .col.scrolled {
   1.362 -  padding: 0;
   1.363 -  max-height: 300px;
   1.364 -  overflow: auto;
   1.365 -}
   1.366 -
   1.367 -.box .row .col.scrolled .head {
   1.368 -  font-weight: bold;
   1.369 -  padding: 0.5ex 0.2em 0.5ex 0.5em;
   1.370 -}
   1.371 -
   1.372 -/*
   1.373 -  Bars
   1.374 -*/
   1.375 -
   1.376 -.bar {
   1.377 -  float: right;
   1.378 -  margin-left: 0.3em;
   1.379 -}
   1.380 -
   1.381 -.bar div {
   1.382 -  margin-top: 2px;
   1.383 -  float: left;
   1.384 -  height: 11px;
   1.385 -}
   1.386 -.bar .green {
   1.387 -  background-color: #0a0;
   1.388 -}
   1.389 -
   1.390 -.bar .grey {
   1.391 -  background-color: #eee;
   1.392 -}
   1.393 -
   1.394 -/*
   1.395 -    Avatars
   1.396 -*/
   1.397 -
   1.398 -.avatars {
   1.399 -  overflow: auto;
   1.400 -}
   1.401 -
   1.402 -.avatars .avatar {
   1.403 -  float: left;
   1.404 -  margin-left: 2px;
   1.405 -  margin-right: 2px;
   1.406 -}
   1.407 -
   1.408 -.avatars.normal .avatar {
   1.409 -  width: 100px;
   1.410 -  -webkit-box-shadow: 1px 1px 1px #000;
   1.411 -  background-color: #eee;
   1.412 -  border-radius: 1ex;
   1.413 -  -moz-border-radius: 1ex;
   1.414 -}
   1.415 -
   1.416 -.avatars.small .avatar {
   1.417 -  border: 2px solid #fff;
   1.418 -  border-radius: 0.5ex;
   1.419 -  -moz-border-radius: 0.5ex;
   1.420 -}
   1.421 -
   1.422 -.avatars .arrow {
   1.423 -  float: left;
   1.424 -  margin-top: 0.3ex;
   1.425 -}
   1.426 -
   1.427 -.avatars .avatar.myweight {
   1.428 -  border-color: #f70;
   1.429 -  background-color: #f70;
   1.430 -}
   1.431 -
   1.432 -.avatars .avatar.autoreject {
   1.433 -  border-color: #f00;
   1.434 -  background-color: #f00;
   1.435 -}
   1.436 +  <!-- WEBMCP SLOTNODIV leftright_pre -->
   1.437 +    <!-- WEBMCP SLOT sidebar -->
   1.438 +    <!-- WEBMCP SLOT default -->
   1.439 +  <!-- WEBMCP SLOTNODIV leftright_post -->
   1.440  
   1.441 -.avatars.small .avatar img {
   1.442 -  border-radius: 0.25ex;
   1.443 -  -moz-border-radius: 0.25ex;
   1.444 -}
   1.445 -
   1.446 -.avatars.normal .avatar img {
   1.447 -  margin-left: 0.3em;
   1.448 -  margin-top: 0.3ex;
   1.449 -  border-radius: 1ex;
   1.450 -  -moz-border-radius: 1ex;
   1.451 -}
   1.452 -
   1.453 -.avatars.small .avatar img {
   1.454 -  height: 24px;
   1.455 -  width: 24px;
   1.456 -}
   1.457 -
   1.458 -.avatars.normal .avatar img {
   1.459 -  height: 48px;
   1.460 -  width: 48px;
   1.461 -}
   1.462 -
   1.463 -.avatars.normal .avatar .name {
   1.464 -  margin-left: 0.3em;
   1.465 -  margin-top: 0.3ex;
   1.466 -  line-height: 100%;
   1.467 -  font-size: 70%;
   1.468 -  overflow: hidden;
   1.469 -  height: 4ex;
   1.470 -}
   1.471 -
   1.472 -.avatars .avatar .weight {
   1.473 -  text-align: center;
   1.474 -  font-size: 70%;
   1.475 -}
   1.476 -
   1.477 -.avatars.small .avatar.participation {
   1.478 -  border-color: #f70;
   1.479 -}
   1.480 -
   1.481 -.avatars.small .avatar.overridden,
   1.482 -.avatars.small .arrow.overridden {
   1.483 -  opacity: 0.3;
   1.484 -}
   1.485 -
   1.486 -/*
   1.487 -  Area
   1.488 -*/
   1.489 -
   1.490 -.area .name {
   1.491 -  color: #444;
   1.492 -}
   1.493 -
   1.494 -.area .name a {
   1.495 -  font-weight: normal;
   1.496 -}
   1.497 -
   1.498 -.area .name .avatars {
   1.499 -  float: right;
   1.500 -  margin-top: -3px;
   1.501 -}
   1.502 -
   1.503 -/* Initiatives */
   1.504 -
   1.505 -.initiative .name,
   1.506 -.initiative a.name {
   1.507 -  font-weight: bold;
   1.508 -}
   1.509 -
   1.510 -.initiative .authors {
   1.511 -  /* color */
   1.512 -  color: #777;
   1.513 -
   1.514 -  /* text format */
   1.515 -  font-size: 80%;
   1.516 -  font-style: italic;
   1.517 -}
   1.518 -
   1.519 -.initiative .authors a {
   1.520 -  /* color */
   1.521 -}
   1.522 -
   1.523 -.drafts .draft .created {
   1.524 -  font-weight: bold;
   1.525 -}
   1.526 -
   1.527 -.drafts .draft .author_name {
   1.528 -  font-style: italic;
   1.529 -}
   1.530 -
   1.531 -/* Draft */
   1.532 -
   1.533 -.draft {
   1.534 -  line-height: 135%;
   1.535 -}
   1.536 -
   1.537 -.draft h2 {
   1.538 -  font-size: 135%;
   1.539 -  font-weight: bold;
   1.540 -  margin-bottom: 0.5ex;
   1.541 -}
   1.542 -
   1.543 -.draft h3 {
   1.544 -  font-size: 135%;
   1.545 -  margin-bottom: 0.5ex;
   1.546 -}
   1.547 -
   1.548 -.draft p {
   1.549 -  margin-bottom: 1ex;
   1.550 -}
   1.551 -
   1.552 -.draft ul {
   1.553 -  padding-left: 2em;
   1.554 -  list-style: disc;
   1.555 -}
   1.556 -
   1.557 -.draft ul li {
   1.558 -  margin-bottom: 1ex;
   1.559 -}
   1.560 -
   1.561 -xdiv { border: 1px dotted #c00 !important; }
   1.562 -
   1.563 -
   1.564 -</style>
   1.565 -</head>
   1.566 -</body>
   1.567 -<div class="tab1">
   1.568 -  <!-- WEBMCP SLOT topnav -->
   1.569 -<br style="clear: both;" />
   1.570 -</div>
   1.571 -
   1.572 -<!-- WEBMCP SLOT sidebar -->
   1.573 -<!-- WEBMCP SLOT default -->
   1.574 -
   1.575 -
   1.576 -    <div class="layout_trace" id="layout_trace" style="xdisplay: none">
   1.577 -      <div id="trace_show" onclick="document.getElementById('trace_content').style.display='block';this.style.display='none';">TRACE</div>
   1.578 -        <div id="trace_content" style="display: none;">
   1.579 -            <tt id="system_error"><!-- WEBMCP SLOT system_error --></tt>
   1.580 -            <div id="trace">&nbsp;</div><hr />
   1.581 -            <!-- WEBMCP SLOT trace -->
   1.582 -          <div class="trace_close" onclick="document.getElementById('trace_show').style.display='block';document.getElementById('trace_content').style.display='none';">
   1.583 -            close
   1.584 -          </div>
   1.585 +  <div class="layout_trace" id="layout_trace" style="xdisplay: none">
   1.586 +    <div id="trace_show" onclick="document.getElementById('trace_content').style.display='block';this.style.display='none';">TRACE</div>
   1.587 +      <div id="trace_content" style="display: none;">
   1.588 +          <tt id="system_error"><!-- WEBMCP SLOT system_error --></tt>
   1.589 +          <div id="trace">&nbsp;</div><hr />
   1.590 +          <!-- WEBMCP SLOT trace -->
   1.591 +        <div class="trace_close" onclick="document.getElementById('trace_show').style.display='block';document.getElementById('trace_content').style.display='none';">
   1.592 +          close
   1.593          </div>
   1.594        </div>
   1.595      </div>
   1.596 +  </div>
   1.597  
   1.598 -</body>
   1.599 -</html>
   1.600 +</body></html>
     2.1 --- a/app/main/lf2/_issues.lua	Thu Mar 03 18:39:00 2011 +0100
     2.2 +++ b/app/main/lf2/_issues.lua	Thu Mar 03 21:26:35 2011 +0100
     2.3 @@ -85,7 +85,7 @@
     2.4        ui.box_col{ class = "interest left", content = function()
     2.5          if interest then
     2.6            ui.image{ static = "lf2/icon_star.png" }
     2.7 -          if issue.closed then
     2.8 +          if issue.close then
     2.9              slot.put(" ", _"You were interested in this issue")
    2.10            else
    2.11              slot.put(" ", _"You are interested in this issue")
     3.1 --- a/app/main/lf2/_sidebar_issue.lua	Thu Mar 03 18:39:00 2011 +0100
     3.2 +++ b/app/main/lf2/_sidebar_issue.lua	Thu Mar 03 21:26:35 2011 +0100
     3.3 @@ -1,4 +1,5 @@
     3.4  local issue = param.get("issue", "table")
     3.5 +local initiative_id = param.get("initiative_id", atom.integer)
     3.6  
     3.7  local initiatives = issue.initiatives
     3.8  
     3.9 @@ -10,27 +11,12 @@
    3.10  
    3.11  local interest = issue.interest
    3.12  
    3.13 -local delegations = issue.delegations
    3.14 -
    3.15  local trustees = Member:new_selector()
    3.16    :add_field("delegation_chain.*")
    3.17    :join("delegation_chain(" .. tostring(app.session.member.id) .. ", NULL, " .. tostring(issue.id or "NULL") .. ")", "delegation_chain", "member.id = delegation_chain.member_id")
    3.18    :add_order_by("index")
    3.19    :exec()
    3.20  
    3.21 -local global_delegation
    3.22 -local area_delegation
    3.23 -local issue_delegation
    3.24 -
    3.25 -for i, delegation in ipairs(issue.delegations) do
    3.26 -  if delegation.scope == "global" then global_delegation = delegation
    3.27 -  elseif delegation.scope == "area" then area_delegation = delegation
    3.28 -  elseif delegation.scope == "issue" then issue_delegation = delegation
    3.29 -  end
    3.30 -end
    3.31 -
    3.32 -local delegation = issue_delegation or area_delegation or global_delegation
    3.33 -
    3.34  local delegating_interest = issue.delegating_interest
    3.35  
    3.36  ui.box{ class = "issue", content = function()
    3.37 @@ -42,21 +28,21 @@
    3.38      }
    3.39    end } end }
    3.40  
    3.41 -  ui.box_row{ class = "unit_name", content = function() ui.box_col{ content = function()
    3.42 +  ui.box_row{ class = "unit_name head2", content = function() ui.box_col{ content = function()
    3.43      ui.link{ 
    3.44        module = "lf2", view = "unit", id = 1,
    3.45        content = "DE / Berlin / Friedrichshain-Kreuzberg" 
    3.46      }
    3.47    end } end }
    3.48  
    3.49 -  ui.box_row{ class = "area_name", content = function() ui.box_col{ content = function()
    3.50 +  ui.box_row{ class = "area_name head2", content = function() ui.box_col{ content = function()
    3.51      ui.link{
    3.52        module = "lf2", view = "area", id = issue.area_id,
    3.53        content = issue.area.name
    3.54      }
    3.55    end } end }
    3.56    
    3.57 -  ui.box_row{ class = "policy_name", content = function() ui.box_col{ content = function()
    3.58 +  ui.box_row{ class = "policy_name head2", content = function() ui.box_col{ content = function()
    3.59      ui.link{
    3.60        module = "lf2", view = "policy", id = issue.policy_id,
    3.61        content = issue.policy.name
    3.62 @@ -76,7 +62,9 @@
    3.63          slot.put(" ", _"You are interested in this issue")
    3.64        end
    3.65      else
    3.66 -      ui.image{ static = "lf2/icon_star_grey.png" }
    3.67 +      if not issue.closed and not issue.fully_frozen then
    3.68 +        ui.image{ static = "lf2/icon_star_grey.png" }
    3.69 +      end
    3.70        slot.put(_"You are not interested in this issue")
    3.71      end
    3.72      
    3.73 @@ -97,7 +85,7 @@
    3.74          ui.link{
    3.75            module = "interest", action = "update", params = { issue_id = issue.id, delete = true },
    3.76            routing = { default = {
    3.77 -            mode = "redirect", module = "lf2", view = "issue", id = issue.id
    3.78 +            mode = "redirect", module = "lf2", view = initiative_id and "initiative" or "issue", id = initiative_id or issue.id,
    3.79            } },
    3.80            attr = { class = "hoverbutton red"},
    3.81            content = function()
    3.82 @@ -112,7 +100,7 @@
    3.83          ui.link{
    3.84            module = "interest", action = "update", params = { issue_id = issue.id },
    3.85            routing = { default = {
    3.86 -            mode = "redirect", module = "lf2", view = "issue", id = issue.id
    3.87 +            mode = "redirect", module = "lf2", view = initiative_id and "initiative" or "issue", id = initiative_id or issue.id,
    3.88            } },
    3.89            attr = { class = "hoverbutton green"},
    3.90            content = function()
    3.91 @@ -128,13 +116,23 @@
    3.92    end } end }
    3.93  
    3.94    ui.box_row{ class = "delegation hoverbutton_container", content = function() ui.box_col{ content = function()
    3.95 -    if delegation then
    3.96 -      if delegation.issue_id then
    3.97 -        slot.put(encode.html(_"You have delegated this issue"))
    3.98 -      elseif delegation.area_id then
    3.99 -        slot.put(encode.html(_"You have delegated this area"))
   3.100 -      elseif delegation then
   3.101 -        slot.put(encode.html(_"You have delegated globally"))
   3.102 +    if trustees[1].scope_out then
   3.103 +      if trustees[1].disabled_out == false then
   3.104 +        if trustees[1].scope_out == "issue" then
   3.105 +          slot.put(encode.html(_"You have delegated this issue"))
   3.106 +        elseif trustees[1].scope_out == "area" then
   3.107 +          slot.put(encode.html(_"You have delegated this area"))
   3.108 +        elseif trustees[1].scope_out == "global" then
   3.109 +          slot.put(encode.html(_"You have delegated globally"))
   3.110 +        end
   3.111 +      else
   3.112 +        if trustees[1].scope_out == "issue" then
   3.113 +          slot.put(encode.html(_"Issue delegation abandoned"))
   3.114 +        elseif trustees[1].scope_out == "area" then
   3.115 +          slot.put(encode.html(_"Area delegation abandoned"))
   3.116 +        elseif trustees[1].scope_out == "global" then
   3.117 +          slot.put(encode.html(_"Global delegation abandoned"))
   3.118 +        end
   3.119        end
   3.120      else
   3.121        slot.put(encode.html(_"No delegation active"))
   3.122 @@ -147,19 +145,25 @@
   3.123          end }
   3.124        end }
   3.125      else
   3.126 -      if delegation then
   3.127 -        ui.link{ attr = { class = "hoverbutton red"}, content = function()
   3.128 +      if #trustees > 1 then
   3.129 +        ui.link{
   3.130 +          module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id },
   3.131 +          attr = { class = "hoverbutton red"}, content = function()
   3.132            ui.container{ attr = { class = "content"}, content = function()
   3.133              ui.image{ static = "lf2/icon_delegation.png" }
   3.134 -            slot.put(" ", encode.html(_"Change delegation..."))
   3.135 +            slot.put(" ", encode.html(_"Change issue delegation..."))
   3.136            end }
   3.137          end }
   3.138          
   3.139        else
   3.140 -        ui.link{ attr = { class = "hoverbutton green"}, content = function()
   3.141 +        ui.link{
   3.142 +          module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id },
   3.143 +          attr = { class = "hoverbutton green"}, content = function()
   3.144            ui.container{ attr = { class = "content"}, content = function()
   3.145              ui.image{ static = "lf2/icon_delegation.png" }
   3.146 -            slot.put(" ", encode.html(_"Delegate issue"))
   3.147 +            slot.put(" ")
   3.148 +            slot.put(" ", encode.html(_"Set issue delegation..."))
   3.149 +            
   3.150            end }
   3.151          end }
   3.152          
   3.153 @@ -167,8 +171,8 @@
   3.154      end
   3.155      
   3.156    end } end }
   3.157 -    
   3.158 -  if delegation then
   3.159 +
   3.160 +  if #trustees > 1 then
   3.161      ui.box_row{ class = "delegation", content = function() ui.box_col{ content = function()
   3.162        execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } }
   3.163      end } end }
     4.1 --- a/app/main/lf2/delegation.lua	Thu Mar 03 18:39:00 2011 +0100
     4.2 +++ b/app/main/lf2/delegation.lua	Thu Mar 03 21:26:35 2011 +0100
     4.3 @@ -37,8 +37,8 @@
     4.4        default = {
     4.5          mode = "redirect",
     4.6          module = "lf2",
     4.7 -        view = area and "area" or issue and "issue" or "index",
     4.8 -        id = area and area.id or issue and issue.id or nil,
     4.9 +        view = area and "area" or initiative and "initiative" or issue and "issue" or "index",
    4.10 +        id = area and area.id or initiative and initiative.id or issue and issue.id or nil,
    4.11        }
    4.12      },
    4.13      content = function()
     5.1 --- a/app/main/lf2/initiative.lua	Thu Mar 03 18:39:00 2011 +0100
     5.2 +++ b/app/main/lf2/initiative.lua	Thu Mar 03 21:26:35 2011 +0100
     5.3 @@ -1,8 +1,12 @@
     5.4  slot.set_layout("lf2")
     5.5  
     5.6 +slot.put_into("leftright_pre", '<div class="sidebar_right">')
     5.7 +slot.put_into("leftright_post", '</div>')
     5.8 +
     5.9  local initiative = Initiative:by_id(param.get_id())
    5.10  
    5.11  local issue = initiative.issue
    5.12 +issue:load("interest_for_member", { member_id = app.session.member_id }, "interest")
    5.13  
    5.14  local supporting_members_selector = Member:new_selector()
    5.15    :join("direct_supporter_snapshot", "dss", { "dss.issue_id = ? AND dss.initiative_id = ? AND dss.member_id = member.id and dss.event = (select latest_snapshot_event from issue where id = ?)", issue.id, initiative.id, issue.id })
    5.16 @@ -23,7 +27,7 @@
    5.17  
    5.18  slot.select("sidebar", function()
    5.19    
    5.20 -  execute.view{ module = "lf2", view = "_sidebar_issue", params = { issue = issue } }
    5.21 +  execute.view{ module = "lf2", view = "_sidebar_issue", params = { issue = issue, initiative_id = initiative.id } }
    5.22    
    5.23    execute.view{ module = "lf2", view = "_sidebar_initiatives", params = {
    5.24      initiatives = alternative_initiatives,
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/static/lf2.css	Thu Mar 03 21:26:35 2011 +0100
     6.3 @@ -0,0 +1,548 @@
     6.4 +/* CSS reset */
     6.5 +
     6.6 +html, body, div, span, applet, object, iframe,
     6.7 +h1, h2, h3, h4, h5, h6, p, blockquote, pre,
     6.8 +a, abbr, acronym, address, big, cite, code,
     6.9 +del, dfn, em, font, img, ins, kbd, q, s, samp,
    6.10 +small, strike, strong, sub, sup, tt, var,
    6.11 +dl, dt, dd, ol, ul, li,
    6.12 +fieldset, form, label, legend,
    6.13 +table, caption, tbody, tfoot, thead, tr, th, td {
    6.14 +    margin: 0;
    6.15 +    padding: 0;
    6.16 +    border: 0;
    6.17 +    outline: 0;
    6.18 +    font-weight: inherit;
    6.19 +    font-style: inherit;
    6.20 +    font-size: 100%;
    6.21 +    font-family: inherit;
    6.22 +    vertical-align: baseline;
    6.23 +}
    6.24 +/* remember to define focus styles! */
    6.25 +:focus {
    6.26 +    outline: 0;
    6.27 +}
    6.28 +body {
    6.29 +    line-height: 1;
    6.30 +    color: black;
    6.31 +    background: white;
    6.32 +}
    6.33 +ol, ul {
    6.34 +    list-style: none;
    6.35 +}
    6.36 +/* tables still need 'cellspacing="0"' in the markup */
    6.37 +table {
    6.38 +    border-collapse: separate;
    6.39 +    border-spacing: 0;
    6.40 +}
    6.41 +caption, th, td {
    6.42 +    text-align: left;
    6.43 +    font-weight: normal;
    6.44 +}
    6.45 +blockquote:before, blockquote:after,
    6.46 +q:before, q:after {
    6.47 +    content: "";
    6.48 +}
    6.49 +blockquote, q {
    6.50 +    quotes: "" "";
    6.51 +}
    6.52 +
    6.53 +/* end CSS reset */
    6.54 +
    6.55 +
    6.56 +/*
    6.57 +    Global settings
    6.58 +*/
    6.59 +body {
    6.60 +  font-family: sans-serif;
    6.61 +  background-color: #7df;
    6.62 +  color: #000;
    6.63 +}
    6.64 +
    6.65 +a {
    6.66 +  background-color: #ffffff;
    6.67 +  color: #000;
    6.68 +}
    6.69 +
    6.70 +/*
    6.71 +    Main top navigation
    6.72 +*/
    6.73 +
    6.74 +.tab1 {
    6.75 +  background-color: #444;
    6.76 +  color: #000;
    6.77 +}
    6.78 +
    6.79 +.tab1 .right {
    6.80 +  float: right;
    6.81 +}
    6.82 +
    6.83 +.tab1 a {
    6.84 +  float: left;
    6.85 +  padding: 0.5ex 0.5em 0.5ex 0.5em;
    6.86 +  margin-left: 0.5em;
    6.87 +  background-color: #444;
    6.88 +  color: #fff;
    6.89 +  font-weight: bold;
    6.90 +  text-decoration: none;
    6.91 +}
    6.92 +
    6.93 +.tab1 .right a {
    6.94 +  margin-left: 0;
    6.95 +  margin-right: 0.5em;
    6.96 +}
    6.97 +
    6.98 +.tab1 a.active {
    6.99 +  background-color: #7df;
   6.100 +  color: #000;
   6.101 +}
   6.102 +
   6.103 +/*
   6.104 +    Default slot
   6.105 +*/
   6.106 +
   6.107 +.slot_default {
   6.108 +  margin: 2ex 1% 2ex 32%;
   6.109 +  position: relative;
   6.110 +  width: 67%;
   6.111 +}
   6.112 +
   6.113 +.sidebar_right .slot_default {
   6.114 +  margin: 2ex 32% 2ex 1%;
   6.115 +}
   6.116 +
   6.117 +/*
   6.118 +Sidebar
   6.119 +*/
   6.120 +
   6.121 +.slot_sidebar {
   6.122 +  margin: 2ex 1% 2ex 1%;
   6.123 +  float: left;
   6.124 +  width: 30%;
   6.125 +}
   6.126 +
   6.127 +.sidebar_right .slot_sidebar {
   6.128 +  margin: 0 1% 2ex 1%;
   6.129 +  float: right;
   6.130 +  width: 30%;
   6.131 +}
   6.132 +
   6.133 +.slot_sidebar .box {
   6.134 +  width: 100%;
   6.135 +}
   6.136 +
   6.137 +
   6.138 +/*
   6.139 +    Boxes
   6.140 +*/
   6.141 +
   6.142 +.box a {
   6.143 +  text-decoration: none;
   6.144 +  color: #46a;
   6.145 +}
   6.146 +
   6.147 +.boxhead,
   6.148 +a.boxhead {
   6.149 +  /* position */
   6.150 +  display: block;
   6.151 +  margin-bottom: 0.5ex;
   6.152 +  margin-top: 1ex;
   6.153 +  margin-left: 0.5em;
   6.154 +
   6.155 +  /* color */
   6.156 +  background-color: #7df;
   6.157 +  color: #000;
   6.158 +
   6.159 +  /* text format */
   6.160 +  font-weight: bold;
   6.161 +  text-shadow: 2px 2px 2px #fff;
   6.162 +}
   6.163 +
   6.164 +.box {
   6.165 +  /* position */
   6.166 +  position: relative;
   6.167 +  width: 100%;
   6.168 +  margin-bottom: 2ex;
   6.169 +
   6.170 +  /* border and shadow*/
   6.171 +  border-radius: 1ex;
   6.172 +  -moz-border-radius: 1ex;
   6.173 +  -webkit-box-shadow: 2px 2px 3px 0px #444;
   6.174 +  -moz-box-shadow: 2px 2px 3px 0px #444;
   6.175 +
   6.176 +  /* color */
   6.177 +  background-color: #fff;
   6.178 +  color: #000;
   6.179 +
   6.180 +}
   6.181 +
   6.182 +.box .row {
   6.183 +  overflow: auto;
   6.184 +  /* position */
   6.185 +
   6.186 +  /* border */
   6.187 +  border-top: 1px solid #ccc;
   6.188 +}
   6.189 +
   6.190 +.box .row .col {
   6.191 +  /* position */
   6.192 +  padding: 0.5ex 0.2em 0.5ex 0.2em;
   6.193 +
   6.194 +  /* text format */
   6.195 +  line-height: 125%;
   6.196 +}
   6.197 +
   6.198 +.box .row .col.left {
   6.199 +  float: left;
   6.200 +}
   6.201 +
   6.202 +.box .row .col.right {
   6.203 +  float: right;
   6.204 +}
   6.205 +
   6.206 +.box .row .col.clearleft {
   6.207 +  clear: left;
   6.208 +}
   6.209 +
   6.210 +.box .row .col.clearright {
   6.211 +  clear: right;
   6.212 +}
   6.213 +
   6.214 +.box .row .col.toggle {
   6.215 +  float: left;
   6.216 +  /* position */
   6.217 +  padding-left: 0.4em;
   6.218 +}
   6.219 +
   6.220 +.box .row .col.toggle:hover {
   6.221 +  /* color */
   6.222 +  background-color: #7cf;
   6.223 +
   6.224 +  /* cursor */
   6.225 +  cursor: pointer;
   6.226 +}
   6.227 +
   6.228 +.box .row.first .col.toggle {
   6.229 +  /* border */
   6.230 +  border-radius: 1ex 0 0 0;
   6.231 +}
   6.232 +
   6.233 +.box .row.last .col.toggle {
   6.234 +  /* border */
   6.235 +  border-radius: 0 0 0 1ex;
   6.236 +}
   6.237 +
   6.238 +.box .row.toggled .col.first {
   6.239 +  /* position */
   6.240 +  margin-left: 1.5em;
   6.241 +}
   6.242 +
   6.243 +.box .row.first {
   6.244 +  /* border */
   6.245 +  border-top: none;
   6.246 +}
   6.247 +
   6.248 +.box .row .col.first {
   6.249 +  /* position */
   6.250 +  padding-left: 0.5em;
   6.251 +}
   6.252 +
   6.253 +.box .row.toggled .col.first {
   6.254 +  /* position */
   6.255 +  padding-left: 0.2em;
   6.256 +}
   6.257 +
   6.258 +.box .row.head {
   6.259 +  background-color: #e4e7f0;
   6.260 +  color: #000;
   6.261 +  border-radius: 1ex 1ex 0 0;
   6.262 +}
   6.263 +
   6.264 +.box .row.last {
   6.265 +  border-radius: 0 0 1ex 1ex;
   6.266 +}
   6.267 +
   6.268 +.box .row.head .col.head {
   6.269 +  font-weight: bold;
   6.270 +  color: #444;
   6.271 +}
   6.272 +
   6.273 +.box .row.head .col a {
   6.274 +  background-color: #e4e7f0;
   6.275 +  color: #3B6E7F;
   6.276 +}
   6.277 +
   6.278 +.box .row.head2 {
   6.279 +  background-color: #f2f3f7;
   6.280 +  color: #000;
   6.281 +}
   6.282 +
   6.283 +.box .row.head2 .col a {
   6.284 +  background-color: #f2f3f7;
   6.285 +  color: #3B6E7F;
   6.286 +}
   6.287 +
   6.288 +
   6.289 +.box .row .col a {
   6.290 +  color: #3B6E7F;
   6.291 +}
   6.292 +
   6.293 +.box .row.active,
   6.294 +.box .row.active a {
   6.295 +  background-color: #DDF7FF;
   6.296 +}
   6.297 +
   6.298 +/* Sidebar hover button */
   6.299 +
   6.300 +.hoverbutton_container {
   6.301 +  position: relative;
   6.302 +}
   6.303 +
   6.304 +
   6.305 +.hoverbutton {
   6.306 +  /* position */
   6.307 +  display: none;
   6.308 +  position: absolute;
   6.309 +  top: 0px;
   6.310 +  left: 0px;
   6.311 +  height: 100%;
   6.312 +  width: 100%;
   6.313 +
   6.314 +  /* color */
   6.315 +  background-color: #fff;
   6.316 +
   6.317 +  /* text format */
   6.318 +  font-weight: bold;
   6.319 +
   6.320 +  /* cursor */
   6.321 +  cursor: pointer;
   6.322 +}
   6.323 +
   6.324 +.hoverbutton_container:hover .hoverbutton {
   6.325 +  /* position */
   6.326 +  display: block;
   6.327 +}
   6.328 +
   6.329 +.hoverbutton_container:hover .hoverbutton img {
   6.330 +  /* text format */
   6.331 +  vertical-align: middle;
   6.332 +}
   6.333 +
   6.334 +.hoverbutton_container:hover .hoverbutton.noaction {
   6.335 +  /* color */
   6.336 +  background-color: #ccc;
   6.337 +
   6.338 +  /* cursor */
   6.339 +  cursor: default;
   6.340 +}
   6.341 +
   6.342 +.hoverbutton_container:hover .hoverbutton.green {
   6.343 +  background-color: #cfc;
   6.344 +}
   6.345 +
   6.346 +.hoverbutton_container:hover .hoverbutton.red {
   6.347 +  background-color: #fcc;
   6.348 +}
   6.349 +
   6.350 +.hoverbutton .content {
   6.351 +  /* position */
   6.352 +  padding: 0.5ex 0.2em 0.5ex 0.5em;
   6.353 +}
   6.354 +
   6.355 +/* Scrolled col */
   6.356 +
   6.357 +.box .row .col.scrolled {
   6.358 +  padding: 0;
   6.359 +  max-height: 300px;
   6.360 +  overflow: auto;
   6.361 +}
   6.362 +
   6.363 +.box .row .col.scrolled .head {
   6.364 +  font-weight: bold;
   6.365 +  padding: 0.5ex 0.2em 0.5ex 0.5em;
   6.366 +}
   6.367 +
   6.368 +/*
   6.369 +  Bars
   6.370 +*/
   6.371 +
   6.372 +.bar {
   6.373 +  float: right;
   6.374 +  margin-left: 0.3em;
   6.375 +}
   6.376 +
   6.377 +.bar div {
   6.378 +  margin-top: 2px;
   6.379 +  float: left;
   6.380 +  height: 11px;
   6.381 +}
   6.382 +.bar .green {
   6.383 +  background-color: #0a0;
   6.384 +}
   6.385 +
   6.386 +.bar .grey {
   6.387 +  background-color: #eee;
   6.388 +}
   6.389 +
   6.390 +/*
   6.391 +    Avatars
   6.392 +*/
   6.393 +
   6.394 +.avatars {
   6.395 +  overflow: auto;
   6.396 +}
   6.397 +
   6.398 +.avatars .avatar {
   6.399 +  float: left;
   6.400 +  margin-left: 2px;
   6.401 +  margin-right: 2px;
   6.402 +}
   6.403 +
   6.404 +.avatars.normal .avatar {
   6.405 +  width: 100px;
   6.406 +  -webkit-box-shadow: 1px 1px 1px #000;
   6.407 +  background-color: #eee;
   6.408 +  border-radius: 1ex;
   6.409 +  -moz-border-radius: 1ex;
   6.410 +}
   6.411 +
   6.412 +.avatars.small .avatar {
   6.413 +  border: 2px solid #fff;
   6.414 +  border-radius: 0.5ex;
   6.415 +  -moz-border-radius: 0.5ex;
   6.416 +}
   6.417 +
   6.418 +.avatars .arrow {
   6.419 +  float: left;
   6.420 +  margin-top: 0.3ex;
   6.421 +}
   6.422 +
   6.423 +.avatars .avatar.myweight {
   6.424 +  border-color: #f70;
   6.425 +  background-color: #f70;
   6.426 +}
   6.427 +
   6.428 +.avatars .avatar.autoreject {
   6.429 +  border-color: #f00;
   6.430 +  background-color: #f00;
   6.431 +}
   6.432 +
   6.433 +.avatars.small .avatar img {
   6.434 +  border-radius: 0.25ex;
   6.435 +  -moz-border-radius: 0.25ex;
   6.436 +}
   6.437 +
   6.438 +.avatars.normal .avatar img {
   6.439 +  margin-left: 0.3em;
   6.440 +  margin-top: 0.3ex;
   6.441 +  border-radius: 1ex;
   6.442 +  -moz-border-radius: 1ex;
   6.443 +}
   6.444 +
   6.445 +.avatars.small .avatar img {
   6.446 +  height: 24px;
   6.447 +  width: 24px;
   6.448 +}
   6.449 +
   6.450 +.avatars.normal .avatar img {
   6.451 +  height: 48px;
   6.452 +  width: 48px;
   6.453 +}
   6.454 +
   6.455 +.avatars.normal .avatar .name {
   6.456 +  margin-left: 0.3em;
   6.457 +  margin-top: 0.3ex;
   6.458 +  line-height: 100%;
   6.459 +  font-size: 70%;
   6.460 +  overflow: hidden;
   6.461 +  height: 4ex;
   6.462 +}
   6.463 +
   6.464 +.avatars .avatar .weight {
   6.465 +  text-align: center;
   6.466 +  font-size: 70%;
   6.467 +}
   6.468 +
   6.469 +.avatars.small .avatar.participation {
   6.470 +  border-color: #f70;
   6.471 +}
   6.472 +
   6.473 +.avatars.small .avatar.overridden,
   6.474 +.avatars.small .arrow.overridden {
   6.475 +  opacity: 0.3;
   6.476 +}
   6.477 +
   6.478 +/*
   6.479 +  Area
   6.480 +*/
   6.481 +
   6.482 +.area .name {
   6.483 +  color: #444;
   6.484 +}
   6.485 +
   6.486 +.area .name a {
   6.487 +  font-weight: normal;
   6.488 +}
   6.489 +
   6.490 +.area .name .avatars {
   6.491 +  float: right;
   6.492 +  margin-top: -3px;
   6.493 +}
   6.494 +
   6.495 +/* Initiatives */
   6.496 +
   6.497 +.initiative .name,
   6.498 +.initiative a.name {
   6.499 +  font-weight: bold;
   6.500 +}
   6.501 +
   6.502 +.initiative .authors {
   6.503 +  /* color */
   6.504 +  color: #777;
   6.505 +
   6.506 +  /* text format */
   6.507 +  font-size: 80%;
   6.508 +  font-style: italic;
   6.509 +}
   6.510 +
   6.511 +.initiative .authors a {
   6.512 +  /* color */
   6.513 +}
   6.514 +
   6.515 +.drafts .draft .created {
   6.516 +  font-weight: bold;
   6.517 +}
   6.518 +
   6.519 +.drafts .draft .author_name {
   6.520 +  font-style: italic;
   6.521 +}
   6.522 +
   6.523 +/* Draft */
   6.524 +
   6.525 +.draft {
   6.526 +  line-height: 135%;
   6.527 +}
   6.528 +
   6.529 +.draft h2 {
   6.530 +  font-size: 135%;
   6.531 +  font-weight: bold;
   6.532 +  margin-bottom: 0.5ex;
   6.533 +}
   6.534 +
   6.535 +.draft h3 {
   6.536 +  font-size: 135%;
   6.537 +  margin-bottom: 0.5ex;
   6.538 +}
   6.539 +
   6.540 +.draft p {
   6.541 +  margin-bottom: 1ex;
   6.542 +}
   6.543 +
   6.544 +.draft ul {
   6.545 +  padding-left: 2em;
   6.546 +  list-style: disc;
   6.547 +}
   6.548 +
   6.549 +.draft ul li {
   6.550 +  margin-bottom: 1ex;
   6.551 +}

Impressum / About Us