Changeset 4484

Show
Ignore:
Timestamp:
10/13/08 12:44:29 (1 month ago)
Author:
coling
Message:

Add field types to a slightly nicer UI

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • clientsplugin/0.11/clients/action_email.py

    r4481 r4484  
    3333  def options(self, client=None): 
    3434    if client is None: 
    35       yield {'name': 'XSLT', 'description': 'Formatting XSLT to convert the summary to an email'
     35      yield {'name': 'XSLT', 'description': 'Formatting XSLT to convert the summary to an email', 'type': 'large'
    3636    else: 
    37       yield {'name': 'Email Addresses', 'description': 'Comma separated list of email addresses'
     37      yield {'name': 'Email Addresses', 'description': 'Comma separated list of email addresses', 'type': 'medium'
    3838 
    3939 
  • clientsplugin/0.11/clients/templates/admin_client_events.html

    r4445 r4484  
    3737              <div py:for="option in options.values()" class="field"> 
    3838                <label>$option.name</label><br /> 
    39                 <!-- Todo: Support more modes other than textarea... --> 
    40                 <textarea name="${field}-option-${option.md5}" rows="10" cols="100">$option.value</textarea> 
     39                <py:choose test="option.type"> 
     40                  <textarea py:when="'large'" name="${field}-option-${option.md5}" rows="10" cols="70">$option.value</textarea> 
     41                  <input py:when="'small'" name="${field}-option-${option.md5}" type="text" size="5" value="$option.value" /> 
     42                  <input py:otherwise="" name="${field}-option-${option.md5}" type="text" size="60" value="$option.value" /> 
     43                </py:choose> 
    4144                <p class="help">$option.description</p> 
    4245              </div> 
  • clientsplugin/0.11/clients/templates/admin_clients.html

    r4449 r4484  
    5858                  <label>$option.name</label><br /> 
    5959                  <!-- Todo: Support more modes other than intput type=text... --> 
    60                   <input type="text" name="${field}-option-${event.md5}-${option.md5}" size="60" value="$option.value"/> 
     60                  <py:choose test="option.type"> 
     61                    <textarea py:when="'large'" name="${field}-option-${event.md5}-${option.md5}" rows="10" cols="70">$option.value</textarea> 
     62                    <input py:when="'small'" name="${field}-option-${event.md5}-${option.md5}" type="text" size="5" value="$option.value" /> 
     63                    <input py:otherwise="" name="${field}-option-${event.md5}-${option.md5}" type="text" size="60" value="$option.value" /> 
     64                  </py:choose> 
    6165                  <p class="help">$option.description</p> 
    6266                </div>