liquid_feedback_frontend

changeset 7:3941792e8be6 beta3

Version beta3

Table allowed_policy is respected while creating new issues

Broken vote now/later link is not shown anymore (until it's implemented)

More user friendly error page

Minor spelling error corrected
author bsw
date Sat Jan 02 12:00:00 2010 +0100 (2010-01-02)
parents 8d91bccab0bf
children 374bbc2ff102
files app/main/_layout/system_error.html app/main/initiative/_action/create.lua app/main/initiative/new.lua app/main/issue/_show_head.lua config/default.lua locale/translations.de.lua model/area.lua
line diff
     1.1 --- a/app/main/_layout/system_error.html	Sat Jan 02 12:00:00 2010 +0100
     1.2 +++ b/app/main/_layout/system_error.html	Sat Jan 02 12:00:00 2010 +0100
     1.3 @@ -3,39 +3,73 @@
     1.4      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     1.5      <title>Liquid Democracy System Error</title>
     1.6      <link rel="stylesheet" type="text/css" media="screen" href="__BASEURL__/static/trace.css" />
     1.7 -    <link rel="stylesheet" type="text/css" media="screen" href="__BASEURL__/static/style.css" />
     1.8 +    <style>
     1.9 +      body {
    1.10 +        font-family: sans-serif;
    1.11 +      }
    1.12 +      .title {
    1.13 +        font-size: 150%;
    1.14 +        font-weight: bold;
    1.15 +      }
    1.16 +      .layout_trace {
    1.17 +        left: 0;
    1.18 +      }
    1.19 +      a {
    1.20 +        background-color: #ddd;
    1.21 +        color: #000;
    1.22 +        padding: 1ex;
    1.23 +        margin: 1ex;
    1.24 +        line-height: 300%;
    1.25 +        border: 1px solid #777;
    1.26 +      }
    1.27 +      hr {
    1.28 +        margin-top: 2ex;
    1.29 +        margin-bottom: 2ex;
    1.30 +      }
    1.31 +    </style>
    1.32    </head>
    1.33    <body class="system_error">
    1.34 -    <div class="layout_content">
    1.35 -      <div class="layout_title">
    1.36 -        <div class="title">
    1.37 -          <br />
    1.38 -          <br />
    1.39 -          System message
    1.40 -        </div>
    1.41 -      </div>
    1.42 -      <br style="clear: left;">
    1.43 -      <div class="layout_actions">
    1.44 -        &nbsp;
    1.45 -      </div>
    1.46 -      <div class="layout_main">
    1.47 -        <div class="main">
    1.48 -          <tt><!-- WEBMCP SLOT system_error --></tt>
    1.49 -          <br />
    1.50 -          <br />
    1.51 -          <br />
    1.52 -          <br />
    1.53 -          <button onclick="window.location.reload()">Retry request</button>
    1.54 -          <a href="__BASEURL__">index</a>
    1.55 -        </div>
    1.56 -      </div>
    1.57 +
    1.58 +    <div class="title">
    1.59 +      <img src="__BASEURL__/static/lang/en.png" />
    1.60 +      Ooops, a system error occured
    1.61 +    </div>
    1.62 +    <p>
    1.63 +      Most probably you found a software bug. Don't panic, you can now choose one of the following options:
    1.64 +    </p>
    1.65 +
    1.66 +    <nobr><a href="__BASEURL__">Go to start page</a></nobr>
    1.67 +    <nobr><a href="#" onclick="window.location.reload()">Retry request</a></nobr>
    1.68 +    <nobr><a href="http://trac.public-software-group.org/projects/lf" target="_blank">Create bug report</a></nobr>
    1.69 +
    1.70 +    <hr />
    1.71 +
    1.72 +    <div class="title">
    1.73 +      <img src="__BASEURL__/static/lang/de.png" />
    1.74 +      Leider ist ein Systemfehler aufgetreten
    1.75      </div>
    1.76 -      <div class="layout_trace" id="layout_trace" style="xdisplay: none">
    1.77 -	    <div id="trace_show" onclick="document.getElementById('trace_content').style.display='block';this.style.display='none';" style="display: none;">TRACE</div>
    1.78 -        <div id="trace_content">
    1.79 -	        <!-- WEBMCP SLOT trace -->
    1.80 -	        <div class="trace_close" onclick="document.getElementById('trace_show').style.display='block';document.getElementById('trace_content').style.display='none';">close</div>
    1.81 -	    </div>
    1.82 -      </div>
    1.83 +    <p>
    1.84 +      Du hast vermutlich gerade einen Fehler in der Software entdeckt. Das ist kein Grund zur Panik, dir bleiben die folgenden Optionen:
    1.85 +    </p>
    1.86 +
    1.87 +    <nobr><a href="__BASEURL__">Weiter zur Startseite</a></nobr>
    1.88 +    <nobr><a href="#" onclick="window.location.reload()">Anfrage wiederholen</a></nobr>
    1.89 +    <nobr><a href="http://trac.public-software-group.org/projects/lf" target="_blank">Fehlerbericht erstellen</a></nobr>
    1.90 +
    1.91 +    <hr />
    1.92 +    <p>
    1.93 +      If you write a bug report, please include the following output in your bug report.<br />
    1.94 +      Falls Du einen Fehlerbericht erstellst, füge bitte die folgenden Ausgaben mit ein.
    1.95 +    </p>
    1.96 +    <tt style="font-size: 75%;"><!-- WEBMCP SLOT system_error --></tt>
    1.97 +
    1.98 +
    1.99 +    <div class="layout_trace" id="layout_trace" style="xdisplay: none">
   1.100 +      <div id="trace_show" onclick="document.getElementById('trace_content').style.display='block';this.style.display='none';" style="display: none;">TRACE</div>
   1.101 +      <div id="trace_content">
   1.102 +        <!-- WEBMCP SLOT trace -->
   1.103 +      <div class="trace_close" onclick="document.getElementById('trace_show').style.display='block';document.getElementById('trace_content').style.display='none';">close</div>
   1.104 +    </div>
   1.105 +
   1.106    </body>
   1.107  </html>
   1.108 \ No newline at end of file
     2.1 --- a/app/main/initiative/_action/create.lua	Sat Jan 02 12:00:00 2010 +0100
     2.2 +++ b/app/main/initiative/_action/create.lua	Sat Jan 02 12:00:00 2010 +0100
     2.3 @@ -41,9 +41,17 @@
     2.4  local initiative = Initiative:new()
     2.5  
     2.6  if not issue then
     2.7 +  local policy_id = param.get("policy_id", atom.integer)
     2.8 +  if not area:get_reference_selector("allowed_policies")
     2.9 +    :add_where{ "policy.id = ?", policy_id }
    2.10 +    :optional_object_mode()
    2.11 +    :exec()
    2.12 +  then
    2.13 +    error("policy not allowed")
    2.14 +  end
    2.15    issue = Issue:new()
    2.16    issue.area_id = area.id
    2.17 -  issue.policy_id = param.get("policy_id", atom.integer)
    2.18 +  issue.policy_id = policy_id
    2.19    issue:save()
    2.20  end
    2.21  
     3.1 --- a/app/main/initiative/new.lua	Sat Jan 02 12:00:00 2010 +0100
     3.2 +++ b/app/main/initiative/new.lua	Sat Jan 02 12:00:00 2010 +0100
     3.3 @@ -30,12 +30,14 @@
     3.4      if issue_id then
     3.5        ui.field.text{ label = _"Issue",  value = issue_id }
     3.6      else
     3.7 +      local value
     3.8        ui.field.select{
     3.9          label = _"Policy",
    3.10          name = "policy_id",
    3.11 -        foreign_records = Policy:new_selector():add_order_by("index"):exec(),
    3.12 +        foreign_records = area.allowed_policies,
    3.13          foreign_id = "id",
    3.14 -        foreign_name = "name"
    3.15 +        foreign_name = "name",
    3.16 +        value = area.default_policy.id
    3.17        }
    3.18      end
    3.19      ui.field.text{ label = _"Name", name = "name" }
     4.1 --- a/app/main/issue/_show_head.lua	Sat Jan 02 12:00:00 2010 +0100
     4.2 +++ b/app/main/issue/_show_head.lua	Sat Jan 02 12:00:00 2010 +0100
     4.3 @@ -64,7 +64,8 @@
     4.4        params = { issue_id = issue.id }
     4.5      }
     4.6    end
     4.7 - 
     4.8 +
     4.9 +--[[ 
    4.10    if issue.state == "accepted" then
    4.11      -- TODO
    4.12      ui.link{
    4.13 @@ -74,6 +75,7 @@
    4.14        end,
    4.15      }
    4.16    end
    4.17 +--]]
    4.18  
    4.19  end)
    4.20  
     5.1 --- a/config/default.lua	Sat Jan 02 12:00:00 2010 +0100
     5.2 +++ b/config/default.lua	Sat Jan 02 12:00:00 2010 +0100
     5.3 @@ -1,5 +1,5 @@
     5.4  config.app_name = "LiquidFeedback"
     5.5 -config.app_version = "beta2"
     5.6 +config.app_version = "beta3"
     5.7  
     5.8  config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)"
     5.9  
     6.1 --- a/locale/translations.de.lua	Sat Jan 02 12:00:00 2010 +0100
     6.2 +++ b/locale/translations.de.lua	Sat Jan 02 12:00:00 2010 +0100
     6.3 @@ -297,7 +297,7 @@
     6.4  ["Supporter"] = "Unterstützer";
     6.5  ["Terms accepted"] = "Bedingungen akzeptiert";
     6.6  ["That's me!"] = "Das bin ich";
     6.7 -["The code you've entered is invalid"] = "Den Code den Du eingeben hast ist nicht gültig!";
     6.8 +["The code you've entered is invalid"] = "Der Code, den Du eingeben hast, ist nicht gültig!";
     6.9  ["The drafts do not differ"] = "Die Entwürfe unterscheiden sich nicht";
    6.10  ["This issue is already closed."] = "Das Thema ist schon geschlossen.";
    6.11  ["This issue is already frozen."] = "Das Thema ist schon eingefroren";
     7.1 --- a/model/area.lua	Sat Jan 02 12:00:00 2010 +0100
     7.2 +++ b/model/area.lua	Sat Jan 02 12:00:00 2010 +0100
     7.3 @@ -38,3 +38,23 @@
     7.4    connected_by_that_key = 'member_id',
     7.5    ref                   = 'members'
     7.6  }
     7.7 +
     7.8 +Area:add_reference{
     7.9 +  mode                  = 'mm',
    7.10 +  to                    = "Policy",
    7.11 +  this_key              = 'id',
    7.12 +  that_key              = 'id',
    7.13 +  connected_by_table    = 'allowed_policy',
    7.14 +  connected_by_this_key = 'area_id',
    7.15 +  connected_by_that_key = 'policy_id',
    7.16 +  ref                   = 'allowed_policies'
    7.17 +}
    7.18 +
    7.19 +function Area.object_get:default_policy()
    7.20 +  return Policy:new_selector()
    7.21 +    :join("allowed_policy", nil, "allowed_policy.policy_id = policy.id")
    7.22 +    :add_where{ "allowed_policy.area_id = ? AND allowed_policy.default_policy", self.id }
    7.23 +    :single_object_mode()
    7.24 +    :exec()
    7.25 +end
    7.26 +

Impressum / About Us