summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-gui/ipagui/templates/principalnewform.kid
blob: fe865b524e5bef92fac3ead6be20ba272abac636 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!-- 
 Copyright (C) 2007  Red Hat
 see file 'COPYING' for use and warranty information

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; version 2 only

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<div xmlns:py="http://purl.org/kid/ns#"
  class="simpleroster">
  <form action="${action}" name="${name}" method="${method}" class="tableform"
      onsubmit="preSubmit()" >

          <input type="submit" class="submitbutton" name="submit" value="Add Principal"/>

<?python
from ipagui.helpers import ipahelper
?>

  <script type="text/javascript" charset="utf-8"
    src="${tg.url('/static/javascript/dynamicedit.js')}"></script>

  <?python searchurl = tg.url('/principal/edit_search') ?>

  <script type="text/javascript">
    function toggleOther(field) {
      otherField = document.getElementById('form_other');
      var e=document.getElementById(field).value;
      if ( e == "other") {
        otherField.disabled = false;
      } else {
        otherField.disabled =true;
      }
    }

    function doSearch() {
      $('searchresults').update("Searching...");
      new Ajax.Updater('searchresults',
          '${searchurl}',
          {  asynchronous:true,
             parameters: { criteria: $('criteria').value },
             evalScripts: true });
      return false;
    }
  </script>

    <div py:for="field in hidden_fields"
      py:replace="field.display(value_for(field), **params_for(field))" 
      />

    <h2 class="formsection">Service Principal Details</h2>
    <table class="formtable" cellpadding="2" cellspacing="0" border="0">
      <tr>
        <th>
          <label class="fieldlabel" for="${principal_fields.hostname.field_id}"
            py:content="principal_fields.hostname.label" />:
        </th>
        <td>
          <span py:replace="principal_fields.hostname.display(value_for(principal_fields.hostname))" />
          <span py:if="tg.errors.get('hostname')" class="fielderror"
              py:content="tg.errors.get('hostname')" />

        </td>
      </tr>

      <tr>
        <th>
          <label class="fieldlabel" for="${principal_fields.service.field_id}"
            py:content="principal_fields.service.label" />:
        </th>
        <td>
          <span py:replace="principal_fields.service.display(value_for(principal_fields.service))" />
          <span py:if="tg.errors.get('service')" class="fielderror"
              py:content="tg.errors.get('service')" />

        </td>
      </tr>

      <tr>
        <th>
          <label class="fieldlabel" for="${principal_fields.other.field_id}"
            py:content="principal_fields.other.label" />:
        </th>
        <td>
          <span py:replace="principal_fields.other.display(value_for(principal_fields.other))" />
          <span py:if="tg.errors.get('other')" class="fielderror"
              py:content="tg.errors.get('other')" />
          <script type="text/javascript">
              var e=document.getElementById('form_service').value;
              if ( e != "other") {
                  document.getElementById('form_other').disabled = true;
              }
          </script>

        </td>
      </tr>

    </table>

<hr />

 <input type="submit" class="submitbutton" name="submit" value="Add Principal"/>

  </form>

  <script type="text/javascript">
    document.getElementById("form_hostname").focus();
  </script>

</div>