liquid_feedback_frontend

diff app/main/suggestion/new.lua @ 279:23c98752e697

Added wiki support for suggestions and member statements
author bsw
date Thu Feb 16 14:08:43 2012 +0100 (2012-02-16)
parents 20e0b64cc1f9
children 99852ec8ee37
line diff
     1.1 --- a/app/main/suggestion/new.lua	Mon Feb 13 01:53:41 2012 +0100
     1.2 +++ b/app/main/suggestion/new.lua	Thu Feb 16 14:08:43 2012 +0100
     1.3 @@ -37,8 +37,6 @@
     1.4          value = _"You are currently not supporting this initiative directly. By adding suggestions to this initiative you will automatically become a potential supporter."
     1.5        }
     1.6      end
     1.7 -    ui.field.text{ label = _"Title (80 chars max)",        name = "name" }
     1.8 -    ui.field.text{ label = _"Description", name = "description", multiline = true, attr={id="suggestion_description"}}
     1.9      ui.field.select{
    1.10        label = _"Degree",
    1.11        name = "degree",
    1.12 @@ -49,6 +47,57 @@
    1.13        foreign_id = "id",
    1.14        foreign_name = "name"
    1.15      }
    1.16 +    ui.field.text{ label = _"Title (80 chars max)", name = "name" }
    1.17 +    ui.field.select{
    1.18 +      label = _"Wiki engine",
    1.19 +      name = "formatting_engine",
    1.20 +      foreign_records = {
    1.21 +        { id = "rocketwiki", name = "RocketWiki" },
    1.22 +        { id = "compat", name = _"Traditional wiki syntax" }
    1.23 +      },
    1.24 +      attr = {id = "formatting_engine"},
    1.25 +      foreign_id = "id",
    1.26 +      foreign_name = "name",
    1.27 +      value = param.get("formatting_engine")
    1.28 +    }
    1.29 +    ui.tag{
    1.30 +      tag = "div",
    1.31 +      content = function()
    1.32 +        ui.tag{
    1.33 +          tag = "label",
    1.34 +          attr = { class = "ui_field_label" },
    1.35 +          content = function() slot.put(" ") end,
    1.36 +        }
    1.37 +        ui.tag{
    1.38 +          content = function()
    1.39 +            ui.link{
    1.40 +              text = _"Syntax help",
    1.41 +              module = "help",
    1.42 +              view = "show",
    1.43 +              id = "wikisyntax",
    1.44 +              attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
    1.45 +            }
    1.46 +            slot.put(" ")
    1.47 +            ui.link{
    1.48 +              text = _"(new window)",
    1.49 +              module = "help",
    1.50 +              view = "show",
    1.51 +              id = "wikisyntax",
    1.52 +              attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
    1.53 +            }
    1.54 +          end
    1.55 +        }
    1.56 +      end
    1.57 +    }
    1.58 +    ui.field.text{
    1.59 +      label = _"Description",
    1.60 +      name = "content",
    1.61 +      multiline = true, 
    1.62 +      attr = { style = "height: 50ex;" },
    1.63 +      value = param.get("content")
    1.64 +    }
    1.65 +
    1.66 +    
    1.67      ui.submit{ text = _"Commit suggestion" }
    1.68    end
    1.69  }

Impressum / About Us