1
+ {% extends 'base2.html' %}
2
+ {% block content %}
3
+ < div class ="container ">
4
+ < div class ="row ">
5
+ < div class ="container py-4 mb-auto ">
6
+ < div class ="h-900 p-2 rounded-3 ">
7
+ < h2 class ="card-title "> 接続情報新規申請</ h2 >
8
+ < br />
9
+ < form method ="post " class ="h-adr ">
10
+ {% csrf_token %}
11
+ < h4 > 0. サービス情報</ h4 >
12
+ < input type ="text " class ="form-control " value ="{{ service_code }} " disabled >
13
+ < br />
14
+ < h4 > {{ form.connection_type.label }}</ h4 >
15
+ {{ form.connection_type }}
16
+ {% if form.connection_type.errors %}
17
+ < p class ="link-danger "> {{ form.connection_type.errors | striptags }}</ p >
18
+ {% endif %}
19
+ < div id ="connectionCommentField " style ="display: none; ">
20
+ < h5 > {{ form.connection_comment.label }}</ h5 >
21
+ {{ form.connection_comment }}
22
+ {% if form.connection_comment.errors %}
23
+ < p class ="link-danger "> {{ form.connection_comment.errors | striptags }}</ p >
24
+ {% endif %}
25
+ </ div >
26
+ < br />
27
+ {% if is_ipv4_bgp or is_ipv6_bgp %}
28
+ < h5 > 1.2.広報する経路</ h5 >
29
+ < div class ="container ">
30
+ < div class ="row align-items-start ">
31
+ {% if is_ipv4_bgp %}
32
+ < div class ="col ">
33
+ < h5 > {{ form.ipv4_route.label }}</ h5 >
34
+ {{ form.ipv4_route }}
35
+ {% if form.ipv4_route.errors %}
36
+ < p class ="link-danger "> {{ form.ipv4_route.errors | striptags }}</ p >
37
+ {% endif %}
38
+ < br />
39
+ < h5 > {{ form.ipv4_route_comment.label }}</ h5 >
40
+ {{ form.ipv4_route_comment }}
41
+ {% if form.ipv4_route_comment.errors %}
42
+ < p class ="link-danger "> {{ form.ipv4_route_comment.errors | striptags }}</ p >
43
+ {% endif %}
44
+ </ div >
45
+ {% endif %}
46
+ {% if is_ipv6_bgp %}
47
+ < div class ="col ">
48
+ < h5 > {{ form.ipv6_route.label }}</ h5 >
49
+ {{ form.ipv6_route }}
50
+ {% if form.ipv6_route.errors %}
51
+ < p class ="link-danger "> {{ form.ipv6_route.errors | striptags }}</ p >
52
+ {% endif %}
53
+ < br />
54
+ < h5 > {{ form.ipv6_route_comment.label }}</ h5 >
55
+ {{ form.ipv6_route_comment }}
56
+ {% if form.ipv6_route_comment.errors %}
57
+ < p class ="link-danger "> {{ form.ipv6_route_comment.errors | striptags }}</ p >
58
+ {% endif %}
59
+ </ div >
60
+ {% endif %}
61
+ </ div >
62
+ </ div >
63
+ < br />
64
+ {% endif %}
65
+ < h4 > 2. 接続情報や場所など</ h4 >
66
+ < h5 > {{ form.hope_location.label }}</ h5 >
67
+ {{ form.hope_location }}
68
+ {% if form.hope_location.errors %}
69
+ < p class ="link-danger "> {{ form.hope_location.errors | striptags }}</ p >
70
+ {% endif %}
71
+ < br />
72
+ < h5 > {{ form.term_location.label }}</ h5 >
73
+ {{ form.term_location }}
74
+ {% if form.term_location.errors %}
75
+ < p class ="link-danger "> {{ form.term_location.errors | striptags }}</ p >
76
+ {% endif %}
77
+ < br />
78
+ < div id ="termField " style ="display: none; ">
79
+ < h5 > {{ form.term_ip.label }}</ h5 >
80
+ {{ form.term_ip }}
81
+ {% if form.term_ip.errors %}
82
+ < p class ="link-danger "> {{ form.term_ip.errors | striptags }}</ p >
83
+ {% endif %}
84
+ < br />
85
+ < h5 > {{ form.ntt_type.label }}</ h5 >
86
+ {{ form.ntt_type }}
87
+ {% if form.ntt_type.errors %}
88
+ < p class ="link-danger "> {{ form.ntt_type.errors | striptags }}</ p >
89
+ {% endif %}
90
+ < br />
91
+ < div id ="nttCommentField " style ="display: none; ">
92
+ < h5 > {{ form.ntt_comment.label }}</ h5 >
93
+ {{ form.ntt_comment }}
94
+ {% if form.ntt_comment.errors %}
95
+ < p class ="link-danger "> {{ form.ntt_comment.errors | striptags }}</ p >
96
+ {% endif %}
97
+ < br />
98
+ </ div >
99
+ < br />
100
+ </ div >
101
+ < h4 > 3. 利用開始・終了日</ h4 >
102
+ < p > (最短で1週間後から選択できます)</ p >
103
+ < div class ="container ">
104
+ < div class ="row align-items-start ">
105
+ < div class ="col ">
106
+ < h5 > {{ form.start_date.label }}</ h5 >
107
+ {{ form.start_date }}
108
+ {% if form.start_date.errors %}
109
+ < p class ="link-danger "> {{ form.start_date.errors | striptags }}</ p >
110
+ {% endif %}
111
+ </ div >
112
+ < div class ="col ">
113
+ < h5 > {{ form.end_date.label }}</ h5 >
114
+ < div id ="endDateField " style ="display: none; ">
115
+ {{ form.end_date }}
116
+ {% if form.end_date.errors %}
117
+ < p class ="link-danger "> {{ form.end_date.errors | striptags }}</ p >
118
+ {% endif %}
119
+ </ div >
120
+ < div class ="form-check ">
121
+ {{ form.no_end_date }}
122
+ < label class ="form-check-label ">
123
+ {{ form.no_end_date.label }}
124
+ </ label >
125
+ {% if form.no_end_date.errors %}
126
+ < p class ="link-danger "> {{ form.no_end_date.errors | striptags }}</ p >
127
+ {% endif %}
128
+ </ div >
129
+ </ div >
130
+ </ div >
131
+ </ div >
132
+ < br />
133
+ < h4 > {{ form.is_monitor.label }}</ h4 >
134
+ < div class ="form-check ">
135
+ {{ form.is_monitor }}
136
+ < label class ="form-check-label "> 監視あり</ label >
137
+ {% if form.is_monitor.errors %}
138
+ < p class ="link-danger "> {{ form.is_monitor.errors | striptags }}</ p >
139
+ {% endif %}
140
+ </ div >
141
+ < br />
142
+ < h4 > {{ form.comment.label }}</ h4 >
143
+ {{ form.comment }}
144
+ {% if form.comment.errors %}
145
+ < p class ="link-danger "> {{ form.comment.errors | striptags }}</ p >
146
+ {% endif %}
147
+ < br />
148
+ < br />
149
+ < button type ="submit " class ="btn btn-primary "> 登録</ button >
150
+ </ form >
151
+ {% if request.user.allow_group_add %}
152
+ {% else %}
153
+ < p >
154
+ < b > 新規にグループを登録したい又は既存の登録グループを紐づけたい方は、チケットページよりお問い合わせください</ b >
155
+ </ p >
156
+ {% endif %}
157
+ </ div >
158
+ </ div >
159
+ </ div >
160
+ </ div >
161
+ {% endblock content %}
162
+ {% block javascript %}
163
+ < script >
164
+ $ ( document ) . ready ( function ( ) {
165
+ checkConnectionTypeForm ( ) ;
166
+ checkNoEndDateForm ( ) ;
167
+ checkNTTCommentForm ( ) ;
168
+
169
+ // サービス種別フォーム変化時
170
+ $ ( '#id_connection_type' ) . change ( function ( ) {
171
+ checkConnectionTypeForm ( ) ;
172
+ } ) ;
173
+ // 終了未定種別フォーム変化時
174
+ $ ( '#id_no_end_date' ) . change ( function ( ) {
175
+ checkNoEndDateForm ( ) ;
176
+ } ) ;
177
+ // 終了未定種別フォーム変化時
178
+ $ ( '#id_ntt_type' ) . change ( function ( ) {
179
+ checkNTTCommentForm ( ) ;
180
+ } ) ;
181
+
182
+
183
+ // サービス種別からIP3B,ET00かどうかを判別する
184
+ function checkConnectionTypeForm ( ) {
185
+ const selectedValue = $ ( '#id_connection_type' ) . val ( ) ;
186
+ if ( selectedValue === 'ETC' ) {
187
+ $ ( '#connectionCommentField' ) . show ( ) ;
188
+ } else {
189
+ $ ( '#connectionCommentField' ) . hide ( ) ;
190
+ }
191
+
192
+ if ( selectedValue !== 'CC0' ) {
193
+ $ ( '#termField' ) . show ( ) ;
194
+ } else {
195
+ $ ( '#termField' ) . hide ( ) ;
196
+ }
197
+ }
198
+
199
+ // 終了未定種別がFalseの場合に利用終了日のフォームを出す
200
+ function checkNoEndDateForm ( ) {
201
+ if ( $ ( '#id_no_end_date' ) . is ( ':checked' ) ) {
202
+ $ ( '#endDateField' ) . hide ( ) ;
203
+ } else {
204
+ $ ( '#endDateField' ) . show ( ) ;
205
+ }
206
+ }
207
+
208
+ function checkNTTCommentForm ( ) {
209
+ const selectedValue = $ ( '#id_ntt_type' ) . val ( ) ;
210
+ if ( selectedValue === 'etc' ) {
211
+ $ ( '#nttCommentField' ) . show ( ) ;
212
+ } else {
213
+ $ ( '#nttCommentField' ) . hide ( ) ;
214
+ }
215
+ }
216
+ } ) ;
217
+ </ script >
218
+ {% endblock javascript %}
0 commit comments