Commit 1f1fb02af99c961af97a40457a8a82703e623199

Authored by AurelioAHeckert
1 parent 1e7dd760

ActionItem251: started

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1602 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 46 additions and 0 deletions   Show diff stats
app/views/shared/forms/example.yml 0 → 100644
... ... @@ -0,0 +1,46 @@
  1 +# This is an example of a yml to auto generate validable forms.
  2 +
  3 +# The base squence list is a hash where the keys are the field names.
  4 +# each hash iten has a hash to dedfine it's properties.
  5 +# The attributes:
  6 +# _: text - friendly name for the user interface - must add to POT file
  7 +# mandatory: boolean - obviously
  8 +# type: prededfined text - text, textarea, hidden, password, radio, checkbox, select
  9 +# val: text or list - the field value
  10 +# val-h: text or list - the value for the user interface - must add to POT file
  11 +# selected: text or list - the selected field(s) on any list fields
  12 +# validate: hash - contais validation information
  13 +
  14 +# You can use variables (wordos inside %...%) where will be replacebe by hash
  15 +# values gave to the form generator method.
  16 +
  17 +form:
  18 +
  19 +- name: {
  20 + _: Full Name,
  21 + type: text,
  22 + mandatory: true,
  23 + size: 40,
  24 + max_size: 255
  25 +}
  26 +- paswd: {
  27 + _: Password,
  28 + type: password,
  29 + mandatory: true,
  30 + validate: {
  31 + min_size: 4
  32 + }
  33 +}
  34 +- sex: {
  35 + _: Sex,
  36 + type: radio,
  37 + val: [ M, F ],
  38 + val-h: [ Male, Female ]
  39 +}
  40 +- country: {
  41 + _: Living Country,
  42 + type: select,
  43 + val: %COUNTRY_CODES%,
  44 + val-h: %COUNTRY_NAMES%
  45 + selected: BR,
  46 +}
... ...