<%namespace file="/base/helper.html" name="helper" import="reStructuredTextHelp,
entityLinkingHelp, embeddingFileHelp, embeddingFormHelp, dateFormatHelp,
guessMorphAnalHelp, defaultFormViewHelp, rememberMetadataPrevFormHelp,
userSpecificOutputOrthographyHelp, userSpecificInputOrthographyHelp"/>



<%def name="addEditForm(addEdit)">
<fieldset>
<legend>User Info</legend>
<ol>
 <li>
% if addEdit == 'edit':
  <label for="username">username <span class="emphasize">(a username cannot be changed)</span></label>
  <input id="username" maxlength="255" name="username" tabindex="1" type="text" readonly="readonly" />
% else:
  <label for="username">username * </label>
  <input id="username" maxlength="255" name="username" tabindex="1" type="text" />
% endif
 </li>
% if addEdit == 'edit':
 <li>
  <label for="password">password <span class="emphasize">(enter a new password or leave blank to retain old one)</span></label>
  <input id="password" maxlength="255" name="password" tabindex="2" type="password" />
 </li>
% else:
 <li>
  <label for="password">password * </label>
  <input id="password" maxlength="255" name="password" tabindex="2" type="password" />
 </li>
% endif
 <li>
  <label for="firstName">first name *</label>
  <input id="firstName" maxlength="255" name="firstName" tabindex="3" type="text" />
 </li>
 <li>
  <label for="lastName">last name *</label>
  <input id="lastName" maxlength="255" name="lastName" tabindex="4" type="text" />
 </li>
 <li>
  <label for="email">email *</label>
  <input id="email" maxlength="255" name="email" tabindex="5" type="text" />
 </li>
 <li>
  <label for="affiliation">affiliation</label>
  <input id="affiliation" maxlength="255" name="affiliation" tabindex="6" type="text" />
 </li>
</ol>
</fieldset>

<fieldset>
<legend>Role</legend>
<ol>
% if session['user_role'] == 'administrator':
 <li>
  <label for="role">role</label>
  ${h.select(name='role', selected_values='', options=app_globals.roles, tabindex=7)}
 </li>
% else:
 <li>
  <label for="role">role</label>
  ${h.select(name='role', selected_values='', options=[session['user_role']], tabindex=7)}
 </li>
% endif
</ol>
</fieldset>

<fieldset>
<legend>Speaker Page Content</legend>
<ol>
 <li>
  <textarea class="monospace" id="personalPageContent" cols="40" rows="15"
            name="personalPageContent" tabindex="8"></textarea>
  <p class='fullyjustified'>To give formatting and structure to the content,
  use the reStructuredText ${reStructuredTextHelp()} markup language.
  Create HTML links to OLD entities ${entityLinkingHelp()} using the syntax
  'form(a)', 'collection(b)', etc., where 'a' and 'b' are IDs.
  Embed representations of OLD Files ${embeddingFileHelp()} or Forms
  ${embeddingFormHelp()} with 'file[x]' and 'form[y]' respectively</p>
 </li>
</ol>
</fieldset>

</%def>


<%def name="settings()">
 <%
  orthographyOptions = [(u'', u'')] + [(key, \
      app_globals.OLOrthographies[key][0]) for key in \
      app_globals.OLOrthographies if app_globals.OLOrthographies[key][0]]
 %>

  <table class="infoTable">

   <tr>
    <td>
     Input Orthography ${userSpecificInputOrthographyHelp(
      c.researcher.firstName + ' ' + c.researcher.lastName,
      app_globals.defaultInputOrthography[0])}
    </td>
    <td>
     ${h.select(name='inputOrthography', selected_values='',
     options=orthographyOptions, tabindex=2)}
    </td>
   </tr>

   <tr>
    <td>
     Output Orthography ${userSpecificOutputOrthographyHelp(
      c.researcher.firstName + ' ' + c.researcher.lastName,
      app_globals.defaultOutputOrthography[0])}
    </td>
    <td>
     ${h.select(name='outputOrthography', selected_values='',
     options=orthographyOptions, tabindex=3)}
    </td>
   </tr>

   <tr>
    <td>
     Remember Metadata from Previous Form ${rememberMetadataPrevFormHelp(
     c.researcher.firstName + ' ' + c.researcher.lastName)}
    </td>
    <td>
     ${h.select(name='defaultMetadataFromPreviousForm', selected_values='',
     options=(('False', False), ('True', True)), tabindex=4)}
    </td>
   </tr>

   <tr>
    <td>
     Default Form View ${defaultFormViewHelp()}
    </td>
    <td>
     ${h.select(name='defaultFormView', selected_values='',
     options=(('IGT', 'IGT'), ('tabular', 'tabular')), tabindex=5)}
    </td>
   </tr>

   <tr>
    <td>
     Guess Morphological Analysis ${guessMorphAnalHelp()}
    </td>
    <td>
     ${h.select(name='guessMorphology', selected_values='',
     options=(('False', False), ('True', True)), tabindex=6)}
    </td>
   </tr>

   <tr>
    <td>
     Date Format ${dateFormatHelp()}
    </td>
    <td>
     ${h.select(name='dateFormat', selected_values='MM/DD/YYYY',
     options=('MM/DD/YYYY', 'DD/MM/YYYY'), tabindex=7)}
    </td>
   </tr>

  </table>
</%def>