| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  | {% extends 'generic/object.html' %} | 
					
						
							|  |  |  | {% load static %} | 
					
						
							|  |  |  | {% load helpers %} | 
					
						
							|  |  |  | {% load plugins %} | 
					
						
							|  |  |  | {% load render_table from django_tables2 %} | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  | {% load i18n %} | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | {% block extra_controls %} | 
					
						
							|  |  |  |   {% if perms.core.sync_datasource %} | 
					
						
							| 
									
										
										
										
											2023-03-30 08:51:47 -04:00
										 |  |  |     {% if object.ready_for_sync %} | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |       <form action="{% url 'core:datasource_sync' pk=object.pk %}" method="post"> | 
					
						
							|  |  |  |         {% csrf_token %} | 
					
						
							|  |  |  |         <button type="submit" class="btn btn-sm btn-primary"> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |           <i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync" %} | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |         </button> | 
					
						
							|  |  |  |       </form> | 
					
						
							|  |  |  |     {% else %} | 
					
						
							| 
									
										
										
										
											2023-03-30 08:51:47 -04:00
										 |  |  |       <span class="inline-block" tabindex="0" data-bs-toggle="tooltip" data-bs-delay="100" data-bs-placement="bottom"> | 
					
						
							| 
									
										
										
										
											2023-03-20 15:12:11 -04:00
										 |  |  |         <button class="btn btn-sm btn-primary" disabled> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |           <i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync" %} | 
					
						
							| 
									
										
										
										
											2023-03-20 15:12:11 -04:00
										 |  |  |         </button> | 
					
						
							|  |  |  |       </span> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |     {% endif %} | 
					
						
							|  |  |  |   {% endif %} | 
					
						
							|  |  |  | {% endblock %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {% block content %} | 
					
						
							|  |  |  |   <div class="row mb-3"> | 
					
						
							|  |  |  |     <div class="col col-md-6"> | 
					
						
							|  |  |  |       <div class="card"> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |         <h5 class="card-header">{% trans "Data Source" %}</h5> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |         <div class="card-body"> | 
					
						
							|  |  |  |           <table class="table table-hover attr-table"> | 
					
						
							|  |  |  |             <tr> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |               <th scope="row">{% trans "Name" %}</th> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |               <td>{{ object.name }}</td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |               <th scope="row">{% trans "Type" %}</th> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |               <td>{{ object.get_type_display }}</td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |               <th scope="row">{% trans "Enabled" %}</th> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |               <td>{% checkmark object.enabled %}</td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |               <th scope="row">{% trans "Status" %}</th> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |               <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |               <th scope="row">{% trans "Last synced" %}</th> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |               <td>{{ object.last_synced|placeholder }}</td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |               <th scope="row">{% trans "Description" %}</th> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |               <td>{{ object.description|placeholder }}</td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |               <th scope="row">{% trans "URL" %}</th> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |               <td> | 
					
						
							| 
									
										
										
										
											2023-03-31 09:06:16 -04:00
										 |  |  |                 {% if not object.is_local %} | 
					
						
							|  |  |  |                   <a href="{{ object.source_url }}">{{ object.source_url }}</a> | 
					
						
							|  |  |  |                 {% else %} | 
					
						
							|  |  |  |                   {{ object.source_url }} | 
					
						
							|  |  |  |                 {% endif %} | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |               </td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |               <th scope="row">{% trans "Ignore rules" %}</th> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |               <td> | 
					
						
							|  |  |  |                 {% if object.ignore_rules %} | 
					
						
							|  |  |  |                   <pre>{{ object.ignore_rules }}</pre> | 
					
						
							|  |  |  |                 {% else %} | 
					
						
							|  |  |  |                   {{ ''|placeholder }} | 
					
						
							|  |  |  |                 {% endif %}</td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |           </table> | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |       {% include 'inc/panels/tags.html' %} | 
					
						
							|  |  |  |       {% include 'inc/panels/comments.html' %} | 
					
						
							|  |  |  |       {% plugin_left_page object %} | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |     <div class="col col-md-6"> | 
					
						
							|  |  |  |       <div class="card"> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |         <h5 class="card-header">{% trans "Backend" %}</h5> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |         <div class="card-body"> | 
					
						
							| 
									
										
										
										
											2023-08-01 11:13:35 -04:00
										 |  |  |           {% with backend=object.backend_class %} | 
					
						
							|  |  |  |             <table class="table table-hover attr-table"> | 
					
						
							|  |  |  |               {% for name, field in backend.parameters.items %} | 
					
						
							|  |  |  |                 <tr> | 
					
						
							|  |  |  |                   <th scope="row">{{ field.label }}</th> | 
					
						
							|  |  |  |                   {% if name in backend.sensitive_parameters and not perms.core.change_datasource %} | 
					
						
							|  |  |  |                     <td>********</td> | 
					
						
							|  |  |  |                   {% else %} | 
					
						
							|  |  |  |                     <td>{{ object.parameters|get_key:name|placeholder }}</td> | 
					
						
							|  |  |  |                   {% endif %} | 
					
						
							|  |  |  |                 </tr> | 
					
						
							|  |  |  |               {% empty %} | 
					
						
							|  |  |  |                 <tr> | 
					
						
							|  |  |  |                   <td colspan="2" class="text-muted"> | 
					
						
							|  |  |  |                     {% trans "No parameters defined" %} | 
					
						
							|  |  |  |                   </td> | 
					
						
							|  |  |  |                 </tr> | 
					
						
							|  |  |  |               {% endfor %} | 
					
						
							|  |  |  |             </table> | 
					
						
							|  |  |  |             {% endwith %} | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |         </div> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |       {% include 'inc/panels/related_objects.html' %} | 
					
						
							|  |  |  |       {% include 'inc/panels/custom_fields.html' %} | 
					
						
							|  |  |  |       {% plugin_right_page object %} | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |   </div> | 
					
						
							|  |  |  |   <div class="row mb-3"> | 
					
						
							|  |  |  |     <div class="col col-md-12"> | 
					
						
							|  |  |  |       <div class="card"> | 
					
						
							| 
									
										
										
										
											2023-07-29 03:30:25 +07:00
										 |  |  |         <h5 class="card-header">{% trans "Files" %}</h5> | 
					
						
							| 
									
										
										
										
											2023-02-02 10:06:23 -05:00
										 |  |  |         <div class="card-body htmx-container table-responsive" | 
					
						
							|  |  |  |           hx-get="{% url 'core:datafile_list' %}?source_id={{ object.pk }}" | 
					
						
							|  |  |  |           hx-trigger="load" | 
					
						
							|  |  |  |         ></div> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |       {% plugin_full_width_page object %} | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |   </div> | 
					
						
							|  |  |  | {% endblock %} |