| 
									
										
										
										
											2020-04-10 10:21:02 -04:00
										 |  |  | {% extends 'base.html' %} | 
					
						
							| 
									
										
										
										
											2019-09-05 17:23:56 -04:00
										 |  |  | {% load helpers %} | 
					
						
							|  |  |  | {% load form_helpers %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% block content %} | 
					
						
							|  |  |  | {% block tabs %}{% endblock %} | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |     <div class="row"> | 
					
						
							|  |  |  |         <div class="col-md-8 col-md-offset-2"> | 
					
						
							|  |  |  |             <h1>{% block title %}{{ obj_type|bettertitle }} Bulk Import{% endblock %}</h1> | 
					
						
							|  |  |  |             {% if form.non_field_errors %} | 
					
						
							|  |  |  |                 <div class="panel panel-danger"> | 
					
						
							|  |  |  |                     <div class="panel-heading"><strong>Errors</strong></div> | 
					
						
							|  |  |  |                     <div class="panel-body"> | 
					
						
							|  |  |  |                         {{ form.non_field_errors }} | 
					
						
							|  |  |  |                     </div> | 
					
						
							| 
									
										
										
										
											2019-09-05 17:23:56 -04:00
										 |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |             {% endif %} | 
					
						
							|  |  |  |             <ul class="nav nav-tabs" role="tablist"> | 
					
						
							|  |  |  |                 <li role="presentation" class="active"><a href="#csv" role="tab" data-toggle="tab">CSV</a></li> | 
					
						
							|  |  |  |             </ul> | 
					
						
							|  |  |  |             <div class="tab-content"> | 
					
						
							|  |  |  |                 <div role="tabpanel" class="tab-pane active" id="csv"> | 
					
						
							| 
									
										
										
										
											2021-05-27 10:31:51 -04:00
										 |  |  |                     <form action="" method="post" class="form" enctype="multipart/form-data"> | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |                         {% csrf_token %} | 
					
						
							|  |  |  |                         {% render_form form %} | 
					
						
							|  |  |  |                         <div class="form-group"> | 
					
						
							|  |  |  |                             <div class="col-md-12 text-right"> | 
					
						
							|  |  |  |                                 <button type="submit" class="btn btn-primary">Submit</button> | 
					
						
							|  |  |  |                                 {% if return_url %} | 
					
						
							|  |  |  |                                     <a href="{{ return_url }}" class="btn btn-default">Cancel</a> | 
					
						
							|  |  |  |                                 {% endif %} | 
					
						
							|  |  |  |                             </div> | 
					
						
							|  |  |  |                         </div> | 
					
						
							|  |  |  |                     </form> | 
					
						
							|  |  |  |                     <div class="clearfix"></div> | 
					
						
							|  |  |  |                     <p></p> | 
					
						
							|  |  |  |                     {% if fields %} | 
					
						
							|  |  |  |                         <div class="panel panel-default"> | 
					
						
							|  |  |  |                             <div class="panel-heading"> | 
					
						
							|  |  |  |                                 <strong>CSV Field Options</strong> | 
					
						
							|  |  |  |                             </div> | 
					
						
							|  |  |  |                             <table class="table"> | 
					
						
							|  |  |  |                                 <tr> | 
					
						
							|  |  |  |                                     <th>Field</th> | 
					
						
							|  |  |  |                                     <th>Required</th> | 
					
						
							| 
									
										
										
										
											2020-05-01 16:01:55 -04:00
										 |  |  |                                     <th>Accessor</th> | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |                                     <th>Description</th> | 
					
						
							|  |  |  |                                 </tr> | 
					
						
							|  |  |  |                                 {% for name, field in fields.items %} | 
					
						
							|  |  |  |                                     <tr> | 
					
						
							|  |  |  |                                         <td> | 
					
						
							|  |  |  |                                             <code>{{ name }}</code> | 
					
						
							|  |  |  |                                         </td> | 
					
						
							|  |  |  |                                         <td> | 
					
						
							|  |  |  |                                             {% if field.required %} | 
					
						
							| 
									
										
										
										
											2020-11-06 14:33:20 -05:00
										 |  |  |                                                 <i class="mdi mdi-check-bold text-success" title="Required"></i> | 
					
						
							| 
									
										
										
										
											2020-05-01 16:01:55 -04:00
										 |  |  |                                             {% else %} | 
					
						
							|  |  |  |                                                 <span class="text-muted">—</span> | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |                                             {% endif %} | 
					
						
							|  |  |  |                                         </td> | 
					
						
							|  |  |  |                                         <td> | 
					
						
							|  |  |  |                                             {% if field.to_field_name %} | 
					
						
							| 
									
										
										
										
											2020-05-01 16:01:55 -04:00
										 |  |  |                                                 <code>{{ field.to_field_name }}</code> | 
					
						
							|  |  |  |                                             {% else %} | 
					
						
							|  |  |  |                                                 <span class="text-muted">—</span> | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |                                             {% endif %} | 
					
						
							|  |  |  |                                         </td> | 
					
						
							|  |  |  |                                         <td> | 
					
						
							| 
									
										
										
										
											2020-09-18 13:03:38 -04:00
										 |  |  |                                             {% if field.STATIC_CHOICES %} | 
					
						
							| 
									
										
										
										
											2020-12-02 10:08:41 -05:00
										 |  |  |                                                 <button type="button" class="btn btn-link btn-xs pull-right" data-toggle="modal" data-target="#{{ name }}_choices"> | 
					
						
							| 
									
										
										
										
											2020-11-06 14:33:20 -05:00
										 |  |  |                                                     <i class="mdi mdi-help-circle"></i> | 
					
						
							| 
									
										
										
										
											2020-08-20 15:44:30 -04:00
										 |  |  |                                                 </button> | 
					
						
							|  |  |  |                                                 <div class="modal fade" id="{{ name }}_choices" tabindex="-1" role="dialog"> | 
					
						
							|  |  |  |                                                     <div class="modal-dialog" role="document"> | 
					
						
							|  |  |  |                                                         <div class="modal-content"> | 
					
						
							|  |  |  |                                                             <div class="modal-header"> | 
					
						
							|  |  |  |                                                                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | 
					
						
							|  |  |  |                                                                 <h4 class="modal-title"><code>{{ name }}</code> Choices</h4> | 
					
						
							|  |  |  |                                                             </div> | 
					
						
							| 
									
										
										
										
											2020-09-18 13:03:38 -04:00
										 |  |  |                                                             <table class="table table-striped modal-body"> | 
					
						
							|  |  |  |                                                                 <tr><th>Import Value</th><th>Label</th></tr> | 
					
						
							|  |  |  |                                                                 {% for value, label in field.choices %} | 
					
						
							|  |  |  |                                                                     {% if value %}<tr><td><samp>{{ value }}</samp></td><td>{{ label }}</td></tr>{% endif %} | 
					
						
							|  |  |  |                                                                 {% endfor %} | 
					
						
							|  |  |  |                                                             </table> | 
					
						
							| 
									
										
										
										
											2020-08-20 15:44:30 -04:00
										 |  |  |                                                         </div> | 
					
						
							|  |  |  |                                                     </div> | 
					
						
							|  |  |  |                                                 </div> | 
					
						
							|  |  |  |                                             {% endif %} | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |                                             {% if field.help_text %} | 
					
						
							|  |  |  |                                                 {{ field.help_text }}<br /> | 
					
						
							|  |  |  |                                             {% elif field.label %} | 
					
						
							|  |  |  |                                                 {{ field.label }}<br /> | 
					
						
							|  |  |  |                                             {% endif %} | 
					
						
							| 
									
										
										
										
											2020-05-04 16:30:21 -04:00
										 |  |  |                                             {% if field|widget_type == 'dateinput' %} | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |                                                 <small class="text-muted">Format: YYYY-MM-DD</small> | 
					
						
							|  |  |  |                                             {% elif field|widget_type == 'checkboxinput' %} | 
					
						
							|  |  |  |                                                 <small class="text-muted">Specify "true" or "false"</small> | 
					
						
							|  |  |  |                                             {% endif %} | 
					
						
							|  |  |  |                                         </td> | 
					
						
							|  |  |  |                                     </tr> | 
					
						
							|  |  |  |                                 {% endfor %} | 
					
						
							|  |  |  |                             </table> | 
					
						
							|  |  |  |                         </div> | 
					
						
							|  |  |  |                         <p class="small text-muted"> | 
					
						
							| 
									
										
										
										
											2020-11-06 14:33:20 -05:00
										 |  |  |                             <i class="mdi mdi-check-bold"></i> Required fields <strong>must</strong> be specified for all | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |                             objects. | 
					
						
							|  |  |  |                         </p> | 
					
						
							|  |  |  |                         <p class="small text-muted"> | 
					
						
							| 
									
										
										
										
											2020-11-06 14:33:20 -05:00
										 |  |  |                             <i class="mdi mdi-information-outline"></i> Related objects may be referenced by any unique attribute. | 
					
						
							| 
									
										
										
										
											2020-05-01 16:01:55 -04:00
										 |  |  |                             For example, <code>vrf.rd</code> would identify a VRF by its route distinguisher. | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |                         </p> | 
					
						
							| 
									
										
										
										
											2019-09-05 17:23:56 -04:00
										 |  |  |                     {% endif %} | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2020-05-01 14:26:04 -04:00
										 |  |  |         </div> | 
					
						
							|  |  |  |     </div> | 
					
						
							| 
									
										
										
										
											2019-09-05 17:23:56 -04:00
										 |  |  | {% endblock %} |