~ubuntu-branches/ubuntu/hardy/bcfg2/hardy-updates

« back to all changes in this revision

Viewing changes to src/lib/Server/Hostbase/hostbase/webtemplates/edit.html

  • Committer: Bazaar Package Importer
  • Author(s): Sami Haahtinen
  • Date: 2006-11-16 22:39:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061116223916-8dtn3t86cz58vg2x
Tags: 0.8.6.1-1
* New Upstream Release
* Replaced faulty if clause in bcfg2.postrm (Closes: #398772)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{% extends "base.html" %}
 
2
 
 
3
{% block pagebanner %}
 
4
  <div class="header">
 
5
      <h2>{{ host.hostname }}</h2>
 
6
  </div>
 
7
  <br/>
 
8
{% endblock %}
 
9
 
 
10
{% block sidebar %}
 
11
{% include "navbar" %}
 
12
<ul class="sidebar">
 
13
<li><a href="/hostbase/{{ host.id }}/" class="sidebar">host info</a></li>
 
14
<li><a href="/hostbase/{{ host.id }}/dns/" class="sidebar">detailed dns info</a></li>
 
15
<li><a href="/hostbase/{{ host.id }}/dns/edit/" class="sidebar">edit dns info</a></li>
 
16
</ul>
 
17
{% include "logout" %}
 
18
{% endblock %}
 
19
 
 
20
{% block content %}
 
21
 
1
22
<script language=JavaScript type=text/Javascript>
2
23
function toggleAddr(interface_id){
3
24
   if(document.getElementById){
14
35
</script>
15
36
 
16
37
<style type=text/css>
17
 
#for $interface in $interfaces
18
 
div#ipaddr${interface.id}{
 
38
{% for interface in interfaces %}
 
39
div#ipaddr{{ interface.0.id }}{
19
40
   display: none;
20
41
}
21
 
#end for
 
42
{% endfor %}
22
43
div#interface{
23
44
   display: none;
24
45
}
25
46
</style>
26
47
 
27
48
<form name="hostdata" action="?sub=true" method="post">
28
 
<input type="hidden" name="host" value="$host.id">
 
49
<input type="hidden" name="host" value="{{ host.id }}">
29
50
<table border="0" width="100%">
30
51
   <colgroup>
31
52
   <col width="150">
32
53
   <col width="*">
33
54
   <tr> <td> <b>hostname</b></td>
34
 
   <td> <input name="hostname" type="text" value="$host.hostname"></td></tr>
 
55
   <td> <input name="hostname" value="{{ host.hostname }}"></td></tr>
35
56
   <tr> <td> <b>whatami</b></td>
36
57
   <td> 
37
58
   <select name="whatami">
38
 
   #for $choice in $host.WHATAMI_CHOICES
39
 
       #if $host.whatami == $choice[0]
40
 
           <option value="$choice[0]" selected="selected">$choice[1]
41
 
       #else
42
 
           <option value="$choice[0]">$choice[1]
43
 
       #end if
44
 
   #end for
 
59
   {% for choice in host.WHATAMI_CHOICES %}
 
60
       {% ifequal host.whatami choice.0 %}
 
61
           <option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
 
62
       {% else %}
 
63
           <option value="{{ choice.0 }}">{{ choice.1 }}
 
64
       {% endifequal %}
 
65
   {% endfor %}
45
66
   </select></td></tr>
46
67
   <tr> <td> <b>netgroup</b></td>
47
68
   <td>
48
69
   <select name="netgroup">
49
 
   #for $choice in $host.NETGROUP_CHOICES
50
 
       #if $host.netgroup == $choice[0]
51
 
           <option value="$choice[0]" selected="selected">$choice[1]
52
 
       #else
53
 
           <option value="$choice[0]">$choice[1]
54
 
       #end if
55
 
   #end for
 
70
   {% for choice in host.NETGROUP_CHOICES %}
 
71
       {% ifequal host.netgroup choice.0 %}
 
72
           <option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
 
73
       {% else %}
 
74
           <option value="{{ choice.0 }}">{{ choice.1 }}
 
75
       {% endifequal %}
 
76
   {% endfor %}
56
77
   </select>
57
78
   </td></tr>
58
79
   <tr> <td> <b>class</b></td>
59
80
   <td>
60
81
   <select name="security_class">
61
 
   #for $choice in $host.CLASS_CHOICES
62
 
       #if $host.security_class == $choice[0]
63
 
           <option value="$choice[0]" selected="selected">$choice[1]
64
 
       #else
65
 
           <option value="$choice[0]">$choice[1]
66
 
       #end if
67
 
   #end for
 
82
   {% for choice in host.CLASS_CHOICES %}
 
83
       {% ifequal host.security_class choice.0 %}
 
84
           <option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
 
85
       {% else %}
 
86
           <option value="{{ choice.0 }}">{{ choice.1 }}
 
87
       {% endifequal %}
 
88
   {% endfor %}
68
89
   </select></td></tr>
69
90
   <tr> <td> <b>support</b></td>
70
91
   <td>
71
92
   <select name="support">
72
 
   #for $choice in $host.SUPPORT_CHOICES
73
 
       #if $host.support == $choice[0]
74
 
           <option value="$choice[0]" selected="selected">$choice[1]
75
 
       #else
76
 
           <option value="$choice[0]">$choice[1]
77
 
       #end if
78
 
   #end for
 
93
   {% for choice in host.SUPPORT_CHOICES %}
 
94
       {% ifequal host.support choice.0 %}
 
95
           <option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
 
96
       {% else %}
 
97
           <option value="{{ choice.0 }}">{{ choice.1 }}
 
98
       {% endifequal %}
 
99
   {% endfor %}
79
100
   </select></td></tr>
80
101
   <tr> <td> <b>csi</b></td>
81
 
   <td> <input name="csi" type="text" value="$host.csi"></td></tr>
 
102
   <td> <input name="csi" type="text" value="{{ host.csi }}"></td></tr>
82
103
   <tr> <td> <b>printq</b></td>
83
 
   <td> <input name="printq" type="text" value="$host.printq"></td></tr>
84
 
   <tr> <td> <b>dhcp</b></td>
85
 
   <td>
86
 
   #if $host.dhcp
87
 
       <input type="checkbox" checked="checked" name="dhcp"></td></tr>
88
 
   #else
89
 
       <input type="checkbox" name="dhcp"></td></tr>
90
 
   #end if   
 
104
   <td> <input name="printq" type="text" value="{{ host.printq }}"></td></tr>
91
105
   <tr> <td> <b>outbound_smtp</b></td>
92
106
   <td>
93
 
   #if $host.outbound_smtp
 
107
   {% if host.outbound_smtp %}
94
108
       <input type="checkbox" checked="checked" name="outbound_smtp"></td></tr>
95
 
   #else
 
109
   {% else %}
96
110
       <input type="checkbox" name="outbound_smtp"></td></tr>
97
 
   #end if   
 
111
   {% endif %}   
98
112
   <tr> <td> <b>primary_user</b></td>
99
 
   <td> <input name="primary_user" type="text" size="32" value="$host.primary_user"></td></tr>
 
113
   <td> <input name="primary_user" type="text" size="32" value="{{ host.primary_user }}"></td></tr>
100
114
   <tr> <td> <b>administrator</b></td>
101
 
   <td> <input name="administrator" type="text" size="32" value="$host.administrator"></td></tr>
 
115
   <td> <input name="administrator" type="text" size="32" value="{{ host.administrator }}"></td></tr>
102
116
   <tr> <td> <b>location</b></td>
103
 
   <td> <input name="location" type="text" value="$host.location"></td></tr>
 
117
   <td> <input name="location" type="text" value="{{ host.location }}"></td></tr>
104
118
   <tr> <td> <b>expiration_date</b></td>
105
 
   <td> <input name="expiration_date" type="text" value="$host.expiration_date"> YYYY-MM-DD</td></tr>
106
 
   #for $interface in $interfaces
 
119
   <td> <input name="expiration_date" type="text" value="{{ host.expiration_date }}"> YYYY-MM-DD</td></tr>
 
120
   {% for interface in interfaces %}
107
121
       <tr> <td><br><b>Interface</b>
108
122
       </td><td><br>
109
 
       #for $choice in $interface.TYPE_CHOICES
110
 
           #if $interface.hdwr_type == $choice[0]
111
 
               <input type="radio" name="hdwr_type$interface.id" value="$choice[0]" checked="checked">$choice[1]
112
 
           #else
113
 
               <input type="radio" name="hdwr_type$interface.id" value="$choice[0]">$choice[1]
114
 
           #end if
115
 
       #end for
 
123
       {% for choice in interface.0.TYPE_CHOICES %}
 
124
           {% ifequal interface.0.hdwr_type choice.0 %}
 
125
               <input type="radio" name="hdwr_type{{ interface.0.id }}" value="{{ choice.0 }}" checked="checked">{{ choice.1 }}
 
126
           {% else %}
 
127
               <input type="radio" name="hdwr_type{{ interface.0.id }}" value="{{ choice.0 }}">{{ choice.1 }}
 
128
           {% endifequal %}
 
129
       {% endfor %}
116
130
       </td></tr>
 
131
       <tr> <td> <b>dhcp</b></td>
 
132
       <td>
 
133
       {% if interface.0.dhcp %}
 
134
           <input type="checkbox" checked="checked" name="dhcp{{ interface.0.id }}"></td></tr>
 
135
       {% else %}
 
136
           <input type="checkbox" name="dhcp{{ interface.0.id }}"></td></tr>
 
137
       {% endif %}   
117
138
       <tr> <td> <b>mac_addr</b></td>
118
 
       <td> <input name="mac_addr$interface.id" type="text" value="$interface.mac_addr">
119
 
       <a style="font-size:75%" href="/hostbase/$host.id/interface/${interface.id}/confirm">remove</a>
 
139
       <td> <input name="mac_addr{{ interface.0.id }}" type="text" value="{{ interface.0.mac_addr }}">
 
140
       <a style="font-size:75%" href="/hostbase/{{ host.id }}/interface/{{ interface.0.id }}/confirm">remove</a>
120
141
       </td></tr>
121
 
       #for $ip in $ips[$interface.id]
 
142
       {% for ip in interface.1 %}
122
143
           <tr> <td> <b>ip_addr</b>
123
144
           </td>
124
 
           <td> <input name="ip_addr${ip.id}" type="text" value="$ip.ip_addr">
125
 
           <a style="font-size:75%" href="/hostbase/$host.id/ip/${ip.id}/confirm">remove
 
145
           <td> <input name="ip_addr{{ ip.id }}" type="text" value="{{ ip.ip_addr }}">
 
146
           <a style="font-size:75%" href="/hostbase/{{ host.id }}/ip/{{ ip.id }}/confirm">remove
126
147
           </a></td></tr>
127
 
       #end for
 
148
       {% endfor %}
128
149
 
129
150
<!-- Section for adding a new IP address to an existing interface -->
130
151
<!-- By default, section is hidden -->
131
152
       </table>
132
 
       <div id=ipaddr${interface.id}>
 
153
       <div id=ipaddr{{ interface.0.id }}>
133
154
       <table border="0" width="100%">
134
155
           <colgroup>
135
156
           <col width="150">
136
157
           <col width="*">
137
158
           <tr> <td> <b>ip_addr</b></td>
138
 
           <td> <input name="${interface.id}ip_addr" type="text"></td></tr>
 
159
           <td> <input name="{{ interface.0.id }}ip_addr" type="text"></td></tr>
139
160
       </table>
140
161
       </div>
141
 
       <a style="font-size:75%" href=# onclick="toggleAddr($interface.id)">Add a New IP Address</a>
 
162
       <a style="font-size:75%" href=# onclick="toggleAddr({{ interface.0.id }})">Add a New IP Address</a>
142
163
       <table border="0" width="100%">
143
164
           <colgroup>
144
165
               <col width="150">
145
166
               <col width="*">
146
 
   #end for
 
167
   {% endfor %}
147
168
<!--  End section for new IP address -->
148
169
 
149
170
<!-- Section for add an entirely new interface to a host -->
155
176
       <col width="150">
156
177
       <col width="*">
157
178
   <tr> <td><br><b>Interface</b></td><td><br>
158
 
   #for $choice in $type_choices
159
 
   <input type="radio" name="hdwr_type_new" value="$choice[0]">$choice[1]
160
 
   #end for
 
179
   {% for choice in TYPE_CHOICES %}
 
180
   <input type="radio" name="hdwr_type_new" value="{{ choice.0 }}">{{ choice.1 }}
 
181
   {% endfor %}
161
182
   </td></tr>
 
183
   <tr> <td> <b>dhcp</b></td>
 
184
   <td>
 
185
   {% if host.dhcp %}
 
186
       <input type="checkbox" checked="checked" name="dhcp_new"></td></tr>
 
187
   {% else %}
 
188
       <input type="checkbox" name="dhcp_new"></td></tr>
 
189
   {% endif %}   
162
190
   <tr> <td> <b>mac_addr</b></td>
163
191
   <td> <input name="mac_addr_new" type="text"></td></tr>
164
192
   <tr> <td> <b>ip_addr</b></td>
174
202
   <col width="150">
175
203
   <col width="*">
176
204
<tr> <td> <b>comments</b></td>
177
 
<td> <textarea rows="10" cols="50" name="comments">$host.comments</textarea></td></tr>
 
205
<td> <textarea rows="10" cols="50" name="comments">{{ host.comments }}</textarea></td></tr>
178
206
</table>
179
 
<a style="font-size:75%" href="/hostbase/$host.id/dns/edit">edit detailed DNS information for this host</a>
 
207
<a style="font-size:75%" href="/hostbase/{{ host.id }}/dns/edit">edit detailed DNS information for this host</a>
180
208
<br>
181
209
this host is 
182
210
<select name="status">
183
 
#for $choice in $host.STATUS_CHOICES
184
 
#if $host.status == $choice[0]
185
 
<option value="$choice[0]" selected="selected">$choice[1]
186
 
#else
187
 
<option value="$choice[0]">$choice[1]
188
 
#end if
189
 
#end for
 
211
{% for choice in host.STATUS_CHOICES %}
 
212
{% ifequal host.status choice.0 %}
 
213
<option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
 
214
{% else %}
 
215
<option value="{{ choice.0 }}">{{ choice.1 }}
 
216
{% endifequal %}
 
217
{% endfor %}
190
218
</select><br>
191
 
last update on $host.last<br>
 
219
last update on {{ host.last }}<br>
192
220
<p><input type="submit" value="Submit">
193
221
</form>
 
222
 
 
223
{% endblock %}